From: Lyberta Date: Mon, 11 Jun 2018 14:40:31 +0000 (+0300) Subject: GunGame: More polish. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3fa35126da2ef0fcb3dc529dc69b71d7ed9e9e3c;p=xonotic%2Fxonotic-data.pk3dir.git GunGame: More polish. --- diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 806caf72b..81dde5139 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -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, diff --git a/qcsrc/common/gamemodes/gamemode/gungame/sv_gungame.qc b/qcsrc/common/gamemodes/gamemode/gungame/sv_gungame.qc index 75448fec0..0a748964a 100644 --- a/qcsrc/common/gamemodes/gamemode/gungame/sv_gungame.qc +++ b/qcsrc/common/gamemodes/gamemode/gungame/sv_gungame.qc @@ -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 ======================================== diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index b4d14034d..eee8a3a1e 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -374,6 +374,8 @@ 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!"), "") @@ -692,6 +694,8 @@ 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!"), "") diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index 7982ee01f..5a254efdd 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -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) : "")) \ diff --git a/randomitems-gungame.cfg b/randomitems-gungame.cfg index d2ece2177..64b1a3b41 100644 --- a/randomitems-gungame.cfg +++ b/randomitems-gungame.cfg @@ -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."