case 7: return "score"; break;
case 8: return "racetimer"; break;
case 9: return "vote"; break;
- case 10: return "pressedkeys"; break;
+ case 10: return "modicons"; break;
+ case 11: return "pressedkeys"; break;
default: return "";
}
}
if(bg != "0")
{
float border;
- border = HUD_Panel_GetBorder(id);
+ border = max(0.0000001, HUD_Panel_GetBorder(id)); // draw_BorderPicture does not like border = 0
vector color;
if(cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color")) != "")
// Weapon icons (#0)
//
-
float weaponspace[10];
void HUD_WeaponIcons_Clear()
{
// Inventory (#1)
//
-
float GetAmmoStat(float i)
{
switch(i)
// Powerups (#2)
+//
float shield_maxtime;
float strength_maxtime;
void HUD_Powerups() {
// ___TODO___ !!!
// Notification area (#4)
+//
void HUD_Notify (void)
{
float id = 4;
}
// Vote window (#9)
+//
float vote_yescount;
float vote_nocount;
float vote_needed;
}
}
+// Draw pressed keys (#11)
+//
+void HUD_DrawPressedKeys(void)
+{
+ float id = 11;
+ vector pos, mySize;
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
+
+ HUD_Panel_DrawBg(id, pos, mySize);
+ float padding;
+ padding = cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_padding"));
+ if(padding)
+ {
+ pos += '1 1 0' * padding;
+ mySize -= '2 2 0' * padding;
+ }
+
+ float pressedkeys;
+
+ pressedkeys = getstatf(STAT_PRESSED_KEYS);
+ drawpic_skin(pos, "key_bg.tga", mySize, '1 1 1', 0.1 * hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 0.22 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.040 * mySize_y, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.023 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.1 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.486 * mySize_y, ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawpic_skin(pos + eX * mySize_x - eX * 0.372 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+}
+
// Awards system
float race_status_time;
float race_status_prev;
==================
*/
-void HUD_DrawPressedKeys(void)
-{
- float id = 10;
- vector pos, mySize;
- pos = HUD_Panel_GetPos(id);
- mySize = HUD_Panel_GetSize(id);
-
- HUD_Panel_DrawBg(id, pos, mySize);
- float padding;
- padding = cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_padding"));
- if(padding)
- {
- pos += '1 1 0' * padding;
- mySize -= '2 2 0' * padding;
- }
-
- float pressedkeys;
-
- pressedkeys = getstatf(STAT_PRESSED_KEYS);
- drawpic_skin(pos, "key_bg.tga", mySize, '1 1 1', 0.1 * hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * mySize_x - eX * 0.22 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.040 * mySize_y, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * 0.023 * mySize_x + eY * 0.195 * mySize_y, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), '1 1 0' * (1/3) * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * 0.1 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.23 * mySize_y + eY * 0.486 * mySize_y, ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
- drawpic_skin(pos + eX * mySize_x - eX * 0.372 * mySize_x + eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
-}
-
void HUD_ShowSpeed(void)
{
vector numsize;