Add lowercase strings to Lua enum reverse table
Step one toward compatibility with case-insensitive legacy command syntax.
This commit is contained in:
@@ -135,6 +135,11 @@ static void Lua##X(lua_State* L) \
|
||||
lua_pushstring( L, (#X "_")+s ); \
|
||||
lua_pushnumber( L, i ); /* 0-based */ \
|
||||
lua_rawset( L, -3 ); \
|
||||
/* Compatibility with old, case-insensitive values */ \
|
||||
s.MakeLower(); \
|
||||
lua_pushstring( L, s ); \
|
||||
lua_pushnumber( L, i ); /* 0-based */ \
|
||||
lua_rawset( L, -3 ); \
|
||||
} \
|
||||
EnumTraits<X>::StringToEnum.SetFromStack( L ); \
|
||||
EnumTraits<X>::StringToEnum.PushSelf( L ); \
|
||||
|
||||
Reference in New Issue
Block a user