From 9706aa70458045e30fd6e94bd2754ea2920112ee Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 13:33:41 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/CashEmotionMgr.cpp, Source/UI/Buttons/UISpriteButton.h, ... Batch #9351 by secret: 0 byte-identical, 2 confirmed by peer review. - fn_09352 UICashEmotionListChildWnd_Basic::Refresh: logic confirmed by peer review - fn_10666 UIHeadsprButton::UIHeadsprButton: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, Toshiro, seumadruga Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/CashEmotionMgr.cpp | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 572c810cd..6dbff7177 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1734,6 +1734,58 @@ const char* UICashEmotionListChildWnd_Basic::Filter() { } // OFFSET: 0x007C4110 +// FUNCTION: fn_09352 +__declspec(noinline) void UICashEmotionListChildWnd_Basic::Refresh(const char* filter) { + for (UIWindow* item : this->m_items) { + this->RemoveChild(item, 0); + } + this->scrollPosition = 0; + this->unknown_009C = 0; + + const int packId = g_cashEmotionMgr->BasePackId(); + std::vector emotions = g_cashEmotionMgr->FindBaseEmotions(filter); + int x = 15; + int y = 4; + std::vector recycled(this->m_items); + this->m_items.clear(); + + CashEmotionTable* table = g_cashEmotionMgr->GetBasePackEmotions(); + int index = 0; + for (int emotionId : emotions) { + if (table->find(emotionId) == table->end()) { + continue; + } + + UICashEmotionPiece* piece; + if (!recycled.empty()) { + piece = static_cast(recycled.back()); + recycled.pop_back(); + } else { + piece = new (std::nothrow) UICashEmotionPiece(); + if (!piece) { + continue; + } + piece->SetSize(40, 40); + } + + piece->Set(packId, emotionId, false, true, false); + piece->Move(x, y); + this->AddChild(piece); + if (index % 5 == 4) { + x = 15; + y += 47; + } else { + x += 47; + } + ++index; + this->m_items.push_back(piece); + } + + for (UIWindow* item : recycled) { + delete item; + } + this->UpdateScrollBars(); +} // OFFSET: 0x007C4440 // FUNCTION: fn_09353 @@ -3992,3 +4044,6 @@ void UISpriteButton::SetSprite(const char* name) { } // OFFSET: 0x0084FE00 +// FUNCTION: fn_10666 +UIHeadsprButton::UIHeadsprButton() : UISpriteButton() { +}