shottype = SHOTTYPE_HITWORLD;
vector wcross_color = '0 0 0', wcross_size = '0 0 0';
- string wcross_wep = "", wcross_name;
+ string wcross_name = "";
float wcross_scale, wcross_blur;
- if (autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1))
+ if(autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1))
{
e = get_weaponinfo(switchingweapon);
- if (e && e.netname != "")
+ if(e)
{
- wcross_wep = e.netname;
if(autocvar_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;
+ // WEAPONTODO: access these through some general settings (with non-balance config settings)
+ //wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
+ //if (wcross_resolution == 0)
+ //return;
+
+ //wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
+ wcross_resolution *= e.w_crosshair_size;
+ wcross_name = e.w_crosshair;
}
}
}
- //printf("crosshair style: %s\n", wcross_style);
- wcross_name = strcat("gfx/crosshair", wcross_style);
+ if(wcross_name == "")
+ wcross_name = strcat("gfx/crosshair", wcross_style);
// MAIN CROSSHAIR COLOR DECISION
switch(autocvar_crosshair_color_special)
{
case 1: // crosshair_color_per_weapon
{
- if(wcross_wep != "")
+ if(e)
{
- wcross_color = stov(cvar_string(sprintf("crosshair_%s_color", wcross_wep)));
+ wcross_color = e.wpcolor;
break;
}
else { goto normalcolor; }
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '1 1 1',
/* model */ "arc",
+/* crosshair */ "gfx/crosshairhlac",
/* netname */ "arc",
/* fullname */ _("Arc")
);
/* rating */ 0,
/* color */ '1 0.5 0.5',
/* model */ "laser",
+/* crosshair */ "gfx/crosshairlaser",
/* netname */ "laser",
/* fullname */ _("Blaster")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0.5 1',
/* model */ "crylink",
+/* crosshair */ "gfx/crosshaircrylink",
/* netname */ "crylink",
/* fullname */ _("Crylink")
);
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '1 1 0',
/* model */ "rl",
+/* crosshair */ "gfx/crosshairrocketlauncher",
/* netname */ "devastator",
/* fullname */ _("Devastator")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 0.5 1',
/* model */ "electro",
+/* crosshair */ "gfx/crosshairelectro",
/* netname */ "electro",
/* fullname */ _("Electro")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0.5 0',
/* model */ "fireball",
+/* crosshair */ "gfx/crosshairfireball",
/* netname */ "fireball",
/* fullname */ _("Fireball")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 1 0.5',
/* model */ "hagar",
+/* crosshair */ "gfx/crosshairhagar",
/* netname */ "hagar",
/* fullname */ _("Hagar")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 1 0',
/* model */ "hlac",
+/* crosshair */ "gfx/crosshairhlac",
/* netname */ "hlac",
/* fullname */ _("Heavy Laser Assault Cannon")
);
/* rating */ 0,
/* color */ '0 0.5 0',
/* model */ "hookgun",
+/* crosshair */ "gfx/crosshairhook",
/* netname */ "hook",
/* fullname */ _("Grappling Hook")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 1 0',
/* model */ "uzi",
+/* crosshair */ "gfx/crosshairuzi",
/* netname */ "uzi",
/* fullname */ _("Machine Gun")
);
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.75 1 0',
/* model */ "minelayer",
+/* crosshair */ "gfx/crosshairminelayer",
/* netname */ "minelayer",
/* fullname */ _("Mine Layer")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '1 0 0',
/* model */ "gl",
+/* crosshair */ "gfx/crosshairgrenadelauncher",
/* netname */ "grenadelauncher",
/* fullname */ _("Mortar")
);
/* rating */ 0,
/* color */ '0.5 0.5 0.5',
/* model */ "porto" ,
+/* crosshair */ "gfx/crosshairporto",
/* netname */ "porto",
/* fullname */ _("Port-O-Launch")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0.5 1 0',
/* model */ "campingrifle",
+/* crosshair */ "gfx/crosshairrifle",
/* netname */ "rifle",
/* fullname */ _("Rifle")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0.5 1 0',
/* model */ "seeker",
+/* crosshair */ "gfx/crosshairseeker",
/* netname */ "seeker",
/* fullname */ _("T.A.G. Seeker")
);
/* rating */ BOT_PICKUP_RATING_LOW,
/* color */ '0.5 0.25 0',
/* model */ "shotgun",
+/* crosshair */ "gfx/crosshairshotgun",
/* netname */ "shockwave",
/* fullname */ _("Shockwave")
);
/* rating */ BOT_PICKUP_RATING_LOW,
/* color */ '0.5 0.25 0',
/* model */ "shotgun",
+/* crosshair */ "gfx/crosshairshotgun",
/* shortname */ "shotgun",
/* fullname */ _("Shotgun")
);
/* rating */ BOT_PICKUP_RATING_MID,
/* color */ '0 1 0',
/* model */ "tuba",
+/* crosshair */ "gfx/crosshairtuba",
/* netname */ "tuba",
/* xgettext:no-c-format */
/* fullname */ _("@!#%'n Tuba")
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.5 1 1',
/* model */ "minstanex",
+/* crosshair */ "gfx/crosshairminstanex",
/* netname */ "minstanex",
/* fullname */ _("Vaporizer")
);
/* rating */ BOT_PICKUP_RATING_HIGH,
/* color */ '0.5 1 1',
/* model */ "nex",
+/* crosshair */ "gfx/crosshairnex 0.65",
/* netname */ "nex",
/* fullname */ _("Vortex")
);
float pickupbasevalue,
vector clr,
string modelname,
+ string crosshair,
string shortname,
string wname)
{
e.bot_pickupbasevalue = pickupbasevalue;
e.ammo_field = ammotype;
+ // WEAPONTODO: reorganize this
+
+ e.w_crosshair = strzone(car(crosshair));
+ string s = cdr(crosshair);
+ e.w_crosshair_size = ((s != "") ? stof(s) : 1);
+
+ printf("wtf: '%s', '%s', %f.\n", car(crosshair), s, e.w_crosshair_size);
+
#ifndef MENUQC
func(WR_INIT);
#endif
dummy_weapon_info.bot_pickupbasevalue = 0;
dummy_weapon_info.ammo_field = ammo_none;
+ dummy_weapon_info.w_crosshair = "gfx/crosshair1";
+ dummy_weapon_info.w_crosshair_size = 1;
+
float i;
weaponorder_byid = "";
for(i = WEP_MAXCOUNT; i >= 1; --i)
float pickupbasevalue,
vector clr,
string modelname,
+ string crosshair,
string shortname,
string wname);
.string model2; // A: wpn-id // wpn- sprite name
.string mdl; // M: model // modelname without g_, v_, w_
.string model; // A: model // full name of g_ model
+.string w_crosshair;
+.float w_crosshair_size;
.string netname; // M: refname // reference name name
.string message; // M: fullname // human readable name
+
// note: the fabs call is just there to hide "if result is constant" warning
-#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,model,refname,wepname) \
+#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname) \
float id; \
WepSet bit; \
float function(float); \
if((flags) & WEP_FLAG_SUPERWEAPON) \
WEPSET_SUPERWEAPONS |= bit; \
++WEP_COUNT; \
- register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,model,refname,wepname); \
+ register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname); \
} \
ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id)
#ifdef MENUQC
-#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,model,refname,wepname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,model,refname,wepname)
+#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname)
#else
-#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,model,refname,wepname) \
- REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,model,refname,wepname)
+#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname) \
+ REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,model,crosshair,refname,wepname)
#endif
#include "all.qh"