_cl_name Player
_cl_playermodel models/player/umbra.iqm
_cl_playerskin 0
- seta crosshair 3
+ seta crosshair 16
seta crosshair_color "0.6 0.8 1"
- seta crosshair_alpha 1
- seta crosshair_size 0.35
+ seta crosshair_alpha 0.3
+ seta crosshair_size 0.5
seta crosshair_dot 1
seta crosshair_dot_alpha 1
- seta crosshair_dot_size 1
+ seta crosshair_dot_size 0.6
+ seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
seta crosshair_pickup 0.25
seta crosshair_pickup_speed 4
seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair"
// ring around crosshair, used for various purposes (such as indicating bullets left in clip, nex charge)
seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex"
+ seta crosshair_ring_alpha 0.2 "ring alpha"
seta crosshair_ring_campingrifle_alpha 0.15
r_motionblur 0 // motion blur value, default is 0
r_damageblur 0 // motion blur when damaged, default is 0
+ r_bloom_blur 8
+ r_bloom_brighten 3
+ r_bloom_colorexponent 1
+ r_bloom_colorscale 1
+ r_bloom_colorsubtract 0.25
+ r_bloom_resolution 320
+ r_hdr_range 4
+
seta vid_x11_display "" "xonotic-linux-*.sh will use this to start xonotic on an other/new X display"
// This can have three possible settings:
// "" run as usual
seta g_ctf_win_mode 0 "0: captures only, 1: captures, then points, 2: points only"
seta g_ctf_ignore_frags 0 "1: regular frags give no points"
+ set g_freezetag 0 "Freeze Tag: Freeze the opposing team(s) to win, unfreeze teammates by standing next to them"
+ seta g_freezetag_warmup 5 "Time players get to run around before the round starts"
+ seta g_freezetag_point_limit -1 "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+ seta g_freezetag_point_leadlimit -1 "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+ seta g_freezetag_revive_time 2.5 "Time it takes to revive a frozen teammate"
+ seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
+ seta g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
+
// 50% of the spawns shall be far away from any players
set g_spawn_furthest 0.5
// respawn delay
set g_cts_respawn_delay 0.25
set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
+ set g_freezetag_respawn_waves 0
+ set g_freezetag_respawn_delay 0.25
+ set g_ka_respawn_delay 0
+ set g_ka_respawn_waves 0
// overtime
seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
alias vmaster "cmd vote master"
alias vlogin "cmd vote login $*"
alias vdo "cmd vote do $*"
- alias vyes "cmd vote yes"
- alias vno "cmd vote no"
+ alias vyes "cl_cmd vyes"
+ alias vno "cl_cmd vno"
alias vdontcare "cmd vote dontcare"
alias vabstain "cmd vote abstain"
seta g_keyhunt_teams_override 0
set g_keyhunt_teams 0
+ // keepaway
+ set g_keepaway 0 "game mode which focuses around a ball, look at g_keepaway_win_mode for further details"
+ set g_keepaway_bckillscore 1 "enable scoring points (y/n) for ball carrier kills"
+ set g_keepaway_pointlimit -1 "total amount of points you can get, -1 for unlimited"
+ set g_keepaway_pointleadlimit -1 "mercy rule, -1 for unlimited"
+ set g_keepaway_ballcarrier_alpha 0.6 "alpha when the player is the ballcarrier"
+ set g_keepaway_ballcarrier_highspeed 1.5 "speed multiplier done to the person holding the ball"
+ set g_keepaway_ballcarrier_damage 1.5 "damage multiplier while having powerup"
+ set g_keepaway_ballcarrier_force 1.5 "force multiplier while having powerup"
+ set g_keepaway_ballcarrier_selfdamage 1 "self damage multiplier while having powerup"
+ set g_keepaway_ballcarrier_selfforce 1.5 "self force multiplier while having powerup"
+ set g_keepaway_noncarrier_warn 0 "warn players when they kill without holding the ball"
+ set g_keepaway_noncarrier_damage 0.5 "damage done to other players if both you and they don't have the ball"
+ set g_keepaway_noncarrier_force 0.5 "force done to other players if both you and they don't have the ball"
+ set g_keepaway_noncarrier_selfdamage 1 "self damage if you don't have the ball"
+ set g_keepaway_noncarrier_selfforce 1 "self force if you don't have the ball"
+ set g_keepawayball_trail_color 254 "particle trail color from player/ball"
+ set g_keepawayball_damageforcescale 2 "Scale of force which is applied to the ball by weapons/explosions/etc"
+ set g_keepawayball_respawntime 15 "if no one picks up the ball, how long to wait until the ball respawns"
+ seta g_keepaway_teams_override 0
+ set g_keepaway_teams 0
+
// so it can be stuffcmd-ed still
set cl_gravity 800 "but ignored anyway"
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_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
+
+ seta hud_panel_healtharmor_maxhealth "250" "when you have this much health, the health status bar is full"
+ seta hud_panel_healtharmor_maxarmor "150" "when you have this much armor, the armor status bar is full"
+
seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
seta hud_panel_notify_fadetime 3 "fade out time"
seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster"
+seta hud_panel_physics_speed_unit 3 "speed unit (1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)"
+seta hud_panel_physics_speed_unit_show 1 "also show speed unit"
+seta hud_panel_physics_speed_max 1800 "speed progressbar gets filled up completely by this value (in qu/s)"
+seta hud_panel_physics_speed_z 0 "include the speed on the Z-axis"
+seta hud_panel_physics_topspeed 1 "also show top speed"
+seta hud_panel_physics_topspeed_time 4 "how many seconds the top speed takes to fade out"
+seta hud_panel_physics_acceleration_max 2 "acceleration progressbar gets filled up completely by this value"
+seta hud_panel_physics_acceleration_z 0 "include the acceleration on the Z-axis"
+
seta hud_showbinds 1 "the way to show the keys to press in HUD messages: 0 displays commands, 1 bound keys, 2 both"
seta hud_showbinds_limit 2 "maximum number of bound keys to show for a command. 0 for unlimited"
+ seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
+
seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
seta cl_gentle_messages 0 "client side gentle mode (only replaces frag messages/centerprints)"
seta cl_gentle_damage 0 "client side gentle mode (only replaces damage flash); when set to 1, a white flash replaces the blood image, when set to 2, a randomily colored flash is used instead"
-seta cl_racetimer_position 0.25 "Y-axis positioning of the race timer (from 0 to 1)"
-seta cl_showpressedkeys 0 "Show which movement keys someone is pressing: 1 for spectating, 2 for always"
-seta cl_showpressedkeys_position "0.5 0.8" "1 0 would be upper right corner, 0.5 0.5 the center"
-
-seta cl_showspeed 0 "show the XY speed of the player"
-seta cl_showspeed_unit 0 "unit selection (0 = qu/s (no postfix), 1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)"
-seta cl_showspeed_z 0 "include the speed on the Z-axis"
-seta cl_showspeed_size 30 "size of the numbers"
-seta cl_showspeed_position 0.7 "Y-axis positioning of the numbers"
-
-seta cl_showacceleration 0 "show the XY acceleration of the player"
-seta cl_showacceleration_z 0 "include the speed on the Z-axis"
-seta cl_showacceleration_size 40 "height of the bar"
-seta cl_showacceleration_scale 1 "X-axis scale of the bar"
-seta cl_showacceleration_alpha 0.5 "alpha of the bar"
-seta cl_showacceleration_color_custom 0 "0 = dynamic color depending on acceleration, 1 = use custom color"
-seta cl_showacceleration_color "1 0 0" "color of the bar, needs cl_showacceleration_color_custom to be 1"
-seta cl_showacceleration_position 0.6 "Y-axis positioning of the bar"
-
set g_jetpack 0 "Jetpack mutator (uses the hook's button, can't coexist with the offhand hook, but only with the onhand one)"
set g_running_guns 0 "... or wonder, till it drives you mad, what would have followed if you had."
alias cl_hook_gamestart_rc
alias cl_hook_gamestart_nexball
alias cl_hook_gamestart_cts
+ alias cl_hook_gamestart_ka
alias cl_hook_gameend
alias cl_hook_activeweapon
alias sv_hook_gamestart_rc
alias sv_hook_gamestart_nexball
alias sv_hook_gamestart_cts
+ alias sv_hook_gamestart_ka
alias sv_hook_gamerestart
alias sv_hook_gameend
set g_forced_team_pink "" "list of player IDs for pink team"
set g_forced_team_otherwise "default" "action if a non listed player joins (can be default for default action, spectate for forcing to spectate, or red, blue, yellow, pink)"
+ // player statistics server URI
+ set g_playerstats_uri ""
+
// other config files
exec balanceXonotic.cfg
exec ctfscoring-ai.cfg
// exec the default skin config
// please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency
exec hud_luminos.cfg
+
+ set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector"
+ set g_weapon_charge_colormod_red_half 0
+ set g_weapon_charge_colormod_green_half 0.5
+ set g_weapon_charge_colormod_blue_half 1
+ set g_weapon_charge_colormod_red_full 1
+ set g_weapon_charge_colormod_green_full -0.5
+ set g_weapon_charge_colormod_blue_full -1
// 1/4 height: bottom part
void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
{
- if (theBorderSize_x <= 0 && theBorderSize_y <= 0) // no border
+ if (theBorderSize_x < 0 && theBorderSize_y < 0) // draw whole image as it is
+ {
+ drawpic(theOrigin, pic, theSize, theColor, theAlpha, 0);
+ return;
+ }
+ if (theBorderSize_x == 0 && theBorderSize_y == 0) // no border
{
// draw only the central part
drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0);
case HUD_PANEL_AMMO:
HUD_Write_PanelCvar_q("_onlycurrent");
HUD_Write_PanelCvar_q("_iconalign");
+ HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_name");
+ HUD_Write_PanelCvar_q("_text");
break;
case HUD_PANEL_POWERUPS:
HUD_Write_PanelCvar_q("_flip");
HUD_Write_PanelCvar_q("_iconalign");
HUD_Write_PanelCvar_q("_baralign");
HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_strength");
+ HUD_Write_PanelCvar_q("_progressbar_shield");
break;
case HUD_PANEL_HEALTHARMOR:
HUD_Write_PanelCvar_q("_flip");
HUD_Write_PanelCvar_q("_iconalign");
HUD_Write_PanelCvar_q("_baralign");
HUD_Write_PanelCvar_q("_progressbar");
+ HUD_Write_PanelCvar_q("_progressbar_health");
+ HUD_Write_PanelCvar_q("_progressbar_armor");
+ HUD_Write_PanelCvar_q("_text");
break;
case HUD_PANEL_NOTIFY:
HUD_Write_PanelCvar_q("_flip");
case HUD_PANEL_INFOMESSAGES:
HUD_Write_PanelCvar_q("_flip");
break;
+ case HUD_PANEL_PHYSICS:
+ HUD_Write_PanelCvar_q("_flip");
+ HUD_Write_PanelCvar_q("_baralign");
+ HUD_Write_PanelCvar_q("_progressbar");
+ break;
}
HUD_Write("\n");
}
} ENDS_WITH_CURLY_BRACE
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
- void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, float lenght_ratio, float vertical, float right_align, vector theColor, float theAlpha, float drawflag)
+ void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float lenght_ratio, float vertical, float right_align, vector theColor, float theAlpha, float drawflag)
{
if(lenght_ratio <= 0 || !theAlpha)
return;
if(lenght_ratio > 1)
lenght_ratio = 1;
- string pic;
vector square;
vector width, height;
if(vertical) {
- pic = strcat(hud_skin_path, "/statusbar_vertical");
+ pic = strcat(hud_skin_path, "/", pic, "_vertical");
if(precache_pic(pic) == "") {
pic = "gfx/hud/default/statusbar_vertical";
}
drawsubpic(theOrigin + height - square, width + square, pic, '0 0.75 0', '1 0.25 0', theColor, theAlpha, drawflag);
}
} else {
- pic = strcat(hud_skin_path, "/statusbar");
+ pic = strcat(hud_skin_path, "/", pic);
if(precache_pic(pic) == "") {
pic = "gfx/hud/default/statusbar";
}
if (currently_selected)
drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- if(a > 0)
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
- else // "ghost" ammo count
- drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ if(a > 0 && cvar("hud_panel_ammo_progressbar"))
+ HUD_Panel_DrawProgressBar(myPos + eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, mySize - eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, cvar_string("hud_panel_ammo_progressbar_name"), 0, 0, a/cvar("hud_panel_ammo_maxammo"), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+
+ if(cvar("hud_panel_ammo_text"))
+ {
+ if(a > 0)
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+ else // "ghost" ammo count
+ drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
+ }
if(a > 0)
drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
else // "ghost" ammo icon
mySize -= '2 2 0' * panel_bg_padding;
}
- vector barpos, barsize;
+ vector barsize;
vector picpos;
vector numpos;
string leftname, rightname;
+ string leftprogressname, rightprogressname;
float leftcnt, rightcnt;
float leftexact, rightexact;
if (cvar("hud_panel_powerups_flip")) {
leftname = "strength";
+ leftprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
leftcnt = ceil(strength_time);
leftexact = strength_time;
rightname = "shield";
+ rightprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
rightcnt = ceil(shield_time);
rightexact = shield_time;
} else {
leftname = "shield";
+ leftprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
leftcnt = ceil(shield_time);
leftexact = shield_time;
rightname = "strength";
+ rightprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
rightcnt = ceil(strength_time);
rightexact = strength_time;
}
float is_vertical = (panel_ar < 1);
if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftcnt)
{
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ }
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(leftcnt > 1)
+ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1);
+ if(leftcnt <= 5)
+ DrawNumIcon_expanding(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
- if(leftcnt > 1)
- DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1);
- if(leftcnt <= 5)
- DrawNumIcon_expanding(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
if(rightcnt)
{
+ pos_x += barsize_x;
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, rightprogressname, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ }
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(rightcnt > 1)
+ DrawNumIcon(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
+ if(rightcnt <= 5)
+ DrawNumIcon_expanding(pos, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
- if(rightcnt > 1)
- DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
- if(rightcnt <= 5)
- DrawNumIcon_expanding(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
}
else
{
+ barsize = eX * mySize_x + eY * 0.5 * mySize_y;
if(leftcnt)
{
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ }
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(leftcnt > 1)
+ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1);
+ if(leftcnt <= 5)
+ DrawNumIcon_expanding(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
- if(leftcnt > 1)
- DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1);
- if(leftcnt <= 5)
- DrawNumIcon_expanding(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
if(rightcnt)
{
+ pos_y += barsize_y;
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, rightprogressname, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+ }
+ if(cvar("hud_panel_powerups_text"))
+ {
+ if(rightcnt > 1)
+ DrawNumIcon(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
+ if(rightcnt <= 5)
+ DrawNumIcon_expanding(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
- if(rightcnt > 1)
- DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
- if(rightcnt <= 5)
- DrawNumIcon_expanding(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
}
drawfont = hud_font;
if(autocvar__hud_configure)
{
- armor = 150;
- health = 100;
- fuel = 70;
+ armor = 75;
+ health = 150;
+ fuel = 20;
}
if(health <= 0)
return;
- vector barpos, barsize;
+ vector barsize;
vector picpos, numpos;
drawfont = hud_bigfont;
float baralign = cvar("hud_panel_healtharmor_baralign");
float iconalign = cvar("hud_panel_healtharmor_iconalign");
float progressbar = cvar("hud_panel_healtharmor_progressbar");
+
+ float maxhealth = cvar("hud_panel_healtharmor_maxhealth");
+ float maxarmor = cvar("hud_panel_healtharmor_maxarmor");
if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
{
vector v;
float x;
x = floor(v_x + 1);
+ float maxtotal = maxhealth + maxarmor;
string biggercount;
if(v_z) // NOT fully armored
{
if(progressbar)
{
HUD_Panel_GetProgressBarColor(health);
- HUD_Panel_DrawProgressBar(pos, mySize, x/400, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, cvar_string("hud_panel_healtharmor_progressbar_health"), x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(armor)
+ if(cvar("hud_panel_healtharmor_text"))
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
}
else
if(progressbar)
{
HUD_Panel_GetProgressBarColor(armor);
- HUD_Panel_DrawProgressBar(pos, mySize, x/400, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, cvar_string("hud_panel_healtharmor_progressbar_armor"), x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(health)
+ if(cvar("hud_panel_healtharmor_text"))
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, 2 * 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, maxtotal), 1);
if(fuel)
{
HUD_Panel_GetProgressBarColor(fuel);
- HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, fuel/100, 0, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
else
{
string leftname, rightname;
+ string leftprogressname, rightprogressname;
float leftcnt, rightcnt;
+ float leftmax, rightmax;
float leftactive, rightactive;
float leftalpha, rightalpha;
if (cvar("hud_panel_healtharmor_flip")) { // layout with armor left/top of health
leftname = "armor";
+ leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
leftcnt = armor;
if(leftcnt)
leftactive = 1;
leftalpha = min((armor+10)/55, 1);
+ leftmax = maxarmor;
rightname = "health";
+ rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
rightcnt = health;
rightactive = 1;
rightalpha = 1;
+ rightmax = maxhealth;
} else {
leftname = "health";
+ leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
leftcnt = health;
leftactive = 1;
leftalpha = 1;
+ leftmax = maxhealth;
rightname = "armor";
+ rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
rightcnt = armor;
if(rightcnt)
rightactive = 1;
rightalpha = min((armor+10)/55, 1);
+ rightmax = maxarmor;
}
float panel_ar = mySize_x/mySize_y;
float is_vertical = (panel_ar < 1);
if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftactive)
{
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1);
}
if(rightactive)
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, barsize, rightprogressname, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(pos + eX * 0.5 * mySize_x, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1);
}
if(fuel)
mySize_x *= 0.2 * 0.5 / 2;
else
mySize_y *= 0.2;
- HUD_Panel_DrawProgressBar(pos, mySize, fuel/100, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
else
{
+ barsize = eX * 0.5 * mySize_x + eY * mySize_y;
if(leftactive)
{
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(leftname);
- HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1);
}
if(rightactive)
if(progressbar)
{
HUD_Panel_GetProgressBarColorForString(rightname);
- HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, barsize, rightprogressname, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1);
+ if(cvar("hud_panel_healtharmor_text"))
+ DrawNumIcon(pos + eY * 0.5 * mySize_y, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1);
}
if(fuel)
mySize_x *= 0.2 / 2;
else
mySize_y *= 0.2 * 0.5;
- HUD_Panel_DrawProgressBar(pos, mySize, fuel/100, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
}
}
}
else if(type == RACE_FAIL) {
HUD_KillNotify_Push(s1, s2, 1, RACE_FAIL);
}
+ } else if(msg == MSG_KA) {
+ if(type == KA_PICKUPBALL) {
+ HUD_KillNotify_Push(s1, s2, 0, KA_PICKUPBALL);
+ if(alsoprint)
+ print (s1, "^7 has picked up the ball!\n");
+ }
+ else if(type == KA_DROPBALL) {
+ HUD_KillNotify_Push(s1, s2, 0, KA_DROPBALL);
+ if(alsoprint)
+ print(s1, "^7 has dropped the ball!\n");
+ }
}
}
s = "notify_blue_captured";
}
}
+ else if(killnotify_deathtype[j] == KA_DROPBALL)
+ {
+ s = "notify_balldropped";
+ }
+ else if(killnotify_deathtype[j] == KA_PICKUPBALL)
+ {
+ s = "notify_ballpickedup";
+ }
+
attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
void HUD_VoteWindow(void)
{
+ uid2name_dialog = 0;
if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
{
vote_active = 1;
vote_called_vote = strzone(strcat("^2Name ^7instead of \"^1Unregistered player\"", " ^7in stats"));
+ uid2name_dialog = 1;
}
if(!autocvar_hud_panel_vote && !autocvar__hud_configure)
active_panel = HUD_PANEL_VOTE;
HUD_Panel_UpdateCvars(vote);
- vector pos, mySize;
- pos = panel_pos;
- mySize = panel_size;
- if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
+ if(uid2name_dialog)
{
panel_pos = eX * 0.3 * vid_conwidth + eY * 0.1 * vid_conheight;
panel_size = eX * 0.4 * vid_conwidth + eY * 0.3 * vid_conheight;
}
+ // these must be below above block
+ vector pos, mySize;
+ pos = panel_pos;
+ mySize = panel_size;
+
a = vote_alpha * bound(cvar("hud_panel_vote_alreadyvoted_alpha"), 1 - vote_highlighted, 1);
HUD_Panel_DrawBg(a);
a = panel_fg_alpha * a;
mySize = newSize;
s = "A vote has been called for:";
- if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
+ if(uid2name_dialog)
s = "Allow servers to store and display your name?";
drawstring_aspect(pos, s, eX * mySize_x + eY * (2/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
s = textShortenToWidth(vote_called_vote, mySize_x, '1 1 0' * mySize_y * (1/8), stringwidth_colors);
drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize_y, s, eX * mySize_x + eY * (1.75/8) * mySize_y, a, DRAWFLAG_NORMAL);
// print the yes/no counts
- s = strcat("Yes (", getcommandkey("vyes", "vyes"), "): ", ftos(vote_yescount));
- if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
- s = strcat("Yes: (press y)");
+ s = strcat("Yes (", getcommandkey("vyes", "vyes"), "): ", ftos(vote_yescount));
drawstring_aspect(pos + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '0 1 0', a, DRAWFLAG_NORMAL);
- s = strcat("No (", getcommandkey("vno", "vno"), "): ", ftos(vote_nocount));
- if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
- s = strcat("No: (press n)");
+ s = strcat("No (", getcommandkey("vno", "vno"), "): ", ftos(vote_nocount));
drawstring_aspect(pos + eX * 0.5 * mySize_x + eY * (4/8) * mySize_y, s, eX * 0.5 * mySize_x + eY * (1.5/8) * mySize_y, '1 0 0', a, DRAWFLAG_NORMAL);
// draw the progress bar backgrounds
}
}
+ // Keepaway HUD mod icon
+ float kaball_prevstatus; // last remembered status
+ float kaball_statuschange_time; // time when the status changed
+
+ // we don't need to reset for keepaway since it immediately
+ // autocorrects prevstatus as to if the player has the ball or not
+
+ void HUD_Mod_Keepaway(vector pos, vector mySize)
+ {
+ mod_active = 1; // keepaway should always show the mod HUD
+
+ float BLINK_FACTOR = 0.15;
+ float BLINK_BASE = 0.85;
+ float BLINK_FREQ = 5;
+ float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+
+ float stat_items = getstati(STAT_ITEMS);
+ float kaball = (stat_items/IT_KEY1) & 1;
+
+ if(kaball != kaball_prevstatus)
+ {
+ kaball_statuschange_time = time;
+ kaball_prevstatus = kaball;
+ }
+
+ // todo: Fix the sizing with the expanding image
+
+ float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
+ float f = bound(0, kaball_statuschange_elapsedtime*2, 1);
+
+ if(kaball_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(pos + eY * 0.25 * mySize_y, "keepawayball_carrying", eX * mySize_x + eY * mySize_y * 0.5, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
+
+ if(kaball)
+ drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
+ }
+
+
// Nexball HUD mod icon
void HUD_Mod_NexBall(vector pos, vector mySize)
{
p = 2 - p;
//Draw the filling
- vector barsize;
- float vertical;
HUD_Panel_GetProgressBarColor(nexball);
if(mySize_x > mySize_y)
- HUD_Panel_DrawProgressBar(pos, mySize, p, 0, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", p, 0, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
else
- HUD_Panel_DrawProgressBar(pos, mySize, p, 1, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", p, 1, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if (stat_items & IT_KEY1)
if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
return;
- if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && !autocvar__hud_configure)
+ if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
return;
active_panel = HUD_PANEL_MODICONS;
HUD_Mod_NexBall(pos, mySize);
else if(gametype == GAME_CTS || gametype == GAME_RACE)
HUD_Mod_Race(pos, mySize);
- else if(gametype == GAME_CA)
+ else if(gametype == GAME_CA || gametype == GAME_FREEZETAG)
HUD_Mod_CA(pos, mySize);
+ else if(gametype == GAME_KEEPAWAY)
+ HUD_Mod_Keepaway(pos, mySize);
}
// Draw pressed keys (#11)
}
}
-/*
-==================
-Main HUD system
-==================
-*/
+// Physics panel (#15)
+//
+vector acc_prevspeed;
+float acc_prevtime, acc_avg, top_speed, top_speed_time;
-void HUD_ShowSpeed(void)
+void HUD_Physics(void)
{
- vector numsize;
- float pos, conversion_factor;
- string speed, zspeed, unit;
+ if(!autocvar_hud_panel_physics && !autocvar__hud_configure)
+ return;
- switch(cvar("cl_showspeed_unit"))
+ active_panel = HUD_PANEL_PHYSICS;
+ HUD_Panel_UpdateCvars(physics);
+ vector pos, mySize;
+ pos = panel_pos;
+ mySize = panel_size;
+
+ HUD_Panel_DrawBg(1);
+ if(panel_bg_padding)
+ {
+ pos += '1 1 0' * panel_bg_padding;
+ mySize -= '2 2 0' * panel_bg_padding;
+ }
+
+ //compute speed
+ float speed, conversion_factor;
+ string zspeed, unit;
+
+ switch(cvar("hud_panel_physics_speed_unit"))
{
default:
- case 0:
- unit = "";
- conversion_factor = 1.0;
- break;
case 1:
- unit = " qu/s";
+ unit = "qu/s";
conversion_factor = 1.0;
break;
case 2:
- unit = " m/s";
+ unit = "m/s";
conversion_factor = 0.0254;
break;
case 3:
- unit = " km/h";
+ unit = "km/h";
conversion_factor = 0.0254 * 3.6;
break;
case 4:
- unit = " mph";
+ unit = "mph";
conversion_factor = 0.0254 * 3.6 * 0.6213711922;
break;
case 5:
- unit = " knots";
+ unit = "knots";
conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
break;
}
- speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
-
- numsize_x = numsize_y = cvar("cl_showspeed_size");
- pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
+ float max_speed = floor( cvar("hud_panel_physics_speed_max") * conversion_factor + 0.5 );
+ if (autocvar__hud_configure)
+ speed = floor( max_speed * 0.65 + 0.5 );
+ else if(cvar("hud_panel_physics_speed_z"))
+ speed = floor( vlen(pmove_vel) * conversion_factor + 0.5 );
+ else
+ speed = floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 );
- drawfont = hud_bigfont;
- drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ //compute acceleration
+ float acceleration, f;
+ float max_acceleration = cvar("hud_panel_physics_acceleration_max");
+ if (autocvar__hud_configure)
+ acceleration = max_acceleration * 0.3;
+ else
+ {
+ f = time - acc_prevtime;
+ if(cvar("hud_panel_physics_acceleration_z"))
+ acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
+ else
+ acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
+ acc_prevspeed = pmove_vel;
+ acc_prevtime = time;
- if (cvar("cl_showspeed_z") == 1) {
- zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
- drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ f = bound(0, f * 10, 1);
+ acc_avg = acc_avg * (1 - f) + acceleration * f;
+ acceleration = acc_avg / getstatf(STAT_MOVEVARS_MAXSPEED);
}
- drawfont = hud_font;
-}
+ //compute layout
+ drawfont = hud_bigfont;
+ float baralign = cvar("hud_panel_physics_baralign");
+ float progressbar = cvar("hud_panel_physics_progressbar");
+ float panel_ar = mySize_x/mySize_y;
+ vector speed_offset, acceleration_offset;
+ if (panel_ar >= 5)
+ {
+ mySize_x *= 0.5;
+ if (cvar("hud_panel_physics_flip"))
+ speed_offset_x = mySize_x;
+ else
+ acceleration_offset_x = mySize_x;
+ }
+ else
+ {
+ mySize_y *= 0.5;
+ if (cvar("hud_panel_physics_flip"))
+ speed_offset_y = mySize_y;
+ else
+ acceleration_offset_y = mySize_y;
+ }
+ float speed_baralign, acceleration_baralign;
+ if (cvar("hud_panel_physics_flip"))
+ {
+ acceleration_baralign = (baralign == 1 || baralign == 2);
+ speed_baralign = (baralign == 1 || baralign == 3);
+ }
+ else
+ {
+ speed_baralign = (baralign == 1 || baralign == 2);
+ acceleration_baralign = (baralign == 1 || baralign == 3);
+ }
-vector acc_prevspeed;
-float acc_prevtime;
-float acc_avg;
+ //draw speed
+ if(speed && progressbar)
+ {
+ HUD_Panel_GetProgressBarColor(speed);
- HUD_Panel_DrawProgressBar(pos + speed_offset, mySize, speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
++ HUD_Panel_DrawProgressBar(pos + speed_offset, mySize, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
-void HUD_ShowAcceleration(void)
-{
- float acceleration, sz, scale, alpha, f;
- vector pos, mySize, rgb;
+ vector tmp_offset, tmp_size;
+ tmp_size_x = mySize_x * 0.75;
+ tmp_size_y = mySize_y;
+ if (speed_baralign)
+ tmp_offset_x = mySize_x - tmp_size_x;
+ //else
+ //tmp_offset_x = 0;
+ drawstring_aspect(pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- f = time - acc_prevtime;
- if(cvar("cl_showacceleration_z"))
- acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
+ //draw speed unit
+ if (speed_baralign)
+ tmp_offset_x = 0;
else
- acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
- acc_prevspeed = pmove_vel;
- acc_prevtime = time;
-
- f = bound(0, f * 10, 1);
- acc_avg = acc_avg * (1 - f) + acceleration * f;
- acceleration = acc_avg / getstatf(STAT_MOVEVARS_MAXSPEED);
- if (acceleration == 0)
- return;
-
- sz = cvar("cl_showacceleration_size");
- scale = cvar("cl_showacceleration_scale");
- alpha = cvar("cl_showacceleration_alpha");
- if (cvar("cl_showacceleration_color_custom"))
- rgb = stov(cvar_string("cl_showacceleration_color"));
- else {
- if (acceleration < 0)
- rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
- else
- rgb = '.5 1 .5' - '.5 0 .5' * bound(0, +acceleration * 0.2, 1);
+ tmp_offset_x = tmp_size_x;
+ if (cvar("hud_panel_physics_speed_unit_show"))
+ {
+ //tmp_offset_y = 0;
+ tmp_size_x = mySize_x * (1 - 0.75);
+ tmp_size_y = mySize_y * 0.4;
+ drawstring_aspect(pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- mySize_x = vid_conwidth/2;
- mySize_y = sz;
- pos_y = cvar("cl_showacceleration_position") * vid_conheight - sz/2;
- if (acceleration > 0)
+ //compute and draw top speed
+ if (cvar("hud_panel_physics_topspeed"))
{
- pos_x = mySize_x;
- HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", acceleration * scale, 0, 0, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ if (autocvar__hud_configure)
+ {
+ top_speed = floor( max_speed * 0.75 + 0.5 );
+ f = 1;
+ }
+ else
+ {
+ if (speed >= top_speed)
+ {
+ top_speed = speed;
+ top_speed_time = time;
+ }
+ if (top_speed == 0) //hide top speed 0, it would be stupid
+ f = 0;
+ else
+ {
+ f = max(1, cvar("hud_panel_physics_topspeed_time"));
+ // divide by f to make it start from 1
+ f = cos( ((time - top_speed_time) / f) * PI/2 );
+ }
+ }
+ if (f > 0)
+ {
+ //top speed progressbar peek
+ if(progressbar && speed < top_speed)
+ {
+ float peek_offset_x, peek_size_x;
+ if (speed_baralign)
+ peek_offset_x = (1 - min(top_speed, max_speed)/max_speed) * mySize_x;
+ else
+ peek_offset_x = min(top_speed, max_speed)/max_speed * mySize_x;
+ //if speed is not 0 the speed progressbar already fetched the color
+ if (speed == 0)
+ HUD_Panel_GetProgressBarColor(speed);
+ peek_size_x = mySize_x * 0.01;
+ drawfill(pos + speed_offset + eX * (peek_offset_x - peek_size_x), eX * peek_size_x + eY * mySize_y, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+
+ //top speed
+ tmp_offset_y = mySize_y * 0.4;
+ tmp_size_x = mySize_x * (1 - 0.75);
+ tmp_size_y = mySize_y - tmp_offset_y;
+ drawstring_aspect(pos + speed_offset + tmp_offset, ftos(top_speed), tmp_size, '1 0 0', f * panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ else
+ top_speed = 0;
}
- else
+
+ //draw acceleration
+ if(acceleration && progressbar)
{
- //pos_x = 0;
- HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", -acceleration * scale, 0, 1, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ if (acceleration < 0)
+ HUD_Panel_GetProgressBarColor(acceleration_neg);
+ else
+ HUD_Panel_GetProgressBarColor(acceleration);
- HUD_Panel_DrawProgressBar(pos + acceleration_offset, mySize, fabs(acceleration)/max_acceleration, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
++ HUD_Panel_DrawProgressBar(pos + acceleration_offset, mySize, "progressbar", fabs(acceleration)/max_acceleration, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
+ drawstring_aspect(pos + acceleration_offset, ftos_decimals(acceleration, 3), mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawfont = hud_font;
}
+/*
+==================
+Main HUD system
+==================
+*/
+
void HUD_Reset (void)
{
// reset gametype specific icons
HUD_EngineInfo(); break;\
case (HUD_PANEL_INFOMESSAGES):\
HUD_InfoMessages(); break;\
+ case (HUD_PANEL_PHYSICS):\
+ HUD_Physics(); break;\
} ENDS_WITH_CURLY_BRACE
void HUD_Main (void)
if(autocvar__con_chat_maximized)
HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
- // TODO hud_'ify these
- if (cvar("cl_showspeed"))
- HUD_ShowSpeed();
- if (cvar("cl_showacceleration"))
- HUD_ShowAcceleration();
-
if (autocvar__hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button)
localcmd("cmd selectteam auto; cmd join\n");