Decompile 10 functions in Source/UI/Guild/UIGuild_Storage_Log.cpp, Source/UI/Guild/UIGuild_Storage_Log.h, ...

Batch #3603 by youko: 0 byte-identical, 10 confirmed by peer review.

- fn_12940 UIDebuffRemoveWnd::SendMsg: logic confirmed by peer review
- fn_12941 UIGuild_Storage_Log::SendMsg: logic confirmed by peer review
- fn_12942 UIMileageWnd::SendMsg: logic confirmed by peer review
- fn_12943 UINormalMB::SendMsg: logic confirmed by peer review
- fn_12945 UIOpenMailBoxWnd::SendMsg: logic confirmed by peer review
- fn_12946 UIOpenRoulletteWnd::SendMsg: logic confirmed by peer review
- fn_12948 UISecondCostumeWnd::SendMsg: logic confirmed by peer review
- fn_12950 UITransMenuWnd::SendMsg: logic confirmed by peer review
- fn_12952 UISecondCostumeWnd::RefreshList: logic confirmed by peer review
- fn_12953 UIQuestDisplay::Slot11: logic confirmed by peer review

Peer-reviewed-by: Lumen, superintelligence, jessip
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/UI/Guild/UIGuild_Storage_Log.cpp, Source/UI/Quest/UIQuestDisplay.cpp, Source/UI/Window/UIDebuffRemoveWnd.cpp, Source/UI/Window/UIMileageWnd.cpp, Source/UI/Window/UINormalMB.cpp, Source/UI/Window/UIOpenMailBoxWnd.cpp, Source/UI/Window/UIOpenRoulletteWnd.cpp, Source/UI/Window/UISecondCostumeWnd.cpp, Source/UI/Window/UITransMenuWnd.cpp
This commit is contained in:
ragnarok-clanker 2026-10-29 22:57:13 +00:00
commit 25829488c2
19 changed files with 536 additions and 0 deletions

View file

@ -0,0 +1,90 @@
#include "UI/Guild/UIGuild_Storage_Log.h"
#include "UI/Text/UIStaticText.h"
#include "UI/Window/WindowManagerWindows.h"
#include <algorithm>
// OFFSET: 0x00950450
// FUNCTION: fn_12941
int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
switch (message) {
case 6:
switch (a) {
case 184:
this->m_frameContext->windows.CloseWindow(253);
break;
case 218: {
const unsigned page = this->m_page;
bool hasNext;
if (this->m_category == 0) {
hasNext = page < this->m_pageCounts[0];
} else if (this->m_category == 1) {
hasNext = page < this->m_pageCounts[1];
} else {
hasNext = page < this->m_pageCounts[2];
}
if (hasNext) {
this->m_state = 1;
this->m_page = page + 1;
this->unknown_0174 = 0;
this->unknown_0188 = this->unknown_0184;
this->SendMsg(this, 60, 0, 0, 0, 0);
return 0;
}
break;
}
case 246: {
const unsigned page = this->m_page;
if (page > 1) {
const int state = this->m_state;
this->m_state = 1;
this->unknown_0174 = 0;
unsigned offset = this->m_offset;
if (state == 11) {
offset -= 20;
} else {
offset = offset - offset % 10 - 10;
}
this->m_offset = std::max(0u, offset);
this->m_page = std::max(1u, page - 1);
this->unknown_0188 = this->unknown_0184;
this->SendMsg(this, 60, 0, 0, 0, 0);
return 0;
}
break;
}
}
return 0;
case 22:
this->m_category = static_cast<int>(a);
this->m_page = 1;
this->m_state = 1;
this->unknown_0174 = 0;
this->m_offset = 0;
this->unknown_0188 = this->unknown_0184;
this->SendMsg(this, 60, 0, 0, 0, 0);
return 0;
case 60:
for (int i = 0; i < 10; ++i) {
this->m_dateTexts[i]->SetText("", 0);
this->m_nameTexts[i]->SetText("", 0);
this->m_itemTexts[i]->SetText("", 0);
this->m_countTexts[i]->SetText("", 0);
}
this->Invalidate();
return 0;
default:
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
}

View file

