diff --git a/Source/Client/Input/Language.cpp b/Source/Client/Input/Language.cpp index adfd451e..fc1a21eb 100644 --- a/Source/Client/Input/Language.cpp +++ b/Source/Client/Input/Language.cpp @@ -407,13 +407,13 @@ UICaptchaPreviewWnd::UICaptchaPreviewWnd(UIWindowContext& windows) // OFFSET: 0x0086C7B0 // FUNCTION: fn_11030 -UIChatHisBox2::UIChatHisBox2(UIWindowContext& windows, UIListBoxContext& list) - : UIChatHisBox(windows, list), backgroundRed(255), backgroundGreen(255), backgroundBlue(255) { +UIChatHisBox2::UIChatHisBox2(UIWindowContext& windows) + : UIChatHisBox(windows), backgroundRed(255), backgroundGreen(255), backgroundBlue(255) { } // OFFSET: 0x0086C830 // FUNCTION: fn_11031 -UIChatHisBox3::UIChatHisBox3(UIWindowContext& windows, UIListBoxContext& list) : UIChatHisBox2(windows, list), unknown_0130(1), unknown_0134(12) { +UIChatHisBox3::UIChatHisBox3(UIWindowContext& windows) : UIChatHisBox2(windows), unknown_0130(1), unknown_0134(12) { } // OFFSET: 0x00999FF0 diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index 3f40586d..b7f16756 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -3779,7 +3779,7 @@ void CGameMode::ShowSpecialPopup(int popupId) { switch (popup->m_messageId) { case 0: for (const std::string& description : popup->m_descriptions) { - text = RemoveTextColors(description.c_str(), static_cast(g_textCodePage)); + text = RemoveTextColors(description.c_str()); g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); } break; @@ -3790,7 +3790,7 @@ void CGameMode::ShowSpecialPopup(int popupId) { [[fallthrough]]; case 2: for (const std::string& description : popup->m_descriptions) { - text = RemoveTextColors(description.c_str(), static_cast(g_textCodePage)); + text = RemoveTextColors(description.c_str()); g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); } if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(358)) { diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index a87d8a35..a3a8aa43 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -298,8 +298,8 @@ void UIChooseSellBuyWnd::CreateViewer(int width, int height) { // OFFSET: 0x008C7420 // FUNCTION: fn_11931 -UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext) - : UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices(), m_listContext(&listContext) { +UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices() { this->m_choices.reserve(6); } @@ -324,7 +324,7 @@ void UIChooseWarpWnd::Slot15(int width, int height) { title->SetFont(0, 12, 0, 0); this->AddChild(title); - this->m_list = new UIListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIListBox(*this->m_context); int listWidth = width - 24; int listHeight = height - 55; if (listWidth < 20) { @@ -362,7 +362,7 @@ void UIChooseWarpWnd::Slot15(int width, int height) { // OFFSET: 0x008DE0E0 // FUNCTION: fn_12164 void UIChooseWnd::Slot15(int width, int height) { - this->m_list = new UIListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIListBox(*this->m_context); int listHeight = height - 55; if (listHeight < 30) { listHeight = 30; diff --git a/Source/UI/Buttons/UINaviLinkButton.cpp b/Source/UI/Buttons/UINaviLinkButton.cpp index ab5ce81a..6d41c596 100644 --- a/Source/UI/Buttons/UINaviLinkButton.cpp +++ b/Source/UI/Buttons/UINaviLinkButton.cpp @@ -1,10 +1,10 @@ +#include "Contents/NavigationManager.h" #include "UI/Text/NavigationLink.h" #include "UI/Buttons/UINaviLinkButton.h" // OFFSET: 0x0086DF60 // FUNCTION: fn_11062 -UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation) - : UITextButton(windows), m_navigation(&navigation) { +UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows) : UITextButton(windows) { } // OFFSET: 0x00873A90 @@ -30,6 +30,6 @@ void UINaviLinkButton::Slot25(int, int) { } if (!map.empty()) { - this->m_navigation->Navigate(map, x, y); + g_navigationManager.SetDestinationMap(map, x, y); } } diff --git a/Source/UI/Buttons/UINaviLinkButton.h b/Source/UI/Buttons/UINaviLinkButton.h index f4700afd..aa7be5d2 100644 --- a/Source/UI/Buttons/UINaviLinkButton.h +++ b/Source/UI/Buttons/UINaviLinkButton.h @@ -3,17 +3,9 @@ #include "UI/Buttons/UITextButton.h" -class NavigationDestination { -public: - virtual void Navigate(std::string map, int x, int y) = 0; - -protected: - ~NavigationDestination() = default; -}; - class UINaviLinkButton : public UITextButton { public: - UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation); + UINaviLinkButton(UIWindowContext& windows); ~UINaviLinkButton() override; void Slot25(int x, int y) override; std::string Link(); @@ -21,8 +13,7 @@ public: /* 0110 */ int column; /* 0114 */ int line; -private: - NavigationDestination* m_navigation; + void* unknown_0118; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index e2d10aab..46b84fbf 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1915,7 +1915,6 @@ void UIListBoxNavi::Paint() { const int limit = this->geometry.height / this->lineHeight - this->bottomMargin + first; const int end = static_cast(std::min(static_cast(this->lines.size()), static_cast(limit))); std::uint32_t color = 0; - auto& owner = *this->m_listContext; for (int index = first, row = 0; index < end; ++index, ++row) { if (this->lineColors[index] == 1) { @@ -3199,7 +3198,6 @@ void UIListBox2::Paint() { end = count; } - auto& owner = *this->m_listContext; for (int row = 0; row + first < static_cast(end); ++row) { const int index = row + first; if (index == this->selected) { @@ -3437,7 +3435,7 @@ UITVTextButton::UITVTextButton() : UIButton() { // OFFSET: 0x0086DE10 // FUNCTION: fn_11060 -UIMemberListBox::UIMemberListBox(UIWindowContext& windows, UIListBoxContext& list) : UIChatHisBox2(windows, list) { +UIMemberListBox::UIMemberListBox(UIWindowContext& windows) : UIChatHisBox2(windows) { this->backgroundRed = 255; this->backgroundGreen = 255; this->backgroundBlue = 255; @@ -3454,8 +3452,8 @@ void UIChatHisBox2::Paint() { end = static_cast(this->lines.size()); } - FontCache& fonts = this->m_listContext->fonts; - const TextLocale& locale = this->m_listContext->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; for (int row = 0; top + row < static_cast(end); ++row) { const int index = top + row; int x; @@ -3489,8 +3487,8 @@ void UIChatHisBox3::Paint() { end = static_cast(this->lines.size()); } - FontCache& fonts = this->m_listContext->fonts; - const TextLocale& locale = this->m_listContext->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; for (int row = 0; top + row < static_cast(end); ++row) { const int index = top + row; this->DrawTextAt(2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, this->unknown_0134, this->unknown_00E4[index], 0, 0); diff --git a/Source/UI/Chat/UISubChatHisWnd.cpp b/Source/UI/Chat/UISubChatHisWnd.cpp index 2399a348..0a681088 100644 --- a/Source/UI/Chat/UISubChatHisWnd.cpp +++ b/Source/UI/Chat/UISubChatHisWnd.cpp @@ -164,7 +164,7 @@ void UISubChatHisWnd::Slot15(int width, int height) { this->AddChild(button); } - this->m_chatBox = new UIChatHisBox(*this->m_context, *this->m_listContext); + this->m_chatBox = new UIChatHisBox(*this->m_context); this->m_chatBox->Configure(0, 0, this->geometry.width - 8, this->geometry.height - this->unknown_00F0 - this->m_inputHeight - 4, 0); this->m_chatBox->Move(5, this->m_inputHeight + 4); this->AddChild(this->m_chatBox); @@ -208,8 +208,8 @@ void UISubChatHisWnd::Slot15(int width, int height) { // OFFSET: 0x00912340 // FUNCTION: fn_12529 -UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list) - : UIFrameWnd(windows, 0), m_editContext(&edit), m_listContext(&list) { +UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit) + : UIFrameWnd(windows, 0), m_editContext(&edit) { this->m_saved = nullptr; this->m_resizer = nullptr; this->m_chatBox = nullptr; diff --git a/Source/UI/Chat/UISubChatHisWnd.h b/Source/UI/Chat/UISubChatHisWnd.h index 106ebcf0..e529647b 100644 --- a/Source/UI/Chat/UISubChatHisWnd.h +++ b/Source/UI/Chat/UISubChatHisWnd.h @@ -12,7 +12,6 @@ class UIResizer; class UIWindowMgr; struct SubChatHisWndInfo; struct UIEditContext; -struct UIListBoxContext; struct SubChatHistoryState { /* 0000 */ int unknown_0000; @@ -29,7 +28,7 @@ class UISubChatHisWnd : public UIFrameWnd { public: UISubChatHisWnd(); - UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list); + UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit); void Resize(int width, int height) override; void Move(int x, int y) override; void Slot11() override; @@ -63,7 +62,7 @@ private: /* 012C */ UIEditCtrl* m_edit; void* unknown_controls; UIEditContext* m_editContext; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Dialogs/UIChooseWarpWnd.h b/Source/UI/Dialogs/UIChooseWarpWnd.h index c9cc39af..67710b60 100644 --- a/Source/UI/Dialogs/UIChooseWarpWnd.h +++ b/Source/UI/Dialogs/UIChooseWarpWnd.h @@ -6,12 +6,11 @@ #include #include -struct UIListBoxContext; class UIListBox; class UIChooseWarpWnd : public UIFrameWnd { public: - UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext); + UIChooseWarpWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Paint() override; std::vector Slot44() override; @@ -23,7 +22,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; #endif diff --git a/Source/UI/Dialogs/UIChooseWnd.cpp b/Source/UI/Dialogs/UIChooseWnd.cpp index f6cd8b88..2869cf5e 100644 --- a/Source/UI/Dialogs/UIChooseWnd.cpp +++ b/Source/UI/Dialogs/UIChooseWnd.cpp @@ -8,8 +8,8 @@ UIChooseWnd::~UIChooseWnd() { // OFFSET: 0x008C74C0 // FUNCTION: fn_11932 -UIChooseWnd::UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists) - : UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr), m_listContext(&lists) { +UIChooseWnd::UIChooseWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr) { this->unknown_00B4 = -1; this->m_placement = nullptr; } diff --git a/Source/UI/Dialogs/UIChooseWnd.h b/Source/UI/Dialogs/UIChooseWnd.h index 8be8d8b2..34ae32a8 100644 --- a/Source/UI/Dialogs/UIChooseWnd.h +++ b/Source/UI/Dialogs/UIChooseWnd.h @@ -6,13 +6,12 @@ #include struct ChooseWndInfo; -struct UIListBoxContext; class UIBitmapButton; class UIListBox; class UIChooseWnd : public UIFrameWnd { public: - UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists); + UIChooseWnd(UIWindowContext& windows); ~UIChooseWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -30,7 +29,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; class UIChoose3Wnd : public UIChooseWnd { diff --git a/Source/UI/Edit/UIEditCtrl.h b/Source/UI/Edit/UIEditCtrl.h index 99290173..c9c3e18c 100644 --- a/Source/UI/Edit/UIEditCtrl.h +++ b/Source/UI/Edit/UIEditCtrl.h @@ -13,7 +13,6 @@ struct CLanguageBase; using InputCharset = CLanguageBase; struct BitmapImage; #include "UI/Window/WindowManagerWindows.h" -class NavigationDestination; class UINaviLinkButton; class UIItemTagButton; struct ITEM_INFO; @@ -24,7 +23,6 @@ struct UIEditContext { unsigned char& password; const InputCharset& charset; WindowManagerWindows& windows; - NavigationDestination& navigation; const BitmapImage& colorChip; const int& candidateCursor; UIWindow* const& candidateWindow; diff --git a/Source/UI/Edit/UIEditLinks.cpp b/Source/UI/Edit/UIEditLinks.cpp index ac8e8433..b7f2b277 100644 --- a/Source/UI/Edit/UIEditLinks.cpp +++ b/Source/UI/Edit/UIEditLinks.cpp @@ -254,7 +254,7 @@ void UIEditCtrl::InsertLink(const char* value) { this->anchor = this->cursor = static_cast(this->text.size()); g_serverLanguage->Select(this->cursor, this->cursor); - auto* button = new UINaviLinkButton(*this->m_context, this->m_edit->navigation); + auto* button = new UINaviLinkButton(*this->m_context); button->Configure(display.c_str(), 0x009E68F0, 0, 12, 0, 0); button->SetId(438); diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index 7eade0c1..453b7b56 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp @@ -64,7 +64,7 @@ int UIEntryQueueHelpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, // OFFSET: 0x00BA42E0 // FUNCTION: fn_19684 -UIEntryQueueListBox::UIEntryQueueListBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { +UIEntryQueueListBox::UIEntryQueueListBox(UIWindowContext& windows) : UIListBox(windows) { } // OFFSET: 0x00BA43F0 @@ -332,9 +332,8 @@ void UIEntryQueueStandByWnd::SetInfo(const char* queueName, int waiting, int ran // OFFSET: 0x00BA6000 // FUNCTION: fn_19704 -UIEntryQueueWnd::UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue, UIListBoxContext& list) - : UIFrameWnd(windows, 0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_entryQueue(&entryQueue), - m_listContext(&list), m_applyButtons(), m_helpButton(nullptr) { +UIEntryQueueWnd::UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue) + : UIFrameWnd(windows, 0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_entryQueue(&entryQueue), m_applyButtons(), m_helpButton(nullptr) { } // OFFSET: 0x00BA6110 @@ -353,7 +352,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { this->AddBaseButton(); this->AddCloseButton("", 0); - this->m_list = new UIEntryQueueListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIEntryQueueListBox(*this->m_context); this->m_list->SetSize(130, 270); this->m_list->Move(10, 40); this->m_list->backgroundRed = 240; diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.h b/Source/UI/EntryQueue/UIEntryQueueWnd.h index 8b5e98f9..1116bfcd 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.h +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.h @@ -41,7 +41,7 @@ public: class UIEntryQueueListBox : public UIListBox { public: - UIEntryQueueListBox(UIWindowContext& windows, UIListBoxContext& list); + UIEntryQueueListBox(UIWindowContext& windows); ~UIEntryQueueListBox() override; void Slot31(int x, int y) override; virtual void AddEntry(const char* name, int value); @@ -102,7 +102,7 @@ public: class UIEntryQueueWnd : public UIFrameWnd { public: - UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue, UIListBoxContext& list); + UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue); ~UIEntryQueueWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -120,7 +120,7 @@ public: protected: UIEntryQueueContext* m_entryQueue; - UIListBoxContext* m_listContext; + void* unknown_listContext; UIBitmapButton* m_applyButtons[3]; UIBitmapButton* m_helpButton; }; diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 07732814..9cb0a572 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -98,7 +98,6 @@ void UIListBoxAgitMenu::Paint() { this->DrawBitmap(this->geometry.width - rightDown->image.width, this->geometry.height - rightDown->image.height, &rightDown->image, false); SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); - auto& owner = *this->m_listContext; for (int index = 0; index < 2; ++index) { if (index == this->selected) { this->FillRegion(3, this->lineHeight * index + 1, this->geometry.width - 6, this->lineHeight - 2, RGB(red, green, blue)); diff --git a/Source/UI/Guild/UIAgitWnd.h b/Source/UI/Guild/UIAgitWnd.h index b3bce238..a6c8d0b5 100644 --- a/Source/UI/Guild/UIAgitWnd.h +++ b/Source/UI/Guild/UIAgitWnd.h @@ -34,7 +34,7 @@ public: class UIListBoxAgitMenu : public UIListBox { public: - UIListBoxAgitMenu(UIWindowContext& windows, UIListBoxContext& list); + UIListBoxAgitMenu(UIWindowContext& windows); 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 Slot25(int x, int y) override; diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index def03f2e..07b80095 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -1027,14 +1027,14 @@ void UIGuildInfoManageWnd::Slot15(int, int) { this->AddChild(this->m_disbandButton); } - this->m_agitList = new UIListBoxAgit(*this->m_context, *this->m_listContext); + this->m_agitList = new UIListBoxAgit(*this->m_context); this->m_agitList->SetSize(95, 158); this->m_agitList->Move(this->TextWidth(LookupMessage(333), 0, 0, 12, 0, 0) + 19, 129); this->m_agitList->lineHeight = 13; this->m_agitList->SetId(558); this->AddChild(this->m_agitList); - this->m_agitMenu = new UIListBoxAgitMenu(*this->m_context, *this->m_listContext); + this->m_agitMenu = new UIListBoxAgitMenu(*this->m_context); this->m_agitMenu->SetSize(120, 35); this->m_agitMenu->SetId(559); this->m_agitMenu->Show(0); @@ -2257,7 +2257,7 @@ UIGuildTotalInfoWnd::UIGuildTotalInfoWnd(UIWindowContext& windows) // OFFSET: 0x00954120 // FUNCTION: fn_13006 -UIListBoxAgitMenu::UIListBoxAgitMenu(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { +UIListBoxAgitMenu::UIListBoxAgitMenu(UIWindowContext& windows) : UIListBox(windows) { } // OFFSET: 0x0095BF90 diff --git a/Source/UI/Guild/UIGuildWnd.h b/Source/UI/Guild/UIGuildWnd.h index be94793b..910de72b 100644 --- a/Source/UI/Guild/UIGuildWnd.h +++ b/Source/UI/Guild/UIGuildWnd.h @@ -41,7 +41,6 @@ class UIListBoxAgit; class UIListBoxAgitMenu; class UIScrollBar; class UIStaticText; -struct UIListBoxContext; struct GuildWndInfo; class ForbiddenWords; @@ -130,7 +129,7 @@ protected: /* 00FC */ int m_hostileRow; /* 0100 */ UIListBoxAgit* m_agitList; /* 0104 */ UIListBoxAgitMenu* m_agitMenu; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; class UIGuildMemberManageWnd : public UIGuildWnd { diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index 4d6288ed..1c01fa3b 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -54,7 +54,7 @@ void UIMakeTargetResultWnd::Paint() { // OFFSET: 0x009A0B00 // FUNCTION: fn_13604 void UIItemRepairWnd::Slot15(int width, int height) { - this->m_list = new UIListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIListBox(*this->m_context); this->m_list->Configure(12, 22, width - 24, height - 55, 0); this->m_list->backgroundRed = 240; this->m_list->backgroundGreen = 240; @@ -84,7 +84,7 @@ void UIItemRepairWnd::Slot15(int width, int height) { // OFFSET: 0x009A1590 // FUNCTION: fn_13605 void UIMakeTargetListWnd::Slot15(int width, int height) { - this->m_list = new UIListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIListBox(*this->m_context); this->m_list->Configure(12, 22, width - 24, height - 55, 0); this->m_list->backgroundRed = 240; this->m_list->backgroundGreen = 240; @@ -153,7 +153,7 @@ void UIMakeTargetResultWnd::Slot15(int width, int height) { // OFFSET: 0x009A2DD0 // FUNCTION: fn_13608 void UIWeaponRefineWnd::Slot15(int width, int height) { - this->m_list = new UIListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIListBox(*this->m_context); this->m_list->Configure(12, 22, width - 24, height - 55, 0); this->m_list->backgroundRed = 240; this->m_list->backgroundGreen = 240; @@ -309,7 +309,7 @@ int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x0099F780 // FUNCTION: fn_13587 -UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext, +UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, WindowResponseRecorder& recorder) : UIFrameWnd(windows, 0), itemIds(), indices(), entries() { } @@ -317,7 +317,7 @@ UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& lis // OFFSET: 0x0099F850 // FUNCTION: fn_13588 UIMakeTargetListWnd::UIMakeTargetListWnd( - UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder + UIWindowContext& windows, WindowResponseRecorder& recorder ) : UIFrameWnd(windows, 0), itemIds() { } @@ -341,7 +341,7 @@ UIMakeTargetResultWnd::UIMakeTargetResultWnd(UIWindowContext& windows) // OFFSET: 0x0099F9C0 // FUNCTION: fn_13591 UIWeaponRefineWnd::UIWeaponRefineWnd( - UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder + UIWindowContext& windows, WindowResponseRecorder& recorder ) : UIFrameWnd(windows, 0), itemIds(), indices() { } diff --git a/Source/UI/Items/UIItemRepairWnd.h b/Source/UI/Items/UIItemRepairWnd.h index c7e8e58f..523848b6 100644 --- a/Source/UI/Items/UIItemRepairWnd.h +++ b/Source/UI/Items/UIItemRepairWnd.h @@ -8,7 +8,6 @@ #include struct WindowResponseRecorder; -struct UIListBoxContext; class UIListBox; #pragma pack(push, 1) @@ -23,7 +22,7 @@ static_assert(sizeof(UIItemRepairEntry) == 0x18); class UIItemRepairWnd : public UIFrameWnd { public: - UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIItemRepairWnd(UIWindowContext& windows, WindowResponseRecorder& recorder); ~UIItemRepairWnd() override; void Slot15(int width, int height) override; void Paint() override; @@ -32,7 +31,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; public: /* 00B4 */ UIListBox* m_list; diff --git a/Source/UI/Items/UIMakeTargetListWnd.h b/Source/UI/Items/UIMakeTargetListWnd.h index 17fc6468..5d09ebbe 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.h +++ b/Source/UI/Items/UIMakeTargetListWnd.h @@ -6,12 +6,11 @@ #include struct WindowResponseRecorder; -struct UIListBoxContext; class UIListBox; class UIMakeTargetListWnd : public UIFrameWnd { public: - UIMakeTargetListWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIMakeTargetListWnd(UIWindowContext& windows, WindowResponseRecorder& recorder); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -21,7 +20,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; public: /* 00B8 */ std::vector itemIds; diff --git a/Source/UI/Items/UIWeaponRefineWnd.h b/Source/UI/Items/UIWeaponRefineWnd.h index 91a18828..b993f92b 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.h +++ b/Source/UI/Items/UIWeaponRefineWnd.h @@ -6,12 +6,11 @@ #include struct WindowResponseRecorder; -struct UIListBoxContext; class UIListBox; class UIWeaponRefineWnd : public UIFrameWnd { public: - UIWeaponRefineWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIWeaponRefineWnd(UIWindowContext& windows, WindowResponseRecorder& recorder); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -21,7 +20,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; public: /* 00B8 */ std::vector itemIds; diff --git a/Source/UI/Lists/UIChatHisBox.cpp b/Source/UI/Lists/UIChatHisBox.cpp index 58a1936f..e24dfa0d 100644 --- a/Source/UI/Lists/UIChatHisBox.cpp +++ b/Source/UI/Lists/UIChatHisBox.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "Client/Input/InputCharset.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" @@ -26,7 +27,7 @@ std::string UIChatHisBox::ResolvePlayerTags(const char* name) { ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; const unsigned short codePage = static_cast(g_textCodePage); const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->m_maximumId, codePage}; - ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width}; + ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width}; for (std::vector& row : this->ItemTags()) { const int count = static_cast(row.size()); @@ -93,7 +94,7 @@ void UIChatHisBox::sub_89C080() { // OFFSET: 0x0086C8D0 // FUNCTION: fn_11032 -UIChatHisBox::UIChatHisBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { +UIChatHisBox::UIChatHisBox(UIWindowContext& windows) : UIListBox(windows) { new (&this->ItemTags()) std::list>(); this->maxLines = 240; this->lineHeight = 14; diff --git a/Source/UI/Lists/UIChatHisBox.h b/Source/UI/Lists/UIChatHisBox.h index 175c183a..88db1481 100644 --- a/Source/UI/Lists/UIChatHisBox.h +++ b/Source/UI/Lists/UIChatHisBox.h @@ -12,7 +12,7 @@ class UINaviLinkButton; class UIChatHisBox : public UIListBox { public: - UIChatHisBox(UIWindowContext& windows, UIListBoxContext& list); + UIChatHisBox(UIWindowContext& windows); ~UIChatHisBox() override; bool Slot08() override; void Resize(int width, int height) override; diff --git a/Source/UI/Lists/UIComboBox.cpp b/Source/UI/Lists/UIComboBox.cpp index 0f5f8000..9c15908a 100644 --- a/Source/UI/Lists/UIComboBox.cpp +++ b/Source/UI/Lists/UIComboBox.cpp @@ -297,5 +297,5 @@ int UIListBoxID::sub_8991B0(UIWindow* sender, int message, std::intptr_t argumen // OFFSET: 0x0086CB40 // FUNCTION: fn_11033 -UIComboBox::UIComboBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), targetId(10041) { +UIComboBox::UIComboBox(UIWindowContext& windows) : UIListBox(windows), targetId(10041) { } diff --git a/Source/UI/Lists/UIComboBox.h b/Source/UI/Lists/UIComboBox.h index 0db8ca72..9b2e29f6 100644 --- a/Source/UI/Lists/UIComboBox.h +++ b/Source/UI/Lists/UIComboBox.h @@ -8,7 +8,7 @@ class UIComboBox : public UIListBox { public: UIComboBox(); - UIComboBox(UIWindowContext& windows, UIListBoxContext& list); + UIComboBox(UIWindowContext& windows); void Resize(int width, int height) override; void Slot15(int width, int height) override; void Paint() override; diff --git a/Source/UI/Lists/UIComboBoxEx.cpp b/Source/UI/Lists/UIComboBoxEx.cpp index f7cef4ba..195b24b0 100644 --- a/Source/UI/Lists/UIComboBoxEx.cpp +++ b/Source/UI/Lists/UIComboBoxEx.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -25,7 +26,7 @@ namespace { // OFFSET: 0x0086CD40 // FUNCTION: fn_11037 -UIComboBoxEx::UIComboBoxEx(UIWindowContext& windows, UIComboBoxContext& combo) : UIListBoxEx(windows, combo.list), targetId(10041), m_combo(&combo) { +UIComboBoxEx::UIComboBoxEx(UIWindowContext& windows, UIComboBoxContext& combo) : UIListBoxEx(windows), targetId(10041), m_combo(&combo) { } // OFFSET: 0x00872C00 @@ -86,7 +87,7 @@ void UIComboBoxEx::Slot27(int x, int y) { // FUNCTION: fn_11435 void UIComboBoxEx::Slot31(int x, int y) { this->selected = this->LineAt(x, y); - auto& windows = this->m_listContext->windows; + auto& windows = g_windowMgr; if (UIWindow* target = windows.LookupWindow(this->targetId)) { target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); @@ -143,12 +144,12 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i switch (message) { case 0: - if (UIWindow* target = this->m_listContext->windows.LookupWindow(this->targetId)) { + if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); } if (this->m_combo->popup) { - this->m_listContext->windows.CloseWindow(26); + g_windowMgr.CloseWindow(26); } return 0; @@ -213,7 +214,6 @@ void UIComboBoxEx::DrawRows(bool centered) { const unsigned end = std::min( static_cast(this->lines.size()), static_cast((this->topLine + (this->geometry.height / this->lineHeight - this->bottomMargin))) ); - auto& owner = *this->m_listContext; for (int index = this->topLine; index < static_cast(end); index = (index + 1)) { auto& row = this->lines[index]; @@ -231,7 +231,7 @@ void UIComboBoxEx::DrawRows(bool centered) { // OFFSET: 0x0088A360 // FUNCTION: fn_11354 void UIComboBoxEx::Paint() { - auto& resources = this->m_listContext->resources; + auto& resources = ResourceMgr::Instance(); this->geometry.surface->Fill(nullptr, Palette(resources, 6, 6)); this->FillRegion(1, 1, (this->geometry.width - 2), (this->geometry.height - 2), Palette(resources, 2, 2)); constexpr char prefix[] = "유저인터페이스\\basic_interface\\"; @@ -276,7 +276,6 @@ UIComboBoxEx2::~UIComboBoxEx2() = default; // OFFSET: 0x00885EE0 // FUNCTION: fn_11320 void UIComboBoxEx2::Slot15(int width, int height) { - auto& list = *this->m_listContext; auto* vertical = new UIScrollBar_Navi(*this->m_context); this->verticalBar = vertical; vertical->vertical = 1; diff --git a/Source/UI/Lists/UIComboBoxEx.h b/Source/UI/Lists/UIComboBoxEx.h index e93ae8b2..e6eadd2e 100644 --- a/Source/UI/Lists/UIComboBoxEx.h +++ b/Source/UI/Lists/UIComboBoxEx.h @@ -4,7 +4,6 @@ #include "UI/Lists/UIListBoxEx.h" struct UIComboBoxContext { - UIListBoxContext& list; UIWindow* const& popup; }; diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index d73103da..350b8655 100644 --- a/Source/UI/Lists/UIListBox.cpp +++ b/Source/UI/Lists/UIListBox.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "Render/DeviceContext/DeviceContext.h" #include "Render/Text/TextContext.h" #include "Resource/Bitmap/BitmapResource.h" @@ -28,7 +29,7 @@ namespace {} UIListBox::UIListBox() : UIWindow(*reinterpret_cast(nullptr), 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0), horizontalOffset(0), contentWidth(0), verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), - textColor(0), textInset(3), m_listContext(nullptr) { + textColor(0), textInset(3) { const SkinPaletteCell cell = {3, 2}; this->selectionColor = SkinPaletteColor(ResourceMgr::Instance(), cell, g_skinInfo.Selected()); this->selectable = 1; @@ -38,18 +39,17 @@ UIListBox::UIListBox() // OFFSET: 0x0086E750 // FUNCTION: fn_11076 UIServerListBox::UIServerListBox() : UIListBox() { - this->m_listContext = nullptr; *reinterpret_cast(reinterpret_cast(this) + 0xD8) = 0; this->unknown_00DC = 0; this->unknown_00E0 = 0; } -UIListBox::UIListBox(UIWindowContext& windows, UIListBoxContext& list) +UIListBox::UIListBox(UIWindowContext& windows) : UIWindow(windows, 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0), horizontalOffset(0), contentWidth(0), verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectable(1), textColor(0), - centerVertically(0), textInset(3), m_listContext(&list) { + centerVertically(0), textInset(3) { constexpr char path[] = "유저인터페이스\\colorchip.bmp"; - const auto* chip = static_cast(list.resources.Load(path)); + const auto* chip = static_cast(ResourceMgr::Instance().Load(path)); this->selectionColor = 0; if (chip) { @@ -231,7 +231,6 @@ void UIChatHisBox::AddText(const char* text, int color, const char* style) { // FUNCTION: fn_11201 void UIListBox::AddLine(const char* text) { this->lines.emplace_back(text); - auto& owner = *this->m_listContext; const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); @@ -330,7 +329,6 @@ void UIListBox::Paint() { const int limit = ((this->geometry.height / this->lineHeight - this->bottomMargin) + first); const int end = static_cast(std::min(static_cast(this->lines.size()), static_cast(limit))); std::uint32_t color = this->textColor; - auto& owner = *this->m_listContext; for (int index = first; index < end; ++index) { const int row = (index - first); @@ -465,7 +463,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s } case 98: if (argument3 > 0) { - if (UIWindow* window = this->m_listContext->windows.LookupWindow(12)) { + if (UIWindow* window = g_windowMgr.LookupWindow(12)) { window->SendMsg(nullptr, 24, argument3, 0, 0, 0); } } @@ -560,5 +558,5 @@ void UIListBoxID::AddLine(const char* text, int id) { // OFFSET: 0x0086D8C0 // FUNCTION: fn_11054 -UIListBox2::UIListBox2(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), fontFamily(0), fontHeight(12), bold(0), italic(0) { +UIListBox2::UIListBox2(UIWindowContext& windows) : UIListBox(windows), fontFamily(0), fontHeight(12), bold(0), italic(0) { } diff --git a/Source/UI/Lists/UIListBox.h b/Source/UI/Lists/UIListBox.h index 7e928217..15fb6de5 100644 --- a/Source/UI/Lists/UIListBox.h +++ b/Source/UI/Lists/UIListBox.h @@ -10,22 +10,11 @@ struct FrameFocus; class ResourceMgr; class UIScrollBar; #include "UI/Window/WindowManagerWindows.h" -class NavigationDestination; - -struct UIListBoxContext { - FrameFocus& capture; - ResourceMgr& resources; - FontCache& fonts; - const TextLocale& locale; - const unsigned short& codePage; - WindowManagerWindows& windows; - NavigationDestination& navigation; -}; class UIListBox : public UIWindow { public: __declspec(noinline) UIListBox(); - __declspec(noinline) UIListBox(UIWindowContext& windows, UIListBoxContext& list); + __declspec(noinline) UIListBox(UIWindowContext& windows); ~UIListBox() override; void Resize(int width, int height) override; void Slot15(int width, int height) override; @@ -68,7 +57,7 @@ public: /* 00D0 */ int textInset; protected: - UIListBoxContext* m_listContext; + void* unknown_listContext; }; class UIServerListBox : public UIListBox { @@ -81,7 +70,7 @@ public: class UIListBox2 : public UIListBox { public: - UIListBox2(UIWindowContext& windows, UIListBoxContext& list); + UIListBox2(UIWindowContext& windows); void Paint() override; /* 00D4 */ int fontFamily; diff --git a/Source/UI/Lists/UIListBoxEx.cpp b/Source/UI/Lists/UIListBoxEx.cpp index 0ca1da79..f86acfab 100644 --- a/Source/UI/Lists/UIListBoxEx.cpp +++ b/Source/UI/Lists/UIListBoxEx.cpp @@ -10,12 +10,11 @@ // OFFSET: 0x0086DA90 // FUNCTION: fn_11056 -UIListBoxEx::UIListBoxEx(UIWindowContext& windows, UIListBoxContext& list) +UIListBoxEx::UIListBoxEx(UIWindowContext& windows) : UIWindow(windows, 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0), horizontalOffset(0), contentWidth(0), - verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectionColor(0), - m_listContext(&list) { + verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectionColor(0) { constexpr char path[] = "유저인터페이스\\colorchip.bmp"; - const auto* chip = static_cast(list.resources.Load(path)); + const auto* chip = static_cast(ResourceMgr::Instance().Load(path)); if (chip) { const auto& image = chip->image; @@ -41,7 +40,6 @@ void UIListBoxEx::Configure(int x, int y, int width, int height, unsigned char v // OFFSET: 0x00886990 // FUNCTION: fn_11327 void UIListBoxEx::Slot15(int width, int height) { - auto& owner = *this->m_listContext; auto* vertical = new UIScrollBar(*this->m_context); this->verticalBar = vertical; const int thickness = vertical->thickness; @@ -78,7 +76,6 @@ void UIListBoxEx::Resize(int width, int height) { // FUNCTION: fn_11202 void UIListBoxEx::AddLine(const char* text, std::uint32_t color) { this->lines.emplace(static_cast(this->lines.size()), ExtendedListLine{text, color}); - auto& owner = *this->m_listContext; const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); @@ -167,7 +164,6 @@ void UIListBoxEx::Paint() { const unsigned end = std::min( static_cast(this->lines.size()), static_cast((this->topLine + (this->geometry.height / this->lineHeight - this->bottomMargin))) ); - auto& owner = *this->m_listContext; for (int index = this->topLine; index < static_cast(end); index = (index + 1)) { const int y = (this->lineHeight * (index - this->topLine)); diff --git a/Source/UI/Lists/UIListBoxEx.h b/Source/UI/Lists/UIListBoxEx.h index 20a722b6..18ed4b98 100644 --- a/Source/UI/Lists/UIListBoxEx.h +++ b/Source/UI/Lists/UIListBoxEx.h @@ -6,7 +6,6 @@ #include #include -struct UIListBoxContext; class UIScrollBar; struct ExtendedListLine { @@ -16,7 +15,7 @@ struct ExtendedListLine { class UIListBoxEx : public UIWindow { public: - UIListBoxEx(UIWindowContext& windows, UIListBoxContext& list); + UIListBoxEx(UIWindowContext& windows); ~UIListBoxEx() override; void Resize(int width, int height) override; void Slot15(int width, int height) override; @@ -49,7 +48,7 @@ public: /* 00BC */ std::uint32_t selectionColor; protected: - UIListBoxContext* m_listContext; + void* unknown_listContext; int LineAt(int x, int y) const; }; diff --git a/Source/UI/Lists/UIListBoxNavi.cpp b/Source/UI/Lists/UIListBoxNavi.cpp index e936cfff..38cb6bc3 100644 --- a/Source/UI/Lists/UIListBoxNavi.cpp +++ b/Source/UI/Lists/UIListBoxNavi.cpp @@ -2,7 +2,7 @@ // OFFSET: 0x0086DD10 // FUNCTION: fn_11058 -UIListBoxNavi::UIListBoxNavi(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), lineColors(), lineOffset(-1) { +UIListBoxNavi::UIListBoxNavi(UIWindowContext& windows) : UIListBox(windows), lineColors(), lineOffset(-1) { this->defaultLineColor = 0xD2D2D2; } diff --git a/Source/UI/Lists/UIListBoxNavi.h b/Source/UI/Lists/UIListBoxNavi.h index 71273c23..72d9a131 100644 --- a/Source/UI/Lists/UIListBoxNavi.h +++ b/Source/UI/Lists/UIListBoxNavi.h @@ -8,7 +8,7 @@ class UIListBoxNavi : public UIListBox { public: - UIListBoxNavi(UIWindowContext& windows, UIListBoxContext& list); + UIListBoxNavi(UIWindowContext& windows); void Paint() override; void Slot25(int x, int y) override; void Clear() override; diff --git a/Source/UI/Lists/UIListBoxNaviSearch.h b/Source/UI/Lists/UIListBoxNaviSearch.h index f7cc53a4..3393883c 100644 --- a/Source/UI/Lists/UIListBoxNaviSearch.h +++ b/Source/UI/Lists/UIListBoxNaviSearch.h @@ -7,7 +7,7 @@ class UIListBox_NaviSearch : public UIListBox { public: - UIListBox_NaviSearch(UIWindowContext& windows, UIListBoxContext& list); + UIListBox_NaviSearch(UIWindowContext& windows); void Resize(int width, int height) override; void Slot15(int width, int height) override; diff --git a/Source/UI/Lists/UIMemberListBox.h b/Source/UI/Lists/UIMemberListBox.h index b50a3d6d..26099178 100644 --- a/Source/UI/Lists/UIMemberListBox.h +++ b/Source/UI/Lists/UIMemberListBox.h @@ -7,7 +7,7 @@ class UIChatHisBox2 : public UIChatHisBox { public: UIChatHisBox2(); - UIChatHisBox2(UIWindowContext& windows, UIListBoxContext& list); + UIChatHisBox2(UIWindowContext& windows); bool Slot08() override; void Paint() override; void Slot15(int width, int height) override; @@ -21,7 +21,7 @@ public: class UIChatHisBox3 : public UIChatHisBox2 { public: - UIChatHisBox3(UIWindowContext& windows, UIListBoxContext& list); + UIChatHisBox3(UIWindowContext& windows); void Paint() override; void Slot15(int width, int height) override; void Resize(int width, int height) override; @@ -33,7 +33,7 @@ public: class UIMemberListBox : public UIChatHisBox2 { public: - UIMemberListBox(UIWindowContext& windows, UIListBoxContext& list); + UIMemberListBox(UIWindowContext& windows); void Paint() override; void Slot25(int x, int y) override; void Slot28(int x, int y) override; diff --git a/Source/UI/Lists/UIPackageBoxNameList.cpp b/Source/UI/Lists/UIPackageBoxNameList.cpp index 1570b2f0..17a45544 100644 --- a/Source/UI/Lists/UIPackageBoxNameList.cpp +++ b/Source/UI/Lists/UIPackageBoxNameList.cpp @@ -2,5 +2,5 @@ // OFFSET: 0x0086E0C0 // FUNCTION: fn_11064 -UIPackageBoxNameList::UIPackageBoxNameList(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { +UIPackageBoxNameList::UIPackageBoxNameList(UIWindowContext& windows) : UIListBox(windows) { } diff --git a/Source/UI/Lists/UIPackageBoxNameList.h b/Source/UI/Lists/UIPackageBoxNameList.h index a69aef4b..cc9a8f54 100644 --- a/Source/UI/Lists/UIPackageBoxNameList.h +++ b/Source/UI/Lists/UIPackageBoxNameList.h @@ -5,7 +5,7 @@ class UIPackageBoxNameList : public UIListBox { public: - UIPackageBoxNameList(UIWindowContext& windows, UIListBoxContext& list); + UIPackageBoxNameList(UIWindowContext& windows); void Slot25(int x, int y) override; }; diff --git a/Source/UI/Lists/UIReplayListBox.h b/Source/UI/Lists/UIReplayListBox.h index fea558e7..ad86b3fc 100644 --- a/Source/UI/Lists/UIReplayListBox.h +++ b/Source/UI/Lists/UIReplayListBox.h @@ -6,7 +6,7 @@ class UIReplayListBox : public UIListBox { public: // INLINED - UIReplayListBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { + UIReplayListBox(UIWindowContext& windows) : UIListBox(windows) { } void Slot25(int x, int y) override; diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 6379b95a..401ee9ca 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -1,3 +1,4 @@ +#include "Network/TextEncoding.h" #include "Render/Text/FontCache.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/ModeCursor.h" @@ -1358,8 +1359,8 @@ void UIChatHisBox::Paint() { end = static_cast(this->lines.size()); } - FontCache& fonts = this->m_listContext->fonts; - const TextLocale& locale = this->m_listContext->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; for (int row = 0; top + row < static_cast(end); ++row) { const int index = top + row; int x; @@ -1824,8 +1825,8 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou const bool languagePrefix = false; const WORD language = g_serverLanguage->language; ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; - const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, this->m_listContext->codePage}; - ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width}; + const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, static_cast(g_textCodePage)}; + ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width}; for (;;) { std::string encoded; @@ -1963,7 +1964,7 @@ std::string UIChatHisBox::RenderNavigationLinks(const char* text, std::string& s tail = line.substr(position + label.size()); } - UINaviLinkButton* button = new (std::nothrow) UINaviLinkButton(*this->m_context, this->m_listContext->navigation); + UINaviLinkButton* button = new (std::nothrow) UINaviLinkButton(*this->m_context); if (button) { button->link = link; button->Configure(label.c_str(), 0x82F2E1, 0, 12, 0, 0); @@ -2077,8 +2078,8 @@ void UIChatHisBox::sub_89DC30(const char* text, int& color, int& mode) { bool languagePrefix = false; WORD language = g_serverLanguage->language; ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; - const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, this->m_listContext->codePage}; - ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width}; + const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, static_cast(g_textCodePage)}; + ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width}; const std::string converted = display.Convert(text); this->sub_8932D0(&mode, &wrapped, converted); this->RewrapLinkLines(wrapped, mode); diff --git a/Source/UI/Lists/UITagListBox.cpp b/Source/UI/Lists/UITagListBox.cpp index 42b60373..21acd3b7 100644 --- a/Source/UI/Lists/UITagListBox.cpp +++ b/Source/UI/Lists/UITagListBox.cpp @@ -65,7 +65,6 @@ void UITagListBox::Paint() { const int end = static_cast(std::min(static_cast(this->lines.size()), static_cast(limit))); std::uint32_t color = 0; - auto& owner = *this->m_listContext; for (int index = 0; index < first; ++index) { const std::string& line = this->lines[index]; @@ -368,7 +367,6 @@ int UITagListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 void UITagListBox::sub_9B9EA0(std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { char* text = reinterpret_cast(argument1); const int width = static_cast(argument2); - auto& owner = *this->m_listContext; std::vector lines; if (width == 138) { diff --git a/Source/UI/Navigation/UINavigationV4Wnd.cpp b/Source/UI/Navigation/UINavigationV4Wnd.cpp index 40f4e13d..8a1f4eb1 100644 --- a/Source/UI/Navigation/UINavigationV4Wnd.cpp +++ b/Source/UI/Navigation/UINavigationV4Wnd.cpp @@ -2,8 +2,8 @@ // OFFSET: 0x005C2860 // FUNCTION: fn_03536 -UINavigationRuideWnd::UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists) - : UIFrameWnd(windows, 0), m_listContext(&lists) { +UINavigationRuideWnd::UINavigationRuideWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x005C28C0 diff --git a/Source/UI/Navigation/UINavigationV4Wnd.h b/Source/UI/Navigation/UINavigationV4Wnd.h index 628efa35..31c5addb 100644 --- a/Source/UI/Navigation/UINavigationV4Wnd.h +++ b/Source/UI/Navigation/UINavigationV4Wnd.h @@ -10,7 +10,6 @@ class CBitmapRes; class CNavi_Object; class CTexture; class UIListBox_NaviSearch; -struct UIListBoxContext; class UIStaticText; struct NavigationWindowInfo { @@ -75,7 +74,7 @@ public: /* 0118 */ int unknown_0118; /* 011C */ int unknown_011C; void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; class UIStaticBitmap; @@ -96,7 +95,7 @@ protected: class UINavigationRuideWnd : public UIFrameWnd { public: - UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists); + UINavigationRuideWnd(UIWindowContext& windows); void Slot15(int width, int height) 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; @@ -109,7 +108,7 @@ public: /* 00B4 */ UIListBox_NaviSearch* routeList; protected: - UIListBoxContext* m_listContext; + void* unknown_listContext; }; extern int g_navigationTab; diff --git a/Source/UI/Text/NavigationLink.cpp b/Source/UI/Text/NavigationLink.cpp index b52c14ff..ea574ec3 100644 --- a/Source/UI/Text/NavigationLink.cpp +++ b/Source/UI/Text/NavigationLink.cpp @@ -804,7 +804,7 @@ int CCreateLineInfo::LayoutLink(int x, std::string text, int type, LineTextStyle if (std::get<0>(info)) { std::string display = std::get<1>(info); if (this->m_parent) { - display = RemoveTextColors(display.c_str(), 0); + display = RemoveTextColors(display.c_str()); } const std::vector parts = SplitString(std::get<2>(info), ","); diff --git a/Source/UI/Text/TextMarkup.cpp b/Source/UI/Text/TextMarkup.cpp index c13aa524..298f74bc 100644 --- a/Source/UI/Text/TextMarkup.cpp +++ b/Source/UI/Text/TextMarkup.cpp @@ -1,3 +1,4 @@ +#include "UI/Text/ColoredText.h" #include "UI/Text/TextMarkup.h" #include @@ -10,19 +11,6 @@ namespace { } // INLINED - bool Color(const char* text, const char* end) { - if (*text != '^' || end - text < 6) { - return false; - } - - for (int index = 1; index <= 6; ++index) { - if (!Hex(static_cast(text[index]))) { - return false; - } - } - - return true; - } } // GLOBAL: gl_24593 @@ -102,18 +90,13 @@ std::string ExpandTextEscapes(std::string text) { // OFFSET: 0x00A7EDC0 // FUNCTION: fn_16961 -std::string RemoveTextColors(const char* text, unsigned short codePage) { +std::string RemoveTextColors(const char* text) { const char* end = text + std::char_traits::length(text); const char* current = text; std::string result; while (current < end) { - const char* next = current; - - while (next < end && !Color(next, end)) { - next = CharNextExA(codePage, next, 0); - } - + const char* next = SegmentEnd(current, end); result.append(current, next); if (next >= end) { diff --git a/Source/UI/Text/TextMarkup.h b/Source/UI/Text/TextMarkup.h index 164a89f5..860b9b1c 100644 --- a/Source/UI/Text/TextMarkup.h +++ b/Source/UI/Text/TextMarkup.h @@ -15,7 +15,7 @@ struct TextLink { bool HasTextLinks(const std::string& text); std::string ExpandTextEscapes(std::string text); -std::string RemoveTextColors(const char* text, unsigned short codePage); +std::string RemoveTextColors(const char* text); std::string DisplayTextTag(std::string text, const std::string& begin, const std::string& end); std::string DisplayItemTextTag(const std::string& text); std::string DisplayNavigationTextTag(const std::string& text); diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index 6a9188f4..71a61ad2 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -470,7 +470,6 @@ void UIAchTV::Paint() { const int rows = this->lineHeight - this->bottomMargin == 0 ? this->geometry.height : this->geometry.height / this->lineHeight - this->bottomMargin; const unsigned end = std::min(static_cast(this->lines.size()), static_cast(rows + this->topLine)); - UIListBoxContext& owner = *this->m_listContext; int row = 0; for (int index = this->topLine; index < static_cast(end); ++index, ++row) { diff --git a/Source/UI/Text/UITextViewer.cpp b/Source/UI/Text/UITextViewer.cpp index fe42e054..902eb284 100644 --- a/Source/UI/Text/UITextViewer.cpp +++ b/Source/UI/Text/UITextViewer.cpp @@ -38,7 +38,7 @@ namespace { } // INLINED - void ScanColors(const std::string& line, unsigned short codePage, std::uint32_t& color) { + void ScanColors(const std::string& line, std::uint32_t& color) { const char* current = line.c_str(); const char* end = current + line.size(); @@ -55,7 +55,7 @@ namespace { ((Digit(current[6]) + 16 * Digit(current[5])) << 16); current += 7; } else { - current = CharNextExA(codePage, current, 0); + current = CharNextExA(static_cast(g_textCodePage), current, 0); } } } @@ -64,10 +64,10 @@ namespace { // OFFSET: 0x0086F0A0 // FUNCTION: fn_11086 UITextViewer::UITextViewer(UIWindowContext& windows, UITextViewerContext& text) - : UIListBox(windows, text.list), splitTipLinks(0), outline(0), bold(0), m_text(&text) { + : UIListBox(windows), splitTipLinks(0), outline(0), bold(0), m_text(&text) { this->lineHeight = 18; constexpr char path[] = "유저인터페이스\\colorchip.bmp"; - const auto* chip = static_cast(text.list.resources.Load(path)); + const auto* chip = static_cast(ResourceMgr::Instance().Load(path)); const auto& image = chip->image; const std::uint32_t pixel = image.width > 18 && image.height > 2 ? image.pixels[18 + 2 * image.width] : 0x00FF0000u; this->backgroundColor = 0xFF000000u | ((pixel & 255) << 16) | (pixel & 0xFF00) | ((pixel >> 16) & 255); @@ -229,11 +229,10 @@ void UITextViewer::Paint() { const int limit = (this->geometry.height / divisor + this->topLine); const int end = static_cast(std::min(static_cast(this->lines.size()), static_cast(limit))); - auto& owner = this->m_text->list; std::uint32_t color = 0; for (int index = 0; index < this->topLine; ++index) { - ScanColors(this->lines[index], owner.codePage, color); + ScanColors(this->lines[index], color); } for (int index = this->topLine; index < end; ++index) { diff --git a/Source/UI/Text/UITextViewer.h b/Source/UI/Text/UITextViewer.h index b735296a..b4a16ba0 100644 --- a/Source/UI/Text/UITextViewer.h +++ b/Source/UI/Text/UITextViewer.h @@ -22,7 +22,6 @@ protected: }; struct UITextViewerContext { - UIListBoxContext& list; ItemNaming& items; const TipBoxTitles& tips; TextViewerActions& actions; diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 7a6eea6c..a54fcd80 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -1,3 +1,4 @@ +#include "Client/Input/InputCharset.h" #include "Contents/Items/ItemNaming.h" #include "Render/Text/TextContext.h" #include "UI/Text/ItemLinkDisplay.h" @@ -38,10 +39,9 @@ std::pair UITextViewer::LinkPosition(unsigned position, unsigned added unsigned accumulated = 0; const auto count = static_cast(this->lines.size()); const unsigned first = count - addedLines; - auto& owner = this->m_text->list; for (unsigned index = first; index < count; ++index) { - const std::string plain = RemoveTextColors(this->lines[index].c_str(), owner.codePage); + const std::string plain = RemoveTextColors(this->lines[index].c_str()); accumulated += static_cast(plain.size()); if (accumulated > position) { @@ -57,8 +57,7 @@ std::pair UITextViewer::LinkPosition(unsigned position, unsigned added // OFFSET: 0x008760D0 // FUNCTION: fn_11205 bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { - auto& owner = this->m_text->list; - std::string parsed = RemoveTextColors(text.c_str(), owner.codePage); + std::string parsed = RemoveTextColors(text.c_str()); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); @@ -101,8 +100,7 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { // OFFSET: 0x00876700 // FUNCTION: fn_11206 bool UITextViewer::AddNaviLinks(std::string text, unsigned addedLines) { - auto& owner = this->m_text->list; - std::string parsed = RemoveTextColors(text.c_str(), owner.codePage); + std::string parsed = RemoveTextColors(text.c_str()); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); @@ -202,8 +200,7 @@ void UIListBoxNavi::ResetLineColors() { // OFFSET: 0x00877020 // FUNCTION: fn_11209 bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { - auto& owner = this->m_text->list; - std::string parsed = RemoveTextColors(text.c_str(), owner.codePage); + std::string parsed = RemoveTextColors(text.c_str()); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); @@ -246,8 +243,7 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { // OFFSET: 0x00877B00 // FUNCTION: fn_11211 void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { - auto& owner = this->m_text->list; - std::string parsed = RemoveTextColors(text.c_str(), owner.codePage); + std::string parsed = RemoveTextColors(text.c_str()); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); @@ -280,7 +276,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { const char* breakAt = begin; while (current < end) { - current = CharNextExA(owner.codePage, current, 0); + current = g_serverLanguage->NextChar(current, static_cast(end - current)); while (*current == ' ') { breakAt = ++current; @@ -346,8 +342,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { // OFFSET: 0x00878750 // FUNCTION: fn_11212 bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) { - auto& owner = this->m_text->list; - std::string parsed = RemoveTextColors(text.c_str(), owner.codePage); + std::string parsed = RemoveTextColors(text.c_str()); parsed = DisplayTextTag(std::move(parsed), "", ""); parsed = DisplayTextTag(std::move(parsed), "", ""); diff --git a/Source/UI/Text/UITextViewerMessages.cpp b/Source/UI/Text/UITextViewerMessages.cpp index 10c522ae..3e3000f8 100644 --- a/Source/UI/Text/UITextViewerMessages.cpp +++ b/Source/UI/Text/UITextViewerMessages.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "Contents/Items/ItemInfo.h" #include "UI/Lists/UIScrollBar.h" #include "UI/Buttons/UITextButton.h" @@ -87,7 +88,7 @@ void UITextViewer::Activate(UITextButton* button, int id) { item.unknown_0070 = 0; item.itemId = arguments.at(0); - if (UIWindow* window = this->m_text->list.windows.LookupWindow(12)) { + if (UIWindow* window = g_windowMgr.LookupWindow(12)) { window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); } @@ -95,7 +96,7 @@ void UITextViewer::Activate(UITextButton* button, int id) { } case 517: if (!arguments.empty()) { - if (UIWindow* window = this->m_text->list.windows.EnsureWindow(315)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(315)) { this->m_text->actions.OpenTip(*window, number(0)); } } @@ -111,7 +112,6 @@ void UITextViewer::Activate(UITextButton* button, int id) { // INLINED void UITextViewer::AppendText(char* text, int width, bool carriageReturns, bool pixels) { - auto& owner = this->m_text->list; std::vector wrapped; if (width == 138) { diff --git a/Source/UI/UIRoundBoxTooltipWnd.cpp b/Source/UI/UIRoundBoxTooltipWnd.cpp index f3845b4d..f6c454ae 100644 --- a/Source/UI/UIRoundBoxTooltipWnd.cpp +++ b/Source/UI/UIRoundBoxTooltipWnd.cpp @@ -20,7 +20,7 @@ #include // INLINED -UIColoringTextViewer::UIColoringTextViewer(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), color(0), lineLimit(0) { +UIColoringTextViewer::UIColoringTextViewer(UIWindowContext& windows) : UIListBox(windows), color(0), lineLimit(0) { } // OFFSET: 0x0099A1F0 @@ -30,7 +30,7 @@ void UIRoundBoxTooltipWnd::Slot15(int width, int height) { return; } - this->viewer = new UIColoringTextViewer(*this->m_context, *this->m_listContext); + this->viewer = new UIColoringTextViewer(*this->m_context); this->viewer->Configure(4, 4, width - 6, height - 6, 0); unsigned red; @@ -68,7 +68,6 @@ void UIColoringTextViewer::Paint() { end = this->lineLimit; } - auto& owner = *this->m_listContext; for (int index = first; index < end; ++index) { const auto& line = this->lines[index]; DrawColoredText(*this, 3, this->lineHeight * (index - first) + 4, line.c_str(), static_cast(line.size()), this->color, 0, 12, false); diff --git a/Source/UI/UIRoundBoxTooltipWnd.h b/Source/UI/UIRoundBoxTooltipWnd.h index 6be4b806..3219bc7f 100644 --- a/Source/UI/UIRoundBoxTooltipWnd.h +++ b/Source/UI/UIRoundBoxTooltipWnd.h @@ -7,7 +7,7 @@ class UIColoringTextViewer : public UIListBox { public: UIColoringTextViewer(); - UIColoringTextViewer(UIWindowContext& windows, UIListBoxContext& list); + UIColoringTextViewer(UIWindowContext& windows); 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; @@ -26,7 +26,7 @@ public: /* 00B4 */ UIColoringTextViewer* viewer; protected: - UIListBoxContext* m_listContext; + void* unknown_listContext; }; #endif diff --git a/Source/UI/Window/UIChatRoomWnd.h b/Source/UI/Window/UIChatRoomWnd.h index df62cb22..379da002 100644 --- a/Source/UI/Window/UIChatRoomWnd.h +++ b/Source/UI/Window/UIChatRoomWnd.h @@ -10,7 +10,6 @@ #include struct UIEditContext; -struct UIListBoxContext; class UIBitmapButton; class UIChatEditCtrl; class UIChatHisBox; @@ -53,7 +52,7 @@ public: protected: void* unknown_controls; UIEditContext* m_editContext; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; #endif diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 94005c12..77738cc7 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -1632,14 +1632,14 @@ void UIChatRoomWnd::Slot15(int, int) { focus.Set(this->edit); this->edit->SetId(494); - UIChatHisBox2* history = new UIChatHisBox2(*this->m_context, *this->m_listContext); + UIChatHisBox2* history = new UIChatHisBox2(*this->m_context); this->history = history; history->Configure(0, 0, this->geometry.width - this->geometry.width * 56 / 280 - 3, this->geometry.height - 38, 0); this->history->Move(1, 17); this->history->SetId(184); this->AddChild(this->history); - this->memberList = new UIMemberListBox(*this->m_context, *this->m_listContext); + this->memberList = new UIMemberListBox(*this->m_context); this->memberList->Configure(0, 0, this->geometry.width * 56 / 280, this->geometry.height - 38, 0); this->memberList->Move(this->geometry.width - this->geometry.width * 56 / 280 - 1, 17); this->memberList->SetId(184); @@ -1927,7 +1927,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { // OFFSET: 0x008B5A50 // FUNCTION: fn_11750 void UISelectReplayDataWnd::Slot15(int width, int height) { - this->m_list = new UIReplayListBox(*this->m_context, *this->m_listContext); + this->m_list = new UIReplayListBox(*this->m_context); this->m_list->Configure(6, 127, width - 12, height - 170, 0); this->m_list->backgroundRed = 240; this->m_list->backgroundGreen = 240; diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index 07ba1c94..22ff547a 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -88,7 +88,7 @@ std::vector g_navigationLabels; // OFFSET: 0x00921A70 // FUNCTION: fn_12643 void UINavigationWnd::Slot15(int width, int height) { - this->m_routePanel = new UIListBoxNavi(*this->m_context, *this->m_listContext); + this->m_routePanel = new UIListBoxNavi(*this->m_context); this->m_routePanel->SetSize(215, 96); this->m_routePanel->backgroundRed = 210; this->m_routePanel->backgroundGreen = 210; @@ -97,7 +97,7 @@ void UINavigationWnd::Slot15(int width, int height) { this->m_routePanel->Move(-1000, -1000); this->AddChild(this->m_routePanel); - this->m_searchPanel = new UIListBoxNavi(*this->m_context, *this->m_listContext); + this->m_searchPanel = new UIListBoxNavi(*this->m_context); this->m_searchPanel->SetSize(215, 96); this->m_searchPanel->backgroundRed = 210; this->m_searchPanel->backgroundGreen = 210; diff --git a/Source/UI/Window/UINavigationWnd.h b/Source/UI/Window/UINavigationWnd.h index 21e79151..81396020 100644 --- a/Source/UI/Window/UINavigationWnd.h +++ b/Source/UI/Window/UINavigationWnd.h @@ -19,7 +19,6 @@ class UIListBoxNavi; class UIResizer; struct UIComboBoxHeaderContext; struct UIEditContext; -struct UIListBoxContext; struct WindowDialogs; struct WindowResponseRecorder; @@ -93,7 +92,7 @@ protected: /* 012C */ std::vector m_history; void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; UIComboBoxHeaderContext* m_comboContext; UIEditContext* m_editContext; WindowResponseRecorder* m_recorder; diff --git a/Source/UI/Window/UISecondCostumeWnd.cpp b/Source/UI/Window/UISecondCostumeWnd.cpp index ba0cb6fa..2b7a1f69 100644 --- a/Source/UI/Window/UISecondCostumeWnd.cpp +++ b/Source/UI/Window/UISecondCostumeWnd.cpp @@ -160,7 +160,7 @@ void UISecondCostumeWnd::Slot15(int width, int height) { this->LoadLists(); this->AddCloseButton("Close", 0); - this->m_list = new UIListBoxNavi(*this->m_context, *this->m_listContext); + this->m_list = new UIListBoxNavi(*this->m_context); this->m_list->SetSize(width - 212, 160); this->m_list->backgroundRed = 210; this->m_list->backgroundGreen = 210; @@ -288,9 +288,9 @@ bool UISecondCostumeWnd::Slot03() { // OFFSET: 0x00946FB0 // FUNCTION: fn_12857 UISecondCostumeWnd::UISecondCostumeWnd( - UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos + UIWindowContext& windows, UIComboBoxHeaderContext& combos ) - : UIFrameWnd(windows, 0), m_listContext(&lists), m_comboContext(&combos) { + : UIFrameWnd(windows, 0), m_comboContext(&combos) { this->m_typeCombo = nullptr; this->m_list = nullptr; this->m_tab = 0; diff --git a/Source/UI/Window/UISecondCostumeWnd.h b/Source/UI/Window/UISecondCostumeWnd.h index b6b2e311..1ec612d7 100644 --- a/Source/UI/Window/UISecondCostumeWnd.h +++ b/Source/UI/Window/UISecondCostumeWnd.h @@ -11,7 +11,6 @@ class UIComboBoxDefWnd; class UIListBox; struct UIComboBoxHeaderContext; -struct UIListBoxContext; struct SecondCostumeEntry { /* 0000 */ std::string name; @@ -20,7 +19,7 @@ struct SecondCostumeEntry { class UISecondCostumeWnd : public UIFrameWnd { public: - UISecondCostumeWnd(UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos); + UISecondCostumeWnd(UIWindowContext& windows, UIComboBoxHeaderContext& combos); bool Slot03() override; void Slot15(int width, int height) override; void Paint() override; @@ -40,7 +39,7 @@ protected: /* 0100 */ std::uint32_t unknown_0100; /* 0104 */ int m_page; void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; UIComboBoxHeaderContext* m_comboContext; /* 0108 */ std::string unknown_0108[7]; /* 01B0 */ std::string unknown_01B0[7]; diff --git a/Source/UI/Window/UISelectReplayDataWnd.h b/Source/UI/Window/UISelectReplayDataWnd.h index 45d8f188..aeb109d7 100644 --- a/Source/UI/Window/UISelectReplayDataWnd.h +++ b/Source/UI/Window/UISelectReplayDataWnd.h @@ -6,7 +6,6 @@ class UIBitmapButton; class UIReplayListBox; class UIStaticText; -struct UIListBoxContext; class UISelectReplayDataWnd : public UIFrameWnd { public: @@ -24,7 +23,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; }; #endif diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index f23e1c2b..6060da77 100644 --- a/Source/UI/Window/UIShowWarpWnd.cpp +++ b/Source/UI/Window/UIShowWarpWnd.cpp @@ -12,7 +12,7 @@ // OFFSET: 0x0094CA20 // FUNCTION: fn_12899 void UIShowWarpWnd::Slot15(int width, int height) { - auto* list = new UIListBox(*this->m_context, *this->m_listContext); + auto* list = new UIListBox(*this->m_context); this->m_list = list; width -= 0x18; height -= 0x32; @@ -83,6 +83,6 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x009470C0 // FUNCTION: fn_12858 -UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, WindowResponseRecorder& recorder) - : UIFrameWnd(windows, 0), m_listContext(&lists), m_recorder(&recorder) { +UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, WindowResponseRecorder& recorder) + : UIFrameWnd(windows, 0), m_recorder(&recorder) { } diff --git a/Source/UI/Window/UIShowWarpWnd.h b/Source/UI/Window/UIShowWarpWnd.h index f2c62c3a..5c9d1de5 100644 --- a/Source/UI/Window/UIShowWarpWnd.h +++ b/Source/UI/Window/UIShowWarpWnd.h @@ -4,12 +4,11 @@ #include "UI/Window/UIFrameWnd.h" struct WindowResponseRecorder; -struct UIListBoxContext; class UIListBox; class UIShowWarpWnd : public UIFrameWnd { public: - UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, WindowResponseRecorder& recorder); + UIShowWarpWnd(UIWindowContext& windows, WindowResponseRecorder& recorder); 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; @@ -18,7 +17,7 @@ public: protected: void* unknown_controls; - UIListBoxContext* m_listContext; + void* unknown_listContext; WindowResponseRecorder* m_recorder; }; diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 5179fc92..1c0e66a7 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -1959,7 +1959,7 @@ bool UIWindow::FitSprite(const ActionFrame* frame, const CSprRes* sprite, int wi // OFFSET: 0x005C27E0 // FUNCTION: fn_03535 -UIListBox_NaviSearch::UIListBox_NaviSearch(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) { +UIListBox_NaviSearch::UIListBox_NaviSearch(UIWindowContext& windows) : UIListBox(windows) { } // OFFSET: 0x005C3340 @@ -2382,7 +2382,7 @@ void UINavigationV4Wnd::Slot15(int, int) { roadListButton->SetTooltip(LookupMessage(0x0C85)); this->AddChild(roadListButton); - UIListBox_NaviSearch* roadList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext); + UIListBox_NaviSearch* roadList = new UIListBox_NaviSearch(*this->m_context); this->unknown_00EC = roadList; roadList->SetSize(138, 244); roadList->backgroundRed = 255; @@ -2391,7 +2391,7 @@ void UINavigationV4Wnd::Slot15(int, int) { roadList->SetId(336); this->AddChild(roadList); - UIListBox_NaviSearch* searchList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext); + UIListBox_NaviSearch* searchList = new UIListBox_NaviSearch(*this->m_context); this->unknown_00F0 = searchList; searchList->SetSize(132, 80); searchList->backgroundRed = 240; @@ -3019,7 +3019,7 @@ int UINavigationroadiconWnd::SendMsg(UIWindow*, int message, std::intptr_t a, st // FUNCTION: fn_03580 void UINavigationRuideWnd::Slot15(int width, int) { this->AddCloseButton(LookupMessage(3045), 0); - this->routeList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext); + this->routeList = new UIListBox_NaviSearch(*this->m_context); this->routeList->SetSize(width - 4, 293); this->routeList->backgroundRed = 255; this->routeList->backgroundGreen = 255; diff --git a/Source/UI/Window/UIWindowFactory.cpp b/Source/UI/Window/UIWindowFactory.cpp index 5677cd02..f0253e92 100644 --- a/Source/UI/Window/UIWindowFactory.cpp +++ b/Source/UI/Window/UIWindowFactory.cpp @@ -16,7 +16,6 @@ struct LayoutWindowContexts { UIWindowContext& windows; UIEntryQueueContext& entryQueue; - UIListBoxContext& listBox; QuickSlotPainting& quickSlots; }; @@ -48,7 +47,7 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) { this->unknown_0404 = window; break; case 0x9D: - window = new UIEntryQueueWnd(contexts.windows, contexts.entryQueue, contexts.listBox); + window = new UIEntryQueueWnd(contexts.windows, contexts.entryQueue); break; case 0x9F: window = new UIQuickSlotWnd(contexts.windows, contexts.quickSlots);