]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move weapon complain messages to notif system
authorSamual Lenks <samual@xonotic.org>
Fri, 1 Mar 2013 06:51:54 +0000 (01:51 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 1 Mar 2013 06:51:54 +0000 (01:51 -0500)
qcsrc/client/Main.qc
qcsrc/common/notifications.qh
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/w_common.qc

index 44c5c572aaeb97f6cfdebe3aaba977493b747710..94626f26d566a62cffb6290ee05a5387956ad551 100644 (file)
@@ -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.
index 11f731af13eb4d4769b9cfdb3046bb58c74a09d9..99c4b35916ad0bf81cd2603650a3d285a3965c6b 100644 (file)
@@ -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) \
index 4259e3ba3724b5f1c5d09a48203705791872c3d2..2a1297dc2be398d5a204852f84c880e862c54820 100644 (file)
@@ -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
index f697d3689c6247ab40a060198244fb147ade1673..f1e1ec906cddbc855310a251cf7e318a87aa6b9d 100644 (file)
@@ -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");
index 13930dd7517cf1cf90a05508aa7d1dc0ccb6f09d..e68a417e00de6855f4bbfce117ce244b4de3a5f1 100644 (file)
@@ -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;
 }