From: terencehill Date: Sun, 25 Aug 2019 12:24:55 +0000 (+0200) Subject: Menu: don't wire up some settings to the "Apply immediately" button since menu can... X-Git-Tag: xonotic-v0.8.5~1370 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=de79444532f6818c544029af72f6e5d6a8767b0d;p=xonotic%2Fxonotic-data.pk3dir.git Menu: don't wire up some settings to the "Apply immediately" button since menu can automatically send changed cvar values to the server. Also fix 2 settings that couldn't be applied immediately in any way --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qc b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qc index afde0914a..087305112 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qc @@ -39,6 +39,7 @@ void XonoticScreenshotBrowserTab_fill(entity me) me.gotoRC(me, 0, 3.1); me.TD(me, 1, 1.9, e = makeXonoticCheckBoxEx(2, 1, "cl_autoscreenshot", _("Auto screenshot scoreboard"))); + e.sendCvars = true; me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0')); e.onClick = ScreenshotList_Refresh_Click; e.onClickEntity = slist; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc index 8705e5ff7..f87e0dbbe 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc @@ -40,8 +40,6 @@ void XonoticProfileTab_fill(entity me) "name \"$_cl_name\";" "playermodel $_cl_playermodel;" "playerskin $_cl_playerskin;" - "sendcvar cl_allow_uidtracking;" - "sendcvar cl_allow_uid2name;" , COMMANDBUTTON_APPLY); profileApplyButton.disableOnClick = true; @@ -127,11 +125,11 @@ void XonoticProfileTab_fill(entity me) me.TR(me); me.TDempty(me, 0.25); me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client"))); - e.applyButton = profileApplyButton; + e.sendCvars = true; me.TR(me); me.TDempty(me, 0.25); me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname"))); - e.applyButton = profileApplyButton; + e.sendCvars = true; setDependent(e, "cl_allow_uidtracking", 1, 1); me.gotoRC(me, 4, 3.1); // TOP RIGHT //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT diff --git a/qcsrc/menu/xonotic/dialog_settings_game_view.qc b/qcsrc/menu/xonotic/dialog_settings_game_view.qc index c1caddd7d..0b3a9ff6c 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_view.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_view.qc @@ -65,6 +65,7 @@ void XonoticGameViewSettingsTab_fill(entity me) me.TR(me); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating"))); + e.sendCvars = true; me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:"))); diff --git a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc index 1d75ecb49..8eac7301a 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qc @@ -23,9 +23,7 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) { entity e; entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', - "sendcvar cl_autoswitch;" "sendcvar cl_weaponpriority;" - "sendcvar cl_weaponimpulsemode;" , COMMANDBUTTON_APPLY); weaponsApplyButton.disableOnClick = true; @@ -51,12 +49,12 @@ void XonoticGameWeaponsSettingsTab_fill(entity me) _("Make use of the list above when cycling through weapons with the mouse wheel"))); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections"))); - e.applyButton = weaponsApplyButton; + e.sendCvars = true; me.TR(me); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"), _("Automatically switch to newly picked up weapons if they are better than what you are carrying"))); - e.applyButton = weaponsApplyButton; + e.sendCvars = true; me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons"))); me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_settings_user.qc b/qcsrc/menu/xonotic/dialog_settings_user.qc index 27d6d4a82..5e5b707fa 100644 --- a/qcsrc/menu/xonotic/dialog_settings_user.qc +++ b/qcsrc/menu/xonotic/dialog_settings_user.qc @@ -17,8 +17,6 @@ entity makeXonoticUserSettingsTab() void XonoticUserSettingsTab_fill(entity me) { entity e, sk; - entity userApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_gentle;", COMMANDBUTTON_APPLY); - userApplyButton.disableOnClick = true; me.TR(me); me.TDempty(me, 0.25); @@ -73,9 +71,5 @@ void XonoticUserSettingsTab_fill(entity me) me.gotoRC(me, 11.5, 3.25); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 2.5, e = makeXonoticCheckBox_T(0, "cl_gentle", _("Disable gore effects and harsh language"), _("Replace blood and gibs with content that does not have any gore effects"))); - e.applyButton = userApplyButton; - - me.gotoRC(me, me.rows - 1, 0); - me.TD(me, 1, 6, userApplyButton); - + e.sendCvars = true; }