Decompile 4 functions in Source/UI/RuneSystem/UIRuneSystemWnd.cpp, Source/UI/RuneSystem/UIRuneSystemWnd.h

Batch #4266 by eAthena: 0 byte-identical, 4 confirmed by peer review.

- fn_10181 UIRuneSetReWard::Paint: logic confirmed by peer review
- fn_10184 UIRuneSystemTab::Paint: logic confirmed by peer review
- fn_10220 UIRuneSet_Info::UpdateActivation: logic confirmed by peer review
- fn_10221 UIRuneSetList::SendMsg: logic confirmed by peer review

Peer-reviewed-by: alisonrag, youko
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 02:22:06 +00:00
commit 9fe8b8b7cd
2 changed files with 96 additions and 0 deletions

View file

@ -5,6 +5,62 @@
#include "Resource/TextureNames.h"
#include "UI/RuneSystem/UIRuneSystemWnd.h"
#include "UI/Window/UIWindowMgr.h"
#include "Utility/Text/FormatString.h"
// OFFSET: 0x00819610
// FUNCTION: fn_10181
void UIRuneSetReWard::Paint() {
this->ClearSurface(0xFFFF00FF);
const std::string* name;
if (this->m_state == 3) {
name = &this->m_texts[1];
} else if (this->m_state == 0) {
name = &this->m_texts[0];
} else if (this->m_state == 1) {
switch (this->geometry.unknown_0030) {
case 0:
name = &this->m_names[3];
break;
case 1:
case 2:
name = &this->m_texts[2];
break;
default:
name = nullptr;
break;
}
} else {
switch (this->geometry.unknown_0030) {
case 0:
name = &this->m_names[0];
break;
case 1:
name = &this->m_names[1];
break;
case 2:
name = &this->m_names[2];
break;
default:
name = nullptr;
break;
}
}
if (name && !name->empty()) {
this->DrawBitmap(0, 0, &static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(name->c_str())))->image, true);
}
if (this->parent) {
this->parent->Invalidate();
}
}
// OFFSET: 0x0081A1D0
// FUNCTION: fn_10184
void UIRuneSystemTab::Paint() {
ResourceMgr& resources = ResourceMgr::Instance();
const std::string name = FormatOwnedString(this->m_label.c_str(), this->geometry.unknown_0030);
this->DrawBitmap(0, 0, &static_cast<CBitmapRes*>(resources.Load(Resolve(name.c_str())))->image, false);
}
// OFFSET: 0x0081BD10
// FUNCTION: fn_10194
@ -181,6 +237,42 @@ void UIRuneSetList::Slot35(int delta) {
}
}
// OFFSET: 0x0081D460
// FUNCTION: fn_10220
void UIRuneSet_Info::UpdateActivation() {
this->m_activeWnd->Show(0);
this->unknown_0084->Enable(0);
if (this->m_runeSet && !this->m_runeSet->IsActive()) {
this->m_activeWnd->Show(1);
this->unknown_0084->Enable(1);
UIBitmapButton* button = this->unknown_0084;
button->SetDisabled(!g_runeSystemMgr->HasRequiredItems(this->m_runeSet->GetActiveType()));
button->Invalidate();
}
this->Invalidate();
}
// OFFSET: 0x0081D580
// FUNCTION: fn_10221
int UIRuneSetList::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) {
if (message == 0x3C) {
if (argument1 > 0 && this->total != argument1) {
int maximum = argument1 - this->visible;
if (maximum < 0) {
maximum = 0;
}
this->SetRange(maximum, this->visible, argument1);
this->SetPosition(0);
}
this->Invalidate();
} else if (message == 0xAB) {
this->m_selected = argument1;
this->Invalidate();
return 0;
}
return 0;
}
// OFFSET: 0x0081D5F0
// FUNCTION: fn_10222
int UIRuneSetReWard::SendMsg(

View file

@ -13,6 +13,7 @@ class RuneSetData;
class UIRuneSetReWard : public UIBitmapButton {
public:
void Paint() 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;
@ -23,6 +24,7 @@ public:
class UIRuneSystemTab : public UIWindow {
public:
void Paint() override;
void Slot25(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;
@ -45,6 +47,7 @@ class UIRuneSetList : public UIScrollBar {
public:
void Slot25(int x, int y) override;
void Slot35(int delta) 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 DrawScrollBar(bool drawLine);
/* 00B4 */ int m_itemHeight;
@ -71,6 +74,7 @@ class UIRuneSystem_ActiveWnd : public UIWindow {
class UIRuneSet_Info : public UIWindow {
public:
void Slot19() override;
void UpdateActivation();
/* 007C */ RuneSetData* m_runeSet;
/* 0080 */ UIRuneSystem_ActiveWnd* m_activeWnd;