1 #ifndef WAYPOINTSPRITES_H
2 #define WAYPOINTSPRITES_H
5 entityclass(WaypointSprite);
6 class(WaypointSprite) .float helpme;
7 class(WaypointSprite) .float rule;
8 class(WaypointSprite) .string netname; // primary picture
9 class(WaypointSprite) .string netname2; // secondary picture
10 class(WaypointSprite) .string netname3; // tertiary picture
11 class(WaypointSprite) .int team; // team that gets netname2
12 class(WaypointSprite) .float lifetime;
13 class(WaypointSprite) .float fadetime;
14 class(WaypointSprite) .float maxdistance;
15 class(WaypointSprite) .int hideflags;
16 class(WaypointSprite) .float spawntime;
17 class(WaypointSprite) .float health;
18 class(WaypointSprite) .float build_started;
19 class(WaypointSprite) .float build_starthealth;
20 class(WaypointSprite) .float build_finished;
22 float waypointsprite_initialized;
23 float waypointsprite_fadedistance;
24 float waypointsprite_normdistance;
25 float waypointsprite_minscale;
26 float waypointsprite_minalpha;
27 float waypointsprite_distancealphaexponent;
28 float waypointsprite_timealphaexponent;
29 float waypointsprite_scale;
30 float waypointsprite_fontsize;
31 float waypointsprite_edgefadealpha;
32 float waypointsprite_edgefadescale;
33 float waypointsprite_edgefadedistance;
34 float waypointsprite_edgeoffset_bottom;
35 float waypointsprite_edgeoffset_left;
36 float waypointsprite_edgeoffset_right;
37 float waypointsprite_edgeoffset_top;
38 float waypointsprite_crosshairfadealpha;
39 float waypointsprite_crosshairfadescale;
40 float waypointsprite_crosshairfadedistance;
41 float waypointsprite_distancefadealpha;
42 float waypointsprite_distancefadescale;
43 float waypointsprite_distancefadedistance;
44 float waypointsprite_alpha;
46 const float SPRITE_HEALTHBAR_WIDTH = 144;
47 const float SPRITE_HEALTHBAR_HEIGHT = 9;
48 const float SPRITE_HEALTHBAR_MARGIN = 6;
49 const float SPRITE_HEALTHBAR_BORDER = 2;
50 const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
51 const float SPRITE_HEALTHBAR_HEALTHALPHA = 0.5;
52 const float SPRITE_ARROW_SCALE = 1.0;
53 const float SPRITE_HELPME_BLINK = 2;
55 float waypointsprite_count, waypointsprite_newcount;
57 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f);
59 void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, float f);
61 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);
63 // returns location of sprite text
64 vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
66 // returns location of sprite healthbar
67 vector drawspritetext(vector o, float ang, float minwidth, vector rgb, float a, vector fontsize, string s);
69 float spritelookupblinkvalue(string s);
70 vector spritelookupcolor(string s, vector def);
71 string spritelookuptext(string s);
73 vector fixrgbexcess_move(vector rgb, vector src, vector dst);
74 vector fixrgbexcess(vector rgb);
76 // they are drawn using a .draw function
78 void Ent_RemoveWaypointSprite();
80 void Ent_WaypointSprite();
82 void WaypointSprite_Load_Frames(string ext);
84 void WaypointSprite_Load();
86 void Draw_WaypointSprite();
90 ..entity owned_by_field;
96 .float(entity) waypointsprite_visible_for_player;
98 void WaypointSprite_UpdateSprites(entity e, string m1, string m2, string m3);
100 void WaypointSprite_UpdateHealth(entity e, float f);
102 void WaypointSprite_UpdateMaxHealth(entity e, float f);
104 void WaypointSprite_UpdateBuildFinished(entity e, float f);
106 void WaypointSprite_UpdateOrigin(entity e, vector o);
108 void WaypointSprite_UpdateRule(entity e, float t, float r);
110 void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col);
112 .float waypointsprite_pingtime;
113 .float waypointsprite_helpmetime;
114 void WaypointSprite_Ping(entity e);
116 float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
118 void WaypointSprite_HelpMePing(entity e);
120 void WaypointSprite_FadeOutIn(entity e, float t);
122 void WaypointSprite_Init();
123 void WaypointSprite_InitClient(entity e);
125 void WaypointSprite_Kill(entity wp);
127 void WaypointSprite_Disown(entity wp, float fadetime);
129 void WaypointSprite_Think();
131 float WaypointSprite_visible_for_player(entity e);
133 entity WaypointSprite_getviewentity(entity e);
135 float WaypointSprite_isteammate(entity e, entity e2);
137 float WaypointSprite_Customize();
139 float WaypointSprite_SendEntity(entity to, float sendflags);
141 void WaypointSprite_Reset();
143 entity WaypointSprite_Spawn(
144 string spr, // sprite
145 float lifetime, float maxdistance, // lifetime, max distance
146 entity ref, vector ofs, // position
147 entity showto, float t, // show to whom? Use a flag to indicate a team
148 entity own, .entity ownfield, // remove when own gets killed
149 float hideable, // true when it should be controlled by cl_hidewaypoints
150 float icon, vector rgb // initial icon and color
153 entity WaypointSprite_SpawnFixed(
158 float icon, vector rgb // initial icon and color
161 .entity waypointsprite_deployed_fixed;
162 entity WaypointSprite_DeployFixed(
166 float icon, vector rgb // initial icon and color
169 .entity waypointsprite_deployed_personal;
170 entity WaypointSprite_DeployPersonal(
173 float icon, vector rgb // initial icon and color
176 .entity waypointsprite_attached;
177 .entity waypointsprite_attachedforcarrier;
178 entity WaypointSprite_Attach(
181 float icon, vector rgb // initial icon and color
184 entity WaypointSprite_AttachCarrier(
187 float icon, vector rgb // initial icon and color
190 void WaypointSprite_DetachCarrier(entity carrier);
192 void WaypointSprite_ClearPersonal();
194 void WaypointSprite_ClearOwned();
196 void WaypointSprite_PlayerDead();
198 void WaypointSprite_PlayerGone();