]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/waypointsprites.qh
Combine client/server waypointsprites
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / waypointsprites.qh
1 #ifndef WAYPOINTSPRITES_H
2 #define WAYPOINTSPRITES_H
3
4 #ifdef CSQC
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;
21
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;
45
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;
54
55 float waypointsprite_count, waypointsprite_newcount;
56
57 void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f);
58
59 void drawquad(vector o, vector ri, vector up, string pic, vector rgb, float a, float f);
60
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);
62
63 // returns location of sprite text
64 vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
65
66 // returns location of sprite healthbar
67 vector drawspritetext(vector o, float ang, float minwidth, vector rgb, float a, vector fontsize, string s);
68
69 float spritelookupblinkvalue(string s);
70 vector spritelookupcolor(string s, vector def);
71 string spritelookuptext(string s);
72
73 vector fixrgbexcess_move(vector rgb, vector src, vector dst);
74 vector fixrgbexcess(vector rgb);
75
76 // they are drawn using a .draw function
77
78 void Ent_RemoveWaypointSprite();
79
80 void Ent_WaypointSprite();
81
82 void WaypointSprite_Load_Frames(string ext);
83
84 void WaypointSprite_Load();
85 .float alpha;
86 void Draw_WaypointSprite();
87 #endif
88
89 #ifdef SVQC
90 ..entity owned_by_field;
91 .float rule;
92 .string model1;
93 .string model2;
94 .string model3;
95
96 .float(entity) waypointsprite_visible_for_player;
97
98 void WaypointSprite_UpdateSprites(entity e, string m1, string m2, string m3);
99
100 void WaypointSprite_UpdateHealth(entity e, float f);
101
102 void WaypointSprite_UpdateMaxHealth(entity e, float f);
103
104 void WaypointSprite_UpdateBuildFinished(entity e, float f);
105
106 void WaypointSprite_UpdateOrigin(entity e, vector o);
107
108 void WaypointSprite_UpdateRule(entity e, float t, float r);
109
110 void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col);
111
112 .float waypointsprite_pingtime;
113 .float waypointsprite_helpmetime;
114 void WaypointSprite_Ping(entity e);
115
116 float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
117
118 void WaypointSprite_HelpMePing(entity e);
119
120 void WaypointSprite_FadeOutIn(entity e, float t);
121
122 void WaypointSprite_Init();
123 void WaypointSprite_InitClient(entity e);
124
125 void WaypointSprite_Kill(entity wp);
126
127 void WaypointSprite_Disown(entity wp, float fadetime);
128
129 void WaypointSprite_Think();
130
131 float WaypointSprite_visible_for_player(entity e);
132
133 entity WaypointSprite_getviewentity(entity e);
134
135 float WaypointSprite_isteammate(entity e, entity e2);
136
137 float WaypointSprite_Customize();
138
139 float WaypointSprite_SendEntity(entity to, float sendflags);
140
141 void WaypointSprite_Reset();
142
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
151 );
152
153 entity WaypointSprite_SpawnFixed(
154     string spr,
155     vector ofs,
156     entity own,
157     .entity ownfield,
158     float icon, vector rgb // initial icon and color
159 );
160
161 .entity waypointsprite_deployed_fixed;
162 entity WaypointSprite_DeployFixed(
163     string spr,
164     float limited_range,
165     vector ofs,
166     float icon, vector rgb // initial icon and color
167 );
168
169 .entity waypointsprite_deployed_personal;
170 entity WaypointSprite_DeployPersonal(
171     string spr,
172     vector ofs,
173     float icon, vector rgb // initial icon and color
174 );
175
176 .entity waypointsprite_attached;
177 .entity waypointsprite_attachedforcarrier;
178 entity WaypointSprite_Attach(
179     string spr,
180     float limited_range,
181     float icon, vector rgb // initial icon and color
182 );
183
184 entity WaypointSprite_AttachCarrier(
185     string spr,
186     entity carrier,
187     float icon, vector rgb // initial icon and color
188 );
189
190 void WaypointSprite_DetachCarrier(entity carrier);
191
192 void WaypointSprite_ClearPersonal();
193
194 void WaypointSprite_ClearOwned();
195
196 void WaypointSprite_PlayerDead();
197
198 void WaypointSprite_PlayerGone();
199 #endif
200
201 #endif