From: terencehill Date: Wed, 2 Dec 2015 23:53:14 +0000 (+0100) Subject: Create cvar list when it is displayed rather then on menu start X-Git-Tag: xonotic-v0.8.2~1286^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=045a9a870f044123cbecfd3f0432671371c40fd8;p=xonotic%2Fxonotic-data.pk3dir.git Create cvar list when it is displayed rather then on menu start --- diff --git a/qcsrc/menu/xonotic/cvarlist.qc b/qcsrc/menu/xonotic/cvarlist.qc index 8323221da..a286d08b1 100644 --- a/qcsrc/menu/xonotic/cvarlist.qc +++ b/qcsrc/menu/xonotic/cvarlist.qc @@ -7,6 +7,7 @@ CLASS(XonoticCvarList, XonoticListBox) METHOD(XonoticCvarList, drawListBoxItem, void(entity, int, vector, bool, bool)); METHOD(XonoticCvarList, resizeNotify, void(entity, vector, vector, vector, vector)); METHOD(XonoticCvarList, keyDown, float(entity, float, float, float)); + METHOD(XonoticCvarList, showNotify, void(entity)); METHOD(XonoticCvarList, destroy, void(entity)); @@ -53,8 +54,10 @@ entity makeXonoticCvarList() void XonoticCvarList_configureXonoticCvarList(entity me) { me.configureXonoticListBox(me); - me.handle = buf_create(); +} +void XonoticCvarList_showNotify(entity me) +{ buf_cvarlist(me.handle, "", "_"); me.nItems = buf_getsize(me.handle); } diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc index 2f3cd47b0..eff3723bd 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc @@ -20,6 +20,7 @@ ENDCLASS(XonoticMutatorsDialog) #ifdef IMPLEMENTATION void XonoticMutatorsDialog_showNotify(entity me) { + SUPER(XonoticMutatorsDialog).showNotify(me); loadAllCvars(me); } diff --git a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc index 6ace10c12..8a2d489a0 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc +++ b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc @@ -15,6 +15,7 @@ ENDCLASS(XonoticCvarsDialog) #ifdef IMPLEMENTATION void XonoticCvarsDialog_showNotify(entity me) { + SUPER(XonoticCvarsDialog).showNotify(me); loadAllCvars(me); } void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls diff --git a/qcsrc/menu/xonotic/dialog_teamselect.qc b/qcsrc/menu/xonotic/dialog_teamselect.qc index 3b624e2ad..9185a1f6e 100644 --- a/qcsrc/menu/xonotic/dialog_teamselect.qc +++ b/qcsrc/menu/xonotic/dialog_teamselect.qc @@ -32,6 +32,7 @@ entity makeTeamButton(string theName, vector theColor, string commandtheName) void XonoticTeamSelectDialog_showNotify(entity me) { + SUPER(XonoticTeamSelectDialog).showNotify(me); float teams, nTeams; teams = cvar("_teams_available"); nTeams = 0;