Decompile fn_11388 (UIString::Paint)

Batch #9453 by Lumen: 0 byte-identical, 1 confirmed by peer review.

- fn_11388 UIString::Paint: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, meitogi, Toshiro
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-01 13:48:49 +00:00
commit dbbca8b41e
4 changed files with 38 additions and 0 deletions

View file

@ -15,6 +15,7 @@ public:
void Slot25(int x, int y) override;
void Slot26(int x, int y) override;
void Slot32(int x, int y) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
void SetSlot(int slot, int fallback);
protected:

View file

@ -3512,3 +3512,38 @@ void UITreeView::Paint() {
this->LayoutNodes(this->root->children, 0, 0);
this->Slot53();
}
// OFFSET: 0x0088F450
// FUNCTION: fn_11388
void UIString::Paint() {
if (this->unknown_00DC.empty()) {
return;
}
std::uint32_t color = (static_cast<std::uint32_t>(static_cast<unsigned char>(this->unknown_00A4)) << 16) |
(static_cast<std::uint32_t>(static_cast<unsigned char>(this->unknown_00A0)) << 8) |
static_cast<std::uint32_t>(static_cast<unsigned char>(this->unknown_009C));
const char* cur = this->unknown_00DC.c_str();
const char* end = cur + this->unknown_00DC.size();
if (!this->unknown_00AC.empty()) {
char path[128];
std::memset(path, 0, sizeof(path));
reinterpret_cast<ItemDescriptions*>(&g_session)->IconPath(path, this->unknown_00AC.c_str(), 0);
CRes* res = ResourceMgr::Instance().Load(Resolve(path));
if (!res) {
return;
}
this->DrawBitmap(0, 0, reinterpret_cast<const BitmapImage*>(res), true);
while (cur < end) {
cur = ParseColorCode(SegmentEnd(cur, end), color);
}
DrawColoredText(*this, 0, 24, 7, this->unknown_00DC.c_str(), static_cast<unsigned>(this->unknown_00DC.size()), color, 0, 12, false);
} else {
DrawColoredText(*this, 0, 0, 0, this->unknown_00DC.c_str(), static_cast<unsigned>(this->unknown_00DC.size()), color, 0, 12, false);
}
}
// OFFSET: 0x00899780

View file

@ -10,6 +10,7 @@ struct TextLocale;
extern unsigned char g_hexDigits[256];
const char* SegmentEnd(const char* text, const char* end);
const char* ParseColorCode(const char* text, std::uint32_t& color);
void DrawColoredText(

View file

@ -8,6 +8,7 @@
class UIString : public UIWindow {
public:
explicit UIString(UIWindowContext& windows);
void Paint() override;
void ResetCursor(int x, int y) override;
void Slot31(int x, int y) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;