]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to sort weapons by priority in the weapons panel
authorMario <mario@smbclan.net>
Sat, 20 Oct 2018 15:56:49 +0000 (01:56 +1000)
committerMario <mario@smbclan.net>
Sat, 20 Oct 2018 15:56:49 +0000 (01:56 +1000)
_hud_descriptions.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/defs.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/weapons.qc

index 30e5a8bee9a8756fe9fafe883306260e1e4025aa..6e393e6a57eff4fdba4a60878e94ce0a2d106ead 100644 (file)
@@ -63,6 +63,7 @@ seta hud_panel_weapons_label_scale "" "scale of the weapon text label"
 seta hud_panel_weapons_accuracy "" "show accuracy color as the weapon icon background; colors can be configured with accuracy_color* cvars"
 seta hud_panel_weapons_ammo "" "show ammo as a status bar"
 seta hud_panel_weapons_onlyowned "" "show only owned weapons, set it to 2 to show only the held weapon"
+seta hud_panel_weapons_orderbyimpulse "" "List weapons in their impulse order instead of priority"
 seta hud_panel_weapons_noncurrent_alpha "" "alpha of noncurrent weapons"
 seta hud_panel_weapons_noncurrent_scale "" "scale of noncurrent weapons, relative to the current weapon"
 seta hud_panel_weapons_selection_radius "" "number of weapons that get partially highlighted on each side of the currently selected weapon"
index 9dcfe0629a03a1e249d4b9f2e37f8e65f673b40e..c4ef1b0c2d6605d2f224a848c94649995d5c08c1 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0.4"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "0.8"
 seta hud_panel_weapons_noncurrent_scale "0.9"
 seta hud_panel_weapons_selection_radius "0"
index 3f4fe39fabf84f5ca284a92daa19b42a20fefc30..15b9066da9c46b7b0412e0420ff9173dd189058f 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0.4"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 seta hud_panel_weapons_selection_radius "0"
index 609ab766de832baf1f9824963913af9994403639..eb61ca79ede9758d6a3027bff68d48d1c4f97be2 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 seta hud_panel_weapons_selection_radius "0"
index b7a7d20ab2d69e566c2dec5bdcaa8bebd5d60d55..bd4dc3f3f3504bec3d4cc0e3db9b008ff8d9d86a 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 seta hud_panel_weapons_selection_radius "0"
index ce818681191a21abeec552cf46522a092028e9d9..82b70e2222ed2e265ca1c62c1f14cc36c7bab6f2 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 seta hud_panel_weapons_selection_radius "0"
index 4159b01c7ddcc1fa0107dc399a29512f554ef460..b3733967efd7029157ddd70c223e8905b7997013 100644 (file)
@@ -64,6 +64,7 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "0"
+seta hud_panel_weapons_orderbyimpulse "1"
 seta hud_panel_weapons_noncurrent_alpha "1"
 seta hud_panel_weapons_noncurrent_scale "1"
 seta hud_panel_weapons_selection_radius "0"
index db756608defe4a18404579bd22bca0c42b97625c..dd6ba66af971838f2da2c1415d756a42619e21d9 100644 (file)
@@ -351,6 +351,7 @@ float autocvar_hud_panel_weapons_selection_radius = 0;
 float autocvar_hud_panel_weapons_selection_speed = 10;
 float autocvar_hud_panel_weapons_timeout;
 int autocvar_hud_panel_weapons_timeout_effect;
+bool autocvar_hud_panel_weapons_orderbyimpulse = true;
 float autocvar_hud_panel_weapons_timeout_fadebgmin;
 float autocvar_hud_panel_weapons_timeout_fadefgmin;
 float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
index 5204e8f36dbcd09f54912bab92b453094914e01c..788c1bac31cce5f699e8ac3884562dd2e5349d9e 100644 (file)
@@ -114,6 +114,7 @@ float bgmtime;
 
 string weaponorder_byimpulse;
 string weaponorder_bypriority;
+bool weapons_orderbyimpulse; // update priority list when toggling this
 
 float vortex_charge_movingavg;
 
index 3043e6e6860d90a0673829688f681eff6fb44e0d..a6c22c74eee9bf113f4d71570b90ec57f7a33938 100644 (file)
@@ -97,6 +97,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
                                        HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
                                        HUD_Write_Cvar("hud_panel_weapons_onlyowned");
+                                       HUD_Write_Cvar("hud_panel_weapons_orderbyimpulse");
                                        HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
                                        HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
                                        HUD_Write_Cvar("hud_panel_weapons_selection_radius");
index 8bf11cf1ac93d3994840bb64b96bac5ce993317d..aae33881b66458886638c423b9962465c455cd46 100644 (file)
@@ -91,11 +91,15 @@ void HUD_Weapons()
        HUD_Panel_LoadCvars();
 
        // figure out weapon order (how the weapons are sorted) // TODO make this configurable
-       if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
+       if(weaponorder_bypriority != autocvar_cl_weaponpriority || autocvar_hud_panel_weapons_orderbyimpulse != weapons_orderbyimpulse || !weaponorder[0])
        {
                int weapon_cnt;
+               weapons_orderbyimpulse = autocvar_hud_panel_weapons_orderbyimpulse;
                strcpy(weaponorder_bypriority, autocvar_cl_weaponpriority);
-               strcpy(weaponorder_byimpulse, W_FixWeaponOrder_BuildImpulseList(W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority))));
+               string weporder = W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority));
+               if(autocvar_hud_panel_weapons_orderbyimpulse)
+                       weporder = W_FixWeaponOrder_BuildImpulseList(weporder);
+               strcpy(weaponorder_byimpulse, weporder);
                weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
 
                weapon_cnt = 0;