Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
waypointsprites.qh
Go to the documentation of this file.
1#pragma once
2
3#include "all.qh"
4
7
8const int SPRITERULE_DEFAULT = 0;
9const int SPRITERULE_TEAMPLAY = 1;
11
12#ifdef CSQC
13entityclass(WaypointSprite);
14classfield(WaypointSprite) .float helpme;
15classfield(WaypointSprite) .float rule;
16classfield(WaypointSprite) .string netname; // primary picture
17classfield(WaypointSprite) .string netname2; // secondary picture
18classfield(WaypointSprite) .string netname3; // tertiary picture
19classfield(WaypointSprite) .int team; // team that gets netname2
20classfield(WaypointSprite) .float lifetime;
21classfield(WaypointSprite) .float fadetime;
22classfield(WaypointSprite) .float maxdistance;
23classfield(WaypointSprite) .int hideflags;
24classfield(WaypointSprite) .float spawntime;
25classfield(WaypointSprite) .float health;
26classfield(WaypointSprite) .float build_started;
27classfield(WaypointSprite) .float build_starthealth;
28classfield(WaypointSprite) .float build_finished;
29
31
63
86
87const float SPRITE_HEALTHBAR_WIDTH = 104;
93const float SPRITE_ARROW_SCALE = 1.0;
94const float SPRITE_HELPME_BLINK = 2;
95
97
98void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f);
99
100void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, float f);
101
102void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float height, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f);
103
104// returns location of sprite text
105vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
106
107// returns location of sprite healthbar
108vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str);
109
110float spritelookupblinkvalue(entity this, string s);
111vector spritelookupcolor(entity this, string s, vector def);
112string spritelookuptext(entity this, string s);
113
116
117// they are drawn using a .draw function
118
120
121void Ent_WaypointSprite(entity this, bool isnew);
122
123void WaypointSprite_Load_Frames(string ext);
124
126.float alpha;
127void Draw_WaypointSprite(entity this);
128#endif
129
130#ifdef SVQC
131.entity sprite;
132
136
138.float rule;
139.string model1;
140.string model2;
141.string model3;
142
143.bool(entity, entity, entity) waypointsprite_visible_for_player;
144
146
147void WaypointSprite_UpdateHealth(entity e, float f);
148
150
152
154
155void WaypointSprite_UpdateRule(entity e, float t, float r);
156
158
162
164
166
167void WaypointSprite_FadeOutIn(entity e, float t);
168
170
172
174
176
178
180
182
183bool WaypointSprite_Customize(entity this, entity client);
184
185bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
186
188
190 entity spr, // sprite
191 float lifetime, float maxdistance, // lifetime, max distance
192 entity ref, vector ofs, // position
193 entity showto, float t, // show to whom? Use a flag to indicate a team
194 entity own, .entity ownfield, // remove when own gets killed
195 float hideable, // true when it should be controlled by cl_hidewaypoints
196 entity icon // initial icon
197);
198
200 entity spr,
201 vector ofs,
202 entity own,
203 .entity ownfield,
204 entity icon // initial icon
205);
206
209 entity spr,
210 bool limited_range,
211 entity player,
212 vector ofs,
213 entity icon // initial icon
214);
215
218 entity spr,
219 entity player,
220 vector ofs,
221 entity icon // initial icon
222);
223
227 entity spr,
228 entity player,
229 bool limited_range,
230 entity icon // initial icon
231);
232
234 entity spr,
235 entity carrier,
236 entity icon // initial icon
237);
238
240
242
244
246
248#endif
float height
Definition bobbing.qc:3
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
string netname
Definition powerups.qc:20
float lifetime
Definition powerups.qc:23
float alpha
Definition items.qc:13
float spawntime
Definition items.qh:16
int team
Definition main.qh:188
fadetime
#define entityclass(...)
Definition oo.qh:52
#define classfield(name)
Definition oo.qh:57
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
vector
Definition self.qh:92
vector org
Definition self.qh:92
vector vector ang
Definition self.qh:92
entity sprite
Definition sv_assault.qc:11
vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str)
const float SPRITE_HEALTHBAR_HEIGHT
void WaypointSprite_HelpMePing(entity e)
void WaypointSprite_ClearOwned(entity this)
entity WaypointSprite_DeployPersonal(entity spr, entity player, vector ofs, entity icon)
bool WaypointSprite_Customize(entity this, entity client)
void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, float width, float height, float margin, float border, float align, vector rgb, float a, vector hrgb, float ha, float f)
entity waypointsprite_deployed_fixed
float autocvar_g_waypointsprite_edgeoffset_left
bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
float autocvar_g_waypointsprite_timealphaexponent
float waypointsprite_limitedrange
float waypointsprite_count
void WaypointSprite_UpdateSprites(entity e, entity m1, entity m2, entity m3)
float waypointsprite_alpha
void WaypointSprite_Kill(entity wp)
entity WaypointSprite_Spawn(entity spr, float lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
const int SPRITERULE_DEFAULT
void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col)
int wp_extra
Additional networked waypoint state, used for items, weapons, buffs.
bool autocvar_g_waypointsprite_uppercase
bool autocvar_g_waypointsprite_turrets_text
float waypointsprite_edgeoffset_left
float autocvar_g_waypointsprite_crosshairfadedistance
float waypointsprite_helpmetime
float autocvar_g_waypointsprite_fontsize
entity WaypointSprite_DeployFixed(entity spr, bool limited_range, entity player, vector ofs, entity icon)
float waypointsprite_scale
float autocvar_g_waypointsprite_normdistance
void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, float f)
float waypointsprite_deadlifetime
float waypointsprite_distancefadedistance
float waypointsprite_edgeoffset_top
entity waypointsprite_attached
void WaypointSprite_UpdateOrigin(entity e, vector o)
void WaypointSprite_Init()
void WaypointSprite_UpdateMaxHealth(entity e, float f)
void WaypointSprite_Ping(entity e)
float autocvar_g_waypointsprite_distancefadealpha
void WaypointSprite_ClearPersonal(entity this)
float autocvar_g_waypointsprite_iconsize
vector drawspritearrow(vector o, float ang, vector rgb, float a, float t)
float autocvar_g_waypointsprite_alpha
float waypointsprite_distancealphaexponent
float autocvar_g_waypointsprite_crosshairfadealpha
float waypointsprite_crosshairfadescale
const float SPRITE_HELPME_BLINK
float waypointsprite_normdistance
float waypointsprite_edgefadescale
void WaypointSprite_Load()
int autocvar_g_waypointsprite_itemstime
string spritelookuptext(entity this, string s)
float waypointsprite_edgeoffset_right
void WaypointSprite_Think(entity this)
float waypointsprite_crosshairfadealpha
bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
entity WaypointSprite_getviewentity(entity e)
float waypointsprite_fadedistance
entity WaypointSprite_Attach(entity spr, entity player, bool limited_range, entity icon)
float waypointsprite_edgefadedistance
entity waypointsprite_deployed_personal
float autocvar_g_waypointsprite_minalpha
const float SPRITE_ARROW_SCALE
float autocvar_sv_waypointsprite_limitedrange
float autocvar_sv_waypointsprite_deadlifetime
float waypointsprite_crosshairfadedistance
string model1
bool autocvar_g_waypointsprite_iconcolor
float autocvar_g_waypointsprite_scale
float waypointsprite_deployed_lifetime
bool autocvar_cl_hidewaypoints
vector fixrgbexcess_move(vector rgb, vector src, vector dst)
entity waypointsprite_attachedforcarrier
bool autocvar_g_waypointsprite_turrets_onlyhurt
float autocvar_g_waypointsprite_turrets_maxdist
const int SPRITERULE_SPECTATOR
void Ent_RemoveWaypointSprite(entity this)
vector spritelookupcolor(entity this, string s, vector def)
void WaypointSprite_FadeOutIn(entity e, float t)
float autocvar_g_waypointsprite_distancealphaexponent
float autocvar_g_waypointsprite_edgeoffset_right
float autocvar_g_waypointsprite_edgeoffset_top
const float SPRITE_HEALTHBAR_HEALTHALPHA
entity WaypointSprite_AttachCarrier(entity spr, entity carrier, entity icon)
string model3
float autocvar_g_waypointsprite_distancefadescale
float autocvar_g_waypointsprite_edgefadescale
const float SPRITE_HEALTHBAR_BORDERALPHA
void WaypointSprite_PlayerGone(entity this)
void Draw_WaypointSprite(entity this)
float autocvar_g_waypointsprite_crosshairfadescale
entity owned_by_field
void WaypointSprite_PlayerDead(entity this)
float waypointsprite_minscale
float waypointsprite_edgefadealpha
const float SPRITE_HEALTHBAR_WIDTH
void Ent_WaypointSprite(entity this, bool isnew)
const float SPRITE_HEALTHBAR_BORDER
float autocvar_g_waypointsprite_edgefadedistance
float waypointsprite_distancefadealpha
float autocvar_g_waypointsprite_edgeoffset_bottom
void WaypointSprite_UpdateHealth(entity e, float f)
vector fixrgbexcess(vector rgb)
float waypointsprite_timealphaexponent
bool autocvar_g_waypointsprite_turrets
float waypointsprite_pingtime
float rule
float waypointsprite_distancefadescale
float WaypointSprite_isteammate(entity e, entity e2)
entity WaypointSprite_SpawnFixed(entity spr, vector ofs, entity own,.entity ownfield, entity icon)
float autocvar_g_waypointsprite_minscale
void WaypointSprite_Disown(entity wp, float fadetime)
void WaypointSprite_DetachCarrier(entity carrier)
const float SPRITE_HEALTHBAR_MARGIN
float autocvar_g_waypointsprite_distancefadedistancemultiplier
float waypointsprite_fontsize
void WaypointSprite_UpdateBuildFinished(entity e, float f)
float autocvar_sv_waypointsprite_deployed_lifetime
void WaypointSprite_Reset(entity this)
const int SPRITERULE_TEAMPLAY
void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
void WaypointSprite_Load_Frames(string ext)
float spritelookupblinkvalue(entity this, string s)
float waypointsprite_minalpha
string model2
float waypointsprite_edgeoffset_bottom
float waypointsprite_newcount
int autocvar_g_waypointsprite_spam
bool autocvar_g_waypointsprite_text
void WaypointSprite_UpdateRule(entity e, float t, float r)
float autocvar_g_waypointsprite_edgefadealpha