]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
Merge branch 'master' into terencehill/min_spec_time
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / waypoints / waypointsprites.qh
index fa9f4fbdf6571f0cdfbfda2187eddeeaafe0752d..94d735a1f6096b2f3a77a0b712e4124912bb0aa3 100644 (file)
@@ -1,30 +1,32 @@
-#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 rule;
-class(WaypointSprite) .string netname; // primary picture
-class(WaypointSprite) .string netname2; // secondary picture
-class(WaypointSprite) .string netname3; // tertiary picture
-class(WaypointSprite) .int team; // team that gets netname2
-class(WaypointSprite) .float lifetime;
-class(WaypointSprite) .float fadetime;
-class(WaypointSprite) .float maxdistance;
-class(WaypointSprite) .int hideflags;
-class(WaypointSprite) .float spawntime;
-class(WaypointSprite) .float health;
-class(WaypointSprite) .float build_started;
-class(WaypointSprite) .float build_starthealth;
-class(WaypointSprite) .float build_finished;
+classfield(WaypointSprite) .float helpme;
+classfield(WaypointSprite) .float rule;
+classfield(WaypointSprite) .string netname; // primary picture
+classfield(WaypointSprite) .string netname2; // secondary picture
+classfield(WaypointSprite) .string netname3; // tertiary picture
+classfield(WaypointSprite) .int team; // team that gets netname2
+classfield(WaypointSprite) .float lifetime;
+classfield(WaypointSprite) .float fadetime;
+classfield(WaypointSprite) .float maxdistance;
+classfield(WaypointSprite) .int hideflags;
+classfield(WaypointSprite) .float spawntime;
+classfield(WaypointSprite) .float health;
+classfield(WaypointSprite) .float build_started;
+classfield(WaypointSprite) .float build_starthealth;
+classfield(WaypointSprite) .float build_finished;
 
-bool autocvar_g_waypointsprite_uppercase;
 float autocvar_g_waypointsprite_alpha;
 float autocvar_g_waypointsprite_crosshairfadealpha;
 float autocvar_g_waypointsprite_crosshairfadedistance;
@@ -50,6 +52,10 @@ int autocvar_g_waypointsprite_spam;
 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;
@@ -74,8 +80,8 @@ float waypointsprite_distancefadescale;
 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;
@@ -95,7 +101,7 @@ void drawhealthbar(vector org, float rot, float h, vector sz, vector hotspot, fl
 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);
 
 float spritelookupblinkvalue(entity this, string s);
 vector spritelookupcolor(entity this, string s, vector def);
@@ -108,7 +114,7 @@ vector fixrgbexcess(vector rgb);
 
 void Ent_RemoveWaypointSprite(entity this);
 
-void Ent_WaypointSprite(entity this);
+void Ent_WaypointSprite(entity this, bool isnew);
 
 void WaypointSprite_Load_Frames(string ext);
 
@@ -118,6 +124,8 @@ 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;
@@ -234,5 +242,3 @@ void WaypointSprite_PlayerDead(entity this);
 
 void WaypointSprite_PlayerGone(entity this);
 #endif
-
-#endif