From 33dea24549cf4956b87302ef5aae1bfdfa8f4a88 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 17:33:19 +0000 Subject: [PATCH] Decompile fn_11954 (UIMinimapZoomWnd::UIMinimapZoomWnd) Batch #18663 by eAthena: 1 byte-identical, 0 confirmed by peer review. - fn_11954 UIMinimapZoomWnd::UIMinimapZoomWnd: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 16 +++++++--------- Source/UI/Navigation/UIMinimapZoomWnd.cpp | 4 +--- Source/UI/Navigation/UIMinimapZoomWnd.h | 5 ++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 8950526c9..a49e4175c 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -772,12 +772,11 @@ void UIMinimapZoomWnd::OnCreate(int, int) { const char* names[5] = {"object", "plus", "minus", "mini", "viewon"}; const std::string prefix("minimap\\i_"); - auto& buttons = *reinterpret_cast*>(&this->townButtonsStorage); - buttons.clear(); + this->m_buttons.clear(); for (int i = 0; i < 5; ++i) { const std::string name = prefix + names[i]; UIWindow* button = AddNumberedButtonInline(this, ids[i], xs[i], ys[i], name.c_str(), tooltips[i], true); - buttons.push_back(button); + this->m_buttons.push_back(button); } this->SendMsg(this, UM_COMMAND, 502, 0, 0, 0); @@ -831,7 +830,7 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } return 0; case 453: { - const auto it = this->m_zoom.find(static_cast(argument2)); + const auto it = this->m_zoom.find(argument2); if (it != this->m_zoom.end()) { static_cast(it->second)->Enable(1); it->second->Move(static_cast(argument3) - this->geometry.x, static_cast(argument4) - this->geometry.y); @@ -840,7 +839,7 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; } case 455: { - const auto it = this->m_zoom.find(static_cast(argument2)); + const auto it = this->m_zoom.find(argument2); if (it != this->m_zoom.end()) { static_cast(it->second)->Enable(0); } @@ -849,9 +848,8 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } case 502: { const unsigned char enabled = g_serviceOptions.Get(223); - const auto& buttons = *reinterpret_cast*>(&this->townButtonsStorage); - for (auto it = buttons.begin(); it != buttons.end(); ++it) { - static_cast(*it)->Enable(enabled); + for (UIWindow* button : this->m_buttons) { + static_cast(button)->Enable(enabled); } this->Invalidate(); break; @@ -859,7 +857,7 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } std::string mapName = static_cast(g_modeMgr.GetGameMode())->MapName(); - TownInfo town = g_townInfoMgr->GetTownInfo(mapName.c_str(), static_cast(argument1 - 1000)); + TownInfo town = g_townInfoMgr->GetTownInfo(mapName, static_cast(argument1 - 1000)); if (!town.image.empty()) { const std::size_t extension = mapName.find_first_of("."); if (extension != std::string::npos) { diff --git a/Source/UI/Navigation/UIMinimapZoomWnd.cpp b/Source/UI/Navigation/UIMinimapZoomWnd.cpp index d8c825e16..1b3e35930 100644 --- a/Source/UI/Navigation/UIMinimapZoomWnd.cpp +++ b/Source/UI/Navigation/UIMinimapZoomWnd.cpp @@ -5,6 +5,4 @@ UIMinimapZoomWnd::UIMinimapZoomWnd() : UIFrameWnd(0), m_zoom(), - townButtonsStorage(0), - townButtonsEnd(0), - townButtonsCapacity(0) {} + m_buttons() {} diff --git a/Source/UI/Navigation/UIMinimapZoomWnd.h b/Source/UI/Navigation/UIMinimapZoomWnd.h index 944e222eb..e2af620a4 100644 --- a/Source/UI/Navigation/UIMinimapZoomWnd.h +++ b/Source/UI/Navigation/UIMinimapZoomWnd.h @@ -4,6 +4,7 @@ #include "UI/Window/UIFrameWnd.h" #include +#include struct TownInfo; @@ -18,9 +19,7 @@ public: void AddTownButton(int index, TownInfo town); /* 00B4 */ std::map m_zoom; - /* 00BC */ int townButtonsStorage; - /* 00C0 */ int townButtonsEnd; - /* 00C4 */ int townButtonsCapacity; + /* 00BC */ std::vector m_buttons; }; #endif