forked from Mirrors/openclonk
Add button X to fade through half solidmasks.
Enabled on the elevator case for testing.objectmenu
parent
d9dccd01ad
commit
711df05e1a
|
@ -420,6 +420,23 @@ public func ObjectControl(int plr, int ctrl, int x, int y, int strength, bool re
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Fall through half-solid mask
|
||||
if (ctrl == CON_FallThrough)
|
||||
{
|
||||
if(!release)
|
||||
{
|
||||
if (this->IsWalking())
|
||||
{
|
||||
HalfVehicleFadeJumpStart();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HalfVehicleFadeJumpStop();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// hotkeys action bar hotkeys
|
||||
var hot = 0;
|
||||
|
|
|
@ -93,6 +93,8 @@ private func Initialize()
|
|||
front->SetAction("Attach", this);
|
||||
back->SetAction("Attach", this);
|
||||
|
||||
SetHalfVehicleSolidMask(true);
|
||||
|
||||
return _inherited(...);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -51,11 +51,24 @@ global func SetVertexCNAT(int vtx, int val, bool set)
|
|||
}
|
||||
|
||||
// Allow falling down throughg a HalfVehicle platform
|
||||
global func HalfVehicleFadeJump()
|
||||
global func HalfVehicleFadeJumpStart()
|
||||
{
|
||||
if (!this)
|
||||
return FatalError("this function requires object context");
|
||||
AddEffect("IntHalfVehicleFadeJump", this, 1, 1);
|
||||
if (GetEffect("IntHalfVehicleFadeJump", this))
|
||||
return;
|
||||
AddEffect("IntHalfVehicleFadeJump", this, 1);
|
||||
}
|
||||
|
||||
|
||||
global func HalfVehicleFadeJumpStop()
|
||||
{
|
||||
if (!this)
|
||||
return FatalError("this function requires object context");
|
||||
var effect;
|
||||
if(effect = GetEffect("IntHalfVehicleFadeJump", this)) {
|
||||
effect.Interval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
global func FxIntHalfVehicleFadeJumpStart(object target, proplist effect, int temp)
|
||||
|
@ -85,6 +98,7 @@ global func FxIntHalfVehicleFadeJumpTimer(object target, proplist effect, int ti
|
|||
return FX_OK;
|
||||
}
|
||||
return FX_Execute_Kill;
|
||||
// The way this is implemented, it may ignore smaller cracks beteween half-solid masks at high speeds. Fix if necessary.
|
||||
}
|
||||
|
||||
global func FxIntHalfVehicleFadeJumpStop(object target, proplist effect, int reason, bool temp)
|
||||
|
|
Loading…
Reference in New Issue