#include "hud.qh"
- #include "_all.qh"
#include "hud_config.qh"
#include "mapvoting.qh"
#include "scoreboard.qh"
#include "teamradar.qh"
#include "t_items.qh"
-
- #include "../dpdefs/keycodes.qh"
-
#include "../common/buffs/all.qh"
- #include "../common/constants.qh"
- #include "../common/deathtypes.qh"
+ #include "../common/deathtypes/all.qh"
#include "../common/items/all.qc"
#include "../common/mapinfo.qh"
- #include "../common/nades/all.qh"
-
#include "../common/mutators/mutator/waypoints/all.qh"
- #include "../server/mutators/gamemode_ctf.qh"
-
+ #include "../common/nades/all.qh"
#include "../common/stats.qh"
-
- #include "../csqcmodellib/cl_player.qh"
+ #include "../lib/csqcmodel/cl_player.qh"
+ #include "../server/mutators/gamemode_ctf.qh"
/*
==================
*/
- // draw the background/borders
- #define HUD_Panel_DrawBg(theAlpha) do { \
- if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
- draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
- } while(0)
-
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
vector color;
// check to see if we want to continue
- if(intermission == 2) return;
if(hud != HUD_NORMAL) return;
if(!autocvar__hud_configure)
float nade_statuschange_time;
void HUD_Ammo(void)
{
- if(intermission == 2) return;
if(hud != HUD_NORMAL) return;
if(!autocvar__hud_configure)
{
void HUD_Powerups()
{
- if(intermission == 2) return;
-
int allItems = getstati(STAT_ITEMS, 0, 24);
int allBuffs = getstati(STAT_BUFFS, 0, 24);
int strengthTime, shieldTime, superTime;
void HUD_HealthArmor(void)
{
int armor, health, fuel;
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_healtharmor) return;
if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
{
vector v;
- v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON);
+ v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);
float x;
x = floor(v.x + 1);
void HUD_Notify(void)
{
- if(intermission == 2) return;
if (!autocvar__hud_configure)
if (!autocvar_hud_panel_notify)
return;
void HUD_Timer(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_timer) return;
void HUD_Radar(void)
{
- if(intermission == 2) return;
if (!autocvar__hud_configure)
{
if (hud_panel_radar_maximized)
void HUD_Score(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_score) return;
//
void HUD_RaceTimer (void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_racetimer) return;
void HUD_Vote(void)
{
- if(intermission == 2) return;
if(autocvar_cl_allow_uid2name == -1 && (gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
{
vote_active = 1;
void HUD_ModIcons(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_modicons) return;
//
void HUD_PressedKeys(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_pressedkeys) return;
float frametimeavg2; // 2 frames ago
void HUD_EngineInfo(void)
{
- //if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_engineinfo) return;
} while(0)
void HUD_InfoMessages(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_infomessages) return;
float physics_update_time, discrete_speed, discrete_acceleration;
void HUD_Physics(void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_physics) return;
float hud_configure_cp_generation_time;
void HUD_CenterPrint (void)
{
- if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_centerprint) return;
==================
*/
+void HUD_Vehicle()
+{
+ if(autocvar__hud_configure) return;
+ if(intermission == 2) return;
+
+ if(hud == HUD_BUMBLEBEE_GUN)
+ CSQC_BUMBLE_GUN_HUD();
+ else {
+ Vehicle info = get_vehicleinfo(hud);
+ info.vr_hud(info);
+ }
+}
+
bool HUD_Panel_CheckFlags(int showflags)
{
if ( HUD_Minigame_Showpanels() )
return showflags & PANEL_SHOW_MINIGAME;
+ if(intermission == 2)
+ return showflags & PANEL_SHOW_MAPVOTE;
return showflags & PANEL_SHOW_MAINGAME;
}
void HUD_Panel_Draw(entity panent)
{
panel = panent;
- if ( HUD_Panel_CheckFlags(panel.panel_showflags) )
+ if(autocvar__hud_configure)
+ {
+ if(panel.panel_configflags & PANEL_CONFIG_MAIN)
+ panel.panel_draw();
+ }
+ else if(HUD_Panel_CheckFlags(panel.panel_showflags))
panel.panel_draw();
}
-void HUD_Reset (void)
+void HUD_Reset(void)
{
// reset gametype specific icons
if(gametype == MAPINFO_TYPE_CTF)
HUD_Mod_CTF_Reset();
}
-void HUD_Main (void)
+void HUD_Main(void)
{
int i;
// global hud theAlpha fade
for(i = hud_panels_COUNT - 1; i >= 0; --i)
HUD_Panel_Draw(hud_panels[panel_order[i]]);
+ HUD_Vehicle();
+
hud_draw_maximized = 1; // panels that may be maximized must check this var
// draw maximized panels on top
if(hud_panel_radar_maximized)
if(hud_panel_quickmenu)
HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
+ if (scoreboard_active || intermission == 2)
+ HUD_Reset();
+
HUD_Configure_PostDraw();
hud_configure_prev = autocvar__hud_configure;
- #ifndef HUD_H
- #define HUD_H
+ #ifndef CLIENT_HUD_H
+ #define CLIENT_HUD_H
#include "../common/weapons/all.qh"
+ bool HUD_Radar_Clickable();
+ void HUD_Radar_Mouse();
+
REGISTRY(hud_panels, 24)
REGISTER_REGISTRY(Registerhud_panels)
-#define REGISTER_HUD_PANEL(id, draw_func, name, showflags) \
+#define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \
void draw_func(); \
REGISTER(Registerhud_panels, HUD_PANEL, hud_panels, id, m_id, new(hud_panel)) { \
this.panel_id = this.m_id; \
this.panel_draw = draw_func; \
this.panel_name = #name; \
+ this.panel_configflags = configflags; \
this.panel_showflags = showflags; \
}
#define HUD_PANEL(NAME) HUD_PANEL_##NAME
+ // draw the background/borders
+ #define HUD_Panel_DrawBg(theAlpha) do { \
+ if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
+ draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
+ } while(0)
+
int panel_order[hud_panels_MAX];
string hud_panelorder_prev;
bool chat_panel_modified;
bool radar_panel_modified;
+ float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary);
void HUD_Radar_Hide_Maximized();
void HUD_Reset (void);
const int PANEL_SHOW_NEVER = 0x00;
const int PANEL_SHOW_MAINGAME = 0x01;
const int PANEL_SHOW_MINIGAME = 0x02;
+const int PANEL_SHOW_MAPVOTE = 0x04;
const int PANEL_SHOW_ALWAYS = 0xff;
bool HUD_Panel_CheckFlags(int showflags);
+.int panel_configflags;
+const int PANEL_CONFIG_NO = 0x00;
+const int PANEL_CONFIG_MAIN = 0x01;
+
// prev_* vars contain the health/armor at the previous FRAME
// set to -1 when player is dead or was not playing
void HUD_ItemsTime();
-REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, weapons, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(AMMO, HUD_Ammo, ammo, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, powerups, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, healtharmor, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, notify, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(TIMER, HUD_Timer, timer, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(RADAR, HUD_Radar, radar, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(SCORE, HUD_Score, score, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, racetimer, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(VOTE, HUD_Vote, vote, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, modicons, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, pressedkeys, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(CHAT, HUD_Chat, chat, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, engineinfo, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, infomessages, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, physics, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, centerprint, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(MINIGAME_BOARD, HUD_MinigameBoard, minigameboard, PANEL_SHOW_MINIGAME)
-REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_SHOW_MINIGAME)
-REGISTER_HUD_PANEL(MINIGAME_HELP, HUD_MinigameHelp, minigamehelp, PANEL_SHOW_MINIGAME)
-REGISTER_HUD_PANEL(MINIGAME_MENU, HUD_MinigameMenu, minigamemenu, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, mapvote, PANEL_SHOW_ALWAYS )
-REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, itemstime, PANEL_SHOW_MAINGAME)
-REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, quickmenu, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, weapons, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(AMMO, HUD_Ammo, ammo, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, powerups, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, healtharmor, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, notify, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS & ~PANEL_SHOW_MAPVOTE)
+REGISTER_HUD_PANEL(TIMER, HUD_Timer, timer, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS & ~PANEL_SHOW_MAPVOTE)
+REGISTER_HUD_PANEL(RADAR, HUD_Radar, radar, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(SCORE, HUD_Score, score, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS & ~PANEL_SHOW_MAPVOTE)
+REGISTER_HUD_PANEL(RACETIMER, HUD_RaceTimer, racetimer, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(VOTE, HUD_Vote, vote, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS )
+REGISTER_HUD_PANEL(MODICONS, HUD_ModIcons, modicons, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(PRESSEDKEYS, HUD_PressedKeys, pressedkeys, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(CHAT, HUD_Chat, chat, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS )
+REGISTER_HUD_PANEL(ENGINEINFO, HUD_EngineInfo, engineinfo, PANEL_CONFIG_MAIN, PANEL_SHOW_ALWAYS )
+REGISTER_HUD_PANEL(INFOMESSAGES, HUD_InfoMessages, infomessages, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(PHYSICS, HUD_Physics, physics, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(CENTERPRINT, HUD_CenterPrint, centerprint, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(MINIGAME_BOARD, HUD_MinigameBoard, minigameboard, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME)
+REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME)
+REGISTER_HUD_PANEL(MINIGAME_HELP, HUD_MinigameHelp, minigamehelp, PANEL_CONFIG_NO , PANEL_SHOW_MINIGAME)
+REGISTER_HUD_PANEL(MINIGAME_MENU, HUD_MinigameMenu, minigamemenu, PANEL_CONFIG_NO , PANEL_SHOW_ALWAYS )
+REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, mapvote, PANEL_CONFIG_NO , PANEL_SHOW_MAPVOTE )
+REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, itemstime, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
+REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, quickmenu, PANEL_CONFIG_MAIN, PANEL_SHOW_MAINGAME)
// always add new panels to the end of list
// Because calling lots of functions in QC apparently cuts fps in half on many machines:
#include "hud_config.qh"
- #include "_all.qh"
#include "hud.qh"
- #include "../common/constants.qh"
-
- #include "../dpdefs/keycodes.qh"
-
-
#define HUD_Write(s) fputs(fh, s)
// q: quoted, n: not quoted
#define HUD_Write_Cvar_n(cvar) HUD_Write(strcat("seta ", cvar, " ", cvar_string(cvar), "\n"))
int i;
for (i = 0; i < hud_panels_COUNT; ++i) {
panel = hud_panels[i];
- if(panel == HUD_PANEL(MAPVOTE)) continue;
+ if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize();
if(!panel_enabled) continue;
int i;
for (i = 0; i < hud_panels_COUNT; ++i) {
panel = hud_panels[i];
- if(panel == HUD_PANEL(MAPVOTE)) continue;
+ if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize();
if(!panel_enabled) continue;
for(i = 0; i < hud_panels_COUNT; ++i)
{
panel = hud_panels[i];
- if(panel == HUD_PANEL(MAPVOTE))
+ if(!(panel.panel_configflags & PANEL_CONFIG_MAIN))
continue;
if (panel == tab_panels[i] || panel == starting_panel)
continue;
j += 1;
panel = hud_panels[i];
- if(panel == HUD_PANEL(MAPVOTE)) continue;
+ if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
HUD_Panel_UpdatePosSize();
float border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
j += 1;
panel = hud_panels[i];
- if(panel == HUD_PANEL(MAPVOTE))
+ if(!(panel.panel_configflags & PANEL_CONFIG_MAIN))
continue;
HUD_Panel_UpdatePosSize();
- #include "_all.qh"
#include "announcer.qh"
#include "hook.qh"
#include "mapvoting.qh"
#include "scoreboard.qh"
#include "shownames.qh"
+ #include "quickmenu.qh"
#include "mutators/events.qh"
#include "../common/constants.qh"
#include "../common/mapinfo.qh"
+ #include "../common/gamemodes/all.qh"
#include "../common/nades/all.qh"
#include "../common/stats.qh"
#include "../common/triggers/target/music.qh"
#include "../common/teams.qh"
- #include "../common/util.qh"
+ #include "../common/vehicles/all.qh"
#include "../common/weapons/all.qh"
+ #include "../common/viewloc.qh"
+ #include "../common/minigames/cl_minigames.qh"
+ #include "../common/minigames/cl_minigames_hud.qh"
- #include "../csqcmodellib/cl_player.qh"
+ #include "../lib/csqcmodel/cl_player.qh"
- #include "../warpzonelib/client.qh"
- #include "../warpzonelib/common.qh"
+ #include "../lib/warpzone/client.qh"
+ #include "../lib/warpzone/common.qh"
entity porto;
vector polyline[16];
return SHOTTYPE_HITWORLD;
}
-void CSQC_common_hud(void);
-
void PostInit(void);
void CSQC_Demo_Camera();
float HUD_WouldDrawScoreboard();
return false;
}
+void HUD_Crosshair_Vehicle()
+{
+ if(hud != HUD_BUMBLEBEE_GUN)
+ {
+ Vehicle info = get_vehicleinfo(hud);
+ info.vr_crosshair(info);
+ }
+}
+
vector damage_blurpostprocess, content_blurpostprocess;
float unaccounted_damage = 0;
spectatee_status_prev = spectatee_status;
}
-void UpdateHitsound()
+void HitSound()
{
// varying sound pitch
}
}
-void UpdateCrosshair()
+void HUD_Crosshair()
{SELFPARAM();
static float rainbow_last_flicker;
static vector rainbow_prev_color;
entity e = self;
float f, i, j;
vector v;
- if(getstati(STAT_FROZEN))
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((getstatf(STAT_REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * getstatf(STAT_REVIVE_PROGRESS)) + ('0 1 1' * getstatf(STAT_REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
- else if (getstatf(STAT_HEALING_ORB)>time)
- drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, NADE_TYPE_HEAL.m_color, autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE);
- if(!intermission)
- if(getstatf(STAT_NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
- {
- DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * getstatf(STAT_NADE_TIMER)) - ('0 1 1' * getstatf(STAT_NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
- drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
- }
- else if(getstatf(STAT_REVIVE_PROGRESS))
- {
- DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
- drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
- }
-
- if(autocvar_r_letterbox == 0)
- if(autocvar_viewsize < 120)
- CSQC_common_hud();
-
- // crosshair goes VERY LAST
if(!scoreboard_active && !camera_active && intermission != 2 &&
- spectatee_status != -1 && hud == HUD_NORMAL && !csqcplayer.viewloc &&
+ spectatee_status != -1 && !csqcplayer.viewloc &&
!HUD_MinigameMenu_IsOpened() )
{
if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
return;
+ if (hud != HUD_NORMAL)
+ {
+ HUD_Crosshair_Vehicle();
+ return;
+ }
+
string wcross_style;
float wcross_alpha, wcross_resolution;
wcross_style = autocvar_crosshair;
}
}
+void HUD_Draw()
+{
+ if(getstati(STAT_FROZEN))
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, ((getstatf(STAT_REVIVE_PROGRESS)) ? ('0.25 0.90 1' + ('1 0 0' * getstatf(STAT_REVIVE_PROGRESS)) + ('0 1 1' * getstatf(STAT_REVIVE_PROGRESS) * -1)) : '0.25 0.90 1'), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ else if (getstatf(STAT_HEALING_ORB)>time)
+ drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, NADE_TYPE_HEAL.m_color, autocvar_hud_colorflash_alpha*getstatf(STAT_HEALING_ORB_ALPHA), DRAWFLAG_ADDITIVE);
+ if(!intermission)
+ if(getstatf(STAT_NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
+ {
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_NADE_TIMER), '0.25 0.90 1' + ('1 0 0' * getstatf(STAT_NADE_TIMER)) - ('0 1 1' * getstatf(STAT_NADE_TIMER)), autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
+ else if(getstatf(STAT_REVIVE_PROGRESS))
+ {
+ DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
+ }
+
+ if(autocvar_r_letterbox == 0)
+ if(autocvar_viewsize < 120)
+ {
+ if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS))
+ Accuracy_LoadLevels();
+
+ HUD_Main();
+ HUD_DrawScoreboard();
+ }
+
+ // crosshair goes VERY LAST
+ UpdateDamage();
+ HUD_Crosshair();
+ HitSound();
+}
+
bool ov_enabled;
float oldr_nearclip;
float oldr_farclip_base;
scoreboard_active = HUD_WouldDrawScoreboard();
- UpdateDamage();
- UpdateCrosshair();
- UpdateHitsound();
+ HUD_Draw();
if(NextFrameCommand)
{
else
HUD_Radar_Mouse();
- if(hud && !intermission)
- if(hud == HUD_BUMBLEBEE_GUN)
- CSQC_BUMBLE_GUN_HUD();
- else {
- Vehicle info = get_vehicleinfo(hud);
- info.vr_hud(info);
- }
-
cl_notice_run();
// let's reset the view back to normal for the end
}
-void CSQC_common_hud(void)
-{
- if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS))
- Accuracy_LoadLevels();
-
- HUD_Main(); // always run these functions for alpha checks
- HUD_DrawScoreboard();
-
- // scoreboard/accuracy, map/gametype voting screen
- if (scoreboard_active || intermission == 2)
- HUD_Reset();
-}
-
-
// following vectors must be global to allow seamless switching between camera modes
vector camera_offset, current_camera_offset, mouse_angles, current_angles, current_origin, current_position;
void CSQC_Demo_Camera()
+ #include "cl_minigames_hud.qh"
#include "minigames.qh"
- #include "../../client/mapvoting.qh"
// whether the mouse is over the given panel
bool HUD_mouse_over(entity somepanel)
bool HUD_Minigame_Showpanels()
{
- return HUD_MinigameMenu_IsOpened() && ( autocvar__hud_configure || minigame_isactive() );
+ return (HUD_MinigameMenu_IsOpened() && minigame_isactive());
}
{
if(autocvar_g_vehicle_bumblebee_raygun)
{
- Damage(trace_ent, vehic, pilot, autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime, DEATH_GENERIC, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * sys_frametime);
+ Damage(trace_ent, vehic, pilot, autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime, DEATH_GENERIC.m_id, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * sys_frametime);
vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_raygun_aps * sys_frametime;
}
else
autocvar_g_vehicle_bumblebee_blowup_edgedamage,
autocvar_g_vehicle_bumblebee_blowup_radius, self, world,
autocvar_g_vehicle_bumblebee_blowup_forceintensity,
- DEATH_VH_BUMB_DEATH, world);
+ DEATH_VH_BUMB_DEATH.m_id, world);
sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_EXPLOSION_BIG, (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
{
Vehicles_drawHUD("vehicle_gunner", "vehicle_gunner_weapon1", string_null,
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- string_null, '0 0 0',
- string_null);
+ string_null, '0 0 0');
}
METHOD(Bumblebee, vr_hud, void(Bumblebee thisveh))
{
Vehicles_drawHUD(VEH_BUMBLEBEE.m_icon, "vehicle_bumble_weapon1", "vehicle_bumble_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- vCROSS_HEAL);
+ "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color);
+
+ float hudAlpha = autocvar_hud_panel_fg_alpha;
+ float blinkValue = 0.55 + sin(time * 7) * 0.45;
+ vector tmpPos = '0 0 0';
+ vector tmpSize = '1 1 1' * hud_fontsize;
+ tmpPos.x = vehicleHud_Pos.x + vehicleHud_Size.x * (520/768);
+
+ if(!AuxiliaryXhair[1].draw2d)
+ {
+ tmpPos.y = vehicleHud_Pos.y + vehicleHud_Size.y * (96/256) - tmpSize.y;
+ drawstring(tmpPos, _("No right gunner!"), tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
+ }
+
+ if(!AuxiliaryXhair[2].draw2d)
+ {
+ tmpPos.y = vehicleHud_Pos.y + vehicleHud_Size.y * (160/256);
+ drawstring(tmpPos, _("No left gunner!"), tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
+ }
+ }
+ METHOD(Bumblebee, vr_crosshair, void(Bumblebee thisveh))
+ {
+ Vehicles_drawCrosshair(vCROSS_HEAL);
}
METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh))
{
#include "racer_weapon.qc"
#ifdef SVQC
- #include "../../effects/effects.qh"
#include "../../triggers/trigger/impulse.qh"
bool autocvar_g_vehicle_racer;
autocvar_g_vehicle_racer_blowup_edgedamage,
autocvar_g_vehicle_racer_blowup_radius, world, world,
autocvar_g_vehicle_racer_blowup_forceintensity,
- DEATH_VH_WAKI_DEATH, world);
+ DEATH_VH_WAKI_DEATH.m_id, world);
self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
self.think = vehicles_spawn;
{
Vehicles_drawHUD(VEH_RACER.m_icon, "vehicle_racer_weapon1", "vehicle_racer_weapon2",
"vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
- vCROSS_GUIDE);
+ "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color);
+ }
+ METHOD(Racer, vr_crosshair, void(Racer thisveh))
+ {
+ Vehicles_drawCrosshair(vCROSS_GUIDE);
}
#endif
METHOD(Racer, vr_setup, void(Racer thisveh))
{SELFPARAM();
self.deadflag = DEAD_DEAD;
self.vehicle_exit(VHEF_NORMAL);
- RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH, world);
+ RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH.m_id, world);
self.alpha = -1;
self.movetype = MOVETYPE_NONE;
#ifdef CSQC
METHOD(Raptor, vr_hud, void(Raptor thisveh))
+ {
+ Vehicles_drawHUD(VEH_RAPTOR.m_icon, "vehicle_raptor_weapon1", "vehicle_raptor_weapon2",
+ "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
+ "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color);
+ }
+ METHOD(Raptor, vr_crosshair, void(Raptor thisveh))
{
string crosshair;
default: crosshair = vCROSS_BURST;
}
- Vehicles_drawHUD(VEH_RAPTOR.m_icon, "vehicle_raptor_weapon1", "vehicle_raptor_weapon2",
- "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
- crosshair);
+ vector tmpSize = '0 0 0';
+ if(weapon2mode != RSM_FLARE)
+ {
+ vector where;
+
+ if(!dropmark)
+ {
+ dropmark = spawn();
+ dropmark.owner = self;
+ dropmark.gravity = 1;
+ }
+
+ float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2) * 0.01;
+ if(reload2 == 1)
+ {
+ setorigin(dropmark, pmove_org);
+ dropmark.velocity = pmove_vel;
+ tracetoss(dropmark, self);
+
+ where = project_3d_to_2d(trace_endpos);
+
+ setorigin(dropmark, trace_endpos);
+ tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size;
+
+ if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight))
+ {
+ where.x -= tmpSize.x * 0.5;
+ where.y -= tmpSize.y * 0.5;
+ where.z = 0;
+ drawpic(where, vCROSS_DROP, tmpSize, '0 1 0', autocvar_crosshair_alpha * 0.9, DRAWFLAG_ADDITIVE);
+ drawpic(where, vCROSS_DROP, tmpSize, '0 1 0', autocvar_crosshair_alpha * 0.6, DRAWFLAG_NORMAL); // Ensure visibility against bright bg
+ }
+ dropmark.cnt = time + 5;
+ }
+ else
+ {
+ if(dropmark.cnt > time)
+ {
+ where = project_3d_to_2d(dropmark.origin);
+ tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size * 1.25;
+
+ if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight))
+ {
+ where.x -= tmpSize.x * 0.5;
+ where.y -= tmpSize.y * 0.5;
+ where.z = 0;
+ drawpic(where, vCROSS_DROP, tmpSize, '1 0 0', autocvar_crosshair_alpha * 0.9, DRAWFLAG_ADDITIVE);
+ drawpic(where, vCROSS_DROP, tmpSize, '1 0 0', autocvar_crosshair_alpha * 0.6, DRAWFLAG_NORMAL); // Ensure visibility against bright bg
+ }
+ }
+ }
+ }
+
+ Vehicles_drawCrosshair(crosshair);
}
METHOD(Raptor, vr_setup, void(Raptor thisveh))
{
v += v_forward * 50;
fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
- autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0);
+ autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
//trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
SUB_SetFade(g1, time, min(self.respawntime, 10));
SUB_SetFade(g2, time, min(self.respawntime, 10));
- RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH, world);
+ RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH.m_id, world);
self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
self.movetype = MOVETYPE_NONE;
float autocvar_cl_vehicle_spiderbot_cross_size = 1;
METHOD(Spiderbot, vr_hud, void(Spiderbot thisveh))
+ {
+ Vehicles_drawHUD(VEH_SPIDERBOT.m_icon, "vehicle_spider_weapon1", "vehicle_spider_weapon2",
+ "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
+ "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color);
+ }
+ METHOD(Spiderbot, vr_crosshair, void(Spiderbot thisveh))
{
string crosshair;
default: crosshair = vCROSS_BURST;
}
- Vehicles_drawHUD(VEH_SPIDERBOT.m_icon, "vehicle_spider_weapon1", "vehicle_spider_weapon2",
- "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
- "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
- crosshair);
+ Vehicles_drawCrosshair(crosshair);
}
METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh))
{