Closed MuffinTastic closed 1 year ago
LGTM, thanks a ton for this! Should make both engine & game development much easier, and I do feel your concerns about string operations in c++ - I think they suck too - but I think your solution works fine. Awesome work!
Changes:
CCmd
classConCmd.X
attributes (only a couple exist right now)"
, enabling the passing of string arguments containing spaces;
and newlines\n
//
list
command has been made aCCmd
instance, and now lists the flags of each command and variableUsage Examples
Native CVar with a callback ```cpp static FloatCVar cvartest_float( "cvartest.float", 0.0f, CVarFlags::None, "Yeah", []( float oldValue, float newValue ) { spdlog::trace( "cvartest.float changed! old {}, new {}", oldValue, newValue ); } ); ``` Native CCmd ```cpp static CCmd cvartest_command( "cvartest.command", CVarFlags::None, "A test command", []( std::vectorNotes:
While the bindings for registering managed ConVars are there you currently can't make them at the moment, because that really should be done through static properties, but source generation is not my forté. Happy to implement suggestions, unless you want to merge and do it yourself
A few CVarSystem methods (
GetString()
,ToString()
) don't have bindings right now due to memory leak concerns43