Decompile 4 functions in Source/UI/Items/UIItemRepairWnd.cpp, Source/UI/Items/UIItemRepairWnd.h, ...

Batch #5658 by Yommy: 0 byte-identical, 4 confirmed by peer review.

- fn_13616 UIMakeTargetListWnd::SendMsg: logic confirmed by peer review
- fn_13617 UIMakeTargetProcessWnd::SendMsg: logic confirmed by peer review
- fn_13618 UIMakeTargetResultWnd::SendMsg: logic confirmed by peer review
- fn_13619 UIWeaponRefineWnd::SendMsg: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, willerthal, Snow
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-30 15:31:18 +00:00
commit c1304e99e7
4 changed files with 319 additions and 0 deletions

View file

@ -268,3 +268,22 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std
}
// OFFSET: 0x009A4C50
// FUNCTION: fn_13618
int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message == 6) {
this->m_frameContext->windows.CloseWindow(81);
return 0;
}
if (message != 40) {
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}
this->makeType = static_cast<int>(a);
if (b) {
this->succeeded = true;
}
this->Invalidate();
return 0;
}

View file

@ -28,3 +28,114 @@ void UIMakeTargetListWnd::Paint() {
}
// OFFSET: 0x009A42E0
// FUNCTION: fn_13616
int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
ITEM_INFO item;
switch (message) {
case 6: {
const int response = static_cast<int>(a);
this->m_recorder->Record(this->geometry.id, response, b, c, this->m_list->selected);
if (response == 184) {
if (g_replayAnimationScaling) {
this->m_list->selected = static_cast<int>(d);
this->m_list->Invalidate();
}
UIListBox* list = this->m_list;
if (list->LineCount() == 0) {
this->m_frameContext->windows.CloseWindow(79);
this->m_frameContext->windows.CloseWindow(79);
return 0;
}
if (list->selected >= 0) {
switch (g_session.m_job) {
case 4054:
case 4060:
case 4096:
case 4252: {
ITEM_INFO materials[3];
g_modeMgr.GetGameMode()->SendMsg(130, this->itemIds[this->m_list->selected], reinterpret_cast<int>(materials), 0, 0);
this->m_frameContext->windows.CloseWindow(79);
return 0;
}
default: {
UIWindow* window = this->m_frameContext->windows.EnsureWindow(80);
window->SendMsg(this, 40, this->itemIds[this->m_list->selected], 0, 0, 0);
window->Move(this->geometry.x, this->geometry.y);
this->m_frameContext->windows.CloseWindow(79);
return 0;
}
}
}
} else if (response == 185) {
ITEM_INFO materials[3];
g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast<int>(materials), 0, 0);
this->m_frameContext->windows.CloseWindow(79);
return 0;
}
return 0;
}
case 18:
this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0);
return 0;
case 19:
this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0);
return 0;
case 31: {
const int itemId = static_cast<int>(a);
this->itemIds.push_back(itemId);
item.SetItemId(itemId);
item.unknown_0060 = 0;
item.identified = 1;
ItemDescriptions descriptions{g_itemDescriptions};
bool languagePrefix = false;
WORD language = g_serverLanguage->language;
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
this->m_list->AddLine(naming.DisplayName(item, 0).c_str());
return 0;
}
case 123: {
const auto* bytes = reinterpret_cast<const unsigned char*>(a);
std::uint16_t marker;
std::memcpy(&marker, bytes, sizeof(marker));
unsigned offset = 6;
if (marker == 22050) {
while (static_cast<unsigned>(b) > offset) {
std::int16_t kind;
std::uint32_t size;
std::memcpy(&kind, bytes + offset, sizeof(kind));
std::memcpy(&size, bytes + offset + 2, sizeof(size));
offset += 6;
if (kind == 22051) {
break;
}
if (kind == 22052) {
int itemId = 0;
std::memcpy(&itemId, bytes + offset, size);
offset += size;
this->SendMsg(nullptr, 31, itemId, 0, 0, 0);
} else {
offset += size;
}
}
}
return 0;
}
}
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}

View file

