centerprint_expire calls in vote.qc were useless since votes called aren't centerprinted anymore (there is the vote panel)
float CPID_GAME_STARTING = 7;
float CPID_TIMEOUT_COUNTDOWN = 8;
float CPID_MOTD = 9;
+float CPID_KH_MSG = 10;
// CSQC centerprint/notify message types
float MSG_SUICIDE = 0;
}
else {
//player may not join because of g_maxplayers is set
- centerprint_atprio(self, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
+ centerprint(self, PREVENT_JOIN_TEXT);
}
}
}
else {
//player may not join because of g_maxplayers is set
- centerprint_atprio(self, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
+ centerprint(self, PREVENT_JOIN_TEXT);
}
}
} else if( cmd == "selectteam" ) {
{
if(should)
{
- centerprint_atprio(p, CENTERPRIO_SHIELDING, "^3You are now ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Make some defensive scores before trying again.");
+ centerprint(p, "^3You are now ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Make some defensive scores before trying again.");
// TODO csqc notifier for this
}
else
{
- centerprint_atprio(p, CENTERPRIO_SHIELDING, "^3You are now free.\n\n^3Feel free to ^1try to capture^3 the flag again\n^3if you think you will succeed.");
+ centerprint(p, "^3You are now free.\n\n^3Feel free to ^1try to capture^3 the flag again\n^3if you think you will succeed.");
// TODO csqc notifier for this
}
p.ctf_captureshielded = should;
mymid = (self.absmin + self.absmax) * 0.5;
othermid = (other.absmin + other.absmax) * 0.5;
Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * captureshield_force);
- centerprint_atprio(other, CENTERPRIO_SHIELDING, "^3You are ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Get some defensive scores before trying again.");
+ centerprint(other, "^3You are ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Get some defensive scores before trying again.");
}
void ctf_flag_spawnstuff()
float weaponsInMap;
-void centerprint_atprio(entity e, float prio, string s);
-void centerprint_expire(entity e, float prio);
void centerprint(entity e, string s);
.float respawn_countdown; // next number to count
}
else
{
- centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3", admin_name(), ":\n\n^7", argv(2)));
+ centerprint(client, strcat("^3", admin_name(), ":\n\n^7", argv(2)));
sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", argv(2), "\n"));
}
print("Message sent to ", client.netname, "\n");
return -1;
}
-#define CENTERPRIO_POINT 1
-#define CENTERPRIO_SPAM 2
-#define CENTERPRIO_VOTE 4
-#define CENTERPRIO_NORMAL 5
-#define CENTERPRIO_SHIELDING 7
-#define CENTERPRIO_MAPVOTE 9
-#define CENTERPRIO_IDLEKICK 50
-#define CENTERPRIO_ADMIN 99
-.float centerprint_priority;
-.float centerprint_expires;
void Send_CSQC_Centerprint_Generic(entity e, float id, string s1, float duration, float countdown_num);
-void centerprint_atprio(entity e, float prio, string s)
-{
- if (intermission_running)
- if (prio < CENTERPRIO_MAPVOTE)
- return;
- if (time > e.centerprint_expires)
- e.centerprint_priority = 0;
- if (prio >= e.centerprint_priority)
- {
- e.centerprint_priority = prio;
- if (timeoutStatus == 2)
- e.centerprint_expires = time + (e.cvar_hud_panel_centerprint_time * TIMEOUT_SLOWMO_VALUE);
- else
- e.centerprint_expires = time + e.cvar_hud_panel_centerprint_time;
- // centerprint_builtin(e, s);
- Send_CSQC_Centerprint_Generic(e, 0, s, 0, 0);
- }
-}
-void centerprint_expire(entity e, float prio)
-{
- if (prio == e.centerprint_priority)
- {
- e.centerprint_priority = 0;
- // centerprint_builtin(e, "");
- Send_CSQC_Centerprint_Generic(e, 0, "", 0, 0);
- }
-}
void centerprint(entity e, string s)
{
- centerprint_atprio(e, CENTERPRIO_NORMAL, s);
+ Send_CSQC_Centerprint_Generic(e, 0, s, 0, 0);
}
// decolorizes and team colors the player name when needed
}
else if(!frag_attacker.ballcarried)
if(autocvar_g_keepaway_noncarrier_warn)
- centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
+ centerprint(frag_attacker, "Killing people while you don't have the ball gives no points!");
if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
//dprint(s, "\n");
+ // TODO limit centerprint spam and set the appropriated duration for each centerprinted msg
FOR_EACH_PLAYER(e)
if(clienttype(e) == CLIENTTYPE_REAL)
- centerprint_atprio(e, CENTERPRIO_SPAM, s);
+ Send_CSQC_Centerprint_Generic(e, CPID_KH_MSG, s, 2, 0); // duration > 1 works with all the messages
}
self.cnt -= 1;
}
{
if(head.team == kh_interferemsg_team)
if(head.kh_next)
- centerprint(head, "All keys are in your team's hands!\n\nMeet the other key carriers ^1NOW^7!");
+ Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, "All keys are in your team's hands!\n\nMeet the other key carriers ^1NOW^7!", 0, 0);
else
- centerprint(head, "All keys are in your team's hands!\n\nHelp the key carriers to meet!");
+ Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, "All keys are in your team's hands!\n\nHelp the key carriers to meet!", 0, 0);
else
- centerprint(head, strcat("All keys are in the ", ColoredTeamName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"));
+ Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, strcat("All keys are in the ", ColoredTeamName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"), 0, 0);
}
}
FOR_EACH_PLAYER(player)
if(clienttype(player) == CLIENTTYPE_REAL)
- centerprint_expire(player, CENTERPRIO_SPAM);
+ Send_CSQC_Centerprint_Generic(player, CPID_KH_MSG, "", 1, 0);
kh_tracking_enabled = TRUE;
}
FOR_EACH_PLAYER(player)
if(clienttype(player) == CLIENTTYPE_REAL)
- centerprint_expire(player, CENTERPRIO_SPAM);
+ Send_CSQC_Centerprint_Generic(player, CPID_KH_MSG, "", 1, 0);
for(i = 0; i < kh_teams; ++i)
{
return;
goto normal;
}
- return centerprint_atprio(self, CENTERPRIO_SPAM, specString); // TODO: convert to Send_CSQC_Centerprint_Generic(self, CPID_TIMEOUT_COUNTDOWN, ...
+ return centerprint(self, specString);
}
:normal
VoteDialog_UpdateHighlight(1);
print_to(e, "^1You accepted the vote.");
e.vote_vote = 1;
- centerprint_expire(e, CENTERPRIO_VOTE);
if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
VoteDialog_UpdateHighlight(2);
print_to(e, "^1You rejected the vote.");
e.vote_vote = -1;
- centerprint_expire(e, CENTERPRIO_VOTE);
if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
VoteDialog_UpdateHighlight(3);
print_to(e, "^1You abstained from your vote.");
e.vote_vote = -2;
- centerprint_expire(e, CENTERPRIO_VOTE);
if(!autocvar_sv_vote_singlecount) {
VoteCount();
}
FOR_EACH_CLIENT(player)
{
player.vote_vote = 0;
- centerprint_expire(player, CENTERPRIO_VOTE);
}
if(votecalled)