mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-12 15:05:44 +00:00
CLIENT: hud.qc: make the readout all fancy and stuff
This commit is contained in:
parent
9e96f938bc
commit
31282c700d
1 changed files with 19 additions and 9 deletions
|
@ -1941,6 +1941,21 @@ void(float width, float height) HUD_RoundStopWatch =
|
|||
// set from CSQC_Ent_Update
|
||||
vector player_velocity;
|
||||
|
||||
// probably only need these right here
|
||||
static void(vector pos, string label, vector v) Draw_Vector_Fancy =
|
||||
{
|
||||
Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0);
|
||||
Draw_String(pos + [32, 16], sprintf("X: %d", v.x), [12, 12], [1, 1, 1], 1, 0);
|
||||
Draw_String(pos + [32, 32], sprintf("Y: %d", v.y), [12, 12], [1, 1, 1], 1, 0);
|
||||
Draw_String(pos + [32, 48], sprintf("Z: %d", v.z), [12, 12], [1, 1, 1], 1, 0);
|
||||
};
|
||||
|
||||
static void(vector pos, string label, float f, string suffix) Draw_Float_Fancy =
|
||||
{
|
||||
Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0);
|
||||
Draw_String(pos + [32, 16], sprintf("%d %s", f, suffix), [12, 12], [1, 1, 1], 1, 0);
|
||||
};
|
||||
|
||||
void(float width, float height) HUD_PlayerDebugInfo =
|
||||
{
|
||||
static float lastupstime;
|
||||
|
@ -1955,20 +1970,15 @@ void(float width, float height) HUD_PlayerDebugInfo =
|
|||
lastupstime = time;
|
||||
}
|
||||
|
||||
string str = sprintf("Speed: %3.1f qu/s", lastups);
|
||||
vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")];
|
||||
pos.x += GetUltraWideOffset();
|
||||
Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0);
|
||||
|
||||
Draw_Float_Fancy(pos, "Speed:", lastups, "qu/s");
|
||||
|
||||
if (cvar("scr_playerdebuginfo") >= 2)
|
||||
{
|
||||
pos.y += 16;
|
||||
str = sprintf("Angles: %v", getproperty(VF_ANGLES));
|
||||
Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0);
|
||||
|
||||
pos.y += 16;
|
||||
str = sprintf("Origin: %v", getproperty(VF_ORIGIN));
|
||||
Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0);
|
||||
Draw_Vector_Fancy(pos + [0, 36], "Angles:", getproperty(VF_ANGLES));
|
||||
Draw_Vector_Fancy(pos + [0, 106], "Origin:", getproperty(VF_ORIGIN));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue