5 /** Additional networked waypoint state, used for items, weapons, buffs */
9 const int SPRITERULE_DEFAULT = 0;
10 const int SPRITERULE_TEAMPLAY = 1;
11 const int SPRITERULE_SPECTATOR = 2;
14 entityclass(WaypointSprite);
15 classfield(WaypointSprite) .float helpme;
16 classfield(WaypointSprite) .float rule;
17 classfield(WaypointSprite) .string netname; // primary picture
18 classfield(WaypointSprite) .string netname2; // secondary picture
19 classfield(WaypointSprite) .string netname3; // tertiary picture
20 classfield(WaypointSprite) .int team; // team that gets netname2
21 classfield(WaypointSprite) .float lifetime;
22 classfield(WaypointSprite) .float fadetime;
23 classfield(WaypointSprite) .float maxdistance;
24 classfield(WaypointSprite) .int hideflags;
25 classfield(WaypointSprite) .float spawntime;
26 classfield(WaypointSprite) .float health;
27 classfield(WaypointSprite) .float build_started;
28 classfield(WaypointSprite) .float build_starthealth;
29 classfield(WaypointSprite) .float build_finished;
30 classfield(WaypointSprite) .int build_reverse;
32 bool autocvar_cl_hidewaypoints;
34 float autocvar_g_waypointsprite_alpha;
35 float autocvar_g_waypointsprite_crosshairfadealpha;
36 float autocvar_g_waypointsprite_crosshairfadedistance;
37 float autocvar_g_waypointsprite_crosshairfadescale;
38 float autocvar_g_waypointsprite_distancealphaexponent;
39 float autocvar_g_waypointsprite_distancefadealpha;
40 float autocvar_g_waypointsprite_distancefadedistancemultiplier;
41 float autocvar_g_waypointsprite_distancefadescale;
42 float autocvar_g_waypointsprite_edgefadealpha;
43 float autocvar_g_waypointsprite_edgefadedistance;
44 float autocvar_g_waypointsprite_edgefadescale;
45 float autocvar_g_waypointsprite_edgeoffset_bottom;
46 float autocvar_g_waypointsprite_edgeoffset_left;
47 float autocvar_g_waypointsprite_edgeoffset_right;
48 float autocvar_g_waypointsprite_edgeoffset_top;
49 float autocvar_g_waypointsprite_fontsize;
50 int autocvar_g_waypointsprite_itemstime;
51 float autocvar_g_waypointsprite_minalpha;
52 float autocvar_g_waypointsprite_minscale;
53 float autocvar_g_waypointsprite_normdistance;
54 float autocvar_g_waypointsprite_scale;
55 int autocvar_g_waypointsprite_spam;
56 float autocvar_g_waypointsprite_timealphaexponent;
57 bool autocvar_g_waypointsprite_turrets = true;
58 float autocvar_g_waypointsprite_turrets_maxdist = 5000;
59 bool autocvar_g_waypointsprite_turrets_text = false;
60 bool autocvar_g_waypointsprite_turrets_onlyhurt = false;
61 bool autocvar_g_waypointsprite_uppercase;
62 bool autocvar_g_waypointsprite_text;
63 float autocvar_g_waypointsprite_iconsize = 32;
64 bool autocvar_g_waypointsprite_iconcolor;
66 float waypointsprite_fadedistance;
67 float waypointsprite_normdistance;
68 float waypointsprite_minscale;
69 float waypointsprite_minalpha;
70 float waypointsprite_distancealphaexponent;
71 float waypointsprite_timealphaexponent;
72 float waypointsprite_scale;
73 float waypointsprite_fontsize;
74 float waypointsprite_edgefadealpha;
75 float waypointsprite_edgefadescale;
76 float waypointsprite_edgefadedistance;
77 float waypointsprite_edgeoffset_bottom;
78 float waypointsprite_edgeoffset_left;
79 float waypointsprite_edgeoffset_right;
80 float waypointsprite_edgeoffset_top;
81 float waypointsprite_crosshairfadealpha;
82 float waypointsprite_crosshairfadescale;
83 float waypointsprite_crosshairfadedistance;
84 float waypointsprite_distancefadealpha;
85 float waypointsprite_distancefadescale;
86 float waypointsprite_distancefadedistance;
87 float waypointsprite_alpha;
89 const float SPRITE_HEALTHBAR_WIDTH = 104;
90 const float SPRITE_HEALTHBAR_HEIGHT = 7;
91 const float SPRITE_HEALTHBAR_MARGIN = 6;
92 const float SPRITE_HEALTHBAR_BORDER = 2;
93 const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
94 const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
95 const float SPRITE_ARROW_SCALE = 1.0;
96 const float SPRITE_HELPME_BLINK = 2;
98 float waypointsprite_count, waypointsprite_newcount;
100 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f);
102 void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, float f);
104 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);
106 // returns location of sprite text
107 vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
109 // returns location of sprite healthbar
110 vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str);
112 float spritelookupblinkvalue(entity this, string s);
113 vector spritelookupcolor(entity this, string s, vector def);
114 string spritelookuptext(entity this, string s);
116 vector fixrgbexcess_move(vector rgb, vector src, vector dst);
117 vector fixrgbexcess(vector rgb);
119 // they are drawn using a .draw function
121 void Ent_RemoveWaypointSprite(entity this);
123 void Ent_WaypointSprite(entity this, bool isnew);
125 void WaypointSprite_Load_Frames(string ext);
127 void WaypointSprite_Load();
129 void Draw_WaypointSprite(entity this);
135 float autocvar_sv_waypointsprite_deadlifetime;
136 float autocvar_sv_waypointsprite_deployed_lifetime;
137 float autocvar_sv_waypointsprite_limitedrange;
139 ..entity owned_by_field;
145 .bool(entity, entity, entity) waypointsprite_visible_for_player;
147 void WaypointSprite_UpdateSprites(entity e, entity m1, entity m2, entity m3);
149 void WaypointSprite_UpdateHealth(entity e, float f);
151 void WaypointSprite_UpdateMaxHealth(entity e, float f);
153 void WaypointSprite_UpdateBuildFinished(entity e, float f);
155 void WaypointSprite_UpdateOrigin(entity e, vector o);
157 void WaypointSprite_UpdateRule(entity e, float t, float r);
159 void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col);
161 .float waypointsprite_pingtime;
162 .float waypointsprite_helpmetime;
163 void WaypointSprite_Ping(entity e);
165 float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
167 void WaypointSprite_HelpMePing(entity e);
169 void WaypointSprite_FadeOutIn(entity e, float t);
171 void WaypointSprite_Init();
173 void WaypointSprite_Kill(entity wp);
175 void WaypointSprite_Disown(entity wp, float fadetime);
177 void WaypointSprite_Think(entity this);
179 bool WaypointSprite_visible_for_player(entity this, entity player, entity view);
181 entity WaypointSprite_getviewentity(entity e);
183 float WaypointSprite_isteammate(entity e, entity e2);
185 bool WaypointSprite_Customize(entity this, entity client);
187 bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
189 void WaypointSprite_Reset(entity this);
191 entity WaypointSprite_Spawn(
192 entity spr, // sprite
193 float lifetime, float maxdistance, // lifetime, max distance
194 entity ref, vector ofs, // position
195 entity showto, float t, // show to whom? Use a flag to indicate a team
196 entity own, .entity ownfield, // remove when own gets killed
197 float hideable, // true when it should be controlled by cl_hidewaypoints
198 entity icon // initial icon
201 entity WaypointSprite_SpawnFixed(
206 entity icon // initial icon
209 .entity waypointsprite_deployed_fixed;
210 entity WaypointSprite_DeployFixed(
215 entity icon // initial icon
218 .entity waypointsprite_deployed_personal;
219 entity WaypointSprite_DeployPersonal(
223 entity icon // initial icon
226 .entity waypointsprite_attached;
227 .entity waypointsprite_attachedforcarrier;
228 entity WaypointSprite_Attach(
232 entity icon // initial icon
235 entity WaypointSprite_AttachCarrier(
238 entity icon // initial icon
241 void WaypointSprite_DetachCarrier(entity carrier);
243 void WaypointSprite_ClearPersonal(entity this);
245 void WaypointSprite_ClearOwned(entity this);
247 void WaypointSprite_PlayerDead(entity this);
249 void WaypointSprite_PlayerGone(entity this);