diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index d61b798b..96f8ae54 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -1,10 +1,13 @@ #include "Contents/AdventureGuideMgr.h" +#include "Contents/MessageTable.h" #include "Contents/RenewQuestMgr.h" #include "UI/AdventureGuide/UIAdventureGuide.h" #include "UI/Lists/UIListBoxTemplate.h" #include "Render/Renderer.h" #include "UI/Lists/UIVScrollBar.h" #include "UI/Text/UIStaticTextControl.h" +#include "UI/Text/UITextViewerControl.h" +#include "Utility/Text/FormatString.h" template void CUIListBoxEx::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); @@ -235,6 +238,50 @@ void CUITab::Slot16() { void CUITabInfo::Slot16() { } +// OFFSET: 0x009DC0F0 +// FUNCTION: fn_14316 +void CUIIntro::BindContents(CUITabInfo* item, const Guide_Intro::Contents& contents) { + item->unknown_00E8->SetText(contents.first.c_str(), contents.first.size()); + item->unknown_00EC->SetText(contents.second.c_str(), contents.second.size()); +} + +// OFFSET: 0x009DFAD0 +// FUNCTION: fn_14359 +void CUIQuestInfo::SetStatusLines(bool first, bool second, bool third) { + CUITextViewer* viewer = reinterpret_cast(this->unknown_00F4); + viewer->Clear(); + if (first == true) { + viewer->SetTextColor(0xC86464u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC2))); + } else { + viewer->SetTextColor(0x6464C8u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC3))); + } + if (second == true) { + viewer->SetTextColor(0xC86464u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC4))); + } else { + viewer->SetTextColor(0x6464C8u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC5))); + } + if (third == true) { + viewer->SetTextColor(0xC86464u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC6))); + } else { + viewer->SetTextColor(0x6464C8u); + viewer->AddLine(FormatOwnedString(LookupMessage(0xFC7))); + } +} + +// OFFSET: 0x009E07B0 +// FUNCTION: fn_14362 +void CUIQuestInfo::SetViewerLines(const std::vector& lines) { + reinterpret_cast(this->unknown_00F0)->Clear(); + for (const std::string& line : lines) { + reinterpret_cast(this->unknown_00F0)->AddLine(line); + } +} + // OFFSET: 0x009DDA40 // FUNCTION: fn_14347 void CUIIntro::Slot54(int, int) { diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.h b/Source/UI/AdventureGuide/UIAdventureGuide.h index b4de65c5..6ff7bc1b 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.h +++ b/Source/UI/AdventureGuide/UIAdventureGuide.h @@ -32,6 +32,7 @@ public: void Slot54(int first, int second) override; void OnSelectContents(CUITabInfo* item, const Guide_Intro::Contents& contents); + void BindContents(CUITabInfo* item, const Guide_Intro::Contents& contents); /* 0084 */ CUIStaticImage* image; /* 0088 */ CUIListBoxEx* contents; diff --git a/Source/UI/Lists/UIListBoxTemplate.h b/Source/UI/Lists/UIListBoxTemplate.h index 3bf8104d..0e9f95f3 100644 --- a/Source/UI/Lists/UIListBoxTemplate.h +++ b/Source/UI/Lists/UIListBoxTemplate.h @@ -87,6 +87,8 @@ public: class CUIQuestInfo : public CUIListItem { public: void Slot16() override; + void SetStatusLines(bool first, bool second, bool third); + void SetViewerLines(const std::vector& lines); /* 00E8 */ UIWindow* unknown_00E8; /* 00EC */ CUIStaticText* unknown_00EC; @@ -99,6 +101,9 @@ public: class CUITabInfo : public CUIListItem { public: void Slot16() override; + + /* 00E8 */ CUIStaticText* unknown_00E8; + /* 00EC */ CUIStaticText* unknown_00EC; }; class CItemData {}; class CMonsterData { diff --git a/Source/UI/Text/UIStaticTextControl.h b/Source/UI/Text/UIStaticTextControl.h index ee56c3df..324d93cc 100644 --- a/Source/UI/Text/UIStaticTextControl.h +++ b/Source/UI/Text/UIStaticTextControl.h @@ -14,6 +14,7 @@ public: void SetColor(std::uint32_t color); void SetOutline(bool enabled, std::uint32_t color); void SetShadow(bool enabled, std::uint32_t color); + void SetText(const char* value, std::size_t length); /* 0080 */ std::string text; /* 0098 */ std::string unknown_0098; diff --git a/Source/UI/Text/UITextViewerControl.h b/Source/UI/Text/UITextViewerControl.h index 901f4b42..caf7b9ce 100644 --- a/Source/UI/Text/UITextViewerControl.h +++ b/Source/UI/Text/UITextViewerControl.h @@ -36,6 +36,7 @@ public: void SetScrollBarBackground(const std::string& name); void SetText(const std::string& text); void Clear(); + void AddLine(const std::string& text); /* 0080 */ int textX; /* 0084 */ int textY;