]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/radar.qc
Add a mutator hook to allow forcing team radar icons to display regardless of their...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / radar.qc
index 612dc12e98ada6183ca03d1ed8712f63f8ae0aaa..a2776b662d2c4ce3e2b79c653bdb306e51d5b342 100644 (file)
@@ -4,7 +4,7 @@
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
 #include <common/ent_cs.qh>
-#include <common/mapinfo.qh>
+#include <common/gamemodes/_mod.qh>
 #include <client/mapvoting.qh>
 #include <client/resources.qh>
 #include <client/teamradar.qh>
 
 // Radar (#6)
 
+void HUD_Radar_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
+       HUD_Write_Cvar("hud_panel_radar_rotation");
+       HUD_Write_Cvar("hud_panel_radar_zoommode");
+       HUD_Write_Cvar("hud_panel_radar_scale");
+       HUD_Write_Cvar("hud_panel_radar_maximized_scale");
+       HUD_Write_Cvar("hud_panel_radar_maximized_size");
+       HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
+       HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
+}
+
 bool HUD_Radar_Clickable()
 {
        return hud_panel_radar_mouse && !hud_panel_radar_temp_hidden;
@@ -340,10 +353,12 @@ void HUD_Radar()
 
        IL_EACH(g_radarlinks, true, draw_teamradar_link(it.origin, it.velocity, it.team));
 
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(TeamRadar_Draw); // TODO: allow players to show on the radar as well!
+
        IL_EACH(g_radaricons, it.teamradar_icon, {
                if ( hud_panel_radar_mouse )
                if ( GetResource(it, RES_HEALTH) >= 0 )
-               if ( it.team == myteam + 1 || ISGAMETYPE(RACE) || !teamplay )
+               if ( it.team == myteam + 1 || mutator_returnvalue || !teamplay )
                {
                        vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
                        if(vdist((mousepos - coord), <, 8))
@@ -355,7 +370,7 @@ void HUD_Radar()
                                drawpic(coord - '8 8 0', "gfx/teamradar_icon_glow", '16 16 0', brightcolor, panel_fg_alpha, 0);
                        }
                }
-               entity icon = RadarIcons_from(it.teamradar_icon);
+               entity icon = REGISTRY_GET(RadarIcons, it.teamradar_icon);
                draw_teamradar_icon(it.origin, icon, it, spritelookupcolor(it, icon.netname, it.teamradar_color), panel_fg_alpha);
        });
        AL_EACH(_entcs, e, it != NULL, {