Decompile 13 functions in Source/UI/Edit/UIEditBoxEx.cpp, Source/UI/Edit/UIEditBoxEx.h

Batch #4993 by Yommy: 0 byte-identical, 13 confirmed by peer review.

- fn_14447 CUIEditCtrlEx::ResetDragState: logic confirmed by peer review
- fn_14448 CUIEditBoxEx::Resize: logic confirmed by peer review
- fn_14449 CUIEditBoxEx::SendMsg: logic confirmed by peer review
- fn_14451 CUIEditBoxEx::SetAlignment: logic confirmed by peer review
- fn_14452 CUIEditBoxEx::SetBackgroundColor: logic confirmed by peer review
- fn_14454 CUIEditBoxEx::SetTextColor: logic confirmed by peer review
- fn_14455 CUIEditBoxEx::SetHighlight: logic confirmed by peer review
- fn_14456 CUIEditBoxEx::SetBorderColor: logic confirmed by peer review
- fn_14457 CUIEditBoxEx::SetBorderWidth: logic confirmed by peer review
- fn_14458 CUIEditBoxEx::SetMaximum: logic confirmed by peer review
- fn_14459 CUIEditBoxEx::SetEditBounds: logic confirmed by peer review
- fn_14460 CUIEditBoxEx::SetMask: logic confirmed by peer review
- fn_14461 CUIEditBoxEx::SetText: 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 07:10:01 +00:00
commit c1f8b59cab
2 changed files with 121 additions and 2 deletions

View file

@ -38,3 +38,104 @@ void CUIEditCtrlEx::Paint() {
}
// OFFSET: 0x009E4F90
// OFFSET: 0x009E5A60
// FUNCTION: fn_14447
void CUIEditCtrlEx::ResetDragState() {
this->unknown_01D4 = -1;
this->unknown_01D8 = 0;
this->unknown_01DC = 0;
}
// OFFSET: 0x009E5A80
// FUNCTION: fn_14448
void CUIEditBoxEx::Resize(int width, int height) {
UIWindow::Resize(width, height);
this->edit->Resize(width - this->editRight - this->editLeft, height - this->editBottom - this->editTop);
this->edit->Move(this->editLeft, this->editTop);
}
// OFFSET: 0x009E5AE0
// FUNCTION: fn_14449
int CUIEditBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message == 0 && this->onSubmit) {
this->onSubmit();
}
return UIWindow::SendMsg(sender, message, a, b, c, d);
}
// OFFSET: 0x009E6090
// FUNCTION: fn_14451
void CUIEditBoxEx::SetAlignment(int value) {
CUIEditCtrlEx* edit = this->edit;
edit->alignment = value;
edit->Invalidate();
}
// OFFSET: 0x009E60D0
// FUNCTION: fn_14452
void CUIEditBoxEx::SetBackgroundColor(std::uint32_t color) {
this->backgroundColor = color;
this->Invalidate();
}
// OFFSET: 0x009E6320
// FUNCTION: fn_14454
void CUIEditBoxEx::SetTextColor(std::uint32_t color) {
CUIEditCtrlEx* edit = this->edit;
edit->normalColor = color;
edit->textColor = color;
edit->selectedAll = 1;
}
// OFFSET: 0x009E6370
// FUNCTION: fn_14455
void CUIEditBoxEx::SetHighlight(int value) {
CUIEditCtrlEx* edit = this->edit;
edit->unknown_018C = value;
edit->unknown_0190 = 1;
edit->Invalidate();
}
// OFFSET: 0x009E63C0
// FUNCTION: fn_14456
void CUIEditBoxEx::SetBorderColor(std::uint32_t color) {
this->borderColor = color;
this->Invalidate();
}
// OFFSET: 0x009E63E0
// FUNCTION: fn_14457
void CUIEditBoxEx::SetBorderWidth(int width) {
this->borderWidth = width;
this->Invalidate();
}
// OFFSET: 0x009E6430
// FUNCTION: fn_14458
void CUIEditBoxEx::SetMaximum(int value) {
this->edit->maximum = value;
this->edit->SetText(this->edit->Text());
}
// OFFSET: 0x009E6470
// FUNCTION: fn_14459
void CUIEditBoxEx::SetEditBounds(int left, int top, int right, int bottom) {
this->editLeft = left;
this->editTop = top;
this->editRight = right;
this->editBottom = bottom;
this->Resize(this->geometry.width, this->geometry.height);
}
// OFFSET: 0x009E64B0
// FUNCTION: fn_14460
void CUIEditBoxEx::SetMask(char value) {
this->edit->mask = value;
}
// OFFSET: 0x009E64D0
// FUNCTION: fn_14461
void CUIEditBoxEx::SetText(const std::string& text) {
this->edit->SetText(text.c_str());
}

View file

@ -7,6 +7,7 @@
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <string>
#include <vector>
@ -25,6 +26,7 @@ public:
virtual void UpdateScrollBar();
void RefreshPlaceholder();
void ResetDragState();
int LeadingBytesFitting(const std::string& text, int width);
int TrailingOffsetFitting(const std::string& text, int width);
@ -33,7 +35,7 @@ public:
/* 0190 */ unsigned char unknown_0190;
/* 0194 */ std::string placeholder;
/* 01AC */ std::uint32_t placeholderColor;
/* 01B0 */ int unknown_01B0;
/* 01B0 */ int alignment;
/* 01B4 */ int unknown_01B4;
/* 01B8 */ int verticalPadding;
/* 01BC */ std::vector<EditLine> lines;
@ -53,18 +55,34 @@ public:
class CUIEditBoxEx : public CUIControl {
public:
void Resize(int width, int height) override;
bool Slot05() override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
void ResetSelection();
void SetCursor(std::size_t position);
int Length();
void SetAlignment(int value);
void SetBackgroundColor(std::uint32_t color);
void SetTextColor(std::uint32_t color);
void SetHighlight(int value);
void SetBorderColor(std::uint32_t color);
void SetBorderWidth(int width);
void SetMaximum(int value);
void SetEditBounds(int left, int top, int right, int bottom);
void SetMask(char value);
void SetText(const std::string& text);
/* 0080 */ std::uint32_t backgroundColor;
/* 0084 */ std::uint32_t borderColor;
/* 0088 */ int borderWidth;
/* 008C */ int unknown_008C[4];
/* 008C */ int editLeft;
/* 0090 */ int editTop;
/* 0094 */ int editRight;
/* 0098 */ int editBottom;
/* 009C */ CUIEditCtrlEx* edit;
/* 00A0 */ std::function<void()> onSubmit;
};
#endif