@ -54,3 +54,95 @@ void UIMakeTargetProcessWnd::Slot25(int x, int y) {
}
// OFFSET: 0x009A48C0
// FUNCTION: fn_13617
int UIMakeTargetProcessWnd::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 response = static_cast<int>(a);
this->m_recorder->Record(this->geometry.id, response, b, c, d);
if (response == 184) {
g_modeMgr.GetGameMode()->SendMsg(130, this->makeType, reinterpret_cast<int>(this->materials), 0, 0);
this->m_frameContext->windows.CloseWindow(80);
return 0;
}
if (response == 185) {
g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast<int>(this->materials), 0, 0);
bool restored = false;
for (ITEM_INFO& material : this->materials) {
if (material.unknown_0000[1] != 0) {
restored = true;
reinterpret_cast<ClientItemLists*>(&g_session)->AddItem1710(material, 0);
}
}
if (restored) {
RefreshItemWindows(&g_windowMgr);
}
if (g_windowMgr.unknown_01D4) {
reinterpret_cast<UIWindow*>(g_windowMgr.unknown_01D4)->SendMsg(nullptr, 23, 0, 0, 0, 0);
}
this->m_frameContext->windows.CloseWindow(80);
return 0;
}
return 0;
}
case 40:
this->makeType = static_cast<int>(a);
this->Invalidate();
return 0;
case 75: {
const char* name = reinterpret_cast<const char*>(a);
for (int index = 2; index >= 0; --index) {
ITEM_INFO& material = this->materials[index];
if (material.unknown_0000[1] != 0 && material.itemId == name) {
reinterpret_cast<ClientItemLists*>(&g_session)->AddItem1710(material, 1);
material.Reset();
this->Invalidate();
return 0;
}
}
return 0;
}
case 123: {
const auto* bytes = reinterpret_cast<const unsigned char*>(a);
std::uint16_t marker;
std::memcpy(&marker, bytes, sizeof(marker));
unsigned offset = 6;
if (marker == 22000) {
while (static_cast<unsigned>(b) > offset) {
std::int16_t kind;
std::uint32_t size;
std::memcpy(&kind, bytes + offset, sizeof(kind));
std::memcpy(&size, bytes + offset + 2, sizeof(size));
offset += 6;
if (kind == 22001) {
break;
}
if (kind == 22002) {
std::memcpy(&this->makeType, bytes + offset, size);
offset += size;
this->SendMsg(nullptr, 40, this->makeType, 0, 0, 0);
} else {
offset += size;
}
}
}
return 0;
}
}
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}

View file

@ -27,3 +27,100 @@ void UIWeaponRefineWnd::Paint() {
}
// OFFSET: 0x009A4CA0
// FUNCTION: fn_13619
int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
ITEM_INFO item;
switch (message) {
case 6: {
const int response = static_cast<int>(a);
this->m_recorder->Record(this->geometry.id, response, b, c, this->m_list->selected);
if (response == 184) {
if (g_replayAnimationScaling) {
this->m_list->selected = static_cast<int>(d);
this->m_list->Invalidate();
}
UIListBox* list = this->m_list;
if (list->LineCount() == 0) {
g_modeMgr.gameMode->SendMsg(182, -1, 0, 0, 0);
this->m_frameContext->windows.CloseWindow(111);
this->m_frameContext->windows.CloseWindow(111);
return 0;
}
const int selected = list->selected;
if (selected >= 0) {
g_modeMgr.gameMode->SendMsg(182, this->indices[selected], 0, 0, 0);
this->m_frameContext->windows.CloseWindow(111);
return 0;
}
} else if (response == 185) {
g_modeMgr.gameMode->SendMsg(182, -1, 0, 0, 0);
this->m_frameContext->windows.CloseWindow(111);
return 0;
}
return 0;
}
case 18:
this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0);
return 0;
case 19:
this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0);
return 0;
case 31: {
const int itemId = static_cast<int>(a);
this->itemIds.push_back(itemId);
this->indices.push_back(static_cast<int>(b));
item.SetItemId(itemId);
item.unknown_0060 = 0;
item.identified = 1;
ItemDescriptions descriptions{g_itemDescriptions};
bool languagePrefix = false;
WORD language = g_serverLanguage->language;
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
this->m_list->AddLine(naming.DisplayName(item, 0).c_str());
return 0;
}
case 123: {
const auto* bytes = reinterpret_cast<const unsigned char*>(a);
std::uint16_t marker;
std::memcpy(&marker, bytes, sizeof(marker));
unsigned offset = 6;
if (marker == 22200) {
while (static_cast<unsigned>(b) > offset) {
std::int16_t kind;
std::uint32_t size;
std::memcpy(&kind, bytes + offset, sizeof(kind));
std::memcpy(&size, bytes + offset + 2, sizeof(size));
offset += 6;
if (kind == 22201) {
break;
}
if (kind == 22202) {
int values[2] = {};
std::memcpy(values, bytes + offset, size);
offset += size;
this->SendMsg(nullptr, 31, values[0], values[1], 0, 0);
} else {
offset += size;
}
}
}
return 0;
}
}
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}