Skip to content

Revamp CVar system #38 - #187

Merged
demoth merged 23 commits into
mainfrom
cvar-rework
Oct 21, 2026
Merged

demoth merged 23 commits into
mainfrom
cvar-rework

Conversation

@demoth

@demoth demoth commented Oct 21, 2026

Copy link
Copy Markdown
Owner

implemented typed cvars (boolean, integer, float, enum, string)

demoth added 23 commits October 10, 2026 15:30
 + simplify parsing and test setup
 + add cvar typing with cached values
 + simplify formatting
 + simplify choice type
 + remove availablity verification
 + Revamp CVar system #38: simplify enum and choice declarations
 + simplify string type
 + chore: align cvars registration
Remove unnecessary repeat registration from the fullscreen suggestions test. Cake migration will keep one owning declaration per cvar, use existing entries at consumers, and preserve typed pending resize state through registry writes. No ChoiceType equality change is needed. Detailed findings remain in the intentionally untracked typed-cvars.md.
Declare Cake settings once and consume cached native values. Move numeric constraints and fixed choices into declarations, preserve spectator passwords as strings, and restore pending resize values through validated registry writes.

Keep test setup scoped to required settings, remove unnecessary singleton resets, and cover resize pending state, crosshair choices, and live download toggles.

Validation: Cake and qcommon tests passed; desktop client compiled. Cake tests passed again after test cleanup; git diff --check passed.
Return generic cvar references from registration and checked native-type lookup, with a reified Kotlin helper. Replace per-type caches with active and pending native values while retaining legacy raw access.

Use typed references throughout Cake and remove test-only per-type pending getters. Cover lookup identity and failures, primitive/wrapper tokens, native choices, enums, cached reads and nullable pending values.

Validation: qcommon and Cake tests passed; desktop client, game, server, dedicated and maptools compiled. Pending-getter cleanup passed qcommon/Cake tests and focused video tests; git diff --check passed.
Document legacy text and Float mirrors, compatibility readers and the future value rename. Distinguish lasting active/pending state from migration storage. Next slice merges declaration metadata into the cvar and stages unregistered config values with suggested flags and diagnostics; detailed decisions remain in the untracked plan.
Store type and default directly on the cvar, removing CvarSpec and late attachment. Stage unknown assignments as text with optional suggested flags until their owner registers them; validate inputs and preserve staged alias write order.

Warn on missing and early reads, flag conflicts, and aliases used before registration. Keep command namespace probes quiet to avoid startup warnings for normal commands.

Validation: qcommon and Cake tests passed; desktop, game, server, dedicated and maptools compiled. Client output fix verified manually by the user; git diff --check passed.
Use live cvar references instead of per-option snapshots, submit edits as a map, and merge section definitions and summaries. Preserve the existing Apply behavior and compare rendered tokens locally to detect cvar changes without rebuilding unchanged editors.

Validation: Cake tests and desktop compilation passed; git diff --check passed.
@demoth
demoth merged commit 141541b into main Oct 21, 2026
1 check passed
@demoth
demoth deleted the cvar-rework branch October 21, 2026 12:58
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