Decompile 6 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Gauges/UIPetInfoBarGraph.cpp, ...

Batch #4534 by eAthena: 0 byte-identical, 6 confirmed by peer review.

- fn_11359 UIINT64BarGraph::Paint: logic confirmed by peer review
- fn_11361 UIItemMoveInfo::Paint: logic confirmed by peer review
- fn_11363 UIItemStoreComboBoxWnd::Paint: logic confirmed by peer review
- fn_11364 UIItemTagButton::Paint: logic confirmed by peer review
- fn_11369 UIListBoxNavi::Paint: logic confirmed by peer review
- fn_11375 UIPetInfoBarGraph::Paint: logic confirmed by peer review

Peer-reviewed-by: youko, Lumen
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 04:18:57 +00:00
commit 08c336e5cd
7 changed files with 173 additions and 2 deletions

View file

@ -8,6 +8,7 @@ struct WindowVisibility;
class UIItemMoveInfo : public UITextButton {
public:
void Paint() override;
void Slot28(int x, int y) override;
void Slot48() override;

View file

@ -7,11 +7,14 @@
class UIItemTagButton : public UITextButton {
public:
void Paint() override;
void Slot28(int x, int y) override;
/* 00F8 */ unsigned char unknown_00F8[0xF0];
/* 01F0 */ int column;
/* 01F4 */ int line;
/* 01F8 */ int unknown_01F8;
/* 01FC */ int textY;
};
#if defined(_WIN32) && !defined(_WIN64)

View file

@ -45,7 +45,7 @@
#include "UI/Lists/UIListBoxNavi.h"
#include "UI/Text/ColoredText.h"
#include "UI/Window/WindowBorder.h"
#include "Resource/SkinPalette.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
@ -1314,3 +1314,125 @@ void UITVTextButton::Slot31(int x, int y) {
void UITabControl::Slot31(int, int) {
g_windowMgr.ReleaseCapture();
}
// OFFSET: 0x0088AD00
// FUNCTION: fn_11359
void UIINT64BarGraph::Paint() {
if (this->m_maximum < this->m_current || this->m_maximum == 99999999) {
return;
}
unsigned red, green, blue;
SkinPaletteChannels(ResourceMgr::Instance(), 26, 2, red, green, blue);
this->ClearSurface((green & 255) << 16 | (green & 255) << 8 | (red & 255));
SkinPaletteChannels(ResourceMgr::Instance(), 30, 2, red, green, blue);
this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, (blue & 255) << 16 | (green & 255) << 8 | (red & 255));
if (this->m_maximum == 0) {
return;
}
const double ratio = static_cast<double>(this->m_current) / static_cast<double>(this->m_maximum);
if (ratio == 0.0) {
return;
}
SkinPaletteChannels(ResourceMgr::Instance(), 2, 6, red, green, blue);
if (this->m_plainColor == 0 && 25.0 > ratio * 100.0) {
red = 255;
green = 0;
blue = 0;
}
this->FillRegion(
1, 1, static_cast<int>((this->geometry.width - 2) * ratio), this->geometry.height - 2, (blue & 255) << 16 | (green & 255) << 8 | (red & 255)
);
}
// OFFSET: 0x0088B070
// FUNCTION: fn_11361
void UIItemMoveInfo::Paint() {
this->ClearSurface(0xFFFF00FF);
if (this->parent) {
this->parent->Invalidate();
}
if (this->m_outline != 0) {
DrawOutlinedText(*this, 1, 1, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0);
} else {
auto& controls = *this->m_buttonContext;
this->DrawTextAt(controls.fonts, controls.locale, 1, 1, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0);
}
if (this->m_underline != 0) {
this->FillRegion(0, this->geometry.height - 1, this->geometry.width, 1, this->m_color);
}
}
// OFFSET: 0x0088B4E0
// FUNCTION: fn_11364
void UIItemTagButton::Paint() {
this->ClearSurface(0xFFFF00FF);
if (this->parent) {
this->parent->Invalidate();
}
if (this->m_outline != 0) {
DrawOutlinedText(*this, 1, this->textY, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0);
} else {
auto& controls = *this->m_buttonContext;
this->DrawTextAt(controls.fonts, controls.locale, 1, this->textY, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0);
}
if (this->m_underline != 0) {
this->FillRegion(0, this->geometry.height - 1, this->geometry.width, 1, this->m_color);
}
}
// OFFSET: 0x0088BFB0
// FUNCTION: fn_11369
void UIListBoxNavi::Paint() {
if (this->transparent != 0) {
this->ClearSurface(0xFFFF00FF);
if (this->parent) {
this->parent->Invalidate();
}
} else {
this->ClearSurface((this->backgroundRed & 255) | ((this->backgroundGreen & 255) << 8) | ((this->backgroundBlue & 255) << 16));
}
const int first = this->topLine;
const int limit = this->geometry.height / this->lineHeight - this->bottomMargin + first;
const int end = static_cast<int>(std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(limit)));
std::uint32_t color = 0;
auto& owner = *this->m_listContext;
for (int index = first, row = 0; index < end; ++index, ++row) {
if (this->lineColors[index] == 1) {
color = this->defaultLineColor;
}
if (index == this->selected) {
this->FillRegion(0, row * this->lineHeight, this->geometry.width, this->lineHeight - 1, this->selectionColor);
}
const auto& line = this->lines[index];
DrawColoredText(*this, owner.codePage, 3 - this->horizontalOffset, this->lineHeight * row, line.c_str(), static_cast<unsigned>(line.size()), color, 0, 12, false);
if (this->lineColors[index] == 1) {
color = 0;
}
}
}
// OFFSET: 0x0088B4A0
// FUNCTION: fn_11363
void UIItemStoreComboBoxWnd::Paint() {
const auto* background = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\bg_setting.bmp")));
this->DrawBitmap(0, this->geometry.height - background->image.height, &background->image, false);
}

