From 6ec679319e8baaf4936feabc0f65daa77a601104 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Tue, 9 Mar 2021 23:31:31 -0300 Subject: [PATCH] :triangular_flag_on_post: Add ini toggle for auto-equip item sounds. Disabled by default. --- Source/diablo.cpp | 2 ++ Source/diablo.h | 3 +++ Source/inv.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index a8b5ff5bc..1f42a48e4 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -403,6 +403,7 @@ static void SaveOptions() setIniInt("Audio", "Sound Volume", sgOptions.Audio.nSoundVolume); setIniInt("Audio", "Music Volume", sgOptions.Audio.nMusicVolume); setIniInt("Audio", "Walking Sound", sgOptions.Audio.bWalkingSound); + setIniInt("Audio", "Auto Equip Sound", sgOptions.Audio.bAutoEquipSound); #ifndef __vita__ setIniInt("Graphics", "Width", sgOptions.Graphics.nWidth); @@ -449,6 +450,7 @@ static void LoadOptions() sgOptions.Audio.nSoundVolume = getIniInt("Audio", "Sound Volume", VOLUME_MAX); sgOptions.Audio.nMusicVolume = getIniInt("Audio", "Music Volume", VOLUME_MAX); sgOptions.Audio.bWalkingSound = getIniBool("Audio", "Walking Sound", true); + sgOptions.Audio.bAutoEquipSound = getIniBool("Audio", "Auto Equip Sound", false); #ifndef __vita__ sgOptions.Graphics.nWidth = getIniInt("Graphics", "Width", DEFAULT_WIDTH); diff --git a/Source/diablo.h b/Source/diablo.h index 7a0890d3d..02cb32f0a 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -28,6 +28,9 @@ typedef struct AudioOptions { /** @brief Player emits sound when walking. */ bool bWalkingSound; + + /** @brief Automatically equipping items on pickup emits the equipment sound. */ + bool bAutoEquipSound; } AudioOptions; typedef struct GraphicsOptions { diff --git a/Source/inv.cpp b/Source/inv.cpp index 7f5a0ef4a..c852a4ace 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -773,7 +773,7 @@ bool AutoEquip(int playerNumber, const ItemStruct &item, int bodyLocation) plr[playerNumber].InvBody[bodyLocation] = item; - if (playerNumber == myplr) { + if (sgOptions.Audio.bAutoEquipSound && playerNumber == myplr) { PlaySFX(ItemInvSnds[ItemCAnimTbl[item._iCurs]]); }