Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented basic console variable support #48

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

ChunkTreasure1
Copy link
Owner

Implemented basic console variable support. Should be created in global scope, can be referenced in other compilation units using a reference

Usage:

static ConsoleVariable<int32_t> s_testCVar = ConsoleVariable<int32_t>("r.test", 0, "Test Variable");

...

auto testValue = s_testVar.GetValue();
s_testVar = 4;

References should only be declared in functions/methods (for now)
Reference Usage:

void TestFunc()
{
    static ConsoleVariableRef<int32_t> testCVarRef = ConsoleVariableRef<int32_t>("r.test");

    // Usage the same as original value.
}

@ChunkTreasure1 ChunkTreasure1 self-assigned this Dec 29, 2023
Copy link
Collaborator

@Cooltomten Cooltomten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I personally dont like the creation of a static variable inside of a function that is not called all the time as it is never removed after the function has been called once, but as long as it is used responsively it is fine

@ChunkTreasure1 ChunkTreasure1 changed the base branch from main to development December 29, 2023 23:14
@ChunkTreasure1 ChunkTreasure1 merged commit 7b12987 into development Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants