Decompile 12 functions in Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UITextButton.cpp, ...

Batch #5651 by Yommy: 1 byte-identical, 11 confirmed by peer review.

- fn_11328 UIListBoxID::Slot15: logic confirmed by peer review
- fn_11329 UINewComboBoxCtrl::Slot15: logic confirmed by peer review
- fn_11330 UIShowAndEditTimeCtrl::Slot15: logic confirmed by peer review
- fn_11331 UISlotBmpButton::Slot15: logic confirmed by peer review
- fn_11332 UITableBox::Slot15: byte-identical
- fn_11333 UITextViewEX::Slot15: logic confirmed by peer review
- fn_11335 UITreeView::Slot15: logic confirmed by peer review
- fn_11336 TableBox::Paint: logic confirmed by peer review
- fn_10938 UIEditCtrl::Border: logic confirmed by peer review
- fn_11555 UINewComboBoxCtrl::SendMsg: logic confirmed by peer review
- fn_11556 UIShowAndEditTimeCtrl::SendMsg: logic confirmed by peer review
- fn_11560 UITableBox::SendMsg: logic confirmed by peer review

Peer-reviewed-by: ntrl, willerthal, Snow, SapitoSucio, eAthena, alisonrag, Qwenkler3.8, Millenium
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 14:50:59 +00:00
commit dd899cd0a3
12 changed files with 261 additions and 6 deletions

View file

@ -3,15 +3,19 @@
#include "UI/Buttons/UIBitmapButton.h"
class UIStaticBitmap;
class UISlotBmpButton : public UIBitmapButton {
public:
void Slot15(int width, int height) override;
void Slot19() override;
void Slot25(int x, int y) override;
void Slot26(int x, int y) override;
void Slot32(int x, int y) override;
protected:
/* 0120 */ unsigned char unknown_0120[0x14];
/* 0120 */ unsigned char unknown_0120[0x10];
/* 0130 */ UIStaticBitmap* icon;
/* 0134 */ short unknown_0134;
/* 0136 */ short unknown_0136;
};

View file

@ -21,6 +21,7 @@
#include "Client/Mode/ModeCursor.h"
#include "UI/Buttons/UIBitmapButton2.h"
#include "UI/Buttons/UISlotBmpButton.h"
#include "UI/UIStaticBitmap.h"
#include "UI/Buttons/UITVBitmapButton.h"
#include "UI/Buttons/UITVTextButton.h"
#include "UI/Lists/UIComboBox.h"
@ -51,7 +52,6 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
// GLOBAL: gl_24606
int g_screenHeight;
@ -2196,3 +2196,81 @@ void UIPackageBoxNameList::Slot25(int x, int y) {
this->Invalidate();
}
// OFFSET: 0x00886AE0
// FUNCTION: fn_11328
void UIListBoxID::Slot15(int width, int height) {
auto* vertical = new UIScrollBar(*this->m_context);
this->verticalBar = vertical;
const int verticalWidth = vertical->thickness;
vertical->vertical = 1;
vertical->UIWindow::Resize(verticalWidth, height);
vertical->Move((width - 13), 0);
vertical->Slot15(verticalWidth, height);
vertical->Slot22(verticalWidth, height);
this->AddChild(this->verticalBar);
auto* horizontal = new UIScrollBar(*this->m_context);
this->horizontalBar = horizontal;
const int horizontalHeight = horizontal->thickness;
horizontal->vertical = 0;
horizontal->UIWindow::Resize((width - 13), horizontalHeight);
horizontal->Move(0, (height - 13));
horizontal->Slot15((width - 13), horizontalHeight);
horizontal->Slot22((width - 13), horizontalHeight);
this->AddChild(this->horizontalBar);
}
// OFFSET: 0x00887280
// FUNCTION: fn_11332
void UITableBox::Slot15(int, int) {
}
// OFFSET: 0x008872B0
// FUNCTION: fn_11335
void UITreeView::Slot15(int width, int height) {
auto* vertical = new UIScrollBar3(*this->m_context);
this->verticalBar = vertical;
const int verticalWidth = vertical->thickness;
vertical->vertical = 1;
vertical->UIWindow::Resize(verticalWidth, height);
vertical->Move((width - 10), 0);
vertical->Slot15(verticalWidth, height);
vertical->Slot22(verticalWidth, height);
this->AddChild(this->verticalBar);
this->edit = new UIEditCtrl2(*this->m_context, *this->m_edit);
this->edit->SetSize(100, 19);
this->edit->Move(-100, -100);
this->AddChild(this->edit);
}
// OFFSET: 0x008873F0
// FUNCTION: fn_11336
void TableBox::Paint() {
RECT rectangle;
rectangle.left = 1;
rectangle.top = 1;
rectangle.right = this->geometry.width - 1;
rectangle.bottom = this->geometry.height - 1;
this->FillSurface(this->borderColor, &rectangle);
}
// OFFSET: 0x008870B0
// FUNCTION: fn_11331
void UISlotBmpButton::Slot15(int, int) {
const std::string path = "유저인터페이스\\renewalparty\\";
char name[256];
std::sprintf(name, "%sicon_jobs_%d.bmp", path.c_str(), 0);
this->icon = new UIStaticBitmap(*this->m_context, *this->m_buttonContext);
this->icon->SetBitmap(name);
this->icon->SetSize(this->icon->geometry.width, this->icon->geometry.height);
this->icon->Move(118, 14);
this->AddChild(this->icon);
}
// OFFSET: 0x00899BE0
// FUNCTION: fn_11560
int UITableBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}

View file

@ -585,6 +585,14 @@ void UIEditCtrl::Background(int red, int green, int blue) {
this->Invalidate();
}
// OFFSET: 0x00865E00
// FUNCTION: fn_10938
void UIEditCtrl::Border(int red, int green, int blue) {
this->borderRed = red;
this->borderGreen = green;
this->borderBlue = blue;
}
// OFFSET: 0x00868570
// FUNCTION: fn_10960
void UIEditCtrl::TextColor(std::uint32_t primary, std::uint32_t secondary) {

View file

@ -61,6 +61,7 @@ public:
const char* Text();
std::string LinkedText();
void Background(int red, int green, int blue);
void Border(int red, int green, int blue);
void TextColor(std::uint32_t primary, std::uint32_t secondary);
void UpdateLinks();
void SetCursor(std::size_t position);
@ -224,6 +225,8 @@ public:
class UIEditCtrlVarId : public UIEditCtrl {
public:
// INLINED
UIEditCtrlVarId(UIWindowContext& windows, UIEditContext& edit) : UIEditCtrl(windows, edit) {}
void Slot24(int retained) override;
void Slot35(int value) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
@ -233,6 +236,17 @@ public:
bool HasItemLinkTag(const std::string& text);
bool HasNaviLinkTag(const std::string& text);
class UIShowAndEditTimeCtrl : public UIWindow {
public:
void Slot15(int width, int height) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
/* 007C */ UIEditCtrlVarId* fields[2];
protected:
UIEditContext* m_edit;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(UIEditCtrl) == 292);
static_assert(sizeof(UIEditCtrlWheel) == 292);

View file

@ -7,7 +7,7 @@
#include "UI/Window/InputFocus.h"
#include "UI/Edit/UIEditCtrl.h"
#include "Network/TextEncoding.h"
#include "Utility/Text/FormatString.h"
#include <cstring>
#include <windows.h>
@ -335,3 +335,39 @@ int UIEditCtrl_OldList::SendMsg(UIWindow* sender, int message, std::intptr_t arg
return UIEditCtrl::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
}
// OFFSET: 0x00886F90
// FUNCTION: fn_11330
void UIShowAndEditTimeCtrl::Slot15(int, int) {
for (int i = 0; i < 2; ++i) {
UIEditCtrlVarId*& field = this->fields[i];
field = new UIEditCtrlVarId(*this->m_context, *this->m_edit);
field->SetSize(20, 18);
field->Background(232, 232, 232);
field->Border(192, 192, 192);
field->flat = 0;
field->maximum = 2;
field->Move(i * 38, 0);
field->SetText("0");
field->SetId(184);
this->AddChild(field);
}
}
// OFFSET: 0x008996B0
// FUNCTION: fn_11556
int UIShowAndEditTimeCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
if (message == 6 && argument1 == 184) {
for (UIEditCtrlVarId* field : this->fields) {
if (sender == field) {
int value = std::atoi(field->Text());
if (value > 60) {
value = 60;
}
const std::string text = FormatOwnedString("%d", value);
field->SetText(text.c_str());
}
}
}
return 0;
}

View file

@ -6,12 +6,18 @@
class TableBox : public UIWindow {
public:
void Slot15(int width, int height) override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
/* 007C */ unsigned char unknown_007C[0x4];
/* 0080 */ std::uint32_t borderColor;
};
class UITableBox : public UIWindow {
public:
void Slot15(int width, int height) override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
};
#endif

View file

@ -5,7 +5,8 @@
#include "UI/Lists/UIListBox.h"
#include "UI/Text/UIStaticText.h"
#include "UI/Window/WindowPolicy.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Lists/UIComboBoxWnd.h"
#include <cstdio>
namespace {
@ -308,3 +309,76 @@ void UIComboBoxDef2Wnd::Paint() {
this->label->Invalidate();
}
}
// OFFSET: 0x00886C30
// FUNCTION: fn_11329
void UINewComboBoxCtrl::Slot15(int, int) {
const std::string base = "유저인터페이스\\basic_interface\\txtbox_btn_";
this->button = new UIBitmapButton(*this->m_context, *this->m_buttons);
this->button->SetBitmap((base + "a.bmp").c_str(), 0, 0);
this->button->SetBitmap((base + "b.bmp").c_str(), 1, 0);
this->button->SetBitmap((base + "c.bmp").c_str(), 2, 0);
this->button->SetSize(this->button->BitmapWidth(), this->button->BitmapHeight());
this->button->Move((this->geometry.width - this->button->BitmapWidth()), 0);
this->button->SetId(273);
this->AddChild(this->button);
this->label = new UIStaticText(*this->m_context, *this->m_buttons);
this->label->SetSize((this->geometry.width - this->button->BitmapWidth()), this->button->BitmapHeight());
this->label->SetText("(No Select)", 0);
this->label->Move(2, 3);
this->label->shadow = 1;
this->AddChild(this->label);
}
// OFFSET: 0x008994B0
// FUNCTION: fn_11555
int UINewComboBoxCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
if (message == 6) {
if (argument1 == 273) {
this->dropped = !this->dropped;
if (g_windowMgr.unknown_0214) {
g_windowMgr.CloseWindow(26);
}
if (this->dropped) {
UIWindow* window = g_windowMgr.EnsureWindow(26);
const int count = static_cast<int>(this->items.size());
for (int index = 0; index < count; ++index) {
window->SendMsg(nullptr, 31, reinterpret_cast<std::intptr_t>(this->items[index].c_str()), 0, 0, 0);
}
window->SendMsg(nullptr, 40, this->selected, 0, 0, 0);
window->Resize(this->geometry.width, count * 16);
static_cast<UIComboBoxWnd*>(window)->SetOwner(this);
int x = 0;
int y = this->geometry.height;
this->ToScreen(x, y);
window->Move(x, y);
}
}
return 0;
}
if (message != 39) {
return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}
this->dropped = false;
const int index = static_cast<int>(argument1);
if (index < 0) {
return 0;
}
if (static_cast<unsigned int>(index) <= this->items.size()) {
this->label->SetText(this->items[index].c_str(), 0);
}
this->selected = index;
this->parent->SendMsg(this, 39, index, 0, 0, 0);
this->Invalidate();
this->parent->Invalidate();
if (this->Root()) {
this->Root()->Invalidate();
}
return 0;
}

View file

@ -44,6 +44,25 @@ protected:
UIComboBoxHeaderContext* m_controls;
};
class UINewComboBoxCtrl : public UIWindow {
public:
void Slot15(int width, int height) override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
/* 007C */ UIBitmapButton* button;
/* 0080 */ UIStaticText* label;
protected:
UIButtonContext* m_buttons;
public:
/* 0084 */ unsigned char unknown_0084;
/* 0085 */ bool dropped;
/* 0088 */ unsigned char unknown_0088[0x18];
/* 00A0 */ int selected;
/* 00A4 */ std::vector<std::string> items;
};
class UIComboBoxDef2Wnd : public UIComboBoxDefWnd {
public:
UIComboBoxDef2Wnd(UIWindowContext& windows, UIComboBoxHeaderContext& controls);

View file

@ -15,6 +15,7 @@ struct IdListLine {
class UIListBoxID : public UIWindow {
public:
void Slot15(int width, int height) override;
void Slot25(int x, int y) override;
void Slot35(int value) override;
virtual void Clear();
@ -28,7 +29,8 @@ public:
/* 00A0 */ int verticalOverflow;
/* 00A4 */ int bottomMargin;
/* 00A8 */ UIScrollBar* verticalBar;
/* 00AC */ unsigned char unknown_00AC[0x8];
/* 00AC */ UIScrollBar* horizontalBar;
/* 00B0 */ unsigned char unknown_00B0[0x4];
/* 00B4 */ int lineHeight;
};

View file

@ -4,10 +4,13 @@
#include "UI/Window/UIWindow.h"
class UIScrollBar;
class UIEditCtrl2;
struct UIEditContext;
class UITreeView : public UIWindow {
public:
void Resize(int width, int height) override;
void Slot15(int width, int height) override;
void Slot25(int x, int y) override;
void Slot27(int x, int y) override;
void Slot31(int x, int y) override;
@ -21,11 +24,15 @@ protected:
/* 0088 */ int unknown_0088;
/* 008C */ int unknown_008C;
/* 0090 */ int unknown_0090;
/* 0094 */ unsigned char unknown_0094[0xC];
/* 0094 */ unsigned char unknown_0094[0x4];
/* 0098 */ UIEditCtrl2* edit;
/* 009C */ unsigned char unknown_009C[0x4];
/* 00A0 */ int itemHeight;
/* 00A4 */ int itemCount;
/* 00A8 */ int unknown_00A8;
/* 00AC */ unsigned char unknown_00AC;
UIEditContext* m_edit;
};
#endif

View file

@ -244,3 +244,9 @@ void UITextViewer::Paint() {
}
}
}
// OFFSET: 0x00887290
// FUNCTION: fn_11333
void UITextViewEX::Slot15(int width, int height) {
UIListBox::Slot15(width, height);
}

View file

@ -74,6 +74,7 @@ private:
class UITextViewEX : public UITextViewer {
public:
void Configure(int x, int y, int width, int height, unsigned char transparent) override;
void Slot15(int width, int height) override;
void Clear() override;
std::vector<UIWindow*> extraLinks;