7 float sbar_hudselector;
\r
11 float numteams; // NOTE: This is changed in Sbar_SortFrags, so use it only AFTER that
\r
13 void CSQC_common_hud(void);
\r
15 void CSQC_kh_hud(void);
\r
16 void CSQC_ctf_hud(void);
\r
17 void CSQC_UpdateView(void)
\r
19 sbar_alpha_fg = cvar("sbar_alpha_fg" );
\r
20 sbar_hudselector = cvar("sbar_hudselector");
\r
21 activeweapon = getstati(STAT_ACTIVEWEAPON);
\r
22 teamplay = cvar("teamplay");
\r
24 if(last_weapon != activeweapon) {
\r
26 last_weapon = activeweapon;
\r
29 if(last_pingrequest < time) {
\r
33 // ALWAYS Clear Current Scene First
\r
36 // Assign Standard Viewflags
\r
37 // Draw the World (and sky)
\r
38 R_SetView(VF_DRAWWORLD, 1);
\r
40 // Draw the Crosshair
\r
41 R_SetView(VF_DRAWCROSSHAIR, 1);
\r
43 // Draw the Engine Status Bar (the default Quake HUD)
\r
44 draw_enginesbar = !cvar("sbar_usecsqc");
\r
45 R_SetView(VF_DRAWENGINESBAR, draw_enginesbar);
\r
47 // Set the console size vars
\r
48 vid_conwidth = cvar("vid_conwidth");
\r
49 vid_conheight = cvar("vid_conheight");
\r
51 // Update the mouse position
\r
53 mousepos_x = vid_conwidth;
\r
54 mousepos_y = vid_conheight;
\r
55 mousepos = mousepos*0.5 + getmousepos();
\r
58 R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
\r
63 // Draw the mouse cursor
\r
64 // NOTE: drawpic must happen after R_RenderScene for some reason
\r
65 //drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
\r
66 //drawstring('50 50', ftos(game), '10 10 0', '1 1 1', 1, 0);
\r
67 //self = edict_num(player_localnum);
\r
68 //drawstring('0 0', vtos(pmove_org), '8 8 0', '1 1 1', 1, 0);
\r
69 //drawstring('0 8', strcat("ORG: ", vtos(self.origin), " state: ", ftos(self.ctf_state), " HP: ", ftos(self.health)), '8 8 0', '1 1 1', 1, 0);
\r
70 // as long as the ctf part isn't in, this is useless
\r
74 /*if(gametype == GAME_CTF)
\r
78 if(!draw_enginesbar)
\r
83 if(gametype == GAME_ONSLAUGHT)
\r
85 //drawstring('0 0', minimapname, '8 8 0', '1 1 1', 1, 0);
\r
86 //drawsetcliparea(0,0,800,600);
\r
88 //drawresetcliparea();
\r
93 void CSQC_common_hud(void)
\r
95 // Sbar_SortFrags(); done in Sbar_Draw
\r
99 // KeyHunt HUD by victim
\r
100 void CSQC_kh_hud(void)
\r
102 // HUD 0 has the weapons on the right hand side - temporarily shown when needed
\r
103 // HUD 1 has the weapons on the bottom - permanently
\r
105 // use the following two binds to check the icons move correctly
\r
106 // bind g "toggle sbar_flagstatus_right; echo Menu right $sbar_flagstatus_right" // move the icons
\r
107 // bind h "toggle sbar_hudselector; echo HUD $sbar_hudselector" // change the HUD
\r
109 float kh_keys, kh_keys_status, kh_teams_set;
\r
110 float kh_margin_x, kh_margin_y;
\r
111 string kh_carrying, kh_outline;
\r
112 vector red_pos, blue_pos, yellow_pos, pink_pos, kh_size;
\r
113 vector red, blue, yellow, pink;
\r
115 kh_keys = cvar("kh_keys"); // set in keyhunt.qc
\r
116 kh_keys_status = cvar("kh_keys_status"); // set in keyhunt.qc
\r
117 kh_teams_set = cvar("_teams_available"); // set in keyhunt.qc
\r
119 // kh_margin_x = 10;
\r
121 kh_margin_x = (cvar("sbar_flagstatus_right") * sbar_hudselector * (vid_conwidth - 66)) + 10;
\r
122 // sbar_flagstatus_right 0/1; sbar_hudselector 0/1; screen width - key width + margin
\r
124 red_pos_x = blue_pos_x = yellow_pos_x = pink_pos_x = kh_margin_x;
\r
126 red_pos_y = kh_margin_y + 120*3;
\r
127 blue_pos_y = kh_margin_y + 120*2;
\r
128 yellow_pos_y = kh_margin_y + 120;
\r
129 pink_pos_y = kh_margin_y + 0;
\r
136 kh_size = '45 116';
\r
138 kh_carrying = "gfx/sb_key_carrying";
\r
139 kh_outline = "gfx/sb_key_carrying_outline";
\r
141 // drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
\r
142 // vector position = '0 0'; // 'x y' 0 0 (the origin) is in the top left. X 0 - 799, Y 0 - 599
\r
144 // vector size = '0 0'; // 'x y' changes the x & y dimensions. '0 0' gives the default pic size
\r
145 // vector rgb = '0 0 0'; // 'r g b' range 0 - 1
\r
147 if (kh_keys_status & 1) // red
\r
148 drawpic (red_pos, kh_carrying, kh_size, red, 0.2, 0); // show 20% alpha key
\r
150 drawpic (red_pos, kh_outline, kh_size, red, 0.4, 0); // show key outline
\r
152 if (kh_keys & 1) //red, added by victim
\r
153 drawpic (red_pos, kh_carrying, kh_size, red, 1.0, 0); // show solid key
\r
156 if (kh_keys_status & 2) // blue
\r
157 drawpic (blue_pos, kh_carrying, kh_size, blue, 0.2, 0);
\r
159 drawpic (blue_pos, kh_outline, kh_size, blue, 0.4, 0);
\r
162 drawpic (blue_pos, kh_carrying, kh_size, blue, 1.0, 0);
\r
165 if (kh_teams_set & 4) // yellow and pink
\r
167 if (kh_keys_status & 4) // yellow
\r
168 drawpic (yellow_pos, kh_carrying, kh_size, yellow, 0.2, 0);
\r
170 drawpic (yellow_pos, kh_outline, kh_size, yellow, 0.4, 0);
\r
172 if (kh_keys & 4) //red, added by victim
\r
173 drawpic (yellow_pos, kh_carrying, kh_size, yellow, 1.0, 0);
\r
177 if (kh_teams_set & 8) // pink only
\r
179 if (kh_keys_status & 8) // pink
\r
180 drawpic (pink_pos, kh_carrying, kh_size, pink, 0.2, 0);
\r
182 drawpic (pink_pos, kh_outline, kh_size, pink, 0.4, 0);
\r
184 if (kh_keys & 8) //red, added by victim
\r
185 drawpic (pink_pos, kh_carrying, kh_size, pink, 1.0, 0);
\r