@ -0,0 +1,29 @@
#ifndef RAGNAROK_SOURCE_UI_GUILD_UIGUILD_STORAGE_LOG_H
#define RAGNAROK_SOURCE_UI_GUILD_UIGUILD_STORAGE_LOG_H
#include "UI/Window/UIFrameWnd.h"
class UIStaticText;
class UIGuild_Storage_Log : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
protected:
/* 00B4 */ UIStaticText* m_dateTexts[10];
/* 00DC */ UIStaticText* m_nameTexts[10];
/* 0104 */ UIStaticText* m_itemTexts[10];
/* 012C */ UIStaticText* m_countTexts[10];
/* 0154 */ int m_category;
/* 0158 */ std::uint32_t unknown_0158;
/* 015C */ unsigned m_page;
/* 0160 */ unsigned m_pageCounts[3];
/* 016C */ unsigned m_offset;
/* 0170 */ int m_state;
/* 0174 */ int unknown_0174;
/* 0178 */ std::uint32_t unknown_0178[3];
/* 0184 */ int unknown_0184;
/* 0188 */ int unknown_0188;
};
#endif

View file

@ -0,0 +1,9 @@
#include "UI/Quest/UIQuestDisplay.h"
// OFFSET: 0x009515D0
// FUNCTION: fn_12953
void UIQuestDisplay::Slot11() {
if (this->m_visibleSetting) {
*this->m_visibleSetting = this->geometry.visible;
}
}

View file

@ -0,0 +1,15 @@
#ifndef RAGNAROK_SOURCE_UI_QUEST_UIQUESTDISPLAY_H
#define RAGNAROK_SOURCE_UI_QUEST_UIQUESTDISPLAY_H
#include "UI/Window/UIWindow.h"
class UIQuestDisplay : public UIWindow {
public:
void Slot11() override;
protected:
/* 007C */ unsigned char unknown_007C[0x14];
/* 0090 */ int* m_visibleSetting;
};
#endif

View file

@ -0,0 +1,30 @@
#include "UI/Window/UIDebuffRemoveWnd.h"
#include "Network/Connection/Connection.h"
#include "Network/Packets/PacketLengths.h"
#include <cstdint>
namespace {
#pragma pack(push, 1)
struct DebuffRemovePacket {
/* 0000 */ std::int16_t id;
};
#pragma pack(pop)
}
// OFFSET: 0x00950400
// FUNCTION: fn_12940
int UIDebuffRemoveWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message != 6) {
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}
if (a == 184) {
DebuffRemovePacket packet;
packet.id = 0xC2A;
CRagConnection& connection = GetRagConnection();
connection.Send(g_packetLengths.FixedLength(packet.id), &packet);
}
return 0;
}

View file

@ -0,0 +1,11 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIDEBUFFREMOVEWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UIDEBUFFREMOVEWND_H
#include "UI/Window/UIFrameWnd.h"
class UIDebuffRemoveWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
};
#endif

View file

@ -0,0 +1,44 @@
#include "UI/Window/UIMileageWnd.h"
#include "Contents/Configuration/ServiceOptions.h"
#include <windows.h>
#include <timeapi.h>
// GLOBAL: gl_24859
int g_mileageWndActive;
// GLOBAL: gl_24860
int g_mileageWndPoint;
// GLOBAL: gl_24861
int g_mileageWndBonus;
// OFFSET: 0x00950690
// FUNCTION: fn_12942
int UIMileageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message != 34) {
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
g_mileageWndActive = static_cast<int>(a);
this->Show(static_cast<int>(a));
if (a != 0) {
this->m_point = static_cast<int>(b);
g_mileageWndPoint = static_cast<int>(b);
this->m_bonus = static_cast<int>(d);
g_mileageWndBonus = static_cast<int>(d);
int remaining = 3600 - static_cast<int>(c);
if (remaining < 0) {
remaining = 0;
}
this->m_remaining = remaining;
this->m_startTime = timeGetTime();
this->Show(g_serviceOptions.Get(219));
}
this->Invalidate();
return 0;
}

View file

@ -0,0 +1,23 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIMILEAGEWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UIMILEAGEWND_H
#include "UI/Window/UIFrameWnd.h"
#include <cstdint>
class UIMileageWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
protected:
/* 00B4 */ std::uint32_t m_startTime;
/* 00B8 */ int m_point;
/* 00BC */ int m_remaining;
/* 00C0 */ int m_bonus;
};
extern int g_mileageWndActive;
extern int g_mileageWndPoint;
extern int g_mileageWndBonus;
#endif

View file

