string wcross_wep, wcross_name;
float wcross_scale, wcross_blur;
- wcross_color = stov(cvar_string("crosshair_color"));
- if (cvar("crosshair_per_weapon")) {
+ if (cvar("crosshair_per_weapon") || cvar("crosshair_color_per_weapon")) {
e = get_weaponinfo(activeweapon);
if (e && e.netname != "")
{
wcross_wep = e.netname;
- wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
- if (wcross_resolution == 0)
- return;
- wcross_alpha *= cvar(strcat("crosshair_", wcross_wep, "_alpha"));
- if (wcross_alpha == 0)
- return;
-
- wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
- if(wcross_style == "")
- wcross_style = e.netname;
-
- if(!cvar("crosshair_color_override"))
- wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
+ if(cvar("crosshair_per_weapon"))
+ {
+ wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
+ if (wcross_resolution == 0)
+ return;
+ wcross_alpha *= cvar(strcat("crosshair_", wcross_wep, "_alpha"));
+ if (wcross_alpha == 0)
+ return;
+
+ wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
+ if(wcross_style == "" || wcross_style == "0")
+ wcross_style = wcross_wep;
+ }
}
}
+ if(wcross_wep != "" && cvar("crosshair_color_per_weapon"))
+ wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
+ else
+ wcross_color = stov(cvar_string("crosshair_color"));
wcross_name = strcat("gfx/crosshair", wcross_style);
e0.textEntity = main.weaponsDialog;
e0.allowCut = 1;
me.TR(me);
- me.TD(me, 1, 0.75, e = makeXonoticTextLabel(0, "Crosshair:"));
- me.TD(me, 1, 1.00, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon"));
- me.TD(me, 1, 1.25, e = makeXonoticCheckBox(1, "crosshair_color_override", "& Per weapon colors"));
- setDependent(e, "crosshair_per_weapon", 1, 1);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair:"));
+ me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon"));
me.TR(me);
me.TDempty(me, 0.5);
for(i = 1; i <= 10; ++i) {
me.TDempty(me, 0.2);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_color"));
- setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1);
+ setDependent(e, "crosshair_color_per_weapon", 1, 1);
+ me.TR(me);
+ me.TDempty(me, 0.3);
+ me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", "Per weapon"));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable centered dot"));
me.TR(me);