feat: add Convar<T> for real convar creation/deletion/access#935
feat: add Convar<T> for real convar creation/deletion/access#935roflmuffin wants to merge 9 commits intomainfrom
Conversation
f7cd192 to
8d9ea3f
Compare
| ScriptContext.GlobalScriptContext.Reset(); | ||
| ScriptContext.GlobalScriptContext.Push(convar); | ||
| ScriptContext.GlobalScriptContext.Push(flags); | ||
| ScriptContext.GlobalScriptContext.SetIdentifier(0xB2BDCCBF); |
There was a problem hiding this comment.
Magic numbers should not be written by themselves. Maybe make them a constant with a name to clarify?
There was a problem hiding this comment.
these are hash calculated native identifiers
|
Yes I know of that. But implement some of these at least into C# as statically typed to make use of the strength of static typing and static code analysis to reduce mistakes and catch erronous usage at compile time. For example would it be suitable to do something similar to this? |
This PR adds
Convar<T>which is a strongly typed variant of ConVar which provides better safety (no raw pointer accesses), as well as the ability to create real-convars that exist within the engine (and can be found usingfind fooin the console) amongst other things.TODO:
.Createstatic be restricted?