Decompile fn_13136 (UIListBoxAgitMenu::SendMsg)

Batch #12642 by cremane: 0 byte-identical, 1 confirmed by peer review.

- fn_13136 UIListBoxAgitMenu::SendMsg: logic confirmed by peer review

Peer-reviewed-by: Yommy, gordaoprogramas, codeplay
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-11-06 04:30:22 +00:00
commit 22d974df5b
2 changed files with 13 additions and 10 deletions

View file

@ -146,7 +146,8 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s
return this->UIListBox::SendMsg(sender, message, a, b, c, d);
}
if (a == 0) {
switch (a) {
case 0: {
if (g_session.GetSceneUnknown004C() == 1) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(3633)), 0xFF, 0, 0, 0);
return 0;
@ -155,18 +156,17 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s
GuildInfo* guildInfo = &g_guildInfo;
uint16_t agitId = static_cast<uint16_t>(guildInfo->GetUnknown0114(this->m_agitIndex));
LuaScript* luaScript = g_session.m_hotkeyScript;
char* agitName = nullptr;
luaScript->Call("get_agit_name", "d>s", agitId, &agitName);
if (agitName != nullptr && strnlen(agitName, 256) != 0) {
g_session.m_hotkeyScript->Call("get_agit_name", "d>s", agitId, &agitName);
if (strnlen(agitName, 256) != 0) {
int costZeny = 0;
luaScript->Call("get_agit_costzeny", "db>d", agitId, 0, &costZeny);
g_session.m_hotkeyScript->Call("get_agit_costzeny", "db>d", agitId, 0, &costZeny);
int costGuildPoint = 0;
luaScript->Call("get_agit_costzeny", "db>d", agitId, 1, &costGuildPoint);
g_session.m_hotkeyScript->Call("get_agit_costzeny", "db>d", agitId, 1, &costGuildPoint);
UIAgitMessageBox* box = new UIAgitMessageBox();
const char* text = FormatString(LookupMessage(3631), agitName, costZeny, costGuildPoint, 310, 130);
box->sub_956130(text);
const char* text = FormatString(LookupMessage(3631), agitName, costZeny, costGuildPoint);
box->sub_956130(text, 310, 130);
int x = g_renderer->viewport.centerX - box->geometry.width / 2;
int y = g_renderer->viewport.centerY - box->geometry.height / 2;
@ -174,11 +174,15 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s
box->m_agitId = agitId;
g_windowMgr.AddRendered(box);
}
} else if (a == 1) {
break;
}
case 1: {
CMode* mode = g_modeMgr.GetGameMode();
GuildInfo* guildInfo = &g_guildInfo;
uint16_t agitId = static_cast<uint16_t>(guildInfo->GetUnknown0114(this->m_agitIndex));
mode->SendMsg(316, agitId, 0, 0, 0);
break;
}
}
return 0;

View file

@ -11,7 +11,6 @@ public:
UIAgitMessageBox();
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
void sub_956130(const char* text);
void sub_956130(const char* text, int width, int height);
/* 00B4 */ std::uint16_t m_agitId;