Decompile 10 functions in Source/UI/Exchange/UIExchangeUI.cpp, Source/UI/Exchange/UIExchangeUI.h, ...

Batch #3854 by youko: 5 byte-identical, 5 confirmed by peer review.

- fn_15193 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::Paint: byte-identical
- fn_15194 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::Slot35: logic confirmed by peer review
- fn_15196 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::SetOnSelect: logic confirmed by peer review
- fn_15197 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::SetBinder: logic confirmed by peer review
- fn_15201 CUIListBoxEx<ExchangeUI::CUIItem,ExchangeUI::CItemData>::SetImages: logic confirmed by peer review
- fn_15289 CUIExchangeUI::OnCheckChanged: byte-identical
- fn_15292 CUIExchangeUI::OnEditSubmit: byte-identical
- fn_15293 CUIExchangeUI::OnSelectFirstListItem: byte-identical
- fn_15295 CUIExchangeUI::OnSelectSecondListItem: byte-identical
- fn_15297 ExchangeUI::CUIItem::Paint: 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).
Adds to the build: Source/UI/Exchange/UIExchangeUI.cpp
This commit is contained in:
ragnarok-clanker 2026-10-29 23:41:46 +00:00
commit b267a8d4dc
4 changed files with 146 additions and 2 deletions

View file

@ -0,0 +1,71 @@
#include "UI/Exchange/UIExchangeUI.h"
#include "Resource/ResourceMgr.h"
#include "Resource/SkinPalette.h"
#include <functional>
#include <string>
#include <windows.h>
template void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::SetOnSelect(std::function<void(ExchangeUI::CUIItem*, const ExchangeUI::CItemData&)>);
template void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::SetBinder(std::function<void(ExchangeUI::CUIItem*, const ExchangeUI::CItemData&)>);
template void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::SetImages(const std::string&, const std::string&, const std::string&,
const std::string&);
// OFFSET: 0x00A15150
// FUNCTION: fn_15193
template <>
void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::Paint() {
this->ClearSurface(0xFFFF00FF);
}
// OFFSET: 0x00A15160
// FUNCTION: fn_15194
template <>
void CUIListBoxEx<ExchangeUI::CUIItem, ExchangeUI::CItemData>::Slot35(int value) {
if (!this->scrollBar->dragging && this->scrollBar->total > this->scrollBar->visible) {
this->scrollBar->Slot35(value);
} else if (this->parent) {
this->parent->Slot35(value);
}
}
// OFFSET: 0x00A157C0
// OFFSET: 0x00A171A0
// OFFSET: 0x00A17530
// FUNCTION: fn_15289
void CUIExchangeUI::OnCheckChanged(bool) {
}
// OFFSET: 0x00A17540
// OFFSET: 0x00A17670
// FUNCTION: fn_15292
void CUIExchangeUI::OnEditSubmit() {
}
// OFFSET: 0x00A17680
// FUNCTION: fn_15293
void CUIExchangeUI::OnSelectFirstListItem(ExchangeUI::CUIItem*, const ExchangeUI::CItemData&) {
}
// OFFSET: 0x00A176A0
// FUNCTION: fn_15295
void CUIExchangeUI::OnSelectSecondListItem(ExchangeUI::CUIItem*, const ExchangeUI::CItemData&) {
}
// OFFSET: 0x00A176C0
// FUNCTION: fn_15297
void ExchangeUI::CUIItem::Paint() {
if (this->frozen) {
unsigned red = 0;
unsigned green = 0;
unsigned blue = 0;
SkinPaletteChannels(ResourceMgr::Instance(), 10, 6, red, green, blue);
this->ClearSurface(RGB(red, green, blue));
} else {
this->ClearSurface(0xFFFFFFFF);
}
}

View file

