From 8ef4b126f44bf2a00aee14897f5805e6d959c19a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 23:00:50 +0000 Subject: [PATCH] Maintenance: Replace raw address calls in CUIGroupSkin::Slot15: 0x00A1E250 (fn_15382, unported, thiscall retn 0Ch) -> declared CUICom Batch #8902 by ragnarok-clanker: forced by an admin (0 lower score(s), 1 changed function(s)); checked with 4 compiled unit(s), including every includer of Source/UI/GameSettings/GameSettingsUI.h. --- Source/UI/GameSettings/GameSettingsUI.cpp | 11 +++++++---- Source/UI/GameSettings/GameSettingsUI.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index 43d7447d..8a7f0437 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -26,7 +26,9 @@ #include "UI/Text/UIStaticTextControl.h" #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Window/UIRoulletteWnd.h" +#include "UI/Lists/UIDropDownBox.h" #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowOrdering.h" #include "UI/Window/WindowBorder.h" #include "Utility/Cipher/XorBytes.h" #include "Utility/Text/StringUtil.h" @@ -160,7 +162,7 @@ void GameSettingsUI::CUIGroupSkin::Slot15(int width, int height) { this->AddChild(this->m_title); this->m_combo = new CUIComboBox(*this->m_context); - reinterpret_cast*, int, int, int)>(0x00A1E250)(this->m_combo, 162, 16, 5); + this->m_combo->Create(162, 16, 5); CUIComboBox* combo = this->m_combo; const std::uint8_t disabledSource[] = {0x0F, 0x74, 0x11, 0xEF, 0x59, 0xE1, 0xAA, 0xDE, 0x09, 0x3F, 0x11, 0xD9, 0x24, 0x95, 0x33, 0x71, 0xAE, 0xA8, 0xB8, 0x76, 0xC6, 0x46, 0x01, 0x67, 0xAA, 0xA9, 0xB7, 0x74, 0xFA, 0x4A, 0x33, 0x67, 0xB7, 0xAF, 0xB3, 0x7A, 0xE1, 0x70, 0x0D, 0x67, 0xA1, 0x84, 0xB0, 0x3B, 0xFB, 0x42, 0x1F, 0x13}; thread_local EncryptedName disabledImage(disabledSource); @@ -186,18 +188,19 @@ void GameSettingsUI::CUIGroupSkin::Slot15(int width, int height) { combo->unknown_0088->Move(combo->geometry.width - 18, 0); combo->unknown_0088->SetImages(normalName, hoverName, pressedName, disabledName); combo->unknown_0088->SetOnClick([combo]() { - if (!reinterpret_cast(0x00A8C750)(&g_windowMgr)) { + WindowDropDown dropDown{*reinterpret_cast(nullptr), reinterpret_cast(g_windowMgr), reinterpret_cast(g_windowMgr.window_0A30)}; + if (!dropDown.Close()) { int x = 0; int y = combo->geometry.height - 1; combo->ToScreen(x, y); - reinterpret_cast(0x00AA27B0)(&g_windowMgr, combo, combo->listBox, x, y); + dropDown.Show(combo, combo->listBox, x, y); } }); combo->AddChild(combo->unknown_0088); } combo->Move(110, 9); - combo->onSelect = [this](CUIComboItem*, const std::string&) { reinterpret_cast(0x00A3FB50)(this); }; + combo->onSelect = [this](CUIComboItem* item, const std::string& name) { this->OnSelect(item, name); }; const std::function binder = [this](CUIComboItem* item, const std::string& name) { SetComboItemSkinText(item, name); }; diff --git a/Source/UI/GameSettings/GameSettingsUI.h b/Source/UI/GameSettings/GameSettingsUI.h index dff6e35a..e052de00 100644 --- a/Source/UI/GameSettings/GameSettingsUI.h +++ b/Source/UI/GameSettings/GameSettingsUI.h @@ -39,6 +39,7 @@ public: int AddItem(const D& value, bool refresh); unsigned int Selected() const; __declspec(noinline) void UpdateListHeight(); + void Create(int width, int itemHeight, int visibleItems); /* 0084 */ int unknown_0084; /* 0088 */ CUIImageButton* unknown_0088;