Decompile fn_12949 (UIShowWarpWnd::SendMsg)

Batch #7140 by aDw: 0 byte-identical, 1 confirmed by peer review.

- fn_12949 UIShowWarpWnd::SendMsg: logic confirmed by peer review

Peer-reviewed-by: eAthena, Lumen
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-31 04:37:51 +00:00
commit 3a09246cdf
2 changed files with 39 additions and 0 deletions

View file

@ -1,6 +1,10 @@
#include "UI/Window/UIShowWarpWnd.h"
#include "UI/Buttons/UIBitmapButton.h"
#include "Client/ReplayPacketRecorder.h"
#include "Client/Session.h"
#include "Contents/MessageTable.h"
#include "UI/Lists/UIListBox.h"
#include "UI/Window/UIWindowMgr.h"
#include <algorithm>
#include <string>
@ -12,3 +16,35 @@
void UIShowWarpWnd::Paint() {
this->DrawBorder(0, 0, 0, 0);
}
// OFFSET: 0x00951210
// FUNCTION: fn_12949
int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
switch (message) {
case 6:
this->m_recorder->Record(this->geometry.id, static_cast<int>(argument1), argument2, argument3, argument4);
if (argument1 == 201) {
g_windowMgr.CloseWindow(0x134);
}
return 0;
case 0x12:
this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0);
return 0;
case 0x13:
this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0);
return 0;
case 0x22: {
const char* name = reinterpret_cast<const char*>(argument1);
if (std::string(name) == "Random") {
this->m_list->AddLine(LookupMessage(0xD4));
} else if (std::string(name) == "cancel") {
this->m_list->AddLine(LookupMessage(0xDA));
} else {
this->m_list->AddLine(g_session.GetMapDisplayName(g_session.GatName2RswName(name)));
}
return 0;
}
default:
return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
}

View file

@ -4,6 +4,7 @@
#include "UI/Window/UIFrameWnd.h"
struct UIButtonContext;
struct WindowResponseRecorder;
struct UIListBoxContext;
class UIListBox;
@ -11,12 +12,14 @@ class UIShowWarpWnd : public UIFrameWnd {
public:
void Slot15(int width, int height) override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
/* 00B4 */ UIListBox* m_list;
protected:
UIButtonContext* m_controls;
UIListBoxContext* m_listContext;
WindowResponseRecorder* m_recorder;
};
#endif