@ -0,0 +1,38 @@
#include "UI/Window/UINormalMB.h"
#include "UI/Text/UITextViewer.h"
#include "UI/Window/UIWindowMgr.h"
// OFFSET: 0x00950740
// FUNCTION: fn_12943
int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
switch (message) {
case 6: {
const int id = static_cast<int>(a);
const auto action = this->m_actions.find(id);
if (action != this->m_actions.end()) {
action->second();
} else {
if (this->m_owner) {
this->m_owner->SendMsg(this, 6, 488, id, 0, 0);
}
if (this->m_keepOpen) {
g_windowMgr.unknown_0474 = id;
return 0;
}
}
g_windowMgr.Schedule(this);
return 0;
}
case 57:
this->m_viewer->Clear();
this->m_viewer->SendMsg(nullptr, 29, a, 38, 0, 0);
return 0;
default:
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}
}

View file

@ -0,0 +1,22 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UINORMALMB_H
#define RAGNAROK_SOURCE_UI_WINDOW_UINORMALMB_H
#include "UI/Window/UIFrameWnd.h"
#include <map>
class UITextViewer;
class UINormalMB : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
protected:
/* 00B4 */ UIWindow* m_owner;
/* 00B8 */ UITextViewer* m_viewer;
/* 00BC */ unsigned char unknown_00BC[0x30];
/* 00EC */ unsigned char m_keepOpen;
/* 00F0 */ std::map<int, void (*)()> m_actions;
};
#endif

View file

@ -0,0 +1,42 @@
#include "UI/Window/UIOpenMailBoxWnd.h"
#include "Contents/MessageTable.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Window/WindowManagerWindows.h"
// OFFSET: 0x00950A60
// FUNCTION: fn_12945
int UIOpenMailBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message != 6) {
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
if (a != 192) {
return 0;
}
if (g_windowMgr.LookupWindow(295)) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(2992)), 0xFF, 0, 0, 0);
return 0;
}
if (g_windowMgr.LookupWindow(343)) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(3715)), 0xFF, 0, 0, 0);
return 0;
}
if (g_windowMgr.LookupWindow(10006)) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(3843)), 0xFF, 0, 0, 0);
return 0;
}
if (g_windowMgr.LookupWindow(361)) {
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(LookupMessage(4054)), 0xFF, 0, 0, 0);
return 0;
}
if (!this->m_frameContext->windows.CloseWindow(263)) {
this->m_frameContext->windows.EnsureWindow(263);
}
return 0;
}

View file

@ -0,0 +1,11 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIOPENMAILBOXWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UIOPENMAILBOXWND_H
#include "UI/Window/UIFrameWnd.h"
class UIOpenMailBoxWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
};
#endif

View file

@ -0,0 +1,32 @@
#include "UI/Window/UIOpenRoulletteWnd.h"
#include "Network/Connection/Connection.h"
#include "Network/Packets/PacketId.h"
#include "Network/Packets/PacketLengths.h"
#include "UI/Window/UIWindowMgr.h"
#include <cstdint>
namespace {
#pragma pack(push, 1)
struct RouletteOpenPacket {
/* 0000 */ std::int16_t id;
};
#pragma pack(pop)
}
// OFFSET: 0x00950B60
// FUNCTION: fn_12946
int UIOpenRoulletteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message != 6) {
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
if (a == 192 && g_windowMgr.unknown_0464 == nullptr) {
RouletteOpenPacket packet;
packet.id = ID_CZ_REQ_OPEN_ROULETTE;
CRagConnection& connection = GetRagConnection();
connection.Send(g_packetLengths.FixedLength(packet.id), &packet);
}
return 0;
}

View file

@ -0,0 +1,11 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIOPENROULLETTEWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UIOPENROULLETTEWND_H
#include "UI/Window/UIFrameWnd.h"
class UIOpenRoulletteWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
};
#endif

View file

@ -0,0 +1,63 @@
#include "UI/Window/UISecondCostumeWnd.h"
#include "UI/Lists/UIListBox.h"
#include "UI/Window/WindowManagerWindows.h"
// OFFSET: 0x00951060
// FUNCTION: fn_12948
int UISecondCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
switch (message) {
case 6:
switch (a) {
case 201:
this->m_frameContext->windows.CloseWindow(259);
break;
case 226:
if (this->m_page < 1) {
this->m_page = 7;
} else {
--this->m_page;
}
this->Invalidate();
return 0;
case 227:
this->m_page = this->m_page < 7 ? this->m_page + 1 : 0;
this->Invalidate();
return 0;
case 336:
if (this->m_list->selected != -1) {
this->m_selected[this->m_tab] = this->m_list->selected;
this->Invalidate();
return 0;
}
break;
}
return 0;
case 39:
this->m_tab = static_cast<int>(a);
this->RefreshList(static_cast<int>(a));
return 0;
default:
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
}
// OFFSET: 0x009514F0
// FUNCTION: fn_12952
void UISecondCostumeWnd::RefreshList(int tab) {
this->m_list->Clear();
for (unsigned i = 0; i < this->m_entries[tab].size(); ++i) {
this->m_list->AddLine(this->m_entries[tab][i].name.c_str());
}
this->m_list->selected = this->m_selected[tab];
this->m_list->Invalidate();
this->Invalidate();
}

