From: terencehill Date: Wed, 30 Mar 2016 22:48:38 +0000 (+0200) Subject: Add dedicated cvar (hud_panel_healtharmor_combined) for combining health and armor... X-Git-Tag: xonotic-v0.8.2~969^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=45dfc727cef14412598d619e1704d1b70dc64b64;p=xonotic%2Fxonotic-data.pk3dir.git Add dedicated cvar (hud_panel_healtharmor_combined) for combining health and armor instead of using the main panel cvar; add a checkbox for enabling it in the menu --- diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 970d6ff7f..adcc7fddc 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -99,9 +99,10 @@ seta hud_panel_powerups_bg_padding "" "if set to something else than \"\" = over seta hud_panel_powerups_progressbar "" "enable progressbar in panel" seta hud_panel_powerups_text "" "show text and icons in the powerups panel" -seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/armor display" +seta hud_panel_healtharmor "" "enable/disable this panel" seta hud_panel_healtharmor_pos "" "position of this panel" seta hud_panel_healtharmor_size "" "size of this panel" +seta hud_panel_healtharmor_combined "" "combined health/armor display" seta hud_panel_healtharmor_flip "" "flip health/armor positions" seta hud_panel_healtharmor_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right" seta hud_panel_healtharmor_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align only left icon to the right, 3 = align only right icon to the right" diff --git a/hud_luma.cfg b/hud_luma.cfg index 226af4c1b..ae4619634 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "" seta hud_panel_healtharmor_bg_border "4" seta hud_panel_healtharmor_bg_padding "" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "3" seta hud_panel_healtharmor_baralign "3" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 04902e07f..a0f26dbff 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "" seta hud_panel_healtharmor_bg_border "" seta hud_panel_healtharmor_bg_padding "" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "3" seta hud_panel_healtharmor_baralign "3" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 76214f490..893ba9502 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "" seta hud_panel_healtharmor_bg_border "" seta hud_panel_healtharmor_bg_padding "0" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "3" seta hud_panel_healtharmor_baralign "3" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 722a316fd..297d2af4f 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "0.600000" seta hud_panel_healtharmor_bg_border "-1" seta hud_panel_healtharmor_bg_padding "0" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "1" seta hud_panel_healtharmor_baralign "1" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 3138471bb..ef3da2df1 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "" seta hud_panel_healtharmor_bg_border "" seta hud_panel_healtharmor_bg_padding "" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "3" seta hud_panel_healtharmor_baralign "3" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 791653f27..5ae9a1aa8 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -109,6 +109,7 @@ seta hud_panel_healtharmor_bg_color_team "" seta hud_panel_healtharmor_bg_alpha "" seta hud_panel_healtharmor_bg_border "" seta hud_panel_healtharmor_bg_padding "" +seta hud_panel_healtharmor_combined "0" seta hud_panel_healtharmor_flip "0" seta hud_panel_healtharmor_iconalign "0" seta hud_panel_healtharmor_baralign "0" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 3320b1662..c36d45154 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -230,6 +230,7 @@ float autocvar_hud_panel_engineinfo_framecounter_time; float autocvar_hud_panel_fg_alpha; bool autocvar_hud_panel_healtharmor; int autocvar_hud_panel_healtharmor_baralign; +bool autocvar_hud_panel_healtharmor_combined; bool autocvar_hud_panel_healtharmor_flip; int autocvar_hud_panel_healtharmor_iconalign; int autocvar_hud_panel_healtharmor_maxarmor; diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index 07166105e..853efd81d 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -120,6 +120,7 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar("_progressbar_armor"); HUD_Write_PanelCvar("_progressbar_gfx"); HUD_Write_PanelCvar("_progressbar_gfx_smooth"); + HUD_Write_PanelCvar("_combined"); HUD_Write_PanelCvar("_text"); break; case HUD_PANEL_NOTIFY: diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index 3b0397917..8f279f2aa 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -74,7 +74,7 @@ void HUD_HealthArmor() int maxhealth = autocvar_hud_panel_healtharmor_maxhealth; int maxarmor = autocvar_hud_panel_healtharmor_maxarmor; - if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display + if(autocvar_hud_panel_healtharmor_combined) // combined health and armor display { vector v; v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc index c158ebabf..ac305b832 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc +++ b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qc @@ -11,6 +11,8 @@ void XonoticHUDHealthArmorDialog_fill(entity me) DIALOG_HUDPANEL_COMMON(); + me.TR(me); + me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_combined", _("Combine health and armor"))); me.TR(me); me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar"))); me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh index 68ffe79ea..495047c5f 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh +++ b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.qh @@ -6,7 +6,7 @@ CLASS(XonoticHUDHealthArmorDialog, XonoticRootDialog) ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel")) ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4) - ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15) + ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 16) ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4) ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor") ATTRIB(XonoticHUDHealthArmorDialog, requiresConnection, float, true)