SetFromStack
This commit is contained in:
@@ -32,6 +32,14 @@ void IPreference::PushValue( lua_State *L ) const
|
|||||||
lua_pushnil( L );
|
lua_pushnil( L );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IPreference::SetFromStack( lua_State *L )
|
||||||
|
{
|
||||||
|
if( LOG )
|
||||||
|
LOG->Trace( "The preference value \"%s\" is of a type not supported by Lua", m_sName.c_str() );
|
||||||
|
|
||||||
|
lua_pop( L, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
#define READFROM_AND_WRITETO( type ) \
|
#define READFROM_AND_WRITETO( type ) \
|
||||||
void Preference<type>::FromString( const CString &s ) \
|
void Preference<type>::FromString( const CString &s ) \
|
||||||
{ \
|
{ \
|
||||||
@@ -44,6 +52,10 @@ void IPreference::PushValue( lua_State *L ) const
|
|||||||
void Preference<type>::PushValue( lua_State *L ) const \
|
void Preference<type>::PushValue( lua_State *L ) const \
|
||||||
{ \
|
{ \
|
||||||
LuaManager::PushStack( m_currentValue, L ); \
|
LuaManager::PushStack( m_currentValue, L ); \
|
||||||
|
} \
|
||||||
|
void Preference<type>::SetFromStack( lua_State *L ) \
|
||||||
|
{ \
|
||||||
|
LuaManager::PopStack( m_currentValue, L ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
READFROM_AND_WRITETO( int )
|
READFROM_AND_WRITETO( int )
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
virtual CString ToString() const = 0;
|
virtual CString ToString() const = 0;
|
||||||
virtual void FromString( const CString &s ) = 0;
|
virtual void FromString( const CString &s ) = 0;
|
||||||
|
|
||||||
|
virtual void SetFromStack( lua_State *L );
|
||||||
virtual void PushValue( lua_State *L ) const;
|
virtual void PushValue( lua_State *L ) const;
|
||||||
|
|
||||||
PrefsGroup GetPrefsGroup() const { return m_PrefsGroup; }
|
PrefsGroup GetPrefsGroup() const { return m_PrefsGroup; }
|
||||||
@@ -59,6 +60,7 @@ public:
|
|||||||
|
|
||||||
CString ToString() const;
|
CString ToString() const;
|
||||||
void FromString( const CString &s );
|
void FromString( const CString &s );
|
||||||
|
void SetFromStack( lua_State *L );
|
||||||
void PushValue( lua_State *L ) const;
|
void PushValue( lua_State *L ) const;
|
||||||
|
|
||||||
void LoadDefault()
|
void LoadDefault()
|
||||||
|
|||||||
Reference in New Issue
Block a user