diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index 2bccf397e..4e5bc7175 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -1,5 +1,6 @@ #include "UI/GameSettings/GameSettingsUI.h" #include "Client/Mode/ModeMgr.h" +#include "Client/Session.h" #include "Contents/Configuration/ServiceOptions.h" #include "Contents/Hotkeys/HotkeyInfo.h" #include "Contents/MessageTable.h" @@ -21,7 +22,6 @@ #include "UI/Window/WindowBorder.h" #include "Utility/Cipher/XorBytes.h" #include "Utility/Text/StringUtil.h" - #include #include #include @@ -1733,3 +1733,37 @@ void GameSettingsUI::CUIGroupLogInOut::Slot16() { const char* tooltipText = tooltip.Text(); this->m_title->SetTooltip(tooltipText, std::strlen(tooltipText)); } + +// OFFSET: 0x00A1A320 + +// OFFSET: 0x00A1A480 + +// OFFSET: 0x00A1A5E0 + +// OFFSET: 0x00A1F890 + +// OFFSET: 0x00A3F9E0 + +// OFFSET: 0x00A41910 + +// OFFSET: 0x00A40560 +// FUNCTION: fn_15976 +void GameSettingsUI::CUIGroupSound::Apply() { + const std::uint8_t bgmVolumeSource[] = {0xCD, 0xDA, 0x82, 0xD8, 0x2B, 0xAA, 0xC1, 0x00, 0xE2, 0xD8, 0xEF}; + thread_local EncryptedName bgmVolumeName(bgmVolumeSource); + this->SetBgmVolume(g_session.GetDefaultOptionValue(bgmVolumeName.Text(), 100)); + const std::uint8_t bgmSource[] = {0x42, 0xD9, 0xF2, 0x40, 0x93}; + thread_local EncryptedName bgmName(bgmSource); + this->SetBgmEnabled(g_session.GetDefaultOptionValue(bgmName.Text(), 1) != 0); + const std::uint8_t effectVolumeSource[] = {0x8C, 0x93, 0x39, 0xEE, 0xEC, 0xA1, 0xE4, 0x75, 0xA6, 0x99, 0x2A, 0xE6, 0xEA, 0xD5}; + thread_local EncryptedName effectVolumeName(effectVolumeSource); + this->SetEffectVolume(g_session.GetDefaultOptionValue(effectVolumeName.Text(), 100)); + const std::uint8_t effectSource[] = {0xA8, 0x60, 0x04, 0x0A, 0x57, 0x6D, 0x71}; + thread_local EncryptedName effectName(effectSource); + const int effect = g_session.GetDefaultOptionValue(effectName.Text(), 1); + const bool muted = effect == 0; + this->m_effectSlider->SetTransparent(muted); + this->m_effectSlider->dragging = muted; + this->m_effectSlider->Invalidate(); + g_serviceOptions.Set(0xB, effect != 0); +} diff --git a/Source/UI/GameSettings/GameSettingsUI.h b/Source/UI/GameSettings/GameSettingsUI.h index 29e7daea4..82e08495c 100644 --- a/Source/UI/GameSettings/GameSettingsUI.h +++ b/Source/UI/GameSettings/GameSettingsUI.h @@ -88,6 +88,7 @@ public: void LoadAdapters(); void LoadModes(); void OnAdapterSelect(CUIComboItem* item, const RenderAdapter& adapter); + void OnModeSelect(CUIComboItem* item, const DisplayMode& mode); /* 0084 */ CUIComboBox* m_adapterCombo; /* 0088 */ CUIStaticText* m_modeText; @@ -155,6 +156,7 @@ public: class CUIGroupSkin : public CUIGroup { public: void Slot15(int width, int height) override; + void Slot16() override; void Apply() override; void Refresh() override; @@ -164,6 +166,7 @@ public: class CUIGroupSound : public CUIGroup { public: void Slot16() override; + void Apply() override; void Paint() override; void Refresh() override; __declspec(noinline) void SetBgmEnabled(bool enabled); @@ -247,6 +250,7 @@ public: class CUIComboItem : public CUIListItem { public: + void Slot15(int width, int height) override; void Slot16() override; /* 00E8 */ CUIStaticText* m_text;