fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_bg_color_team \"", cvar_string("hud_bg_color_team"), "\"", "\n"));
fputs(fh, strcat("seta hud_bg_alpha \"", cvar_string("hud_bg_alpha"), "\"", "\n"));
fputs(fh, strcat("seta hud_bg_border \"", cvar_string("hud_bg_border"), "\"", "\n"));
fputs(fh, strcat("seta hud_bg_padding \"", cvar_string("hud_bg_padding"), "\"", "\n"));
fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
fputs(fh, strcat("seta hud_dock_color \"", cvar_string("hud_dock_color"), "\"", "\n"));
+ fputs(fh, strcat("seta hud_dock_color_team \"", cvar_string("hud_dock_color_team"), "\"", "\n"));
fputs(fh, strcat("seta hud_dock_alpha \"", ftos(cvar("hud_dock_alpha")), "\"", "\n"));
fputs(fh, "\n");
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_size \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_size")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color")), "\"", "\n"));
+ fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color_team \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color_team")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_alpha \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_alpha")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_border \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_border")), "\"", "\n"));
fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_padding \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_padding")), "\"", "\n"));
float f;
vector color_vec;
string color;
- color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
+
+ // fetch per-panel color
+ if(teamplay && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")) != "") {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color = vtos(colormapPaletteColor(mod(f, 16), 1) * cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")));
+ }
+ else
+ color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
color_vec = stov(color);
- if(color == "") {
+
+ if(color == "") { // fetch default color
color = cvar_string("hud_bg_color");
color_vec = stov(color);
- if(color == "shirt") {
+ if(teamplay && cvar(strcat("hud_bg_color_team"))) {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_bg_color_team");
+ }
+ else if(color == "shirt") {
f = stof(getplayerkey(self.sv_entnum, "colors"));
color_vec = colormapPaletteColor(floor(f / 16), 0);
}
string color;
color = cvar_string("hud_dock_color");
color_vec = stov(color);
- if(color == "shirt") {
+ if(teamplay && cvar(strcat("hud_dock_color_team"))) {
+ f = stof(getplayerkey(self.sv_entnum, "colors"));
+ color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_dock_color_team");
+ }
+ else if(color == "shirt") {
f = stof(getplayerkey(self.sv_entnum, "colors"));
color_vec = colormapPaletteColor(floor(f / 16), 0);
}
// Notification area (#4)
//
-string Weapon_SuicideMessage(float id)
+string Weapon_SuicideMessage(float deathtype)
{
- switch (id)
+ float w;
+ w = DEATH_WEAPONOF(deathtype);
+
+ switch (w)
{
case 1:
return "lasered himself to hell";
case 3:
return "did the impossible";
case 4:
- if(id & HITTYPE_SECONDARY)
+ if(deathtype & HITTYPE_SECONDARY)
return "tried out his own grenade";
return "detonated";
}
// TODO: was blasted by?
- return strcat("[no kill message for weapon ", ftos(id), "!]");
+ return strcat("[no kill message for weapon ", ftos(w), "!]");
}
-string Weapon_KillMessage(float id)
+string Weapon_KillMessage(float deathtype)
{
- switch (id)
+ float w;
+ w = DEATH_WEAPONOF(deathtype);
+
+ switch (w)
{
case 1:
return "was lasered to death by";
return "didn't see #'s grenade";
return "almost dodged #'s grenade";
}
- return strcat("[no suicide message for weapon ", ftos(id), "!]");
+ return strcat("[no suicide message for weapon ", ftos(w), "!]");
}
float killnotify_times[10];
if(msg == MSG_SUICIDE) {
// TODO: cl_gentle
// TODO: way of finding out secondary?
- if(type == DEATH_WEAPON) {
- HUD_KillNotify_Push(s1, "", stof(s3));
+ print("deathtype: ", ftos(type), "\n");
+
+ float w;
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ HUD_KillNotify_Push(s1, "", w);
if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
- print("^1", s1, "^1 ", Weapon_SuicideMessage(stof(s3)), "\n");
+ print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
}
else if (type == DEATH_KILL)
print ("^1",s1, "^1 couldn't take it anymore\n");
if (stof(s2) > 2) // killcount > 2
print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
} else if(msg == MSG_KILL) {
- if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
+ print("deathtype: ", ftos(type), "\n");
+
+ float w;
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ HUD_KillNotify_Push(s1, s2, w);
+ if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
+ print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+ }
+ else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
if(cvar("cl_gentle")) {
print ("^1", s1, "^1 took action against a team mate\n");
} else {
}
else if(type == KILL_FIRST_BLOOD)
print("^1",s1, "^1 drew first blood", "\n");
- else if (type == DEATH_WEAPON) {
- HUD_KillNotify_Push(s1, s2, stof(s3));
- if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
- print("^1", s1, "^1 ", Weapon_KillMessage(stof(s3)), "\n");
- }
else if (type == DEATH_TELEFRAG)
print ("^1",s1, "^1 was telefragged by ", s2, "\n");
else if (type == DEATH_DROWN)
hud_configure = cvar("_hud_configure");
// Drawing stuff
+
+ // HUD configure visible grid
+ if(hud_configure && cvar("hud_configure_grid") && cvar("hud_configure_grid_alpha"))
+ {
+ float i;
+ // x-axis
+ for(i = 0; i < vid_conwidth/cvar("hud_configure_grid_x"); ++i)
+ {
+ drawfill(eX * i * cvar("hud_configure_grid_x"), eX + eY * vid_conheight, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+ }
+ // y-axis
+ for(i = 0; i < vid_conheight/cvar("hud_configure_grid_y"); ++i)
+ {
+ drawfill(eY * i * cvar("hud_configure_grid_y"), eY + eX * vid_conwidth, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+ }
+ }
+
if(cvar_string("hud_dock") != "")
drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);