Skip to content

Add CVar attribute to register on value changed automatically for fields, properties, and methods on systems, services, and controllers#6409

Open
DrSmugleaf wants to merge 2 commits intospace-wizards:masterfrom
DrSmugleaf:feature/cvar-attribute
Open

Add CVar attribute to register on value changed automatically for fields, properties, and methods on systems, services, and controllers#6409
DrSmugleaf wants to merge 2 commits intospace-wizards:masterfrom
DrSmugleaf:feature/cvar-attribute

Conversation

@DrSmugleaf
Copy link
Member

@DrSmugleaf DrSmugleaf commented Feb 4, 2026

Example usage:

[CVar<CVars>(nameof(CVars.NetMaxConnections))]
public int Value;

[CVar<CVars>(nameof(CVars.NetMaxConnections))]
public void OnMaxConnectionsChanged(int val)
{
    ...
}

Now I don't need to remind every contributor to pass true to OnValueChanged forget 1 time and be hit by the curse of Ra

…lds, properties, and methods on systems, services, and controllers
@DrSmugleaf DrSmugleaf requested a review from PJB3005 as a code owner February 4, 2026 10:18
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.

1 participant