@ -0,0 +1,45 @@
#ifndef RAGNAROK_SOURCE_UI_EXCHANGE_UIEXCHANGEUI_H
#define RAGNAROK_SOURCE_UI_EXCHANGE_UIEXCHANGEUI_H
#include "Contents/Items/ItemInfo.h"
#include "UI/FrameSkin.h"
#include "UI/Lists/UIListBoxTemplate.h"
#include <cstddef>
namespace ExchangeUI {
class CUIItem : public CUIListItem {
public:
void Paint() override;
};
class CItemData {
public:
/* 0000 */ ITEM_INFO item;
/* 00F8 */ int unknown_00F8;
/* 00FC */ bool unknown_00FC;
};
using CItemListBox = CUIListBoxEx<CUIItem, CItemData>;
}
class CUIExchangeUI : public CUIFrameWnd {
public:
void OnCheckChanged(bool checked);
void OnEditSubmit();
void OnSelectFirstListItem(ExchangeUI::CUIItem* item, const ExchangeUI::CItemData& data);
void OnSelectSecondListItem(ExchangeUI::CUIItem* item, const ExchangeUI::CItemData& data);
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(ExchangeUI::CItemData) == 0x100);
static_assert(offsetof(ExchangeUI::CItemData, unknown_00FC) == 0xFC);
static_assert(offsetof(ExchangeUI::CItemListBox, imageNames) == 0x90);
static_assert(offsetof(ExchangeUI::CItemListBox, disabledName) == 0x98);
static_assert(offsetof(ExchangeUI::CItemListBox, scrollBar) == 0xB0);
static_assert(offsetof(ExchangeUI::CItemListBox, data) == 0xD4);
static_assert(offsetof(ExchangeUI::CItemListBox, onSelect) == 0xE8);
static_assert(offsetof(ExchangeUI::CItemListBox, binder) == 0x110);
#endif
#endif

View file

@ -8,6 +8,7 @@
#include <cstddef>
#include <functional>
#include <list>
#include <map>
#include <string>
#include <vector>
@ -184,6 +185,29 @@ public:
this->UpdateScrollBar();
}
// OFFSET: 0x00A15450
// FUNCTION: fn_15196
void SetOnSelect(std::function<void(T*, const D&)> handler) {
this->onSelect = handler;
}
// OFFSET: 0x00A154C0
// FUNCTION: fn_15197
void SetBinder(std::function<void(T*, const D&)> handler) {
this->binder = handler;
}
// OFFSET: 0x00A15AA0
// FUNCTION: fn_15201
void SetImages(const std::string& normal, const std::string& hover, const std::string& pressed, const std::string& disabled) {
this->imageNames[0] = normal;
this->imageNames[1] = hover;
this->imageNames[2] = pressed;
this->disabledName = disabled;
this->Slot53(0);
this->Invalidate();
}
// OFFSET: 0x009DD950
// OFFSET: 0x00A06300
// FUNCTION: fn_14344
@ -259,7 +283,9 @@ public:
}
}
/* 0084 */ unsigned char unknown_0084[0x2C];
/* 0084 */ unsigned char unknown_0084[0x0C];
/* 0090 */ std::map<int, std::string> imageNames;
/* 0098 */ std::string disabledName;
/* 00B0 */ CUIVScrollBar* scrollBar;
/* 00B4 */ int itemWidth;
/* 00B8 */ int rowHeight;
@ -271,7 +297,8 @@ public:
/* 00DC */ unsigned int selected;
/* 00E0 */ unsigned char unknown_00E0;
/* 00E1 */ unsigned char rebind;
/* 00E2 */ unsigned char unknown_00E2[0x2E];
/* 00E2 */ unsigned char unknown_00E2[0x06];
/* 00E8 */ std::function<void(T*, const D&)> onSelect;
/* 0110 */ std::function<void(T*, const D&)> binder;
};

View file

@ -728,6 +728,7 @@
"Source/UI/Edit/UIEditLinks.cpp": 2,
"Source/UI/Edit/UIEditVariants.cpp": 2,
"Source/UI/Enchant/UIEnchantUI.cpp": 2,
"Source/UI/Exchange/UIExchangeUI.cpp": 2,
"Source/UI/FrameSkin.cpp": 2,
"Source/UI/GameSettings/GameSettingsUI.cpp": 2,
"Source/UI/Gauges/UIPetInfoBarGraph.cpp": 2,