]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move "You got the foobar" and "you dropped the foobar" to notif system
authorSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 06:40:45 +0000 (01:40 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 06:40:45 +0000 (01:40 -0500)
qcsrc/common/notifications.qh
qcsrc/server/cl_weapons.qc
qcsrc/server/t_items.qc
qcsrc/server/w_common.qc

index f3f2d50d72e100bc6e6546e0d7d86c888f98583f..ee5b3687cb108dc954a6771500cb33b93604f534 100644 (file)
@@ -261,6 +261,8 @@ 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, "weapon", "",                                                                                     "",                                             _("^BGYou got the ^F1%s\n"), "") \
+       MSG_INFO_NOTIF(0, INFO_WEAPON_DROPPED,                                  1, 1, "weapon withammo", "",                                                            "",                                             _("^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"), "") \
@@ -423,10 +425,14 @@ 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_TIMEOUT_ENDING,                                      0, 1, "",                               CPID_TIMEOUT,                   "1 f1", _("^F4Timeout ends in ^COUNT"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_WEAPON_GOTWEP,                                       0, 1, "weapon",                         CPID_ITEM,                      "1 0", _("^BGYou got the ^F1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_WEAPON_DROPPED,                                      1, 1, "weapon withammo",        CPID_ITEM,                      "1 0", _("^BGYou dropped the ^F1%s^BG%s"), "")
 
 #define MSG_WEAPON_NOTIFICATIONS \
        /*MSG_WEAPON_NOTIF(1, WEAPON_EMPTY,                                                     NO_MSG,                                                                         NO_MSG)*/ \
+       MSG_WEAPON_NOTIF(1, WEAPON_GOTWEP,                                                      INFO_WEAPON_GOTWEP,                                                     CENTER_WEAPON_GOTWEP) \
+       MSG_WEAPON_NOTIF(1, WEAPON_DROPPED,                                                     INFO_WEAPON_DROPPED,                                            CENTER_WEAPON_DROPPED) \
        MSG_WEAPON_NOTIF(1, WEAPON_THINKING_WITH_PORTALS,                       INFO_WEAPON_THINKING_WITH_PORTALS,                      CENTER_DEATH_SELF_GENERIC) \
        MSG_WEAPON_NOTIF(1, WEAPON_CRYLINK_SUICIDE,                             INFO_WEAPON_CRYLINK_SUICIDE,                            CENTER_DEATH_SELF_GENERIC) \
        MSG_WEAPON_NOTIF(1, WEAPON_CRYLINK_MURDER,                                      INFO_WEAPON_CRYLINK_MURDER,                             NO_MSG) \
@@ -649,6 +655,7 @@ string arg_slot[NOTIF_MAX_ARGS];
        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",                       W_Name(f1)) \
+       ARG_CASE(ARG_CS_SV,                     "withammo",             (s1 != "" ? s1 : "")) \
        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)) \
index cea561451c9f180d8ea576cc16fc04c9d2ed9c05..e407640344b9dbc0b21920889685cfb291d62dfc 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_WEAPON, INFO_WEAPON_DROPPED, w, a);
+       Send_Notification(NOTIF_ONE, self, MSG_WEAPON, WEAPON_DROPPED, w, a);
 }
 
 // Bringed back weapon frame
index bf70da0286a837b98fb68fb2adbff927f8d30254..2ff925ca53d9fbf2ac2c05c103b85e4a0402e263 100644 (file)
@@ -639,7 +639,7 @@ float Item_GiveTo(entity item, entity player)
                        //      AnnounceTo(player, "ammo");
 
                        if (WEPSET_CONTAINS_EW(item, WEP_MINSTANEX))
-                               W_GiveWeapon (player, WEP_MINSTANEX, item.netname);
+                               W_GiveWeapon (player, WEP_MINSTANEX);
                        player.health = 100;
                }
 
@@ -709,7 +709,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                                        if(WEPSET_CONTAINS_AW(it, i))
-                                               W_GiveWeapon (player, i, item.netname);
+                                               W_GiveWeapon(player, i);
                        }
                }
 
index 67f5b3356b056b0d63c071877068247b87376897..565b33b40e2e7ea8764a090dea921c4b3ba1e685 100644 (file)
@@ -1,5 +1,5 @@
 
-void W_GiveWeapon (entity e, float wep, string name)
+void W_GiveWeapon (entity e, float wep)
 {
        entity oldself;
 
@@ -12,12 +12,8 @@ void W_GiveWeapon (entity e, float wep, string name)
        self = e;
 
        if not(g_minstagib)
-       if (other.classname == "player")
-       {
-               sprint (other, "You got the ^2");
-               sprint (other, name);
-               sprint (other, "\n");
-       }
+       if(other.classname == "player")
+               { Send_Notification(NOTIF_ONE, other, MSG_WEAPON, WEAPON_GOTWEP, wep); }
 
        self = oldself;
 }