Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
cl_lms.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void HUD_Mod_LMS (vector myPos, vector mySize)
void HUD_Mod_LMS_Draw (vector myPos, vector mySize)

Function Documentation

◆ HUD_Mod_LMS()

void HUD_Mod_LMS ( vector myPos,
vector mySize )

Definition at line 66 of file cl_lms.qc.

67{
68 mod_active = 1;
69
70 HUD_Mod_LMS_Draw(myPos, mySize);
71}
void HUD_Mod_LMS_Draw(vector myPos, vector mySize)
Definition cl_lms.qc:27
bool mod_active
Definition modicons.qh:7

◆ HUD_Mod_LMS_Draw()

void HUD_Mod_LMS_Draw ( vector myPos,
vector mySize )

Definition at line 27 of file cl_lms.qc.

28{
29 int leaders_count = STAT(REDALIVE); // recycled stat
30 if(!leaders_count)
31 {
32 mod_active = 0;
33 return;
34 }
35
36 int rows, columns;
37 float aspect_ratio = 2;
38 rows = HUD_GetRowCount(2, mySize, aspect_ratio);
39 columns = ceil(2 / rows);
40
41 vector pos = myPos;
42 vector itemSize = vec2(mySize.x / columns, mySize.y / rows);
43
44 bool visible_leaders = STAT(OBJECTIVE_STATUS);
45
46 if (visible_leaders)
47 drawpic_aspect_skin(pos, "flag_stalemate", vec2(0.5 * itemSize.x, itemSize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
48 drawpic_aspect_skin(pos, "player_neutral", vec2(0.5 * itemSize.x, itemSize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
49 drawstring_aspect(pos + eX * 0.5 * itemSize.x, ftos(leaders_count), vec2(0.5 * itemSize.x, itemSize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
50
51 if (rows > 1)
52 pos.y = myPos.y + itemSize.y;
53 else
54 pos.x = myPos.x + itemSize.x;
55
56 int lives_diff = STAT(BLUEALIVE); // recycled stat
57 vector color = '1 1 0';
58 if (lives_diff >= 4)
59 color = '1 0 0';
60 else if (lives_diff == 3)
61 color = '1 0.5 0';
62 float scale = 0.75;
63 drawstring_aspect(pos + itemSize * (1 - scale) * 0.5, strcat("+", ftos(lives_diff)), itemSize * scale, color, panel_fg_alpha, DRAWFLAG_NORMAL);
64}
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
Definition draw.qc:110
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Definition draw.qh:78
const float DRAWFLAG_NORMAL
vector color
Definition dynlight.qc:15
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
Definition hud.qc:165
float panel_fg_alpha
Definition hud.qh:169
#define STAT(...)
Definition stats.qh:82
float ceil(float f)
string ftos(float f)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
float scale
Definition projectile.qc:14
vector
Definition self.qh:92
const vector eX
Definition vector.qh:44
#define vec2(...)
Definition vector.qh:90

References ceil(), color, DRAWFLAG_NORMAL, drawpic_aspect_skin, drawstring_aspect(), eX, ftos(), HUD_GetRowCount(), mod_active, panel_fg_alpha, scale, STAT, strcat(), vec2, and vector.

Referenced by HUD_Mod_LMS().