X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fradar.qc;h=66665498e07c6ced0a88d11371c4567c7aea4eee;hb=c05104bde1e758c4022f9755f02f177aa0476134;hp=f0ec01c9e7b1847e68734896348da82b7658ad0f;hpb=04eab4332c011c1bb8cde236055daf8b6bcd311c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index f0ec01c9e..66665498e 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -1,16 +1,29 @@ #include "radar.qh" #include -#include +#include #include #include -#include #include +#include #include #include // 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; @@ -18,7 +31,7 @@ bool HUD_Radar_Clickable() void HUD_Radar_Show_Maximized(bool doshow, bool clickable) { - TC(bool, doshow); + TC(bool, doshow); hud_panel_radar_maximized = doshow; hud_panel_radar_temp_hidden = 0; @@ -26,8 +39,6 @@ void HUD_Radar_Show_Maximized(bool doshow, bool clickable) { if (clickable) { - if(autocvar_hud_cursormode) - setcursormode(1); hud_panel_radar_mouse = 1; // we must unset the player's buttons, as they aren't released elsewhere @@ -42,9 +53,6 @@ void HUD_Radar_Show_Maximized(bool doshow, bool clickable) { hud_panel_radar_mouse = 0; mouseClicked = 0; - if(autocvar_hud_cursormode) - if(!mv_active) - setcursormode(0); } } void HUD_Radar_Hide_Maximized() @@ -55,7 +63,7 @@ void HUD_Radar_Hide_Maximized() float HUD_Radar_InputEvent(int bInputType, float nPrimary, float nSecondary) { - TC(int, bInputType); + TC(int, bInputType); if(!hud_panel_radar_maximized || !hud_panel_radar_mouse || autocvar__hud_configure || mv_active) return false; @@ -140,9 +148,6 @@ void HUD_Radar_Mouse() return; } - if (!autocvar_hud_cursormode) - update_mousepos(); - panel = HUD_PANEL(RADAR); HUD_Panel_LoadCvars(); @@ -168,9 +173,6 @@ void HUD_Radar_Mouse() HUD_Radar_Hide_Maximized(); return; } - - - draw_cursor_normal(mousepos, '1 1 1', 0.8); } void HUD_Radar() @@ -350,10 +352,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 ( it.health >= 0 ) - if ( it.team == myteam + 1 || gametype == MAPINFO_TYPE_RACE || !teamplay ) + if ( GetResource(it, RES_HEALTH) >= 0 ) + 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)) @@ -365,7 +369,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, { @@ -380,11 +384,11 @@ void HUD_Radar() if ( hud_panel_radar_mouse ) { - string message = "Click to select teleport destination"; + string message = _("Click to select teleport destination"); if ( STAT(HEALTH) <= 0 ) { - message = "Click to select spawn location"; + message = _("Click to select spawn location"); } drawcolorcodedstring(pos + '0.5 0 0' * (mySize_x - stringwidth(message, true, hud_fontsize)) - '0 1 0' * hud_fontsize_y * 2,