Decompile 2 functions in Source/UI/Window/UIBasicInfoWnd.cpp, Source/UI/Window/UIBasicInfoWnd.h

Batch #7333 by gordaoprogramas: 0 byte-identical, 2 confirmed by peer review.

- fn_13490 UIBasicInfoWnd::SetHeight: logic confirmed by peer review
- fn_13497 UIBasicInfoWnd::RefreshLayout: logic confirmed by peer review

Peer-reviewed-by: eAthena, Romain
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-31 07:02:24 +00:00
commit 032acfbb26
2 changed files with 101 additions and 2 deletions

View file

@ -2,6 +2,7 @@
#include "Client/Session.h"
#include "UI/Buttons/UIButton.h"
#include "UI/Text/UIStaticText.h"
#include "UI/Window/UIWindowMgr.h"
#include <cstdio>
@ -12,6 +13,85 @@ bool UIBasicInfoWnd::Slot03() {
return true;
}
// OFFSET: 0x009981A0
// FUNCTION: fn_13490
void UIBasicInfoWnd::SetHeight(int height) {
if (height == this->collapsedHeight) {
this->Resize(this->geometry.width, this->collapsedHeight);
this->nameText->Resize(this->geometry.width - 30, 15);
this->nameText->SetTextFitted(g_session.DecodePlayerName());
this->nameText->Move(17, 3);
this->hpBar->Move(-100, -100);
this->spBar->Move(-100, -100);
this->apBar->Move(-100, -100);
this->baseExpBar->Move(-100, -100);
this->jobExpBar->Move(-100, -100);
} else if (height == this->expandedHeight) {
this->Resize(this->geometry.width, this->expandedHeight);
this->hpBar->Move(35, 53);
this->spBar->Move(35, 68);
if (g_session.IsTreeGroupThree(g_session.GetDisplayJob()) == true) {
this->apBar->Move(35, 83);
}
this->nameText->Resize(this->geometry.width - 20, 15);
this->nameText->SetTextFitted(g_session.DecodePlayerName());
this->nameText->Move(9, 22);
if (g_session.GetMaxBaseLevel(g_session.GetDisplayJob()) == g_session.m_level) {
this->baseExpBar->Move(-200, 78);
} else {
this->baseExpBar->Move(85, this->layoutOffset + 76);
}
if (g_session.m_jobLevel < g_session.GetMaxJobLevel(g_session.GetDisplayJob())) {
this->jobExpBar->Move(85, this->layoutOffset + 88);
} else {
this->jobExpBar->Move(-200, 88);
}
}
if (UIWindow* window = g_windowMgr.LookupWindow(307)) {
int screenX = 0;
int screenY = 0;
this->ToScreen(screenX, screenY);
window->Move(screenX, this->geometry.height + screenY);
}
}
// OFFSET: 0x00999490
// FUNCTION: fn_13497
void UIBasicInfoWnd::RefreshLayout() {
const int height = this->geometry.height;
if (g_session.IsTreeGroupThree(g_session.GetDisplayJob())) {
if (height == this->collapsedHeight) {
this->layoutOffset = this->extendedOffset;
this->collapsedHeight = this->extendedCollapsedHeight;
this->expandedHeight = this->extendedExpandedHeight;
this->SetHeight(this->extendedCollapsedHeight);
} else if (height == this->expandedHeight) {
this->layoutOffset = this->extendedOffset;
this->collapsedHeight = this->extendedCollapsedHeight;
this->expandedHeight = this->extendedExpandedHeight;
this->SetHeight(this->extendedExpandedHeight);
}
} else {
if (height == this->collapsedHeight) {
this->layoutOffset = this->normalOffset;
this->collapsedHeight = this->normalCollapsedHeight;
this->expandedHeight = this->normalExpandedHeight;
this->SetHeight(this->normalCollapsedHeight);
} else if (height == this->expandedHeight) {
this->layoutOffset = this->normalOffset;
this->collapsedHeight = this->normalCollapsedHeight;
this->expandedHeight = this->normalExpandedHeight;
this->SetHeight(this->normalExpandedHeight);
}
this->apBar->Move(-100, -100);
}
this->Invalidate();
}
// OFFSET: 0x00999BC0
// FUNCTION: fn_13499
void UIBasicInfoWnd::Slot11() {

View file

@ -4,6 +4,8 @@
#include "Contents/UserData/NormalItemSlots.h"
#include "UI/Window/UIFrameWnd.h"
class UIStaticText;
class UIBasicInfoWnd : public UIFrameWnd {
public:
bool Slot03() override;
@ -13,11 +15,28 @@ public:
void Slot27(int x, int y) override;
void Slot28(int x, int y) override;
/* 00B4 */ unsigned char unknown_00B4[0x4];
void SetHeight(int height);
void RefreshLayout();
/* 00B4 */ int collapsedHeight;
/* 00B8 */ int expandedHeight;
/* 00BC */ unsigned char mode;
/* 00BD */ unsigned char unknown_00BD[0x7];
/* 00BD */ unsigned char unknown_00BD[0x3];
/* 00C0 */ UIStaticText* nameText;
/* 00C4 */ BasicInfoWndInfo* saved;
/* 00C8 */ unsigned char unknown_00C8[0x20];
/* 00E8 */ UIWindow* hpBar;
/* 00EC */ UIWindow* spBar;
/* 00F0 */ UIWindow* baseExpBar;
/* 00F4 */ UIWindow* jobExpBar;
/* 00F8 */ int layoutOffset;
/* 00FC */ UIWindow* apBar;
/* 0100 */ int normalOffset;
/* 0104 */ int normalCollapsedHeight;
/* 0108 */ int normalExpandedHeight;
/* 010C */ int extendedOffset;
/* 0110 */ int extendedCollapsedHeight;
/* 0114 */ int extendedExpandedHeight;
protected:
UIButtonContext* m_controls;