From 5fdce3cf2030a693f5979fac379401a70af65ddc Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 01:29:23 +0000 Subject: [PATCH] Decompile fn_17216 (ToggleGameSettingsTab4) Batch #6642 by vinnyamancio: 0 byte-identical, 1 confirmed by peer review. - fn_17216 ToggleGameSettingsTab4: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, superintelligence, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/GameSettings/GameSettingsUI.cpp | 23 +++++++++++++++++++++++ Source/UI/GameSettings/GameSettingsUI.h | 1 + 2 files changed, 24 insertions(+) diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index 044837c3..297b8024 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -1278,6 +1278,12 @@ void CUIGameSettingsUI::sub_A421E0() { this->m_applyButton->Show(visible); } +// OFFSET: 0x00A41E10 +// FUNCTION: fn_45466 +void CUIGameSettingsUI::SelectTab4() { + this->m_tab->Select(static_cast(this->m_tab->FindChildById(4))); +} + // OFFSET: 0x00A41E50 // FUNCTION: fn_16004 void sub_A41E50(int option) { @@ -1358,3 +1364,20 @@ void GameSettingsUI::CUIGroupTextureDetailLevel::Slot16() { const char* text = LookupMessage(0x145); this->m_title->SetText(text, std::strlen(text)); } + +// OFFSET: 0x00AA2760 +// FUNCTION: fn_17216 +void ToggleGameSettingsTab4() { + UIWindow* window = g_windowMgr.LookupWindow(0x271E); + if (!window) { + window = g_windowMgr.EnsureWindow(0x271E); + } + + CUIGameSettingsUI* settings = static_cast(window); + if (settings->IsTab4Selected()) { + g_windowMgr.CloseWindow(0x271E); + return; + } + + settings->SelectTab4(); +} diff --git a/Source/UI/GameSettings/GameSettingsUI.h b/Source/UI/GameSettings/GameSettingsUI.h index 172a1033..8b45b069 100644 --- a/Source/UI/GameSettings/GameSettingsUI.h +++ b/Source/UI/GameSettings/GameSettingsUI.h @@ -247,6 +247,7 @@ public: void sub_A421E0(); void sub_A433D0(UIWindow* window); bool IsTab4Selected(); + void SelectTab4(); void sub_A43380(); void sub_A43390(); void sub_A433A0();