Decompile 2 functions in Source/UI/Acceptance/UIChooseSellBuyWnd.cpp, Source/UI/Window/UIFrameWnd.h, ...

Batch #8021 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_12072 UIFrameWnd::FitLastTextLine: logic confirmed by peer review
- fn_12417 UIFrameWnd::DrawTextLines: logic confirmed by peer review

Peer-reviewed-by: Yommy, Tanke
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 13:18:37 +00:00
commit f420ea4e5c
5 changed files with 77 additions and 2 deletions

View file

@ -2222,6 +2222,48 @@ void UIItemParamChangeDisplayWnd::Slot15(int, int) {
void UIMenuWnd::Slot15(int, int) {
}
// OFFSET: 0x008CED30
// FUNCTION: fn_12072
void UIFrameWnd::FitLastTextLine(int width, unsigned lineCount, int family, int height, FrameTextLines& lines) {
if (lines.begin() == lines.end()) {
return;
}
if (static_cast<unsigned>(lines.end() - lines.begin()) < lineCount - 1) {
return;
}
auto& last = lines.back();
if (last.begin() == last.end()) {
return;
}
int total = 0;
for (auto it = last.begin(); it != last.end(); ++it) {
int segment = this->TextWidth(this->m_context->fonts, this->m_context->locale, it->second.c_str(), it->second.size(), 0, 12, 0, 0);
total += segment;
if (total >= width) {
it->second = this->FitDisplayText(width - total + segment, it->second.c_str(), family, height, 0);
last.erase(it + 1, last.end());
break;
}
}
}
// OFFSET: 0x0090AD60
// FUNCTION: fn_12417
void UIFrameWnd::DrawTextLines(int x, int y, int family, int lineHeight, const FrameTextLines& lines) {
y -= (static_cast<int>(lines.end() - lines.begin()) - 1) * (lineHeight / 2);
for (auto line = lines.begin(); line != lines.end(); ++line) {
int left = x;
for (auto it = line->begin(); it != line->end(); ++it) {
this->DrawShadowedText(left, y, it->second.c_str(), it->second.size(), it->first, 0xE0E0E0, family, 12, 0);
left += this->TextWidth(this->m_context->fonts, this->m_context->locale, it->second.c_str(), it->second.size(), 0, 12, 0, 0);
}
y += lineHeight;
}
}
// OFFSET: 0x0090AB10
// FUNCTION: fn_12416
int UIWindow::DrawItemNameSegments(
@ -3607,6 +3649,16 @@ UInCash_CallWnd::UInCash_CallWnd(UIWindowContext& windows, UIFrameContext& frame
: UIFrameWnd(windows, frames, 0) {
}
// OFFSET: 0x008C8F80
// OFFSET: 0x008C9430
// OFFSET: 0x008C86B0
// FUNCTION: fn_11958
UINotifyItemObtainWnd::UINotifyItemObtainWnd()
: UIFrameWnd(*reinterpret_cast<UIWindowContext*>(nullptr), *reinterpret_cast<UIFrameContext*>(nullptr), 0), m_identified(false) {
}
// OFFSET: 0x008C6FA0
// OFFSET: 0x008C7070

View file

@ -30,16 +30,28 @@ struct TipBoxDot {
class UITipboxWnd : public UIFrameWnd {
public:
UITipboxWnd();
void ShowTip(int id);
void TrimAt(std::string& text, const char* marker);
void UpdateAnimations();
bool BuildAnimations();
/* 00B4 */ unsigned char unknown_00B4[0x28];
/* 00B4 */ int unknown_00B4;
/* 00B8 */ int unknown_00B8;
/* 00BC */ int unknown_00BC;
/* 00C0 */ int unknown_00C0;
/* 00C4 */ int unknown_00C4;
/* 00C8 */ int unknown_00C8;
/* 00CC */ int unknown_00CC;
/* 00D0 */ int unknown_00D0;
/* 00D4 */ int unknown_00D4;
/* 00D8 */ int unknown_00D8;
/* 00DC */ std::vector<TipBoxAnimation> m_animations;
/* 00E8 */ std::vector<TipBoxDot> m_dots;
/* 00F4 */ std::uint32_t m_buildTime;
/* 00F8 */ std::uint32_t m_frameTime;
/* 00FC */ bool unknown_00FC;
/* 0100 */ int unknown_0100;
};
#if defined(_WIN32) && !defined(_WIN64)

View file

@ -8,6 +8,8 @@
class UINotifyItemObtainWnd : public UIFrameWnd {
public:
UINotifyItemObtainWnd();
/* 00B4 */ std::string m_itemId;
/* 00CC */ std::string m_message;
/* 00E4 */ std::uint32_t m_shownTick;

View file

@ -3,9 +3,16 @@
#include "UI/Window/UIFrameWnd.h"
#include <string>
class UISkillDescribeWnd : public UIFrameWnd {
public:
/* 00B4 */ unsigned char unknown_00B4[0x50];
UISkillDescribeWnd();
/* 00B4 */ unsigned char unknown_00B4[0x8];
/* 00BC */ std::string unknown_00BC;
/* 00D4 */ std::string unknown_00D4;
/* 00EC */ std::string unknown_00EC;
/* 0104 */ int m_skillId;
/* 0108 */ UIWindow* m_text;

View file

@ -45,6 +45,8 @@ public:
);
UICheckBox* AddCheckBox(UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, int checked, const char* tooltip);
void DrawBorder(int x, int y, int width, int height);
void FitLastTextLine(int width, unsigned lineCount, int family, int height, FrameTextLines& lines);
void DrawTextLines(int x, int y, int family, int lineHeight, const FrameTextLines& lines);
protected:
/* 007C */ int m_dragX;