// hud cvar descriptions
exec _hud_descriptions.cfg
// exec the default skin config. remember, NO menu_restart in the deafault cfg (dp segfaults at startup otherwise)
+// please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency
exec hud_default.cfg
// user preference cvars (i.e. shouldn't be adjusted by a skin config)
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_timeout "10" "panel disappears if you don't switch weapon for this amount of seconds"
+seta hud_panel_weapons_timeout "3" "panel disappears if you don't switch weapon for this amount of seconds"
seta hud_panel_weapons_timeout_effect "1" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
complain_weapon_type = ReadByte();
complain_weapon_time = time;
+ weapontime = time; // ping the weapon panel
}
// CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
return;
float timeout = cvar("hud_panel_weapons_timeout");
- float timeout_effect_lenght;
+ float timeout_effect_length, timein_effect_length;
if (cvar("hud_panel_weapons_timeout_effect") == 0)
- timeout_effect_lenght = 0;
+ {
+ timeout_effect_length = 0;
+ timein_effect_length = 0;
+ }
else
- timeout_effect_lenght = 0.75;
+ {
+ timeout_effect_length = 0.75;
+ timein_effect_length = 0.375;
+ }
- if (timeout && time >= weapontime + timeout + timeout_effect_lenght && !autocvar__hud_configure)
+ if (timeout && time >= weapontime + timeout + timeout_effect_length && !autocvar__hud_configure)
+ {
+ weaponprevtime = time;
return;
+ }
active_panel = HUD_PANEL_WEAPONS;
HUD_Panel_UpdateCvars(weapons);
if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
{
- float f = (time - (weapontime + timeout)) / timeout_effect_lenght;
- if (cvar("hud_panel_weapons_timeout_effect") == 2)
+ float f = (time - (weapontime + timeout)) / timeout_effect_length;
+ if (cvar("hud_panel_weapons_timeout_effect"))
{
panel_bg_alpha *= (1 - f);
panel_fg_alpha *= (1 - f);
}
- else
+ if (cvar("hud_panel_weapons_timeout_effect") == 1)
+ {
+ f *= f; // for a cooler movement
+ vector center;
+ center_x = panel_pos_x + panel_size_x/2;
+ center_y = panel_pos_y + panel_size_y/2;
+ float screen_ar = vid_conwidth/vid_conheight;
+ if (center_x/center_y < screen_ar) //bottom left
+ {
+ if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
+ panel_pos_y += f * (vid_conheight - panel_pos_y);
+ else //left
+ panel_pos_x -= f * (panel_pos_x + panel_size_x);
+ }
+ else //top right
+ {
+ if ((vid_conwidth - center_x)/center_y < screen_ar) //right
+ panel_pos_x += f * (vid_conwidth - panel_pos_x);
+ else //top
+ panel_pos_y -= f * (panel_pos_y + panel_size_y);
+ }
+ }
+ weaponprevtime = time - (1 - f) * timein_effect_length;
+ }
+ else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
+ {
+ float f = (time - weaponprevtime) / timein_effect_length;
+ if (cvar("hud_panel_weapons_timeout_effect"))
+ {
+ panel_bg_alpha *= (f);
+ panel_fg_alpha *= (f);
+ }
+ if (cvar("hud_panel_weapons_timeout_effect") == 1)
{
f *= f; // for a cooler movement
+ f = 1 - f;
vector center;
center_x = panel_pos_x + panel_size_x/2;
center_y = panel_pos_y + panel_size_y/2;
float last_weapon;
float weapontime;
+float weaponprevtime;
float teamnagger;
float hud_accuracy_hud;
ATTRIB(XonoticHUDWeaponsDialog, title, string, "Weapons Panel")
ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
- ATTRIB(XonoticHUDWeaponsDialog, rows, float, 15)
+ ATTRIB(XonoticHUDWeaponsDialog, rows, float, 17)
ATTRIB(XonoticHUDWeaponsDialog, columns, float, 4)
ATTRIB(XonoticHUDWeaponsDialog, name, string, "HUDweapons")
ENDCLASS(XonoticHUDWeaponsDialog)
for(i = 0; i <= 10; ++i)
e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Fade out after:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout"))));
+ e.addValue(e, "Never", "0");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(strcat(ftos_decimals(i, 0), "s")), strzone(ftos(i)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Fade effect:"));
+ me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "0", "None"));
+ setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
+ me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "1", "Slide"));
+ setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
+ me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", "Alpha"));
+ setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Weapon icons:"));
me.TR(me);