From: Samual Date: Sun, 3 Jul 2011 08:53:01 +0000 (-0400) Subject: Add the ability to select "show only owned weapons" to the hud config menu for the... X-Git-Tag: xonotic-v0.6.0~40^2~118^2~18^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e4850e6d83fb795a1c5d9a12d8bafa9abf8f0b39;p=xonotic%2Fxonotic-data.pk3dir.git Add the ability to select "show only owned weapons" to the hud config menu for the panel, and enable it by default. --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 2376bf472..9c83bae92 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1431,7 +1431,7 @@ seta hud_panel_weapons_ammo_full_nails 200 "show 100% of the status bar at this seta hud_panel_weapons_ammo_full_cells 80 "show 100% of the status bar at this ammo count" seta hud_panel_weapons_ammo_full_rockets 80 "show 100% of the status bar at this ammo count" seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this ammo count" -seta hud_panel_weapons_onlyowned 0 "show only owned weapons" +seta hud_panel_weapons_onlyowned 1 "show only owned weapons" seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full" diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7a0c1a0f8..7788641b3 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -679,7 +679,7 @@ void HUD_Weapons(void) fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime; float weapons_st = getstati(STAT_WEAPONS); float weapon_count; - if (!autocvar__hud_configure && autocvar_hud_panel_weapons_onlyowned) + if (autocvar_hud_panel_weapons_onlyowned) { vector old_panel_size; for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i) @@ -687,7 +687,7 @@ void HUD_Weapons(void) if(weapons_st & weaponorder[i].weapons) ++weapon_count; } - if(autocvar_hud_panel_weapons_complainbubble && time - complain_weapon_time < when + fadetime)// && complain_weapon >= 0 + if(!autocvar__hud_configure && (autocvar_hud_panel_weapons_complainbubble && time - complain_weapon_time < when + fadetime))// && complain_weapon >= 0 ++weapon_count; if (weapon_count == 0) return; @@ -843,7 +843,7 @@ void HUD_Weapons(void) continue; if (autocvar_hud_panel_weapons_onlyowned) if (!((weapons_st & self.weapons) || (self.weapon == complain_weapon && time - complain_weapon_time < when + fadetime && autocvar_hud_panel_weapons_complainbubble))) - if (!autocvar__hud_configure) + //if (!autocvar__hud_configure) continue; wpnpos = panel_pos + eX * column * wpnsize_x + eY * row * wpnsize_y; diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_weapons.c b/qcsrc/menu/xonotic/dialog_hudpanel_weapons.c index d0daa6784..b31622f67 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_weapons.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_weapons.c @@ -4,7 +4,7 @@ CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog) ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel")) ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4) - ATTRIB(XonoticHUDWeaponsDialog, rows, float, 17) + ATTRIB(XonoticHUDWeaponsDialog, rows, float, 18) ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4) ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons") ENDCLASS(XonoticHUDWeaponsDialog) @@ -40,6 +40,9 @@ void XonoticHUDWeaponsDialog_fill(entity me) setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0"); me.TR(me); me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Weapon icons:"))); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_weapons_onlyowned", _("Show only owned weapons"))); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));