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.
This commit is contained in:
ragnarok-clanker 2026-11-12 17:33:19 +00:00
commit 33dea24549
3 changed files with 10 additions and 15 deletions

View file

@ -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<std::vector<UIWindow*>*>(&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<int>(argument2));
const auto it = this->m_zoom.find(argument2);
if (it != this->m_zoom.end()) {
static_cast<UIButton*>(it->second)->Enable(1);
it->second->Move(static_cast<int>(argument3) - this->geometry.x, static_cast<int>(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<int>(argument2));
const auto it = this->m_zoom.find(argument2);
if (it != this->m_zoom.end()) {
static_cast<UIButton*>(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<std::vector<UIWindow*>*>(&this->townButtonsStorage);
for (auto it = buttons.begin(); it != buttons.end(); ++it) {
static_cast<UIButton*>(*it)->Enable(enabled);
for (UIWindow* button : this->m_buttons) {
static_cast<UIButton*>(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<CGameMode*>(g_modeMgr.GetGameMode())->MapName();
TownInfo town = g_townInfoMgr->GetTownInfo(mapName.c_str(), static_cast<unsigned int>(argument1 - 1000));
TownInfo town = g_townInfoMgr->GetTownInfo(mapName, static_cast<unsigned int>(argument1 - 1000));
if (!town.image.empty()) {
const std::size_t extension = mapName.find_first_of(".");
if (extension != std::string::npos) {

View file

@ -5,6 +5,4 @@
UIMinimapZoomWnd::UIMinimapZoomWnd()
: UIFrameWnd(0),
m_zoom(),
townButtonsStorage(0),
townButtonsEnd(0),
townButtonsCapacity(0) {}
m_buttons() {}

View file

@ -4,6 +4,7 @@
#include "UI/Window/UIFrameWnd.h"
#include <map>
#include <vector>
struct TownInfo;
@ -18,9 +19,7 @@ public:
void AddTownButton(int index, TownInfo town);
/* 00B4 */ std::map<int, UIWindow*> m_zoom;
/* 00BC */ int townButtonsStorage;
/* 00C0 */ int townButtonsEnd;
/* 00C4 */ int townButtonsCapacity;
/* 00BC */ std::vector<UIWindow*> m_buttons;
};
#endif