|
virtual void *PushColor( Color color ) = 0; // ToDo: This seems to return something, but it hasn't been figured out what yet. |
Doesn't this return ILuaObject*?
Also, wasn't Color added as a native type at some point (Color values now have metatable), should it be added to types enum? It can be confirmed by invoking GetTypeName/GetActualTypeName on full range and observing whether color was added. (just tried type(Color(1, 2, 3)) which gave table, but still)
|
virtual ConCommand *CreateConCommand( const char *name, const char *helpString, int flags, void ( *callback )( const CCommand & ), int ( *completionFunc )( const char *, char ( * )[128] ) ) = 0; |
and
|
virtual ConCommand *CreateConCommand( const char *name, const char *helpString, int flags, void ( *callback )( const CCommand & ), int ( *completionFunc )( const char *, char ( * )[128] ) ) = 0; |
Maybe use actual prototypes for callback and completionFunc parameters:
FnCommandCallback_t and FnCommandCompletionCallback, with COMMAND_COMPLETION_MAXITEMS and COMMAND_COMPLETION_ITEM_LENGTH being 128 in gmod.
|
virtual void Init( void *( *interfaceFactory )( const char *, int * ), bool magicBool, CSteamAPIContext *context, IGet *pGet ) = 0; |
Maybe use CreateInterfaceFn prototype for the first parameter.
|
unsigned char _ignore_this_common_lua_header_[48 + 22]; |
Maybe use modern std::byte as padding type since that is guaranteed to be 1-byte.
Maybe use ILua*.
|
virtual int GetColor( int index ) = 0; |
Shouldn't this return uint32_t, or even better Color?
|
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)), i) |
The i in macro is stack index. Why is it being used as the third parameter, which is gmod "MetaID" value?
garrysmod_common/include/GarrysMod/Lua/LuaInterface.h
Line 88 in 9ec6d60
Doesn't this return
ILuaObject*?Also, wasn't
Coloradded as a native type at some point (Color values now have metatable), should it be added to types enum? It can be confirmed by invoking GetTypeName/GetActualTypeName on full range and observing whether color was added. (just triedtype(Color(1, 2, 3))which gavetable, but still)garrysmod_common/include/GarrysMod/Lua/LuaConVars.h
Line 19 in 9ec6d60
and
garrysmod_common/include/GarrysMod/Lua/LuaInterface.h
Line 111 in 9ec6d60
Maybe use actual prototypes for
callbackandcompletionFuncparameters:FnCommandCallback_tandFnCommandCompletionCallback, withCOMMAND_COMPLETION_MAXITEMSandCOMMAND_COMPLETION_ITEM_LENGTHbeing 128 in gmod.garrysmod_common/include/GarrysMod/Lua/LuaShared.h
Line 78 in 9ec6d60
Maybe use
CreateInterfaceFnprototype for the first parameter.garrysmod_common/include/GarrysMod/Lua/Interface.h
Line 25 in 9ec6d60
Maybe use modern
std::byteas padding type since that is guaranteed to be 1-byte.garrysmod_common/include/GarrysMod/Lua/LuaObject.h
Line 183 in 9ec6d60
Maybe use
ILua*.garrysmod_common/include/GarrysMod/Lua/LuaInterface.h
Line 87 in 9ec6d60
Shouldn't this return
uint32_t, or even betterColor?garrysmod_common/include/lauxlib.h
Line 104 in 9ec6d60
The
iin macro is stack index. Why is it being used as the third parameter, which is gmod "MetaID" value?