View file

@ -0,0 +1,35 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UISECONDCOSTUMEWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UISECONDCOSTUMEWND_H
#include "UI/Window/UIFrameWnd.h"
#include <string>
#include <vector>
class UIListBox;
struct SecondCostumeEntry {
/* 0000 */ std::string name;
/* 0018 */ int unknown_0018;
};
class UISecondCostumeWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
__declspec(noinline) void RefreshList(int tab);
protected:
/* 00B4 */ std::uint32_t unknown_00B4;
/* 00B8 */ UIListBox* m_list;
/* 00BC */ int m_tab;
/* 00C0 */ int m_selected[4];
/* 00D0 */ std::vector<SecondCostumeEntry> m_entries[4];
/* 0100 */ std::uint32_t unknown_0100;
/* 0104 */ int m_page;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(SecondCostumeEntry) == 0x1C);
#endif
#endif

View file

@ -0,0 +1,11 @@
#include "UI/Window/UITransMenuWnd.h"
// OFFSET: 0x00951440
// FUNCTION: fn_12950
int UITransMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message != 48) {
this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
return 0;
}

View file

@ -0,0 +1,11 @@
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UITRANSMENUWND_H
#define RAGNAROK_SOURCE_UI_WINDOW_UITRANSMENUWND_H
#include "UI/Window/UIFrameWnd.h"
class UITransMenuWnd : public UIFrameWnd {
public:
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
};
#endif

View file

@ -703,6 +703,7 @@
"Source/UI/Guild/UIAgitWnd.cpp": 2,
"Source/UI/Guild/UIGuildHelperWnd.cpp": 2,
"Source/UI/Guild/UIGuildWnd.cpp": 2,
"Source/UI/Guild/UIGuild_Storage_Log.cpp": 2,
"Source/UI/Item/UIEquipmentPropertiesWnd.cpp": 2,
"Source/UI/Items/UIItemRepairWnd.cpp": 2,
"Source/UI/Items/UIMakeTargetListWnd.cpp": 2,
@ -731,6 +732,7 @@
"Source/UI/Party/UIRequestJoinPartyWnd.cpp": 2,
"Source/UI/PriceCommission.cpp": 2,
"Source/UI/Quest/UIOngoingQuestInfo.cpp": 2,
"Source/UI/Quest/UIQuestDisplay.cpp": 2,
"Source/UI/Quest/UIRecommendedQuestInfo.cpp": 2,
"Source/UI/Quest/UIRenewQuestUI.cpp": 2,
"Source/UI/Shop/ItemDrawing.cpp": 2,
@ -780,9 +782,16 @@
"Source/UI/Window/InputFocus.cpp": 2,
"Source/UI/Window/UIBasicInfoWnd.cpp": 2,
"Source/UI/Window/UIControl.cpp": 2,
"Source/UI/Window/UIDebuffRemoveWnd.cpp": 2,
"Source/UI/Window/UIFrameWnd.cpp": 2,
"Source/UI/Window/UIMessageBox.cpp": 2,
"Source/UI/Window/UIMileageWnd.cpp": 2,
"Source/UI/Window/UINormalMB.cpp": 2,
"Source/UI/Window/UIOpenMailBoxWnd.cpp": 2,
"Source/UI/Window/UIOpenRoulletteWnd.cpp": 2,
"Source/UI/Window/UISecondCostumeWnd.cpp": 2,
"Source/UI/Window/UISeekPartyListWnd.cpp": 2,
"Source/UI/Window/UITransMenuWnd.cpp": 2,
"Source/UI/Window/UIWindow.cpp": 2,
"Source/UI/Window/UIWindowMgr.cpp": 2,
"Source/UI/Window/WindowAncestry.cpp": 2,