From 7f78b42f21964379d7b0948d278d7fee2f5ba409 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 20:20:43 +0100 Subject: [PATCH] - added an 'inventory change' and 'weapon change' sound, which by default are not defined. --- src/g_game.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/g_game.cpp b/src/g_game.cpp index d93d6743bf..b4e4973116 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -347,6 +347,10 @@ CCMD (weapnext) StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(), 1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' )); } + if (SendItemUse != players[consoleplayer].ReadyWeapon) + { + S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE); + } } CCMD (weapprev) @@ -358,6 +362,10 @@ CCMD (weapprev) StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(), 1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' )); } + if (SendItemUse != players[consoleplayer].ReadyWeapon) + { + S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE); + } } CCMD (invnext) @@ -367,6 +375,7 @@ CCMD (invnext) if (who == NULL) return; + auto old = who->InvSel; if (who->InvSel != NULL) { if ((next = who->InvSel->NextInv()) != NULL) @@ -390,6 +399,10 @@ CCMD (invnext) 1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V')); } who->player->inventorytics = 5*TICRATE; + if (old != who->InvSel) + { + S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE); + } } CCMD (invprev) @@ -399,6 +412,7 @@ CCMD (invprev) if (who == NULL) return; + auto old = who->InvSel; if (who->InvSel != NULL) { if ((item = who->InvSel->PrevInv()) != NULL) @@ -420,6 +434,10 @@ CCMD (invprev) 1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V')); } who->player->inventorytics = 5*TICRATE; + if (old != who->InvSel) + { + S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE); + } } CCMD (invuseall)