seta sv_status_privacy 1 "hide IP addresses from \"status\" replies shown to clients"
-seta cl_teamradar 1 "show radar in teammatches when available"
-seta cl_teamradar_background_alpha 0 "set to -1 to disable"
-seta cl_teamradar_foreground_alpha 0.8 "alpha of the map"
-seta cl_teamradar_scale 4096 "distance you can see on the team radar"
-seta cl_teamradar_rotation 0 "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
-seta cl_teamradar_size "128 128" "size of the team radar in pixels"
-seta cl_teamradar_position "1 0" "1 0 would be upper right corner, 0.5 0.5 the center, append a 2 at the end to disable the corner hack, and a 1 to disable half the hack"
-seta cl_teamradar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
-alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"
+seta hud_radar_background_alpha 0 "set to -1 to disable"
+seta hud_radar_foreground_alpha 0.8 "alpha of the map"
+seta hud_radar_scale 4096 "distance you can see on the team radar"
+seta hud_radar_rotation 0 "rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north"
+seta hud_radar_zoommode 0 "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
+alias hud_radar_rotate "toggle hud_radar_rotation 0 1 2 3 4"
set g_maplist_allow_hidden 0 "allow hidden maps to be, e.g., voted for and in the maplist"
set g_maplist_allow_frustrating 0 "allow impossible maps to be, e.g., voted for and in the maplist (if set to 2, ONLY impossible maps are allowed)"
float scale2d, normalsize, bigsize;
float f;
- teamradar_origin2d = pos + 0.5 * mySize; // TODO: stupid compat, should be removed
+ teamradar_origin2d = pos + 0.5 * mySize; // TODO: stupid compat, should be removed (hint: code seems to assume origin to be in center, where panelhud code uses pos as topleft pixel)
teamradar_size2d = mySize;
if(minimapname == "" && !ons_showmap)
teamradar_loadcvars();
- switch(cl_teamradar_zoommode)
+ switch(hud_radar_zoommode)
{
default:
case 0:
break;
}
- switch(cl_teamradar_rotation)
+ switch(hud_radar_rotation)
{
case 0:
teamradar_angle = view_angles_y - 90;
break;
default:
- teamradar_angle = 90 * cl_teamradar_rotation;
+ teamradar_angle = 90 * hud_radar_rotation;
break;
}
teamradar_extraclip_mins = teamradar_extraclip_maxs = '0 0 0'; // we always center
// pixels per world qu to match the teamradar_size2d_x range in the longest dimension
- if(cl_teamradar_rotation == 0)
+ if(hud_radar_rotation == 0)
{
// max-min distance must fit the radar in any rotation
bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
);
}
- normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / cl_teamradar_scale;
+ normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / hud_radar_scale;
if(bigsize > normalsize)
normalsize = bigsize;
mySize_y
);
- draw_teamradar_background(cl_teamradar_background_alpha, cl_teamradar_foreground_alpha);
+ draw_teamradar_background(hud_radar_background_alpha, hud_radar_foreground_alpha);
if(ons_showmap)
{
HUD_Timer();
// TODO hud'ify
if(HUD_Panel_CheckActive(6))
- if(ons_showmap || cvar_string("cl_teamradar") != "0" && (cvar("cl_teamradar") == 2 || teamplay))
+ if(ons_showmap || cvar_string("hud_radar") != "0" && (cvar("hud_radar") == 2 || teamplay))
HUD_Radar();
if(HUD_Panel_CheckActive(7))
HUD_Score();
vector teamradar_size2d; // 2D size
vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // for non-centered radar display
float teamradar_size; // 2D scale factor
-float cl_teamradar_scale; // window size = ...qu
-float cl_teamradar_nohudhack;
+float hud_radar_scale; // window size = ...qu
+float hud_radar_nohudhack;
float v_flipped;
float vlen2d(vector v)
R_EndPolygon();
}
-float cl_teamradar_scale;
-float cl_teamradar_background_alpha;
-float cl_teamradar_foreground_alpha;
-float cl_teamradar_rotation;
-vector cl_teamradar_size;
-vector cl_teamradar_position;
-float cl_teamradar_zoommode;
+float hud_radar_scale;
+float hud_radar_background_alpha;
+float hud_radar_foreground_alpha;
+float hud_radar_rotation;
+vector hud_radar_size;
+vector hud_radar_position;
+float hud_radar_zoommode;
void teamradar_loadcvars()
{
v_flipped = cvar("v_flipped");
if(ons_showmap)
{
- cl_teamradar_scale = 42; // dummy, not used (see zoommode)
- cl_teamradar_background_alpha = 1 * (1 - cvar("_menu_alpha"));
- cl_teamradar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));
- cl_teamradar_rotation = cvar("cl_teamradar_rotation");
- if(!cl_teamradar_rotation)
- cl_teamradar_rotation = 4;
- cl_teamradar_zoommode = 3;
- cl_teamradar_nohudhack = 0;
+ hud_radar_scale = 42; // dummy, not used (see zoommode)
+ hud_radar_background_alpha = 1 * (1 - cvar("_menu_alpha"));
+ hud_radar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));
+ hud_radar_rotation = cvar("hud_radar_rotation");
+ if(!hud_radar_rotation)
+ hud_radar_rotation = 4;
+ hud_radar_zoommode = 3;
+ hud_radar_nohudhack = 0;
}
else
{
- cl_teamradar_scale = cvar("cl_teamradar_scale");
- cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha") * hud_alpha_fg;
- cl_teamradar_foreground_alpha = cvar("cl_teamradar_foreground_alpha") * hud_alpha_fg;
- cl_teamradar_rotation = cvar("cl_teamradar_rotation");
- cl_teamradar_zoommode = cvar("cl_teamradar_zoommode");
+ hud_radar_scale = cvar("hud_radar_scale");
+ hud_radar_background_alpha = cvar("hud_radar_background_alpha") * hud_alpha_fg;
+ hud_radar_foreground_alpha = cvar("hud_radar_foreground_alpha") * hud_alpha_fg;
+ hud_radar_rotation = cvar("hud_radar_rotation");
+ hud_radar_zoommode = cvar("hud_radar_zoommode");
// others default to 0
// match this to defaultXonotic.cfg!
- if(!cl_teamradar_scale) cl_teamradar_scale = 4096;
- if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.4 * hud_alpha_fg;
- if(!cl_teamradar_foreground_alpha) cl_teamradar_foreground_alpha = 0.8 * hud_alpha_fg;
- if(!cl_teamradar_size_x) cl_teamradar_size_x = 128;
- if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;
-
- cl_teamradar_size_z = 0;
- cl_teamradar_nohudhack = cl_teamradar_position_z;
- cl_teamradar_position_z = 0;
+ if(!hud_radar_scale) hud_radar_scale = 4096;
+ if(!hud_radar_background_alpha) hud_radar_background_alpha = 0.4 * hud_alpha_fg;
+ if(!hud_radar_foreground_alpha) hud_radar_foreground_alpha = 0.8 * hud_alpha_fg;
+ if(!hud_radar_size_x) hud_radar_size_x = 128;
+ if(!hud_radar_size_y) hud_radar_size_y = hud_radar_size_x;
+
+ hud_radar_size_z = 0;
+ hud_radar_nohudhack = hud_radar_position_z;
+ hud_radar_position_z = 0;
}
}
entity e, sl;
me.TR(me);
me.TD(me, 1, 4, makeXonoticTextLabel(0, "Radar settings:"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Position:"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0 0", "Top left"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0.5 0", "Top middle"));
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "1 0", "Top right"));
- me.TR(me);
- me.TDempty(me, 1);
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "0 0.5", "Middle left"));
- me.TDempty(me, 1);
- me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_teamradar_position", "1 0.5", "Middle right"));
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Size:"));
- me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_teamradar_size"));
- e.addValue(e, "96x96", "96 96");
- e.addValue(e, "128x96", "128 96");
- e.addValue(e, "128x128", "128 128");
- e.addValue(e, "192x144", "192 144");
- e.addValue(e, "192x192", "192 192");
- e.addValue(e, "256x192", "256 192");
- e.addValue(e, "256x256", "256 256");
- e.configureXonoticTextSliderValues(e);
me.TR(me);
me.TDempty(me, 0.2);
sl = makeXonoticSlider(0.20, 1, 0.01, "cl_teamradar_background_alpha");