From: Samual Lenks Date: Tue, 26 Feb 2013 20:36:45 +0000 (-0500) Subject: Nix messages too X-Git-Tag: xonotic-v0.7.0~62^2~23^2~104 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=63002dfdf36aad778a9257da37a0973f21b7e97a;p=xonotic%2Fxonotic-data.pk3dir.git Nix messages too --- diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 11d88cfc8..70e6c154d 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -378,8 +378,6 @@ float WATERLEVEL_SUBMERGED = 3; float MAX_SHOT_DISTANCE = 32768; //centerprint ID list -float CPID_CTF_CAPTURESHIELD = 2; -float CPID_NIX_WPNCHANGE = 4; float CPID_ROUND_STARTING = 6; float CPID_GAME_STARTING = 7; float CPID_TIMEOUT_COUNTDOWN = 8; diff --git a/qcsrc/common/items.qc b/qcsrc/common/items.qc index 0aebde0af..c961895d9 100644 --- a/qcsrc/common/items.qc +++ b/qcsrc/common/items.qc @@ -172,3 +172,13 @@ void W_RandomWeapons(entity e, float n) } WEPSET_COPY_EA(e, result); } + +string W_Name(float weaponid) +{ + return (get_weaponinfo(weaponid)).message; +} + +float W_AmmoItemCode(float wpn) +{ + return (get_weaponinfo(wpn)).items & IT_AMMO; +} diff --git a/qcsrc/common/items.qh b/qcsrc/common/items.qh index c20715d58..ba42d55ac 100644 --- a/qcsrc/common/items.qh +++ b/qcsrc/common/items.qh @@ -242,3 +242,7 @@ string W_FixWeaponOrder_AllowIncomplete(string order); string W_FixWeaponOrder_ForceComplete(string order); void W_RandomWeapons(entity e, float n); + +string W_Name(float weaponid); + +float W_AmmoItemCode(float wpn); diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 257e007ea..140b4adef 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -386,9 +386,11 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_DROPPED, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has dropped the ball!"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has picked up the ball!"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_WARN, 0, 0, "", CPID_KA_WARN, "0 0", _("^BGKilling people while you don't have the ball gives no points!"), "") \ - MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK, 0, 0, "", CPID_LMS_CAMP, "0 0", _("^K1Don't camp!"), "") \ - MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 9", _("^K1^COUNT^BG left to find some ammo!"), "") \ - MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 10", _("Get some ammo or you'll be dead in ^K1^COUNT^BG!"), _("Get some ammo! ^K1^COUNT^BG left!")) \ + MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK, 0, 0, "", CPID_LMS_CAMP, "0 0", _("^F2Don't camp!"), "") \ + MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \ + MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("Get some ammo! ^F4^COUNT^BG left!")) \ + MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN, 0, 2, "weapon", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON, 0, 1, "weapon", CPID_NIX, "0 0", _("^F2Active weapon: ^F1%s"), "") \ MSG_CENTER_NOTIF(1, CENTER_JOIN_NOSPAWNS, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1No spawnpoints available!\nHope your team can fix it..."), "") \ MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \ MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME, 0, 1, "f1time", CPID_OVERTIME, "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s ^F2minute(s) to the game!"), "") \ @@ -631,7 +633,7 @@ string arg_slot[NOTIF_MAX_ARGS]; ARG_CASE(ARG_CS_SV, "spree_inf", (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \ ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \ - ARG_CASE(ARG_CS_SV, "weapon_name", ftos(f1)) \ + ARG_CASE(ARG_CS_SV, "weapon", W_Name(f1)) \ ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \ ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \ ARG_CASE(ARG_CS_SV, "race_time", mmssss(f2)) \ diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 4df59a09a..cb40be914 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -158,16 +158,6 @@ float weapon_action(float wpn, float wrequest) return (get_weaponinfo(wpn)).weapon_func(wrequest); } -string W_Name(float weaponid) -{ - return (get_weaponinfo(weaponid)).message; -} - -float W_AmmoItemCode(float wpn) -{ - return (get_weaponinfo(wpn)).items & IT_AMMO; -} - .float savenextthink; void thrown_wep_think() { diff --git a/qcsrc/server/mutators/mutator_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index b492ee60e..d5f95bd30 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -96,7 +96,7 @@ void NIX_GiveCurrentWeapon() if(dt >= 1 && dt <= 5) self.nix_lastinfotime = -42; else - Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 0, 0); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_NIX_NEWWEAPON, nix_weapon); weapon_action(nix_weapon, WR_RESETPLAYER); @@ -118,7 +118,7 @@ void NIX_GiveCurrentWeapon() { self.nix_lastinfotime = dt; // initial value 0 should count as "not seen" if(dt >= 1 && dt <= 5) - Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^3%d^2 seconds until weapon change...\n\nNext weapon: ^3", W_Name(nix_nextweapon)), 1, dt); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_NIX_COUNTDOWN, nix_nextweapon, dt); } if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)