Added new move_rope/keyframe_rope inputs

This commit is contained in:
Blixibon 2021-05-27 11:39:47 -05:00
parent 764f0c09e1
commit dcd7b95b62
2 changed files with 54 additions and 0 deletions

View File

@ -90,6 +90,10 @@ BEGIN_DATADESC( CRopeKeyframe )
DEFINE_INPUTFUNC( FIELD_VOID, "Break", InputBreak ),
#ifdef MAPBASE
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetSlack", InputSetSlack ),
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetWidth", InputSetWidth ),
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetSubdivision", InputSetSubdivision ),
// Outputs
DEFINE_OUTPUT( m_OnBreak, "OnBreak" ),
#endif
@ -613,6 +617,51 @@ void CRopeKeyframe::InputBreak( inputdata_t &inputdata )
#endif
}
#ifdef MAPBASE
//-----------------------------------------------------------------------------
// Purpose: Sets the slack
// Input : &inputdata -
//-----------------------------------------------------------------------------
void CRopeKeyframe::InputSetSlack( inputdata_t &inputdata )
{
m_Slack = inputdata.value.Int();
// Must resize in order for changes to occur
m_RopeFlags |= ROPE_RESIZE;
if (!(m_RopeFlags & ROPE_USE_WIND))
{
Warning( "WARNING: SetSlack on %s may need wind enabled in order to function\n", GetDebugName() );
}
}
//-----------------------------------------------------------------------------
// Purpose: Sets the width
// Input : &inputdata -
//-----------------------------------------------------------------------------
void CRopeKeyframe::InputSetWidth( inputdata_t &inputdata )
{
m_Width = inputdata.value.Float();
}
//-----------------------------------------------------------------------------
// Purpose: Sets the subdivision
// Input : &inputdata -
//-----------------------------------------------------------------------------
void CRopeKeyframe::InputSetSubdivision( inputdata_t &inputdata )
{
m_Subdiv = inputdata.value.Int();
// Must resize in order for changes to occur
m_RopeFlags |= ROPE_RESIZE;
if (!(m_RopeFlags & ROPE_USE_WIND))
{
Warning( "WARNING: SetSubdivision on %s may need wind enabled in order to function\n", GetDebugName() );
}
}
#endif
//-----------------------------------------------------------------------------
// Purpose: Breaks the rope
// Output : Returns true on success, false on failure.

View File

@ -102,6 +102,11 @@ public:
void InputSetScrollSpeed( inputdata_t &inputdata );
void InputSetForce( inputdata_t &inputdata );
void InputBreak( inputdata_t &inputdata );
#ifdef MAPBASE
void InputSetSlack( inputdata_t &inputdata );
void InputSetWidth( inputdata_t &inputdata );
void InputSetSubdivision( inputdata_t &inputdata );
#endif
public: