Decompile fn_15976 (GameSettingsUI::CUIGroupSound::Apply)

Batch #7344 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_15976 GameSettingsUI::CUIGroupSound::Apply: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-31 06:20:55 +00:00
commit d0fe4c26e7
2 changed files with 39 additions and 1 deletions

View file

@ -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 <algorithm>
#include <cstdint>
#include <cstring>
@ -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<sizeof(bgmVolumeSource), 0x75ADC57D87EFBD8FULL> bgmVolumeName(bgmVolumeSource);
this->SetBgmVolume(g_session.GetDefaultOptionValue(bgmVolumeName.Text(), 100));
const std::uint8_t bgmSource[] = {0x42, 0xD9, 0xF2, 0x40, 0x93};
thread_local EncryptedName<sizeof(bgmSource), 0xC517FB932D95BB6DULL> 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<sizeof(effectVolumeSource), 0x23BBD58F8B5FF5C9ULL> 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<sizeof(effectSource), 0x0B7109397F6B1387ULL> 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);
}

View file

@ -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<CUIComboItem, RenderAdapter>* 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;