]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
GunGame: More polish.
authorLyberta <lyberta@lyberta.net>
Mon, 11 Jun 2018 14:40:31 +0000 (17:40 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 11 Jun 2018 14:40:31 +0000 (17:40 +0300)
qcsrc/client/hud/panel/modicons.qc
qcsrc/common/gamemodes/gamemode/gungame/sv_gungame.qc
qcsrc/common/notifications/all.inc
qcsrc/common/notifications/all.qh
randomitems-gungame.cfg

index 806caf72b454147f85f01601f11edfe553af8e65..81dde51391fce86914a0a157dbf71aa8268129ca 100644 (file)
@@ -716,6 +716,9 @@ int gg_previous_weapon; ///< Previous weapon.
 string gg_previous_weapon_picture; ///< Previous weapon picture.
 float gg_weapon_change_time; ///< Time when the weapon changed.
 
+/// \brief Returns the picture of the weapon.
+/// \param[in] weapon Index of the weapon.
+/// \return Picture of the weapon.
 string GG_GetWeaponPicture(int weapon)
 {
        FOREACH(Weapons, it != WEP_Null,
index 75448fec05a3174517b5b6877970c59e1bea60df..0a748964ab991298a078d252beb29a68d56ee956 100644 (file)
@@ -137,8 +137,10 @@ void GunGame_GivePlayerWeapon(entity player)
        }
        entity weapon = GunGame_GetWeapon(level);
        STAT(WEAPONS, player) |= weapon.m_wepset;
-       centerprint(player, strcat("^3Level ", ftos(level + 1), ": ^2",
-               weapon.m_name));
+       Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_GUNGAME_NEW_LEVEL,
+               level + 1, weapon.m_id);
+       Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_GUNGAME_NEW_LEVEL,
+               level + 1, weapon.m_id);
 }
 
 //============================= Hooks ========================================
index b4d14034def463e93ce6747dc98bcb9bdac73c61..eee8a3a1e32463f3043adfc07457571fc98134f0 100644 (file)
 
     MSG_INFO_NOTIF(GODMODE_OFF,                             N_CONSOLE,  0, 1, "f1", "",         "",     _("^BGGodmode saved you %s units of damage, cheater!"), "")
 
+    MSG_INFO_NOTIF(GUNGAME_NEW_LEVEL,                       N_CONSOLE,  0, 2, "f1 item_wepname2", "", "", _("^BGYou are on level %s: ^F1%s"), "")
+
     MSG_INFO_NOTIF(ITEM_BUFF,                               N_CONSOLE,  1, 1, "s1 item_buffname", "",       "",     _("^BG%s^BG got the %s^BG buff!"), "")
     MSG_INFO_NOTIF(ITEM_BUFF_LOST,                          N_CONSOLE,  1, 1, "s1 item_buffname", "",       "",     _("^BG%s^BG lost the %s^BG buff!"), "")
     MSG_INFO_NOTIF(ITEM_BUFF_DROP,                          N_CONSOLE,  0, 1, "item_buffname", "",          "",     _("^BGYou dropped the %s^BG buff!"), "")
     MSG_CENTER_NOTIF(FREEZETAG_SELF,                    N_ENABLE,    0, 0, "",               CPID_Null,              "0 0",  _("^K1You froze yourself"), "")
     MSG_CENTER_NOTIF(FREEZETAG_SPAWN_LATE,              N_ENABLE,    0, 0, "",               CPID_Null,              "0 0",  _("^K1Round already started, you spawn as frozen"), "")
 
+    MSG_CENTER_NOTIF(GUNGAME_NEW_LEVEL,                 N_ENABLE,    0, 2, "f1 item_wepname2", CPID_Null,             "0 0",  _("^F2Level %s: ^F1%s"), "")
+
     MSG_CENTER_NOTIF(INVASION_SUPERMONSTER,             N_ENABLE,    1, 0, "s1",             CPID_Null,              "0 0",  _("^K1A %s has arrived!"), "")
 
     MSG_CENTER_NOTIF(ITEM_BUFF_DROP,                    N_ENABLE,    0, 1, "item_buffname",                      CPID_ITEM, "item_centime 0", _("^BGYou dropped the %s^BG buff!"), "")
index 7982ee01f73acfc3348bed12334f125d60af494e..5a254efdd21d0d03045272f74abeb3a7e204ff80 100644 (file)
@@ -431,6 +431,7 @@ string BUFF_NAME(int i);
        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,     "item_wepname",  Weapons_from(f1).m_name) \
+       ARG_CASE(ARG_CS_SV,     "item_wepname2",  Weapons_from(f2).m_name) \
        ARG_CASE(ARG_CS_SV,     "item_buffname", BUFF_NAME(f1)) \
        ARG_CASE(ARG_CS_SV,     "f3buffname",    BUFF_NAME(f3)) \
        ARG_CASE(ARG_CS_SV,     "item_wepammo",  (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \
index d2ece2177d519861ead510b54016678e6ff220e0..64b1a3b418c0cc00e1bb69e657116989dd87849b 100644 (file)
@@ -1,5 +1,8 @@
 // Random items mutator config for GunGame gamemode
 
+// This config is not executed by default, you may want to put it inside
+// sv_hook_gamestart_gg in your server.cfg.
+
 // Map items
 
 set g_random_items_health_probability 10 "Probability of random health items spawning in the map."