void HUD_WeaponIcons()
{
+ float id = 0;
float alpha, height, accuracybar_height, stat_weapons; // "constants"
vector pos, mySize, mysize, mypos, accuracy_color;
- float i, id, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
+ float i, weapid, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
- pos = HUD_Panel_GetPos(0);
- mySize = HUD_Panel_GetSize(0);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
accuracybar_height = cvar_or("hud_weaponicons_accuracy_height", 3);
stat_weapons = getstati(STAT_WEAPONS);
}
heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
- HUD_Panel_DrawBg(0, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
// hits
weapon_stats = getstati(STAT_DAMAGE_HITS);
self = weaponorder[i];
if((self.weapons && (self.impulse >= 0) && (stat_weapons & self.weapons)) || hud_configure)
{
- id = self.impulse;
+ weapid = self.impulse;
alpha = (self.weapon == activeweapon) ? 1 : 0.6;
drawpic(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), strcat("gfx/weapons/weapon", self.netname), eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows), '1 1 1', fade * hud_alpha_fg, DRAWFLAG_NORMAL);
if(cvar_or("hud_weaponicons_number", 1))
- drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(id), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows), ftos(weapid), '1 1 0' * 0.5 * mySize_y*(1/rows), '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
// draw the weapon accuracy on the HUD
if(hud_accuracy_hud && !(gametype == GAME_RACE || gametype == GAME_CTS))
void HUD_Inventory()
{
+ float id = 1;
float i;
float stat_items;
vector pos, mySize, mysize, mypos;
- pos = HUD_Panel_GetPos(1);
- mySize = HUD_Panel_GetSize(1);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(1, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
// ammo
stat_items = getstati(STAT_ITEMS);
float shield_maxtime;
float strength_maxtime;
void HUD_Powerups() {
+ float id = 2;
float stat_items;
stat_items = getstati(STAT_ITEMS);
}
vector pos, mySize;
- pos = HUD_Panel_GetPos(2);
- mySize = HUD_Panel_GetSize(2);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(2, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
float strength_time, shield_time;
string leftname, rightname;
float leftcnt, rightcnt;
float leftalpha, rightalpha;
- if (cvar(strcat("hud_", HUD_Panel_GetName(2), "_flip"))) {
+ if (cvar(strcat("hud_", HUD_Panel_GetName(id), "_flip"))) {
leftname = "strength";
leftcnt = strength_time;
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/30);
barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x;
barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
picpos = pos + eX * 0.5 * mySize_x;
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/30);
barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos;
barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/30);
picpos = pos + eX * 0.05 * mySize_x;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(2), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x;
barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/30);
picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
//
void HUD_HealthArmor(void)
{
+ float id = 3;
vector pos, mySize;
- pos = HUD_Panel_GetPos(3);
- mySize = HUD_Panel_GetSize(3);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(3, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
float armor, health, x;
armor = getstati(STAT_ARMOR);
float leftactive, rightactive;
float leftalpha, rightalpha;
// TODO!
- if (cvar(strcat("hud_", HUD_Panel_GetName(3), "_flip"))) { // old style layout with armor left/top of health
+ if (cvar(strcat("hud_", HUD_Panel_GetName(id), "_flip"))) { // old style layout with armor left/top of health
leftname = "armor";
leftcnt = armor;
if(leftcnt)
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x - eX * 0.5 * mySize_x * min(1, leftcnt/200);
barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
picpos = pos + eX * 0.5 * mySize_x - eX * mySize_y;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x;
barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
picpos = pos + eX * 0.5 * mySize_x;
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * mySize_x - eX * mySize_x * min(1, leftcnt/200);
barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * mySize_x - eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
picpos = pos + eX * mySize_x - eX * 0.5 * mySize_y + eY * 0.5 * mySize_y;
HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.5 * mySize_y, hud_alpha_fg);
}
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * mySize_x - eX * mySize_x * min(1, fuel/100);
barsize = eX * mySize_x * min(1, fuel/100) + eY * 0.1 * mySize_y;
} else {
{
len = strlen(ftos(leftcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos;
barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, leftcnt/200);
picpos = pos + eX * 0.05 * mySize_x;
{
len = strlen(ftos(rightcnt));
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos + eX * 0.5 * mySize_x;
barsize = eX * 0.5 * mySize_x + eY * mySize_y * min(1, rightcnt/200);
picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
HUD_DrawXNum_Colored(numpos, rightcnt, len, 0.166 * mySize_x, hud_alpha_fg);
}
- if(cvar(strcat("hud_", HUD_Panel_GetName(3), "_mirror"))) {
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
barpos = pos;
barsize = eX * 0.05 * mySize_x + eY * mySize_y * min(1, fuel/100);
} else {
// Notification area (#4)
void HUD_Notify (void)
{
+ float id = 4;
vector pos, mySize;
- pos = HUD_Panel_GetPos(4);
- mySize = HUD_Panel_GetSize(4);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(4, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
string s;
entity tm;
//
void HUD_Timer()
{
+ float id = 5;
vector pos, mySize;
- pos = HUD_Panel_GetPos(5);
- mySize = HUD_Panel_GetSize(5);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(5, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;
//
void HUD_Radar(void)
{
+ float id = 6;
vector pos, mySize;
- pos = HUD_Panel_GetPos(6);
- mySize = HUD_Panel_GetSize(6);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(6, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
local float color1, color2; // color already declared as a global in hud.qc
local vector rgb;
//
void HUD_Score()
{
+ float id = 7;
vector pos, mySize;
- pos = HUD_Panel_GetPos(7);
- mySize = HUD_Panel_GetSize(7);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(7, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
float score, distribution, leader;
float score_len, distr_len;
// Race timer (#8)
//
void HUD_RaceTimer (void) {
+ float id = 8;
vector pos, mySize;
- pos = HUD_Panel_GetPos(8);
- mySize = HUD_Panel_GetSize(8);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(8, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
drawfont = hud_bigfont;
float a, t;
drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.25 * mySize_y) + eY * 0.75 * mySize_y, s, '1 1 0' * 0.25 * mySize_y, hud_alpha_fg * a, DRAWFLAG_NORMAL);
}
+ // ___ TODO!!!___
if(race_penaltytime)
{
a = bound(0, 2 - (time - race_penaltyeventtime), 1);
void HUD_VoteWindow(void)
{
+ float id = 9;
vector pos, mySize;
- pos = HUD_Panel_GetPos(9);
- mySize = HUD_Panel_GetSize(9);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
string s;
float a;
vote_needed = 4;
}
- HUD_Panel_DrawBg(9, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
if(vote_alpha) {
a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
void HUD_DrawPressedKeys(void)
{
+ float id = 10;
vector pos, mySize;
- pos = HUD_Panel_GetPos(10);
- mySize = HUD_Panel_GetSize(10);
+ pos = HUD_Panel_GetPos(id);
+ mySize = HUD_Panel_GetSize(id);
- HUD_Panel_DrawBg(10, pos, mySize);
+ HUD_Panel_DrawBg(id, pos, mySize);
float pressedkeys;