From effac2c08043ca68366097809aef7e472ec0dba0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 04:54:47 +0000 Subject: [PATCH] Decompile fn_12754 (UIRoMapWnd::SendMsg) Batch #9239 by secret: 0 byte-identical, 1 confirmed by peer review. - fn_12754 UIRoMapWnd::SendMsg: logic confirmed by peer review Peer-reviewed-by: superintelligence, KWDev, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/UIRoMapWnd.cpp | 74 +++++++++++++++++++++++++++++++++ Source/UI/Window/UIRoMapWnd.h | 11 ++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index bf404fa9..5a8a4fb7 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -711,3 +711,77 @@ void CFlyingShipRouteInfo::BuildRoute(const std::vector& mapNames) } reinterpret_cast(&this->unknown_0034)[1] = 1; } + +// OFFSET: 0x00938FF0 +// FUNCTION: fn_12754 +int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { + switch (message) { + case 0: + if (sender == this->m_searchEdit) { + if (this->m_searchEdit->Length() > 0) { + this->SendMsg(this->m_searchEdit, 6, 321, 0, 0, 0); + return 0; + } + } + break; + case 6: + switch (argument1) { + case 192: + this->m_showLabels = !this->m_showLabels; + this->m_labelCheck->geometry.unknown_0030 = this->m_showLabels; + this->m_labelCheck->Invalidate(); + this->Invalidate(); + return 0; + case 200: + g_windowMgr.EnsureWindow(203); + if (g_navigationWindow) { + g_navigationWindow->SendMsg(nullptr, 6, 200, 0, 0, 0); + } + this->UpdateNavigationButtons(); + return 0; + case 201: + g_windowMgr.CloseWindow(140); + return 0; + case 321: + if (this->m_searchEdit->Length()) { + std::string name(this->m_searchEdit->Text()); + if (g_navigationManager.sub_B995D0(name, 0, true) == true) { + reinterpret_cast(this)->RefreshWorldMapLevels(); + } + } + return 0; + } + return 0; + case 39: + if (this->m_worldCombo == sender) { + g_worldViewMgr.currentWorld = argument1; + this->Invalidate(); + return 0; + } + if (argument1 >= 0 && static_cast(argument1) < this->unknown_01FC.size()) { + { + std::string name(g_worldViewMgr.CurrentWorld()->maps[this->unknown_0208]->fields[argument1]->name); + if (name.size() > 4) { + name.resize(name.size() - 4); + } + g_navigationMinimized = false; + g_navigationManager.sub_B995D0(name, 0, false); + if (g_windowMgr.LookupWindow(203)) { + static_cast(g_navigationWindow)->SelectRoute(0); + static_cast(g_navigationWindow)->SelectRouteNode(0); + } + this->UpdateNavigationButtons(); + } + this->Invalidate(); + return 0; + } + return 0; + case 60: + this->ClearRecords(); + this->RefreshPartyRecords(); + this->Invalidate(); + return 0; + } + + return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); +} diff --git a/Source/UI/Window/UIRoMapWnd.h b/Source/UI/Window/UIRoMapWnd.h index e907e774..638560fb 100644 --- a/Source/UI/Window/UIRoMapWnd.h +++ b/Source/UI/Window/UIRoMapWnd.h @@ -4,6 +4,8 @@ #include "Contents/FlyingShipRouteInfo.h" #include "Contents/WorldView/WorldViewData.h" #include "UI/Window/UIFrameWnd.h" +#include "UI/Edit/UIEditCtrl.h" +#include "UI/Navigation/UINavigationV4Wnd.h" #include #include @@ -57,6 +59,7 @@ public: void Slot27(int x, int y) override; void Slot31(int x, int y) override; void Slot33(int x, int y) override; + int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; void ClearRecords(); void ResetKafraBounds(); void UpdateNavigationButtons(); @@ -98,10 +101,14 @@ private: /* 0198 */ CFlyingShipRouteInfo m_flyingShipRoute2; /* 01E8 */ int m_mouseX; /* 01EC */ int m_mouseY; - /* 01F0 */ unsigned char unknown_01F0[0xC]; + /* 01F0 */ UIWindow* unknown_01F0; + /* 01F4 */ UIWindow* m_worldCombo; + /* 01F8 */ UIWindow* m_labelCheck; /* 01FC */ std::vector unknown_01FC; /* 0208 */ int unknown_0208; - /* 020C */ unsigned char unknown_020C[0xC]; + /* 020C */ UIWindow* unknown_020C; + /* 0210 */ UIWindow* unknown_0210; + /* 0214 */ UIEditCtrl* m_searchEdit; /* 0218 */ int m_kafraLeft; /* 021C */ int m_kafraTop; /* 0220 */ int m_kafraRight;