Skip to content

The forgotten suggestions #119

Description

@Cheatoid

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions