From 02aad8c15e1a7c31880d0c29fe4ca77e5ae92884 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 08:53:40 +0000 Subject: [PATCH] Decompile 10 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Party/UIRegisterPartyWnd.cpp, ... Batch #13159 by KWDev: 10 byte-identical, 0 confirmed by peer review. - fn_11417 UIItemTagButton::Slot25: byte-identical - fn_10210 UIRuneSystem_tagListWnd::Slot28: byte-identical - fn_12642 UINavigationHelpWnd::Slot15: byte-identical - fn_09290 UIRegisterPartyWnd::NormalizeLevels: byte-identical - fn_03560 UIWindow::Slot44: byte-identical - fn_03637 UINavigationV4Wnd::SelectRouteNode: byte-identical - fn_16152 ProbabilityTableSelectCallback::operator(): byte-identical - fn_16715 ListSelectCallback::operator(): byte-identical - fn_16716 ListSelectCallback::operator(): byte-identical - fn_16835 SkillDelayInfoSelectCallback::operator(): byte-identical Merged automatically: every function is byte-identical to the original. --- Source/UI/Buttons/UITextButton.cpp | 2 +- Source/UI/Party/UIRegisterPartyWnd.cpp | 2 +- .../ProbabilityTable/UIProbabilityTable.cpp | 9 ++++--- Source/UI/RuneSystem/UIRuneSystemWnd.cpp | 4 +-- .../UISelectPackageItemBox.cpp | 14 +++++----- Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp | 7 ++--- Source/UI/Window/UINavigationHelpWnd.cpp | 26 +++++++++---------- Source/UI/Window/UIWindow.cpp | 8 +++--- 8 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index dcbc916bf..fbbbd9015 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -2916,7 +2916,7 @@ void UIItemTagButton::Slot25(int x, int y) { return; } - if (x < 0 || this->geometry.width <= x || y < 0 || this->geometry.height <= y) { + if (x < 0 || x >= this->geometry.width || y < 0 || y >= this->geometry.height) { this->geometry.unknown_0030 = 0; } else { this->geometry.unknown_0030 = 1; diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index df3490526..5d5fddd80 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -221,7 +221,7 @@ void UIRegisterPartyWnd::NormalizeLevels() { if (!Digits(text)) { char number[10] = {}; - StringFormat(number, sizeof(number), _TRUNCATE, "%d", std::max(level - 5, 1)); + StringFormat(number, sizeof(number), _TRUNCATE, "%d", level - 5 > 1 ? level - 5 : 1); this->minimum->SetText(number); } diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index 4c319b745..dc46daf53 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -109,11 +109,12 @@ void ProbabilityTableSelectCallback::operator()(CUIListItem* const& item) { if (selectedItem->index != static_cast(list->selected) || !list->unknown_00E0) { ProbabilityTable::CUIItem* probabilityItem = dynamic_cast(selectedItem); if (probabilityItem) { - list->selected = probabilityItem->index; - if (list->onSelect && probabilityItem->index >= 0 && - static_cast(probabilityItem->index) < list->data.size()) { + const int selectedIndex = probabilityItem->index; + list->selected = selectedIndex; + if (list->onSelect && selectedIndex >= 0 && + static_cast(selectedIndex) < list->data.size()) { auto node = list->data.begin(); - for (int index = probabilityItem->index; index > 0; --index) { + for (int index = selectedIndex; index > 0; --index) { ++node; } list->onSelect(probabilityItem, *node); diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 31686ba99..819ba686e 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -442,12 +442,12 @@ void UIRuneSet_Info::Slot28(int x, int y) { // OFFSET: 0x0081C960 // FUNCTION: fn_10210 void UIRuneSystem_tagListWnd::Slot28(int x, int) { - if (x < 20 || x > this->geometry.width - 23) { + if (x < 20 || this->geometry.width - 23 < x) { return; } const int index = (x - 20) / 27; - if (index > -1 && index < g_runeSystemMgr->GetTagCount()) { + if (index > -1 && g_runeSystemMgr->GetTagCount() > index) { std::string name = g_runeSystemMgr->GetTagByIndex(index)->m_name; if (!name.empty()) { int screenX = index * 24 + 19; diff --git a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp index b61251c18..80dcd1104 100644 --- a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp +++ b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp @@ -477,10 +477,11 @@ void ListSelectCallback::operator( return; } - list->selected = selectedItem->index; - if (list->onSelect && selectedItem->index >= 0 && static_cast(selectedItem->index) < list->data.size()) { + const int selectedIndex = selectedItem->index; + list->selected = selectedIndex; + if (list->onSelect && selectedIndex >= 0 && static_cast(selectedIndex) < list->data.size()) { auto node = list->data.begin(); - for (int index = selectedItem->index; index > 0; --index) { + for (int index = selectedIndex; index > 0; --index) { ++node; } list->onSelect(selectedItem, *node); @@ -513,10 +514,11 @@ void ListSelectCallbackselected = selectedTab->index; - if (list->onSelect && selectedTab->index >= 0 && static_cast(selectedTab->index) < list->data.size()) { + const int selectedIndex = selectedTab->index; + list->selected = selectedIndex; + if (list->onSelect && selectedIndex >= 0 && static_cast(selectedIndex) < list->data.size()) { auto node = list->data.begin(); - for (int index = selectedTab->index; index > 0; --index) { + for (int index = selectedIndex; index > 0; --index) { ++node; } list->onSelect(selectedTab, *node); diff --git a/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp b/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp index 3ee5dac3d..d3b632e2e 100644 --- a/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp +++ b/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp @@ -393,10 +393,11 @@ void SkillDelayInfoSelectCallback::operator()(CUIListItem* const& item) { if (!delayItem) { return; } - list->selected = delayItem->index; - if (list->onSelect && delayItem->index >= 0 && static_cast(delayItem->index) < list->data.size()) { + const int selectedIndex = delayItem->index; + list->selected = selectedIndex; + if (list->onSelect && selectedIndex >= 0 && static_cast(selectedIndex) < list->data.size()) { auto node = list->data.begin(); - for (int index = delayItem->index; index > 0; --index) { + for (int index = selectedIndex; index > 0; --index) { ++node; } list->onSelect(delayItem, *node); diff --git a/Source/UI/Window/UINavigationHelpWnd.cpp b/Source/UI/Window/UINavigationHelpWnd.cpp index d3729cef1..a11a991d7 100644 --- a/Source/UI/Window/UINavigationHelpWnd.cpp +++ b/Source/UI/Window/UINavigationHelpWnd.cpp @@ -11,39 +11,39 @@ void UINavigationHelpWnd::Slot15(int width, int height) { this->m_viewer = new UITextViewer(); this->m_viewer->Configure(5, 22, width - 10, height - 27, 0); - this->m_viewer->backgroundRed = 0xd2; - this->m_viewer->backgroundGreen = 0xd2; this->m_viewer->backgroundBlue = 0xd2; + this->m_viewer->backgroundGreen = 0xd2; + this->m_viewer->backgroundRed = 0xd2; this->AddChild(this->m_viewer); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2241)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2242)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2243)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2244)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2245)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2246)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2247)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2248)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2249)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2250)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2251)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2252)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2253)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2254)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2255)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2256)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3216)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3217)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3218)), 0x30, 0, 0); diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 5325150f2..da75b9368 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -550,8 +550,7 @@ void UIWindow::Slot43() { // OFFSET: 0x005C4480 // FUNCTION: fn_03560 std::vector UIWindow::Slot44() { - std::vector result; - return result; + return std::vector(); } // OFFSET: 0x005C8F60 @@ -3448,8 +3447,9 @@ void UINavigationV4Wnd::SelectRouteNode(int node) { g_navigationManager.SelectNodeState(); } - this->unknown_00F0->selected = g_navigationManager.unknown_12C8; - this->unknown_00F0->Invalidate(); + UIListBox_NaviSearch* list = this->unknown_00F0; + list->selected = g_navigationManager.unknown_12C8; + list->Invalidate(); if (g_windowMgr.modal) { reinterpret_cast(g_windowMgr.modal)->RefreshWorldMapSelection(); }