本文整理汇总了C++中CScriptArgReader::ReadEnumString方法的典型用法代码示例。如果您正苦于以下问题:C++ CScriptArgReader::ReadEnumString方法的具体用法?C++ CScriptArgReader::ReadEnumString怎么用?C++ CScriptArgReader::ReadEnumString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CScriptArgReader
的用法示例。
在下文中一共展示了CScriptArgReader::ReadEnumString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsAmbientSoundEnabled
int CLuaFunctionDefs::IsAmbientSoundEnabled ( lua_State* luaVM )
{
eAmbientSoundType eType;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( eType );
if ( !argStream.HasErrors () )
{
bool bResultEnabled;
if ( CStaticFunctionDefinitions::IsAmbientSoundEnabled ( eType, bResultEnabled ) )
{
lua_pushboolean ( luaVM, bResultEnabled );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() );
lua_pushboolean ( luaVM, false );
return 1;
}
示例2: SetWeaponState
int CLuaFunctionDefs::SetWeaponState ( lua_State* luaVM )
{
CClientWeapon * pWeapon;
eWeaponState weaponState;
CScriptArgReader argStream ( luaVM );
argStream.ReadUserData ( pWeapon );
argStream.ReadEnumString ( weaponState );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetWeaponState ( pWeapon, weaponState ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() );
lua_pushboolean ( luaVM, false );
return 1;
}
示例3: SetAmbientSoundEnabled
int CLuaFunctionDefs::SetAmbientSoundEnabled ( lua_State* luaVM )
{
eAmbientSoundType eType; bool bEnabled;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( eType, AMBIENT_SOUND_GENERAL );
argStream.ReadBool ( bEnabled );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetAmbientSoundEnabled ( eType, bEnabled ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() );
lua_pushboolean ( luaVM, false );
return 1;
}
示例4: GetSFXStatus
int CLuaFunctionDefs::GetSFXStatus ( lua_State* luaVM )
{
// bool getSFXStatus ( string audioContainer )
eAudioLookupIndex containerIndex;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( containerIndex );
if ( !argStream.HasErrors () )
{
bool bNotCut;
if ( CStaticFunctionDefinitions::GetSFXStatus ( containerIndex, bNotCut ) )
{
lua_pushboolean ( luaVM, bNotCut );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushnil ( luaVM );
return 1;
}
示例5: argStream
int CLuaFunctionDefs::PlaySFX3D ( lua_State* luaVM )
{
// sound playSFX3D ( string audioContainer, int bankIndex, int audioIndex, float posX, float posY, float posZ [, loop = false ] )
eAudioLookupIndex containerIndex; int iBankIndex; int iAudioIndex; CVector vecPosition; bool bLoop;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( containerIndex );
argStream.ReadNumber ( iBankIndex );
argStream.ReadNumber ( iAudioIndex );
argStream.ReadNumber ( vecPosition.fX );
argStream.ReadNumber ( vecPosition.fY );
argStream.ReadNumber ( vecPosition.fZ );
argStream.ReadBool ( bLoop, false );
if ( !argStream.HasErrors () )
{
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
if ( pLuaMain )
{
CResource* pResource = pLuaMain->GetResource ();
if ( pResource )
{
CClientSound* pSound;
if ( CStaticFunctionDefinitions::PlaySFX3D ( pResource, containerIndex, iBankIndex, iAudioIndex, vecPosition, bLoop, pSound ) )
{
lua_pushelement ( luaVM, pSound );
return 1;
}
}
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushboolean ( luaVM, false );
return 1;
}
示例6: GetEasingValue
int CLuaFunctionDefs::GetEasingValue ( lua_State* luaVM )
{
// float getEasingValue( float fProgress, string strEasingType [, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot] )
float fProgress; CEasingCurve::eType easingType; float fEasingPeriod; float fEasingAmplitude; float fEasingOvershoot;
CScriptArgReader argStream ( luaVM );
argStream.ReadNumber ( fProgress );
argStream.ReadEnumString ( easingType );
argStream.ReadNumber ( fEasingPeriod, 0.3f );
argStream.ReadNumber ( fEasingAmplitude, 1.0f );
argStream.ReadNumber ( fEasingOvershoot, 1.70158f );
if ( argStream.HasErrors () )
{
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushboolean ( luaVM, false );
return 1;
}
CEasingCurve easingCurve ( easingType );
easingCurve.SetParams ( fEasingPeriod, fEasingAmplitude, fEasingOvershoot );
lua_pushnumber ( luaVM, easingCurve.ValueForProgress ( fProgress ) );
return 1;
}
示例7: IsPlayerHudComponentVisible
int CLuaPlayerDefs::IsPlayerHudComponentVisible ( lua_State* luaVM )
{
// bool isPlayerHudComponentVisible ( string componen )
eHudComponent component;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( component );
if ( !argStream.HasErrors () )
{
bool bIsVisible;
if ( CStaticFunctionDefinitions::IsPlayerHudComponentVisible ( component, bIsVisible ) )
{
lua_pushboolean ( luaVM, bIsVisible );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
// Failed
lua_pushboolean ( luaVM, false );
return 1;
}
示例8: ShowPlayerHudComponent
int CLuaPlayerDefs::ShowPlayerHudComponent ( lua_State* luaVM )
{
// bool showPlayerHudComponent ( string component, bool show )
eHudComponent component; bool bShow;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumString ( component );
argStream.ReadBool ( bShow );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::ShowPlayerHudComponent ( component, bShow ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
// Failed
lua_pushboolean ( luaVM, false );
return 1;
}
示例9: setTrafficLightState
int CLuaWorldDefs::setTrafficLightState ( lua_State* luaVM )
{
// bool setTrafficLightState ( int state )
// bool setTrafficLightState ( string state )
// bool setTrafficLightState ( string colorNS, string colorEW )
CScriptArgReader argStream ( luaVM );
// Determine which version to parse
if ( argStream.NextIsNumber () )
{
// bool setTrafficLightState ( int state )
int iState;
argStream.ReadNumber ( iState );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetTrafficLightState ( iState ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
}
else
if ( !argStream.NextIsString ( 1 ) )
{
// bool setTrafficLightState ( string state )
TrafficLight::EState eState;
argStream.ReadEnumString ( eState );
if ( !argStream.HasErrors () )
{
if ( eState == TrafficLight::AUTO )
{
bool bOk = CStaticFunctionDefinitions::SetTrafficLightsLocked ( false ) &&
CStaticFunctionDefinitions::SetTrafficLightState ( 0 );
lua_pushboolean ( luaVM, bOk );
return 1;
}
else
{
bool bOk = CStaticFunctionDefinitions::SetTrafficLightsLocked ( true ) &&
CStaticFunctionDefinitions::SetTrafficLightState ( 9 );
lua_pushboolean ( luaVM, bOk );
return 1;
}
}
}
else
{
// bool setTrafficLightState ( string colorNS, string colorEW )
TrafficLight::EColor eColorNS;
TrafficLight::EColor eColorEW;
argStream.ReadEnumString ( eColorNS );
argStream.ReadEnumString ( eColorEW );
if ( !argStream.HasErrors () )
{
unsigned char ucState = SharedUtil::GetTrafficLightStateFromColors ( eColorNS, eColorEW );
// Change it.
bool bOk = CStaticFunctionDefinitions::SetTrafficLightsLocked ( true ) &&
CStaticFunctionDefinitions::SetTrafficLightState ( ucState );
lua_pushboolean ( luaVM, bOk );
return 1;
}
}
if ( argStream.HasErrors () )
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() );
lua_pushboolean ( luaVM, false );
return 1;
}
示例10: GetOriginalWeaponProperty
int CLuaFunctionDefs::GetOriginalWeaponProperty ( lua_State* luaVM )
{
eWeaponSkill eWepSkill = WEAPONSKILL_STD;
eWeaponType eWep = WEAPONTYPE_UNARMED;
eWeaponProperty eProp = WEAPON_INVALID_PROPERTY;
CScriptArgReader argStream ( luaVM );
argStream.ReadEnumStringOrNumber ( eWep );
argStream.ReadEnumStringOrNumber ( eWepSkill );
argStream.ReadEnumString ( eProp );
if ( !argStream.HasErrors () )
{
switch ( eProp )
{
case WEAPON_WEAPON_RANGE:
case WEAPON_TARGET_RANGE:
case WEAPON_ACCURACY:
case WEAPON_FIRING_SPEED:
case WEAPON_LIFE_SPAN:
case WEAPON_SPREAD:
case WEAPON_MOVE_SPEED:
// Get only
case WEAPON_REQ_SKILL_LEVEL:
case WEAPON_ANIM_LOOP_START:
case WEAPON_ANIM_LOOP_STOP:
case WEAPON_ANIM_LOOP_RELEASE_BULLET_TIME:
case WEAPON_ANIM2_LOOP_START:
case WEAPON_ANIM2_LOOP_STOP:
case WEAPON_ANIM2_LOOP_RELEASE_BULLET_TIME:
case WEAPON_ANIM_BREAKOUT_TIME:
case WEAPON_RADIUS:
{
float fWeaponInfo = 0.0f;
if ( CStaticFunctionDefinitions::GetOriginalWeaponProperty ( eProp, eWep, eWepSkill, fWeaponInfo ) )
{
lua_pushnumber ( luaVM, fWeaponInfo );
return 1;
}
break;
}
case WEAPON_DAMAGE:
case WEAPON_MAX_CLIP_AMMO:
case WEAPON_FLAGS:
case WEAPON_ANIM_GROUP:
case WEAPON_FIRETYPE:
case WEAPON_MODEL:
case WEAPON_MODEL2:
case WEAPON_SLOT:
case WEAPON_AIM_OFFSET:
case WEAPON_SKILL_LEVEL:
case WEAPON_DEFAULT_COMBO:
case WEAPON_COMBOS_AVAILABLE:
{
int sWeaponInfo = 0;
if ( CStaticFunctionDefinitions::GetOriginalWeaponProperty ( eProp, eWep, eWepSkill, sWeaponInfo ) )
{
lua_pushinteger ( luaVM, sWeaponInfo );
return 1;
}
break;
}
case WEAPON_FIRE_OFFSET:
{
CVector vecWeaponInfo;
if ( CStaticFunctionDefinitions::GetOriginalWeaponProperty ( eProp, eWep, eWepSkill, vecWeaponInfo ) )
{
lua_pushnumber ( luaVM, vecWeaponInfo.fX );
lua_pushnumber ( luaVM, vecWeaponInfo.fY );
lua_pushnumber ( luaVM, vecWeaponInfo.fZ );
return 3;
}
break;
}
case WEAPON_FLAG_AIM_NO_AUTO:
case WEAPON_FLAG_AIM_ARM:
case WEAPON_FLAG_AIM_1ST_PERSON:
case WEAPON_FLAG_AIM_FREE:
case WEAPON_FLAG_MOVE_AND_AIM:
case WEAPON_FLAG_MOVE_AND_SHOOT:
case WEAPON_FLAG_TYPE_THROW:
case WEAPON_FLAG_TYPE_HEAVY:
case WEAPON_FLAG_TYPE_CONSTANT:
case WEAPON_FLAG_TYPE_DUAL:
case WEAPON_FLAG_ANIM_RELOAD:
case WEAPON_FLAG_ANIM_CROUCH:
case WEAPON_FLAG_ANIM_RELOAD_LOOP:
case WEAPON_FLAG_ANIM_RELOAD_LONG:
case WEAPON_FLAG_SHOT_SLOWS:
case WEAPON_FLAG_SHOT_RAND_SPEED:
case WEAPON_FLAG_SHOT_ANIM_ABRUPT:
case WEAPON_FLAG_SHOT_EXPANDS:
{
MinServerReqCheck ( argStream, MIN_SERVER_REQ_WEAPON_PROPERTY_FLAG, "flag name is being used" );
if ( !argStream.HasErrors () )
{
bool bEnable;
if ( CStaticFunctionDefinitions::GetOriginalWeaponPropertyFlag ( eProp, eWep, eWepSkill, bEnable ) )
//.........这里部分代码省略.........
示例11: SetWeaponProperty
int CLuaFunctionDefs::SetWeaponProperty ( lua_State* luaVM )
{
// bool setWeaponProperty ( int weaponID/string weaponName, string weaponSkill, string property/int property, int/float theValue )
eWeaponSkill eWepSkill = WEAPONSKILL_STD;
eWeaponType eWep = WEAPONTYPE_BRASSKNUCKLE;
eWeaponProperty eProp = WEAPON_ACCURACY;
CScriptArgReader argStream ( luaVM );
if ( argStream.NextIsUserData () )
{
CCustomWeapon * pWeapon;
eWeaponProperty weaponProperty;
CScriptArgReader argStream ( luaVM );
argStream.ReadUserData ( pWeapon );
argStream.ReadEnumString ( weaponProperty );
if ( !argStream.HasErrors () )
{
if ( weaponProperty == WEAPON_DAMAGE )
{
short sData = 0;
argStream.ReadNumber ( sData );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetWeaponProperty ( pWeapon, weaponProperty, sData ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
}
else
{
float fData = 0.0f;
argStream.ReadNumber ( fData );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetWeaponProperty ( pWeapon, weaponProperty, fData ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
}
}
if ( argStream.HasErrors () )
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
}
else
{
argStream.ReadEnumStringOrNumber ( eWep );
argStream.ReadEnumStringOrNumber ( eWepSkill );
argStream.ReadEnumString ( eProp );
if ( !argStream.HasErrors () )
{
switch ( eProp )
{
case WEAPON_WEAPON_RANGE:
case WEAPON_TARGET_RANGE:
case WEAPON_ACCURACY:
case WEAPON_MOVE_SPEED:
case WEAPON_ANIM_LOOP_START:
case WEAPON_ANIM_LOOP_STOP:
case WEAPON_ANIM_LOOP_RELEASE_BULLET_TIME:
case WEAPON_ANIM2_LOOP_START:
case WEAPON_ANIM2_LOOP_STOP:
case WEAPON_ANIM2_LOOP_RELEASE_BULLET_TIME:
case WEAPON_ANIM_BREAKOUT_TIME:
{
float fWeaponInfo = 0.0f;
argStream.ReadNumber ( fWeaponInfo );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetWeaponProperty ( eProp, eWep, eWepSkill, fWeaponInfo ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
break;
}
case WEAPON_DAMAGE:
case WEAPON_MAX_CLIP_AMMO:
case WEAPON_FLAGS:
{
int sWeaponInfo = 0;
argStream.ReadNumber ( sWeaponInfo );
if ( !argStream.HasErrors () )
{
if ( CStaticFunctionDefinitions::SetWeaponProperty ( eProp, eWep, eWepSkill, sWeaponInfo ) )
{
lua_pushboolean ( luaVM, true );
return 1;
}
}
break;
}
case WEAPON_FLAG_AIM_NO_AUTO:
//.........这里部分代码省略.........