From: terencehill Date: Sun, 26 Jun 2011 11:59:38 +0000 (+0200) Subject: Cleanup: remove unneeded strcats, leading and trailing spaces and newlines from msgs X-Git-Tag: xonotic-v0.5.0~181 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=173b6dc5fcf44d36ed5f884cd807a5ea3a305b3d;p=xonotic%2Fxonotic-data.pk3dir.git Cleanup: remove unneeded strcats, leading and trailing spaces and newlines from msgs --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7bfc57e66..e49fd4911 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1841,34 +1841,34 @@ void HUD_Centerprint(string s1, string s2, float type, float msg) if (type == DEATH_TEAMCHANGE) { centerprint(strcat(sprintf(_("You are now on: %s"), s1))); } else if (type == DEATH_AUTOTEAMCHANGE) { - centerprint(strcat(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1))); + centerprint(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1)); } else if (type == DEATH_CAMP) { if(gentle) - centerprint(strcat(_("^1Reconsider your tactics, camper!"))); + centerprint(_("^1Reconsider your tactics, camper!")); else - centerprint(strcat(_("^1Die camper!"))); + centerprint(_("^1Die camper!")); } else if (type == DEATH_NOAMMO) { if(gentle) - centerprint(strcat(_("^1You are reinserted into the game for running out of ammo..."))); + centerprint(_("^1You are reinserted into the game for running out of ammo...")); else - centerprint(strcat(_("^1You were killed for running out of ammo..."))); + centerprint(_("^1You were killed for running out of ammo...")); } else if (type == DEATH_ROT) { if(gentle) - centerprint(strcat(_("^1You need to preserve your health"))); + centerprint(_("^1You need to preserve your health")); else - centerprint(strcat(_("^1You grew too old without taking your medicine"))); + centerprint(_("^1You grew too old without taking your medicine")); } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) - centerprint(strcat(_("^1Don't go against team mates!"))); + centerprint(_("^1Don't go against team mates!")); else - centerprint(strcat(_("^1Don't shoot your team mates!"))); + centerprint(_("^1Don't shoot your team mates!")); } else if (type == DEATH_QUIET) { // do nothing } else { // generic message if(gentle) - centerprint(strcat(_("^1You need to be more careful!"))); + centerprint(_("^1You need to be more careful!")); else - centerprint(strcat(_("^1You killed your own dumb self!"))); + centerprint(_("^1You killed your own dumb self!")); } } else if(msg == MSG_KILL) { if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { @@ -1879,15 +1879,15 @@ void HUD_Centerprint(string s1, string s2, float type, float msg) } } else if (type == KILL_FIRST_BLOOD) { if(gentle) { - centerprint(strcat(_("^1First score"))); + centerprint(_("^1First score")); } else { - centerprint(strcat(_("^1First blood"))); + centerprint(_("^1First blood")); } } else if (type == KILL_FIRST_VICTIM) { if(gentle) { - centerprint(strcat(_("^1First casualty"))); + centerprint(_("^1First casualty")); } else { - centerprint(strcat(_("^1First victim"))); + centerprint(_("^1First victim")); } } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap... if(gentle) { @@ -1916,7 +1916,7 @@ void HUD_Centerprint(string s1, string s2, float type, float msg) } } else if(msg == MSG_KILL_ACTION) { // TODO: invent more centerprints here? - centerprint(strcat(_("^1Watch your step!"))); + centerprint(_("^1Watch your step!")); } } diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index 4c82b3f34..61de86157 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -395,7 +395,7 @@ void Spawnqueue_Check() if (time > warntime) { FOR_EACH_PLAYER(self) - centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n")); + centerprint(self, "^1Need at least 1 player in each team to play CA"); warntime = time + 1; } return; @@ -405,7 +405,7 @@ void Spawnqueue_Check() next_round = time + 5; } else if((!redspawned && !bluespawned) || time - warmup > autocvar_g_ca_round_timelimit) { - FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n")); + FOR_EACH_CLIENT(self) centerprint(self, "^7Round tied"); next_round = time + 5; } @@ -415,14 +415,14 @@ void Spawnqueue_Check() if(redalive && !bluealive) { play2all("ctf/red_capture.wav"); - FOR_EACH_CLIENT(self) centerprint(self, "^1 RED ^7team wins the round.\n"); + FOR_EACH_CLIENT(self) centerprint(self, "^1RED ^7team wins the round"); TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, +1); stopalivecheck = TRUE; } else if(bluealive && !redalive) { play2all("ctf/blue_capture.wav"); - FOR_EACH_CLIENT(self) centerprint(self, "^4 BLUE ^7team wins the round.\n"); + FOR_EACH_CLIENT(self) centerprint(self, "^4BLUE ^7team wins the round"); TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, +1); stopalivecheck = TRUE; } diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index bca53cb4d..923950b50 100644 --- a/qcsrc/server/campaign.qc +++ b/qcsrc/server/campaign.qc @@ -108,7 +108,7 @@ void CampaignPreInit() title = campaign_shortdesc[0]; title = strzone(strcat("Level ", ftos(campaign_level + 1), ": ", title)); - campaign_message = strzone(strcat("^1\n", title, "\n^3\n", campaign_longdesc[0], "\n\n^1press jump to enter the game")); + campaign_message = strzone(strcat(title, "\n^3\n", campaign_longdesc[0], "\n\n^1press jump to enter the game")); strunzone(title); } diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index f3828adc2..5a3c42e3f 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -127,7 +127,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth // messages and sounds Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); - WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n")); + WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!")); sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) // scoring @@ -169,7 +169,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los // messages and sounds Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); - WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n")); + WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!")); sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) // scoring