View file

@ -1,4 +1,7 @@
#include "UI/UIBarGraph.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "Resource/ResourceMgr.h"
#include "Resource/TextureNames.h"
// OFFSET: 0x0089B4D0
// FUNCTION: fn_11564
@ -27,3 +30,37 @@ void UIPetInfoBarGraph::SetValue(int value) {
this->unknown_007C = value;
this->Invalidate();
}
// OFFSET: 0x0088C970
// FUNCTION: fn_11375
void UIPetInfoBarGraph::Paint() {
const auto* left = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_left.bmp")));
const auto* middle = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_mid.bmp")));
const auto* right = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_right.bmp")));
const int span = this->geometry.width - left->image.width - right->image.width;
this->DrawBitmap(0, 0, &left->image, false);
for (int x = 0; x < span; ++x) {
this->DrawBitmap(left->image.width + x, 0, &middle->image, false);
}
this->DrawBitmap(this->geometry.width - right->image.width, 0, &right->image, false);
if (this->unknown_007C != 0) {
const auto* barLeft = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_left.bmp")));
const auto* barMiddle = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_mid.bmp")));
const auto* barRight = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_right.bmp")));
const int fill = static_cast<int>(
static_cast<float>(this->geometry.width - barRight->image.width - barLeft->image.width) *
(static_cast<float>(static_cast<unsigned>(this->unknown_007C)) / 100.0f)
);
this->DrawBitmap(0, 0, &barLeft->image, true);
int x = 0;
for (; x < fill; ++x) {
this->DrawBitmap(barLeft->image.width + x, 0, &barMiddle->image, true);
}
this->DrawBitmap(barMiddle->image.width * x + barLeft->image.width, 0, &barRight->image, true);
}
}

View file

@ -9,4 +9,9 @@ public:
void Slot31(int x, int y) override;
};
class UIItemStoreComboBoxWnd : public UIWindow {
public:
void Paint() override;
};
#endif

View file

@ -8,6 +8,7 @@
class UIListBoxNavi : public UIListBox {
public:
void Paint() override;
void Slot25(int x, int y) override;
/* 00D4 */ std::uint32_t defaultLineColor;
/* 00D8 */ std::vector<std::uint32_t> lineColors;

View file

@ -34,12 +34,13 @@ protected:
class UIINT64BarGraph : public UIWindow {
public:
void Paint() override;
void Slot28(int x, int y) override;
void SetValues(std::int64_t current, std::int64_t maximum);
protected:
/* 007C */ int unknown_007C;
/* 007C */ unsigned char m_plainColor;
/* 0080 */ std::int64_t m_current;
/* 0088 */ std::int64_t m_maximum;
UIButtonContext* m_controls;
@ -47,6 +48,7 @@ protected:
class UIPetInfoBarGraph : public UIWindow {
public:
void Paint() override;
void SetValue(int value);
/* 007C */ int unknown_007C;