3 void CSQC_common_hud(void);
\r
5 void CSQC_kh_hud(void);
\r
6 void CSQC_ctf_hud(void);
\r
8 void CSQC_UpdateView(void)
\r
13 sbar_alpha_fg = cvar("sbar_alpha_fg" );
\r
14 sbar_hudselector = cvar("sbar_hudselector");
\r
15 activeweapon = getstati(STAT_ACTIVEWEAPON);
\r
16 teamplay = cvar("teamplay");
\r
18 if(last_weapon != activeweapon) {
\r
20 last_weapon = activeweapon;
\r
23 // ALWAYS Clear Current Scene First
\r
26 // Assign Standard Viewflags
\r
27 // Draw the World (and sky)
\r
28 R_SetView(VF_DRAWWORLD, 1);
\r
30 // Draw the Crosshair
\r
31 R_SetView(VF_DRAWCROSSHAIR, 1);
\r
33 // Draw the Engine Status Bar (the default Quake HUD)
\r
34 draw_enginesbar = !cvar("sbar_usecsqc");
\r
35 R_SetView(VF_DRAWENGINESBAR, draw_enginesbar);
\r
37 // Set the console size vars
\r
38 vid_conwidth = cvar("vid_conwidth");
\r
39 vid_conheight = cvar("vid_conheight");
\r
41 // Update the mouse position
\r
43 mousepos_x = vid_conwidth;
\r
44 mousepos_y = vid_conheight;
\r
45 mousepos = mousepos*0.5 + getmousepos();
\r
48 R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS);
\r
53 // Draw the mouse cursor
\r
54 // NOTE: drawpic must happen after R_RenderScene for some reason
\r
55 //drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
\r
56 //drawstring('50 50', ftos(game), '10 10 0', '1 1 1', 1, 0);
\r
57 //self = edict_num(player_localnum);
\r
58 //drawstring('0 0', vtos(pmove_org), '8 8 0', '1 1 1', 1, 0);
\r
59 //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
60 // as long as the ctf part isn't in, this is useless
\r
64 /*if(gametype == GAME_CTF)
\r
68 if(!draw_enginesbar)
\r
73 if(gametype == GAME_ONSLAUGHT)
\r
75 //drawstring('0 0', minimapname, '8 8 0', '1 1 1', 1, 0);
\r
76 //drawsetcliparea(0,0,800,600);
\r
78 //drawresetcliparea();
\r
83 void CSQC_common_hud(void)
\r
85 // Sbar_SortFrags(); done in Sbar_Draw
\r
89 // KeyHunt HUD by victim
\r
90 void CSQC_kh_hud(void)
\r
92 // HUD 0 has the weapons on the right hand side - temporarily shown when needed
\r
93 // HUD 1 has the weapons on the bottom - permanently
\r
95 // use the following two binds to check the icons move correctly
\r
96 // bind g "toggle sbar_flagstatus_right; echo Menu right $sbar_flagstatus_right" // move the icons
\r
97 // bind h "toggle sbar_hudselector; echo HUD $sbar_hudselector" // change the HUD
\r
99 float kh_keys, kh_keys_status, kh_teams_set;
\r
100 float kh_margin_x, kh_margin_y, kh_key_box;
\r
101 string kh_carrying, kh_outline;
\r
102 vector red_pos, blue_pos, yellow_pos, pink_pos, kh_size;
\r
103 vector red, blue, yellow, pink;
\r
105 kh_keys = getstati(STAT_KH_KEYS);
\r
106 kh_keys_status = kh_keys / 256;
\r
107 kh_teams_set = cvar("_teams_available"); // set in keyhunt.qc
\r
110 kh_margin_x = (cvar("sbar_flagstatus_right") * sbar_hudselector * (vid_conwidth - 67)) + 10;
\r
111 // sbar_flagstatus_right 0/1; sbar_hudselector 0/1; screen width - key width + margin
\r
113 red_pos_x = blue_pos_x = yellow_pos_x = pink_pos_x = kh_margin_x;
\r
117 pink_pos_y = kh_margin_y + 0; // top
\r
118 yellow_pos_y = kh_margin_y + kh_key_box;
\r
119 blue_pos_y = kh_margin_y + kh_key_box * 2;
\r
120 red_pos_y = kh_margin_y + kh_key_box * 3; //bottom
\r
127 kh_size = '0 0'; // don't resize the image
\r
129 kh_carrying = "gfx/sb_kh_full";
\r
130 kh_outline = "gfx/sb_kh_outline";
\r
132 // drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
\r
133 // vector position = '0 0'; // 'x y' 0 0 (the origin) is the top left. X 0 - 799, Y 0 - 599
\r
135 // vector size = '0 0'; // 'x y' changes the x & y dimensions. '0 0' gives the default pic size
\r
136 // vector rgb = '0 0 0'; // 'r g b' range 0 - 1
\r
138 if (kh_keys_status & 1) // red
\r
139 drawpic (red_pos, kh_carrying, kh_size, red, 0.2, 0); // show 20% alpha key
\r
141 drawpic (red_pos, kh_outline, kh_size, red, 0.4, 0); // show key outline 40% alpha
\r
144 drawpic (red_pos, kh_carrying, kh_size, red, 1.0, 0); // show solid key 100% alpha
\r
147 if (kh_keys_status & 2) // blue
\r
148 drawpic (blue_pos, kh_carrying, kh_size, blue, 0.2, 0);
\r
150 drawpic (blue_pos, kh_outline, kh_size, blue, 0.4, 0);
\r
153 drawpic (blue_pos, kh_carrying, kh_size, blue, 1.0, 0);
\r
156 if (kh_teams_set & 4) // yellow
\r
158 if (kh_keys_status & 4)
\r
159 drawpic (yellow_pos, kh_carrying, kh_size, yellow, 0.2, 0);
\r
161 drawpic (yellow_pos, kh_outline, kh_size, yellow, 0.4, 0);
\r
164 drawpic (yellow_pos, kh_carrying, kh_size, yellow, 1.0, 0);
\r
168 if (kh_teams_set & 8) // pink
\r
170 if (kh_keys_status & 8)
\r
171 drawpic (pink_pos, kh_carrying, kh_size, pink, 0.2, 0);
\r
173 drawpic (pink_pos, kh_outline, kh_size, pink, 0.4, 0);
\r
176 drawpic (pink_pos, kh_carrying, kh_size, pink, 1.0, 0);
\r