-#ifndef WAYPOINTSPRITES_H
-#define WAYPOINTSPRITES_H
+#pragma once
#include "all.qh"
/** Additional networked waypoint state, used for items, weapons, buffs */
.int wp_extra;
+const int SPRITERULE_DEFAULT = 0;
+const int SPRITERULE_TEAMPLAY = 1;
+const int SPRITERULE_SPECTATOR = 2;
+
#ifdef CSQC
entityclass(WaypointSprite);
class(WaypointSprite) .float helpme;
class(WaypointSprite) .float build_starthealth;
class(WaypointSprite) .float build_finished;
-bool autocvar_g_waypointsprite_uppercase;
float autocvar_g_waypointsprite_alpha;
float autocvar_g_waypointsprite_crosshairfadealpha;
float autocvar_g_waypointsprite_crosshairfadedistance;
float autocvar_g_waypointsprite_timealphaexponent;
bool autocvar_g_waypointsprite_turrets = true;
float autocvar_g_waypointsprite_turrets_maxdist = 5000;
+bool autocvar_g_waypointsprite_uppercase;
+bool autocvar_g_waypointsprite_text;
+float autocvar_g_waypointsprite_iconsize = 32;
+bool autocvar_g_waypointsprite_iconcolor;
float waypointsprite_fadedistance;
float waypointsprite_normdistance;
float waypointsprite_distancefadedistance;
float waypointsprite_alpha;
-const float SPRITE_HEALTHBAR_WIDTH = 144;
-const float SPRITE_HEALTHBAR_HEIGHT = 9;
+const float SPRITE_HEALTHBAR_WIDTH = 104;
+const float SPRITE_HEALTHBAR_HEIGHT = 7;
const float SPRITE_HEALTHBAR_MARGIN = 6;
const float SPRITE_HEALTHBAR_BORDER = 2;
const float SPRITE_HEALTHBAR_BORDERALPHA = 1;
vector drawspritearrow(vector o, float ang, vector rgb, float a, float t);
// returns location of sprite healthbar
-vector drawspritetext(vector o, float ang, float minwidth, vector rgb, float a, vector fontsize, string s);
+vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, vector rgb, float a, vector sz, string str, string pic);
-float spritelookupblinkvalue(string s);
-vector spritelookupcolor(string s, vector def);
-string spritelookuptext(string s);
+float spritelookupblinkvalue(entity this, string s);
+vector spritelookupcolor(entity this, string s, vector def);
+string spritelookuptext(entity this, string s);
vector fixrgbexcess_move(vector rgb, vector src, vector dst);
vector fixrgbexcess(vector rgb);
// they are drawn using a .draw function
-void Ent_RemoveWaypointSprite();
+void Ent_RemoveWaypointSprite(entity this);
-void Ent_WaypointSprite();
+void Ent_WaypointSprite(entity this, bool isnew);
void WaypointSprite_Load_Frames(string ext);
void WaypointSprite_Load();
.float alpha;
-void Draw_WaypointSprite();
+void Draw_WaypointSprite(entity this);
#endif
#ifdef SVQC
+.entity sprite;
+
float autocvar_sv_waypointsprite_deadlifetime;
float autocvar_sv_waypointsprite_deployed_lifetime;
float autocvar_sv_waypointsprite_limitedrange;
.string model2;
.string model3;
-.float(entity) waypointsprite_visible_for_player;
+.bool(entity, entity, entity) waypointsprite_visible_for_player;
void WaypointSprite_UpdateSprites(entity e, entity m1, entity m2, entity m3);
void WaypointSprite_UpdateRule(entity e, float t, float r);
-void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col);
+void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col);
.float waypointsprite_pingtime;
.float waypointsprite_helpmetime;
void WaypointSprite_FadeOutIn(entity e, float t);
void WaypointSprite_Init();
-void WaypointSprite_InitClient(entity e);
void WaypointSprite_Kill(entity wp);
void WaypointSprite_Disown(entity wp, float fadetime);
-void WaypointSprite_Think();
+void WaypointSprite_Think(entity this);
-float WaypointSprite_visible_for_player(entity e);
+bool WaypointSprite_visible_for_player(entity this, entity player, entity view);
entity WaypointSprite_getviewentity(entity e);
float WaypointSprite_isteammate(entity e, entity e2);
-float WaypointSprite_Customize();
+bool WaypointSprite_Customize(entity this, entity client);
-float WaypointSprite_SendEntity(entity to, float sendflags);
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
-void WaypointSprite_Reset();
+void WaypointSprite_Reset(entity this);
entity WaypointSprite_Spawn(
entity spr, // sprite
entity showto, float t, // show to whom? Use a flag to indicate a team
entity own, .entity ownfield, // remove when own gets killed
float hideable, // true when it should be controlled by cl_hidewaypoints
- float icon // initial icon
+ entity icon // initial icon
);
entity WaypointSprite_SpawnFixed(
vector ofs,
entity own,
.entity ownfield,
- float icon // initial icon
+ entity icon // initial icon
);
.entity waypointsprite_deployed_fixed;
entity WaypointSprite_DeployFixed(
entity spr,
float limited_range,
+ entity player,
vector ofs,
- float icon // initial icon
+ entity icon // initial icon
);
.entity waypointsprite_deployed_personal;
entity WaypointSprite_DeployPersonal(
entity spr,
+ entity player,
vector ofs,
- float icon // initial icon
+ entity icon // initial icon
);
.entity waypointsprite_attached;
.entity waypointsprite_attachedforcarrier;
entity WaypointSprite_Attach(
entity spr,
+ entity player,
float limited_range,
- float icon // initial icon
+ entity icon // initial icon
);
entity WaypointSprite_AttachCarrier(
entity spr,
entity carrier,
- float icon // initial icon
+ entity icon // initial icon
);
void WaypointSprite_DetachCarrier(entity carrier);
-void WaypointSprite_ClearPersonal();
-
-void WaypointSprite_ClearOwned();
+void WaypointSprite_ClearPersonal(entity this);
-void WaypointSprite_PlayerDead();
+void WaypointSprite_ClearOwned(entity this);
-void WaypointSprite_PlayerGone();
-#endif
+void WaypointSprite_PlayerDead(entity this);
+void WaypointSprite_PlayerGone(entity this);
#endif