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"
+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_ammo "" "enable/disable this panel"
seta hud_panel_ammo_pos "" "position of this panel"
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_noncurrent_alpha "0.8"
+seta hud_panel_weapons_noncurrent_scale "0.8"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.315000 0.865000"
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_noncurrent_alpha "1"
+seta hud_panel_weapons_noncurrent_scale "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.330000 0.960000"
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_noncurrent_alpha "1"
+seta hud_panel_weapons_noncurrent_scale "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.650000 0.890000"
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_noncurrent_alpha "1"
+seta hud_panel_weapons_noncurrent_scale "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.450000 0.630000"
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_noncurrent_alpha "1"
+seta hud_panel_weapons_noncurrent_scale "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.190000 0.920000"
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_noncurrent_alpha "1"
+seta hud_panel_weapons_noncurrent_scale "1"
seta hud_panel_ammo 1
seta hud_panel_ammo_pos "0.160000 0.910000"
int autocvar_hud_panel_weapons_label;
float autocvar_hud_panel_weapons_label_scale = 0.5;
bool autocvar_hud_panel_weapons_onlyowned;
+float autocvar_hud_panel_weapons_noncurrent_alpha = 1;
+float autocvar_hud_panel_weapons_noncurrent_scale = 1;
float autocvar_hud_panel_weapons_timeout;
int autocvar_hud_panel_weapons_timeout_effect;
float autocvar_hud_panel_weapons_timeout_fadebgmin;
// draw items
row = column = 0;
vector label_size = '1 1 0' * min(weapon_size.x, weapon_size.y) * bound(0, autocvar_hud_panel_weapons_label_scale, 1);
+ vector noncurrent_pos = '0 0 0';
+ vector noncurrent_size = weapon_size * bound(0, autocvar_hud_panel_weapons_noncurrent_scale, 1);
+ float noncurrent_alpha = panel_fg_alpha * bound(0, autocvar_hud_panel_weapons_noncurrent_alpha, 1);
+ bool isCurrent;
+
for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
{
// retrieve information about the current weapon to be drawn
self = weaponorder[i];
weapon_id = self.impulse;
+ isCurrent = (self.weapon == switchweapon);
// skip if this weapon doesn't exist
if(!self || weapon_id < 0) { continue; }
continue;
// figure out the drawing position of weapon
- weapon_pos = (panel_pos
- + eX * column * weapon_size.x
- + eY * row * weapon_size.y);
+ weapon_pos = (panel_pos + eX * column * weapon_size.x + eY * row * weapon_size.y);
+ noncurrent_pos.x = weapon_pos.x + (weapon_size.x - noncurrent_size.x) / 2;
+ noncurrent_pos.y = weapon_pos.y + (weapon_size.y - noncurrent_size.y) / 2;
// draw background behind currently selected weapon
- if(self.weapon == switchweapon)
+ if(isCurrent)
drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
// draw the weapon accuracy
if(weapons_stat & WepSet_FromWeapon(self.weapon))
{
// draw the weapon image
- drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ if(isCurrent)
+ drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ else
+ drawpic_aspect_skin(noncurrent_pos, self.model2, noncurrent_size, '1 1 1', noncurrent_alpha, DRAWFLAG_NORMAL);
// draw weapon label string
switch(autocvar_hud_panel_weapons_label)
}
else // draw a "ghost weapon icon" if you don't have the weapon
{
- drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(noncurrent_pos, self.model2, noncurrent_size, '0.2 0.2 0.2', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
}
// draw the complain message
HUD_Write_PanelCvar_q("_timeout_speed_in");
HUD_Write_PanelCvar_q("_timeout_speed_out");
HUD_Write_PanelCvar_q("_onlyowned");
+ HUD_Write_PanelCvar_q("_noncurrent_alpha");
+ HUD_Write_PanelCvar_q("_noncurrent_scale");
break;
case HUD_PANEL_AMMO:
HUD_Write_PanelCvar_q("_onlycurrent");
ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
- ATTRIB(XonoticHUDWeaponsDialog, rows, float, 19)
+ ATTRIB(XonoticHUDWeaponsDialog, rows, float, 21)
ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4)
ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons")
ATTRIB(XonoticHUDWeaponsDialog, requiresConnection, float, true)
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.2, e = makeXonoticTextLabel(0, _("Noncurrent alpha:")));
+ me.TD(me, 1, 2.6, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_weapons_noncurrent_alpha"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Noncurrent scale:")));
+ me.TD(me, 1, 2.6, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_weapons_noncurrent_scale"));
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));