From: terencehill Date: Mon, 23 May 2011 22:23:40 +0000 (+0200) Subject: Get rid of the EOLS at the beginning of the messages, they no longer need, stop/finis... X-Git-Tag: xonotic-v0.5.0~221 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6f964ff41762dd2ccb8627aa54dc7e10070e1962;p=xonotic%2Fxonotic-data.pk3dir.git Get rid of the EOLS at the beginning of the messages, they no longer need, stop/finish some countdown better by sending one last message; stop displaying the MOTD too in the same way --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 45993d309..f0c359de4 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1815,92 +1815,90 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } } -#define DAMAGE_CENTERPRINT_SPACER NEWLINES - void HUD_Centerprint(string s1, string s2, float type, float msg) { float gentle; gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages); if(msg == MSG_SUICIDE) { if (type == DEATH_TEAMCHANGE) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("You are now on: %s"), s1))); + centerprint(strcat(sprintf(_("You are now on: %s"), s1))); } else if (type == DEATH_AUTOTEAMCHANGE) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1))); + centerprint(strcat(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(DAMAGE_CENTERPRINT_SPACER, _("^1Reconsider your tactics, camper!"))); + centerprint(strcat(_("^1Reconsider your tactics, camper!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Die camper!"))); + centerprint(strcat(_("^1Die camper!"))); } else if (type == DEATH_NOAMMO) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You are reinserted into the game for running out of ammo..."))); + centerprint(strcat(_("^1You are reinserted into the game for running out of ammo..."))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You were killed for running out of ammo..."))); + centerprint(strcat(_("^1You were killed for running out of ammo..."))); } else if (type == DEATH_ROT) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You need to preserve your health"))); + centerprint(strcat(_("^1You need to preserve your health"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You grew too old without taking your medicine"))); + centerprint(strcat(_("^1You grew too old without taking your medicine"))); } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Don't go against team mates!"))); + centerprint(strcat(_("^1Don't go against team mates!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Don't shoot your team mates!"))); + centerprint(strcat(_("^1Don't shoot your team mates!"))); } else if (type == DEATH_QUIET) { // do nothing } else { // generic message if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You need to be more careful!"))); + centerprint(strcat(_("^1You need to be more careful!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You killed your own dumb self!"))); + centerprint(strcat(_("^1You killed your own dumb self!"))); } } else if(msg == MSG_KILL) { if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1Moron! You went against %s, a team mate!"), s1))); + centerprint(strcat(sprintf(_("^1Moron! You went against %s, a team mate!"), s1))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1Moron! You fragged %s, a team mate!"), s1))); + centerprint(strcat(sprintf(_("^1Moron! You fragged %s, a team mate!"), s1))); } } else if (type == KILL_FIRST_BLOOD) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First score"))); + centerprint(strcat(_("^1First score"))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First blood"))); + centerprint(strcat(_("^1First blood"))); } } else if (type == KILL_FIRST_VICTIM) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First casualty"))); + centerprint(strcat(_("^1First casualty"))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First victim"))); + centerprint(strcat(_("^1First victim"))); } } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap... if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); + centerprint(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You typefragged ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2)); } } else if (type == KILL_TYPEFRAGGED) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); } } else if (type == KILL_FRAG) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^4You scored against ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^4You fragged ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2)); } } else { // generic message if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were scored against by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were fragged by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2)); } } } else if(msg == MSG_KILL_ACTION) { // TODO: invent more centerprints here? - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Watch your step!"))); + centerprint(strcat(_("^1Watch your step!"))); } } diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 04a1588e3..31dcf71a9 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -589,6 +589,7 @@ float MAX_SHOT_DISTANCE = 32768; #define CPID_ROUND_STARTING "\r6 " #define CPID_GAME_STARTING "\r7 " #define CPID_TIMEOUT_COUNTDOWN "\r8 " +#define CPID_MOTD "\r9 " // CSQC centerprint/notify message types float MSG_SUICIDE = 0; diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index 6072c1512..6c70e7e65 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -224,7 +224,6 @@ void Arena_Warmup() if(ca_players < required_ca_players) allowed_to_spawn = 1; - msg = NEWLINES; if(time < warmup && !inWarmupStage) { if (g_ca) @@ -263,7 +262,7 @@ void Arena_Warmup() { roundStartTime_prev = f; Announce("begin"); - centerprint(self, "^1Begin!\n"); + centerprint(self, strcat(CPID_ROUND_STARTING, "^1Begin!\n")); if(g_ca) { ca_players = 0; diff --git a/qcsrc/server/campaign.qc b/qcsrc/server/campaign.qc index 9a3654671..bca53cb4d 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("\n\n\n\n\n\n\n\n\n\n^1\n", title, "\n^3\n", campaign_longdesc[0], "\n\n^1press jump to enter the game")); + campaign_message = strzone(strcat("^1\n", title, "\n^3\n", campaign_longdesc[0], "\n\n^1press jump to enter the game")); strunzone(title); } diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 6df11cc02..a07c2e26e 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2440,7 +2440,7 @@ void LeaveSpectatorMode() bprint ("^4", self.netname, "^4 is playing now\n"); if(!autocvar_g_campaign) - centerprint(self,""); // clear MOTD + centerprint(self, CPID_MOTD); // clear MOTD return; } else { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 29fc297d5..73914d405 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -41,8 +41,6 @@ void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad Net_LinkEntity(e, FALSE, 0.2, Damage_DamageInfo_SendEntity); } -#define DAMAGE_CENTERPRINT_SPACER NEWLINES - float checkrules_firstblood; float yoda; @@ -647,7 +645,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage) { targ.armorvalue -= 1; - centerprint(targ, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(targ.armorvalue))); + centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue))); damage = 0; targ.hitsound += 1; attacker.hitsound += 1; // TODO change this to a future specific hitsound for armor hit @@ -659,7 +657,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if (targ != attacker) { if ((targ.health >= 1) && (targ.classname == "player")) - centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "Secondary fire inflicts no damage!")); + centerprint(attacker, "Secondary fire inflicts no damage!"); force = '0 0 0'; // keep mirrorforce attacker = targ; @@ -896,7 +894,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if(attacker.armorvalue > 0) { attacker.armorvalue = attacker.armorvalue - 1; - centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue))); + centerprint(attacker, strcat("^3Remaining extra lives: ",ftos(attacker.armorvalue))); attacker.hitsound += 1; } mirrordamage = 0; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 5a591e035..0eea40b15 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -283,7 +283,7 @@ float Item_GiveTo(entity item, entity player) { pickedup = TRUE; // play some cool sounds ;) - centerprint(player, "\n"); + centerprint(player, CPID_MINSTA_FINDAMMO); //clear countdown if (clienttype(player) == CLIENTTYPE_REAL) { if(player.health <= 5) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index f9321b8db..68aa07a39 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -484,12 +484,11 @@ void PrintWelcomeMessage(entity pl) { // TODO get rid of this too local string specString; - specString = NEWLINES; //if(time < game_starttime) //also show the countdown when being a spectator // specString = strcat(specString, "\n\n^1Game starts in ", ftos(ceil(game_starttime - time)), " seconds^7"); //else if (timeoutStatus != 0) - specString = strcat(specString, "\n\n", getTimeoutText(1)); + specString = getTimeoutText(1); else { if(self.classname == "player") @@ -536,7 +535,7 @@ void PrintWelcomeMessage(entity pl) local string versionmessage; versionmessage = GetClientVersionMessage(); - s = strcat(s, NEWLINES, "This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage); + s = strcat(CPID_MOTD, "This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage); s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n"); if(modifications != "")