diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 7a60f913..abf36ed8 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -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(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(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(nullptr), *reinterpret_cast(nullptr), 0), m_identified(false) { +} + // OFFSET: 0x008C6FA0 // OFFSET: 0x008C7070 diff --git a/Source/UI/Dialogs/UITipboxWnd.h b/Source/UI/Dialogs/UITipboxWnd.h index 92d1b3a6..4cff097e 100644 --- a/Source/UI/Dialogs/UITipboxWnd.h +++ b/Source/UI/Dialogs/UITipboxWnd.h @@ -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 m_animations; /* 00E8 */ std::vector 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) diff --git a/Source/UI/Items/UINotifyItemObtainWnd.h b/Source/UI/Items/UINotifyItemObtainWnd.h index b91d265c..d92aecf8 100644 --- a/Source/UI/Items/UINotifyItemObtainWnd.h +++ b/Source/UI/Items/UINotifyItemObtainWnd.h @@ -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; diff --git a/Source/UI/Skill/UISkillDescribeWnd.h b/Source/UI/Skill/UISkillDescribeWnd.h index 5426de9b..572bdbde 100644 --- a/Source/UI/Skill/UISkillDescribeWnd.h +++ b/Source/UI/Skill/UISkillDescribeWnd.h @@ -3,9 +3,16 @@ #include "UI/Window/UIFrameWnd.h" +#include + 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; diff --git a/Source/UI/Window/UIFrameWnd.h b/Source/UI/Window/UIFrameWnd.h index 0d685e59..a00d9971 100644 --- a/Source/UI/Window/UIFrameWnd.h +++ b/Source/UI/Window/UIFrameWnd.h @@ -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;