From 2ad035ccbca72c7b95a3a62676887a1353064342 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 1 Mar 2013 01:51:54 -0500 Subject: [PATCH] Move weapon complain messages to notif system --- qcsrc/client/Main.qc | 10 +++++++++- qcsrc/common/notifications.qh | 23 ++++++++++++++++------- qcsrc/server/cl_weapons.qc | 2 +- qcsrc/server/cl_weaponsystem.qc | 4 +--- qcsrc/server/w_common.qc | 2 +- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 44c5c572a..94626f26d 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1127,7 +1127,8 @@ void Net_ReadPingPLReport() playerslots[e].ping_movementloss = ml / 255.0; } -void Net_WeaponComplain() { +void Net_WeaponComplain() +{ complain_weapon = ReadByte(); if(complain_weapon_name) @@ -1138,6 +1139,13 @@ void Net_WeaponComplain() { complain_weapon_time = time; weapontime = time; // ping the weapon panel + + switch(complain_weapon_type) + { + case 0: Local_Notification(MSG_MULTI, ITEM_WEAPON_NOAMMO, complain_weapon); break; + case 1: Local_Notification(MSG_MULTI, ITEM_WEAPON_DONTHAVE, complain_weapon); break; + default: Local_Notification(MSG_MULTI, ITEM_WEAPON_UNAVAILABLE, complain_weapon); break; + } } // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 11f731af1..99c4b3591 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -266,6 +266,11 @@ float CPID_KH_MSG = 10; MSG_INFO_NOTIF(1, INFO_FREEZETAG_FREEZE, 2, 0, "s1 s2", "", "", _("^BG%s^K1 was frozen by ^BG%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_FREEZETAG_SELF, 1, 0, "s1", "", "", _("^BG%s^K1 froze themself\n"), "") \ MSG_INFO_NOTIF(1, INFO_GODMODE_OFF, 0, 1, "f1", "", "", _("^BGGodmode saved you %s units of damage, cheater!\n"), "") \ + MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DONTHAVE, 0, 1, "item_wepname", "", "", _("^BGYou do not have the ^F1%s\n"), "") \ + MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DROP, 1, 1, "item_wepname item_wepammo", "", "", _("^BGYou dropped the ^F1%s^BG%s\n"), "") \ + MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_GOT, 0, 1, "item_wepname", "", "", _("^BGYou got the ^F1%s\n"), "") \ + MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_NOAMMO, 0, 1, "item_wepname", "", "", _("^BGYou don't have enough ammo for the ^F1%s\n"), "") \ + MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_UNAVAILABLE, 0, 1, "item_wepname", "", "", _("^BGThe ^F1%s^BG is ^F4not available^BG on this map\n"), "") \ MSG_INFO_NOTIF(2, INFO_JOIN_CONNECT, 1, 0, "s1", "", "", _("^BG%s^F3 connected%s\n"), "") \ MULTITEAM_INFO(2, INFO_JOIN_CONNECT_TEAM_, 4, 1, 0, "s1", "", "", _("^BG%s^F3 connected and joined the ^TC^TT\n"), "") \ MSG_INFO_NOTIF(2, INFO_JOIN_PLAY, 1, 0, "s1", "", "", _("^BG%s^F3 is now playing\n"), "") \ @@ -293,8 +298,6 @@ float CPID_KH_MSG = 10; MSG_INFO_NOTIF(2, INFO_VERSION_OLD, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s\n"), "") \ MSG_INFO_NOTIF(2, INFO_VERSION_OUTDATED, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^F1Xonotic %s^BG is out, and you still have ^F2Xonotic %s^BG - get the update from ^F3http://www.xonotic.org/^BG!\n"), "") \ MSG_INFO_NOTIF(1, INFO_WATERMARK, 1, 0, "s1", "", "", _("^F3SVQC Build information: ^F4%s\n"), "") \ - MSG_INFO_NOTIF(0, INFO_WEAPON_GOTWEP, 0, 1, "item_wepname", "", "", _("^BGYou got the ^F1%s\n"), "") \ - MSG_INFO_NOTIF(0, INFO_WEAPON_DROPPED, 1, 1, "item_wepname item_wepammo", "", "", _("^BGYou dropped the ^F1%s^BG%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_THINKING_WITH_PORTALS, 2, 1, "s1 s2loc spree_lost", "s1", "notify_selfkill", _("^BG%s^K1 is now thinking with portals%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_CRYLINK_SUICIDE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink%s%s\n"), "") \ MSG_INFO_NOTIF(1, INFO_WEAPON_CRYLINK_MURDER, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponcrylink", _("^BG%s%s^K1 felt the strong pull of ^BG%s^K1's Crylink%s%s\n"), "") \ @@ -428,6 +431,11 @@ float CPID_KH_MSG = 10; MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_SELF, 0, 0, "", NO_CPID, "0 0", _("^K1You froze yourself"), "") \ MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_FREEZE, 1, 0, "s1", NO_CPID, "0 0", _("^K3You froze ^BG%s"), "") \ MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_FROZEN, 1, 0, "s1", NO_CPID, "0 0", _("^K1You were frozen by ^BG%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_DONTHAVE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou do not have the ^F1%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_DROP, 1, 1, "item_wepname item_wepammo", CPID_ITEM, "item_centime 0", _("^BGYou dropped the ^F1%s^BG%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_GOT, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou got the ^F1%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_NOAMMO, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou don't have enough ammo for the ^F1%s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_UNAVAILABLE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGThe ^F1%s^BG is ^F4not available^BG on this map"), "") \ 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!"), "") \ @@ -458,9 +466,7 @@ float CPID_KH_MSG = 10; MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_AUTO, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGChanging team in ^COUNT"), "") \ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") \ MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_BEGINNING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") \ - MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") \ - MSG_CENTER_NOTIF(1, CENTER_WEAPON_GOTWEP, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou got the ^F1%s"), "") \ - MSG_CENTER_NOTIF(1, CENTER_WEAPON_DROPPED, 1, 1, "item_wepname item_wepammo", CPID_ITEM, "item_centime 0", _("^BGYou dropped the ^F1%s^BG%s"), "") + MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") #define MSG_MULTI_NOTIFICATIONS \ /*MSG_MULTI_NOTIF(1, MULTI_EMPTY, NO_MSG, NO_MSG)*/ \ @@ -527,8 +533,11 @@ float CPID_KH_MSG = 10; MSG_MULTI_NOTIF(1, DEATH_MURDER_VH_RAPT_DEATH, INFO_DEATH_MURDER_VH_RAPT_DEATH, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_VH_BUMB_GUN, INFO_DEATH_MURDER_VH_BUMB_GUN, NO_MSG) \ MSG_MULTI_NOTIF(1, DEATH_MURDER_VH_BUMB_DEATH, INFO_DEATH_MURDER_VH_BUMB_DEATH, NO_MSG) \ - MSG_MULTI_NOTIF(1, WEAPON_GOTWEP, INFO_WEAPON_GOTWEP, CENTER_WEAPON_GOTWEP) \ - MSG_MULTI_NOTIF(1, WEAPON_DROPPED, INFO_WEAPON_DROPPED, CENTER_WEAPON_DROPPED) \ + MSG_MULTI_NOTIF(1, ITEM_WEAPON_DONTHAVE, INFO_ITEM_WEAPON_DONTHAVE, CENTER_ITEM_WEAPON_DONTHAVE) \ + MSG_MULTI_NOTIF(1, ITEM_WEAPON_DROP, INFO_ITEM_WEAPON_DROP, CENTER_ITEM_WEAPON_DROP) \ + MSG_MULTI_NOTIF(1, ITEM_WEAPON_GOT, INFO_ITEM_WEAPON_GOT, CENTER_ITEM_WEAPON_GOT) \ + MSG_MULTI_NOTIF(1, ITEM_WEAPON_NOAMMO, INFO_ITEM_WEAPON_NOAMMO, CENTER_ITEM_WEAPON_NOAMMO) \ + MSG_MULTI_NOTIF(1, ITEM_WEAPON_UNAVAILABLE, INFO_ITEM_WEAPON_UNAVAILABLE, CENTER_ITEM_WEAPON_UNAVAILABLE) \ MSG_MULTI_NOTIF(1, WEAPON_THINKING_WITH_PORTALS, INFO_WEAPON_THINKING_WITH_PORTALS, CENTER_DEATH_SELF_GENERIC) \ MSG_MULTI_NOTIF(1, WEAPON_CRYLINK_SUICIDE, INFO_WEAPON_CRYLINK_SUICIDE, CENTER_DEATH_SELF_GENERIC) \ MSG_MULTI_NOTIF(1, WEAPON_CRYLINK_MURDER, INFO_WEAPON_CRYLINK_MURDER, NO_MSG) \ diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index 4259e3ba3..2a1297dc2 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -351,7 +351,7 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce) a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo); if not(a) return; - Send_Notification(NOTIF_ONE, self, MSG_MULTI, WEAPON_DROPPED, a, w); + Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_WEAPON_DROP, a, w); } // Bringed back weapon frame diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index f697d3689..f1e1ec906 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -728,8 +728,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) // Report Proper Weapon Status / Modified Weapon Ownership Message if (WEPSET_CONTAINS_AW(weaponsInMap, wpn)) { - sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") ); - Send_WeaponComplain (cl, wpn, W_Name(wpn), 1); + Send_WeaponComplain(cl, wpn, W_Name(wpn), 1); if(autocvar_g_showweaponspawns) { @@ -760,7 +759,6 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) else { Send_WeaponComplain (cl, wpn, W_Name(wpn), 2); - sprint(cl, strcat("The ^2", W_Name(wpn), "^7 is ^1NOT AVAILABLE^7 in this map\n") ); } play2(cl, "weapons/unavailable.wav"); diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index 13930dd75..e68a417e0 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -13,7 +13,7 @@ void W_GiveWeapon (entity e, float wep) if not(g_minstagib) if(other.classname == "player") - { Send_Notification(NOTIF_ONE, other, MSG_MULTI, WEAPON_GOTWEP, wep); } + { Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_WEAPON_GOT, wep); } self = oldself; } -- 2.39.2