rodecomp/Source/UI/Window/UIShowWarpWnd.cpp
ragnarok-clanker 0c10747096 Decompile 12 functions in Source/UI/Quest/UIQuestDisplay.cpp, Source/UI/Quest/UIQuestDisplay.h, ...
Batch #7711 by secret: 0 byte-identical, 12 confirmed by peer review.

- fn_12846 UIAccountLimitedToolWnd::UIAccountLimitedToolWnd: logic confirmed by peer review
- fn_12847 UIBalloonOpenBtn::UIBalloonOpenBtn: logic confirmed by peer review
- fn_12848 UIDebuffRemoveWnd::UIDebuffRemoveWnd: logic confirmed by peer review
- fn_12850 UIMileageWnd::UIMileageWnd: logic confirmed by peer review
- fn_12852 UINoteWnd::UINoteWnd: logic confirmed by peer review
- fn_12853 UIOpenMailBoxWnd::UIOpenMailBoxWnd: logic confirmed by peer review
- fn_12854 UIOpenRoulletteWnd::UIOpenRoulletteWnd: logic confirmed by peer review
- fn_12855 UIQuestDisplay::UIQuestDisplay: logic confirmed by peer review
- fn_12856 UIRPImageWnd2::UIRPImageWnd2: logic confirmed by peer review
- fn_12857 UISecondCostumeWnd::UISecondCostumeWnd: logic confirmed by peer review
- fn_12858 UIShowWarpWnd::UIShowWarpWnd: logic confirmed by peer review
- fn_12859 UITransMenuWnd::UITransMenuWnd: logic confirmed by peer review

Peer-reviewed-by: eAthena, Yommy
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-31 11:28:47 +00:00

88 lines
2.8 KiB
C++

#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>
// OFFSET: 0x0094CA20
// FUNCTION: fn_12899
void UIShowWarpWnd::Slot15(int width, int height) {
auto* list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = list;
width -= 0x18;
height -= 0x32;
if (width < 0x14) {
width = 0x14;
}
if (height < 0x1e) {
height = 0x1e;
}
list->Configure(0x0c, 0x14, width, height, 0);
list->backgroundRed = 0xf0;
list->backgroundGreen = 0xf0;
list->backgroundBlue = 0xf0;
list->selected = -1;
list->Invalidate();
list->transparent = 0;
this->AddChild(list);
const std::string prefix = "유저인터페이스\\";
auto* close = new UIBitmapButton(*this->m_context, *this->m_controls);
close->SetBitmap((prefix + "btn_close" + ".bmp").c_str(), 0, 0);
close->SetBitmap((prefix + "btn_close_a" + ".bmp").c_str(), 1, 0);
close->SetBitmap((prefix + "btn_close_b" + ".bmp").c_str(), 2, 0);
close->SetSize(close->BitmapWidth(), close->BitmapHeight());
close->Move(this->geometry.width - 0x2e, this->geometry.height - 0x18);
close->SetId(0xc9);
this->AddChild(close);
this->m_message0 = 0xb8;
}
// OFFSET: 0x0094ECE0
// FUNCTION: fn_12914
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);
}
}
// OFFSET: 0x009470C0
// FUNCTION: fn_12858
UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, UIFrameContext& frames, UIButtonContext& controls, UIListBoxContext& lists, WindowResponseRecorder& recorder)
: UIFrameWnd(windows, frames, 0), m_controls(&controls), m_listContext(&lists), m_recorder(&recorder) {
}