X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fradar.qc;h=3bc537c8f8b5e42760e5ca614ac4e02dadc4ce08;hb=34e7f534e2015466228eb3a78c9857741b736dca;hp=1642e41891a8d75eed766cbe826bad92636feaa7;hpb=74cebbb48d9481bb83eccb4438283f319352cb74;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index 1642e4189..3bc537c8f 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -26,6 +26,13 @@ void HUD_Radar_Show_Maximized(bool doshow,float 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 + localcmd("-fire\n"); + localcmd("-fire2\n"); + localcmd("-use\n"); + localcmd("-hook\n"); + localcmd("-jump\n"); } } else if ( hud_panel_radar_mouse ) @@ -78,11 +85,9 @@ float HUD_Radar_InputEvent(int bInputType, float nPrimary, float nSecondary) else { // allow console/use binds to work without hiding the map - string con_keys; - float keys; - float i; - con_keys = strcat(findkeysforcommand("toggleconsole", 0)," ",findkeysforcommand("+use", 0)) ; - keys = tokenize(con_keys); // findkeysforcommand returns data for this + string con_keys = strcat(findkeysforcommand("toggleconsole", 0), " ", findkeysforcommand("+use", 0)) ; + int keys = tokenize(con_keys); // findkeysforcommand returns data for this + int i; for (i = 0; i < keys; ++i) { if(nPrimary == stof(argv(i))) @@ -132,15 +137,11 @@ void HUD_Radar_Mouse() return; } - if(!autocvar_hud_cursormode) - { - mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; - - mousepos_x = bound(0, mousepos_x, vid_conwidth); - mousepos_y = bound(0, mousepos_y, vid_conheight); - } + if (!autocvar_hud_cursormode) + update_mousepos(); - HUD_Panel_UpdateCvars(); + panel = HUD_PANEL(RADAR); + HUD_Panel_LoadCvars(); panel_size = autocvar_hud_panel_radar_maximized_size; @@ -192,7 +193,7 @@ void HUD_Radar() if ( hud_panel_radar_temp_hidden ) return; - HUD_Panel_UpdateCvars(); + HUD_Panel_LoadCvars(); float f = 0; @@ -279,7 +280,7 @@ void HUD_Radar() HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding; @@ -311,10 +312,10 @@ void HUD_Radar() else { vector c0, c1, c2, c3, span; - c0 = rotate(mi_min, teamradar_angle * DEG2RAD); - c1 = rotate(mi_max, teamradar_angle * DEG2RAD); - c2 = rotate('1 0 0' * mi_min.x + '0 1 0' * mi_max.y, teamradar_angle * DEG2RAD); - c3 = rotate('1 0 0' * mi_max.x + '0 1 0' * mi_min.y, teamradar_angle * DEG2RAD); + c0 = Rotate(mi_min, teamradar_angle * DEG2RAD); + c1 = Rotate(mi_max, teamradar_angle * DEG2RAD); + c2 = Rotate('1 0 0' * mi_min.x + '0 1 0' * mi_max.y, teamradar_angle * DEG2RAD); + c3 = Rotate('1 0 0' * mi_max.x + '0 1 0' * mi_min.y, teamradar_angle * DEG2RAD); span = '0 0 0'; span.x = max(c0_x, c1_x, c2_x, c3_x) - min(c0_x, c1_x, c2_x, c3_x); span.y = max(c0_y, c1_y, c2_y, c3_y) - min(c0_y, c1_y, c2_y, c3_y); @@ -346,12 +347,12 @@ void HUD_Radar() draw_teamradar_background(hud_panel_radar_foreground_alpha); - FOREACH_ENTITY_CLASS("radarlink", true, draw_teamradar_link(it.origin, it.velocity, it.team)); + IL_EACH(g_radarlinks, true, draw_teamradar_link(it.origin, it.velocity, it.team)); - FOREACH_ENTITY_FLAGS(teamradar_icon, 0xFFFFFF, { + 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 ) + if ( it.health >= 0 ) + if ( it.team == myteam + 1 || gametype == MAPINFO_TYPE_RACE || !teamplay ) { vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin)); if(vdist((mousepos - coord), <, 8))