diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 7c53a172..835668ce 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -2465,7 +2465,7 @@ std::vector CGameMode::SaveGroundItems() { // FUNCTION: fn_21409 UIBroadcastBalloon* CGameMode::EnsureBroadcastBalloon() { if (!this->broadcastBalloon) { - this->broadcastBalloon = new UIBroadcastBalloon(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + this->broadcastBalloon = new UIBroadcastBalloon(*reinterpret_cast(nullptr)); this->broadcastBalloon->SetSize(g_renderer->viewport.width, 50); this->broadcastBalloon->Move(0, 51); g_windowMgr.AddRenderedFront(this->broadcastBalloon); @@ -2514,7 +2514,7 @@ void CGameMode::ShowNoticeBalloon(const std::vector* lines) { UIBroadcastBalloon* balloon = this->noticeBalloon; if (!balloon) { - this->noticeBalloon = new UIBroadcastBalloon(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + this->noticeBalloon = new UIBroadcastBalloon(*reinterpret_cast(nullptr)); this->noticeBalloon->SetSize(g_renderer->viewport.width, 50); this->noticeBalloon->Move(0, 130 * g_renderer->viewport.height / 480); g_windowMgr.AddRenderedFront(this->noticeBalloon); diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 441d9583..4f44c4a8 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "Contents/CashEmotionMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Render/DeviceContext/DeviceContext.h" @@ -276,7 +278,7 @@ static_assert(sizeof(CashEmotionPurchasePacket) == 7); class UICashEmotionListWnd : public UIFrameWnd { public: - UICashEmotionListWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits); + UICashEmotionListWnd(UIWindowContext& windows, UIEditContext& edits); void Slot11() override; void Slot15(int width, int height) override; void Slot19() override; @@ -310,7 +312,7 @@ protected: /* 00E4 */ UIBitmapButton* unknown_00E4; /* 00E8 */ UICashEmotionListChildWnd_Abstract* m_currentList; /* 00EC */ UIStaticText* m_period; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_edits; }; @@ -2158,16 +2160,16 @@ int UICashEmotionListChildWnd_UnPurchased::SendMsg(UIWindow* sender, int message // OFFSET: 0x007C6CB0 // FUNCTION: fn_09401 -UICashEmotionListWnd::UICashEmotionListWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits) +UICashEmotionListWnd::UICashEmotionListWnd(UIWindowContext& windows, UIEditContext& edits) : UIFrameWnd(windows, 0), m_placement(nullptr), m_basicList(nullptr), m_purchaseList(nullptr), m_unpurchasedList(nullptr), m_searchList(nullptr), m_tab(0), unknown_00D4(nullptr), m_searchEdit(nullptr), unknown_00DC(nullptr), unknown_00E0(nullptr), unknown_00E4(nullptr), m_currentList(nullptr), - m_period(nullptr), m_controls(&controls), m_edits(&edits) { + m_period(nullptr), m_edits(&edits) { } // OFFSET: 0x007C7240 // FUNCTION: fn_09405 UIBitmapButton* UICashEmotionListWnd::CreateButton(int x, int y, int width, int height, int id, const char* format, bool hasDisabled) { - UIBitmapButton* button = new (std::nothrow) UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new (std::nothrow) UIBitmapButton(*this->m_context); if (!button) { return nullptr; } @@ -2190,8 +2192,8 @@ UIBitmapButton* UICashEmotionListWnd::CreateButton(int x, int y, int width, int // OFFSET: 0x007C74D0 // FUNCTION: fn_09406 void UICashEmotionListWnd::Slot15(int width, int height) { - this->AddCloseButton(*this->m_controls, "Alt+L", 0); - if (UIBitmapButton* base = this->AddBaseButton(*this->m_controls)) { + this->AddCloseButton("Alt+L", 0); + if (UIBitmapButton* base = this->AddBaseButton()) { base->Move(32, 3); } @@ -2203,7 +2205,7 @@ void UICashEmotionListWnd::Slot15(int width, int height) { }; int x = 46; for (int index = 0; index < 4; ++index) { - UIBmpRadioBtn2* tab = new (std::nothrow) UIBmpRadioBtn2(*this->m_context, *this->m_controls); + UIBmpRadioBtn2* tab = new (std::nothrow) UIBmpRadioBtn2(*this->m_context); if (!tab) { continue; } @@ -2268,7 +2270,7 @@ void UICashEmotionListWnd::Slot15(int width, int height) { this->SendMsg(first->second, 6, 215, 0, 0, 0); } - this->m_period = new UIStaticText(*this->m_context, *this->m_controls); + this->m_period = new UIStaticText(*this->m_context); this->m_period->SetSize(200, 14); this->m_period->Move(39, 359); this->m_period->SetColor(214, 24, 16); @@ -2771,7 +2773,7 @@ void UICashEmotionMiniWnd::Slot15(int width, int height) { } } - this->m_previous = new (std::nothrow) UIBitmapButton(*this->m_context, this->m_controls->buttons); + this->m_previous = new (std::nothrow) UIBitmapButton(*this->m_context); if (this->m_previous) { this->m_previous->SetBitmap("유저인터페이스\\cashemotion\\btn_arrow_l_normal.bmp", 0, 0); this->m_previous->SetBitmap("유저인터페이스\\cashemotion\\btn_arrow_l_over.bmp", 1, 0); @@ -2782,7 +2784,7 @@ void UICashEmotionMiniWnd::Slot15(int width, int height) { this->AddChild(this->m_previous); } - this->m_next = new (std::nothrow) UIBitmapButton(*this->m_context, this->m_controls->buttons); + this->m_next = new (std::nothrow) UIBitmapButton(*this->m_context); if (this->m_next) { this->m_next->SetBitmap("유저인터페이스\\cashemotion\\bth_arrow_r_normal.bmp", 0, 0); this->m_next->SetBitmap("유저인터페이스\\cashemotion\\bth_arrow_r_over.bmp", 1, 0); @@ -3486,7 +3488,7 @@ void UICashEmotionPiece::Set(int packId, int emotionId, bool showTooltip, bool h // OFFSET: 0x007CBC70 // FUNCTION: fn_09482 void UICashEmotionPiece::Slot15(int width, int height) { - this->m_button = new (std::nothrow) UICashEmotionSprBtn(*this->m_context, this->m_controls->buttons, this); + this->m_button = new (std::nothrow) UICashEmotionSprBtn(*this->m_context, this); if (this->m_button) { this->m_button->SetSize(width, height); this->m_button->Move(0, 0); @@ -3710,8 +3712,8 @@ void UICashEmotionScrollWnd::Slot53() { // OFFSET: 0x007CC870 // FUNCTION: fn_09499 -UICashEmotionSprBtn::UICashEmotionSprBtn(UIWindowContext& windowContext, UIButtonContext& buttonContext, UIWindow* target) - : UISpriteButton2(windowContext, buttonContext, target), m_selected(false) { +UICashEmotionSprBtn::UICashEmotionSprBtn(UIWindowContext& windowContext, UIWindow* target) + : UISpriteButton2(windowContext, target), m_selected(false) { } // OFFSET: 0x007CC990 @@ -3844,7 +3846,7 @@ void UICashEmotionSprBtn::Slot28(int x, int y) { int screenY = -20; this->ToScreen(screenX, screenY); - this->m_buttonContext->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, false); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, false); } if (!this->m_disabled) { @@ -3854,13 +3856,13 @@ void UICashEmotionSprBtn::Slot28(int x, int y) { // OFFSET: 0x008502C0 // FUNCTION: fn_10674 -UISpriteButton2::UISpriteButton2(UIWindowContext& windowContext, UIButtonContext& buttonContext, UIWindow* target) - : UISpriteButton(windowContext, buttonContext), m_target(target) { +UISpriteButton2::UISpriteButton2(UIWindowContext& windowContext, UIWindow* target) + : UISpriteButton(windowContext), m_target(target) { } // OFFSET: 0x00850320 // FUNCTION: fn_10675 -UISpriteButton::UISpriteButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIButton(windowContext, buttonContext) { +UISpriteButton::UISpriteButton(UIWindowContext& windowContext) : UIButton(windowContext) { this->unknown_00BC = 0; this->unknown_00C0 = 0; this->unknown_00B4 = 0; diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index be824091..a489a033 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -88,7 +88,6 @@ public: }; struct UIFriendOptionContext { - UIButtonContext& buttons; int& option0; int& option1; int& option2; @@ -115,7 +114,7 @@ private: class UIJobIconButton : public UIBitmapButton { public: - UIJobIconButton(UIWindowContext& windows, UIButtonContext& buttons); + UIJobIconButton(UIWindowContext& windows); ~UIJobIconButton() override; void Paint() override; void Slot25(int x, int y) override; @@ -127,7 +126,7 @@ public: class UIMessengerGroupWnd : public UIFrameWnd { public: - UIMessengerGroupWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMessengerGroupWnd(UIWindowContext& windows); ~UIMessengerGroupWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -182,7 +181,7 @@ public: /* 0278 */ UIButton* iconModeButtons[2]; /* 0280 */ unsigned char hiddenButtons[11]; /* 028C */ int mode; - UIButtonContext* m_controls; + void* unknown_controls; }; // GLOBAL: gl_24961 @@ -520,42 +519,40 @@ UIFriendOptionWnd::~UIFriendOptionWnd() = default; // OFFSET: 0x00738F30 // FUNCTION: fn_07681 void UIFriendOptionWnd::Slot15(int, int) { - auto& controls = this->m_options->buttons; - const char* label = controls.services.MessageText(361); + const char* label = LookupMessage(361); int width = std::min(this->TextWidth(label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); - this->option0Box = new UICheckBox(*this->m_context, controls); + this->option0Box = new UICheckBox(*this->m_context); this->option0Box->SetSize(width, 12); - this->option0Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(361)); + this->option0Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(361)); this->option0Box->Move(6, 21); this->option0Box->SetChecked(this->m_options->option0); this->AddChild(this->option0Box); - label = controls.services.MessageText(359); + label = LookupMessage(359); width = std::min(this->TextWidth(label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); - this->option2Box = new UICheckBox(*this->m_context, controls); + this->option2Box = new UICheckBox(*this->m_context); this->option2Box->SetSize(width, 12); - this->option2Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(359)); + this->option2Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(359)); this->option2Box->Move(6, 37); this->option2Box->SetChecked(this->m_options->option2); this->AddChild(this->option2Box); - label = controls.services.MessageText(362); + label = LookupMessage(362); width = std::min(this->TextWidth(label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); - this->option1Box = new UICheckBox(*this->m_context, controls); + this->option1Box = new UICheckBox(*this->m_context); this->option1Box->SetSize(width, 12); - this->option1Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(362)); + this->option1Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(362)); this->option1Box->Move(6, 53); this->option1Box->SetChecked(this->m_options->option1); this->AddChild(this->option1Box); - this->closeButton = this->AddCloseButton(controls, "Alt+I", 0); + this->closeButton = this->AddCloseButton("Alt+I", 0); } // OFFSET: 0x007391C0 // FUNCTION: fn_07682 void UIFriendOptionWnd::Paint() { - auto& controls = this->m_options->buttons; const int titleHeight = this->DrawTitleBar(true, LookupMessage(355), 0); this->DrawPanelBackground(titleHeight, 0, ""); @@ -613,7 +610,7 @@ void UIFriendOptionWnd::Slot11() { // OFFSET: 0x00739330 // FUNCTION: fn_07685 -UIJobIconButton::UIJobIconButton(UIWindowContext& windows, UIButtonContext& buttons) : UIBitmapButton(windows, buttons) { +UIJobIconButton::UIJobIconButton(UIWindowContext& windows) : UIBitmapButton(windows) { this->unknown_0120 = 0; } @@ -688,7 +685,7 @@ MiniPartyInfoEntry::MiniPartyInfoEntry(const char* text, int value) : text(text) // OFFSET: 0x00739C80 // FUNCTION: fn_07698 -UIMessengerGroupWnd::UIMessengerGroupWnd(UIWindowContext& windows, UIButtonContext& controls) : UIFrameWnd(windows, 0) { +UIMessengerGroupWnd::UIMessengerGroupWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { this->saved = nullptr; this->scrollBar = nullptr; this->scrollTop = 0; @@ -702,7 +699,6 @@ UIMessengerGroupWnd::UIMessengerGroupWnd(UIWindowContext& windows, UIButtonConte for (int i = 0; i < 11; ++i) { this->hiddenButtons[i] = 0; } - this->m_controls = &controls; } // OFFSET: 0x0073A080 @@ -803,8 +799,8 @@ void UIMessengerGroupWnd::Slot15(int, int) { this->iconPositions[1].y = 1; this->iconPositions[1].size = 27; - this->iconModeButtons[0] = this->AddMinimizeButton(*this->m_controls, "", 0); - this->iconModeButtons[1] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->iconModeButtons[0] = this->AddMinimizeButton("", 0); + this->iconModeButtons[1] = new UIBitmapButton(*this->m_context); static_cast(this->iconModeButtons[1])->SetBitmap("유저인터페이스\\renewalparty\\btn_titlebar_maximum_out.bmp", 0, 0); static_cast(this->iconModeButtons[1])->SetBitmap("유저인터페이스\\renewalparty\\btn_titlebar_maximum_over.bmp", 1, 0); static_cast(this->iconModeButtons[1])->SetBitmap("유저인터페이스\\renewalparty\\btn_titlebar_maximum_press.bmp", 2, 0); @@ -824,7 +820,7 @@ void UIMessengerGroupWnd::Slot15(int, int) { } for (int index = 0; index < 40; ++index) { - this->jobIcons[index] = new UIJobIconButton(*this->m_context, *this->m_controls); + this->jobIcons[index] = new UIJobIconButton(*this->m_context); this->jobIcons[index]->SetSize(50, 50); this->jobIcons[index]->SetBitmap("유저인터페이스\\renewalparty\\icon_jobs_4046.bmp", 0, 0); this->jobIcons[index]->SetBitmap("유저인터페이스\\renewalparty\\icon_jobs_4046.bmp", 1, 0); @@ -841,7 +837,7 @@ void UIMessengerGroupWnd::Slot15(int, int) { int tabWidths[2] = {48, this->TextWidth(LookupMessage(0x67), 0, 0, 12, 0, 0) + 13}; int tabValues[2] = {0, 1}; for (int index = 0; index < 2; ++index) { - UIRadioBtn* tab = new UIRadioBtn(*this->m_context, *this->m_controls); + UIRadioBtn* tab = new UIRadioBtn(*this->m_context); this->tabs[index] = tab; tab->SetSize(tabWidths[index], 12); tab->Move(index * 60 + 4, this->geometry.height - 16); @@ -862,13 +858,13 @@ void UIMessengerGroupWnd::Slot15(int, int) { sprintf(title, "%s(%d/%d)", titles[this->mode], this->members.size(), 40); } - this->titleText = new UIStaticText(*this->m_context, *this->m_controls); + this->titleText = new UIStaticText(*this->m_context); this->titleText->SetSize(this->geometry.width - 57, 15); this->titleText->SetTextFitted(title); this->titleText->Move(16, 2); this->titleText->shadow = 1; this->AddChild(this->titleText); - this->closeButton = this->AddCloseButton(*this->m_controls, "Alt+Z", 0); + this->closeButton = this->AddCloseButton("Alt+Z", 0); { std::string prefix = "유저인터페이스\\basic_interface\\mesbtn_0"; @@ -899,7 +895,7 @@ void UIMessengerGroupWnd::Slot15(int, int) { for (int index = 0; index < 11; ++index) { char number[8]; _itoa(index + 1, number, 10); - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->buttons[index] = button; bool useDisabledImage = false; diff --git a/Source/Contents/SignBoard/SignBoard.cpp b/Source/Contents/SignBoard/SignBoard.cpp index 2b087c4f..8763af4d 100644 --- a/Source/Contents/SignBoard/SignBoard.cpp +++ b/Source/Contents/SignBoard/SignBoard.cpp @@ -81,7 +81,7 @@ void CSignBoardMgr::Initialize() { case 1: { C3DCooRendering* object = new C3DCooRendering(); object->type = it->type; - object->Create(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + object->Create(*reinterpret_cast(nullptr)); std::string image; if (_mbsstr(reinterpret_cast(it->image), reinterpret_cast("유저인터페이스")) == nullptr) { image = "유저인터페이스\\"; @@ -111,7 +111,7 @@ void CSignBoardMgr::Initialize() { case 3: { C3DCooRendering* object = new C3DCooRendering(); object->type = it->type; - object->Create(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + object->Create(*reinterpret_cast(nullptr)); std::string image; if (_mbsstr(reinterpret_cast(it->image), reinterpret_cast("유저인터페이스")) == nullptr) { image = "유저인터페이스\\"; @@ -193,7 +193,7 @@ CIcon::CIcon() { // OFFSET: 0x00821180 // FUNCTION: fn_10257 -CSignBoardWnd::CSignBoardWnd(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), m_controls(&controls) { +CSignBoardWnd::CSignBoardWnd(UIWindowContext& windows) : UIWindow(windows, 0) { } // OFFSET: 0x008213D0 @@ -256,7 +256,7 @@ void CBmpObjWnd::Slot15(int width, int height) { void CSignBoardWnd::Slot15(int width, int height) { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\signboard\\bg_signboard.bmp"))); this->Resize(bitmap->image.width, bitmap->image.height); - UIStaticText* text = new (std::nothrow) UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* text = new (std::nothrow) UIStaticText(*this->m_context); this->text = text; text->SetSize(0x7e, 0xe); text->Move(0x1e, this->geometry.height / 2 - 7); @@ -285,7 +285,7 @@ void CSignBoardWnd::Paint() { // OFFSET: 0x00821D10 // FUNCTION: fn_10267 -void C3DCooRendering::Create(UIWindowContext& windows, UIButtonContext& controls) { +void C3DCooRendering::Create(UIWindowContext& windows) { UIWindow* window; int width; int height; @@ -296,7 +296,7 @@ void C3DCooRendering::Create(UIWindowContext& windows, UIButtonContext& controls height = 0xaa; break; case 3: - window = new (std::nothrow) CSignBoardWnd(windows, controls); + window = new (std::nothrow) CSignBoardWnd(windows); width = 0xa2; height = 0x24; break; diff --git a/Source/Contents/SignBoard/SignBoard.h b/Source/Contents/SignBoard/SignBoard.h index fb5a6b50..71eea40d 100644 --- a/Source/Contents/SignBoard/SignBoard.h +++ b/Source/Contents/SignBoard/SignBoard.h @@ -9,7 +9,6 @@ #include class UIStaticText; -struct UIButtonContext; class CBmpObjWnd : public UIWindow { public: @@ -23,7 +22,7 @@ public: class CSignBoardWnd : public UIWindow { public: - CSignBoardWnd(UIWindowContext& windows, UIButtonContext& controls); + CSignBoardWnd(UIWindowContext& windows); ~CSignBoardWnd() override; void Slot15(int width, int height) override; void Paint() override; @@ -35,7 +34,7 @@ public: /* 00B0 */ std::string unknown_00B0; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class CIcon : public CRenderObject { @@ -55,7 +54,7 @@ public: ~C3DCooRendering() override; bool OnProcess() override; void Render(int argument) override; - void Create(UIWindowContext& windows, UIButtonContext& controls); + void Create(UIWindowContext& windows); void SetOverrideColor(); void SetBoard(const std::string& text, const std::string& color); void SetWindowImage(const std::string& name); diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index c1303303..90a72539 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/CMode.h" #include "Contents/UserData/NormalItemSlots.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Application/Launcher.h" @@ -267,7 +268,7 @@ UIChooseSellBuyWnd::~UIChooseSellBuyWnd() = default; // INLINED void UIChooseSellBuyWnd::AddChoice(const char* name, int id, int x, int y) { - auto* button = new UIBitmapButton(*this->m_context, this->m_acceptance->text.buttons); + auto* button = new UIBitmapButton(*this->m_context); const char* suffixes[] = {"", "_a", "_b"}; for (int state = 0; state < 3; ++state) { @@ -287,7 +288,7 @@ void UIChooseSellBuyWnd::CreateViewer(int width, int height) { this->viewer = new UITextViewer(*this->m_context, text); this->viewer->Configure(10, 22, width - 20, height - 55, 0); const std::string chip = std::string(prefix) + "colorchip.bmp"; - const auto* bitmap = static_cast(text.buttons.resources.Load(chip.c_str())); + const auto* bitmap = static_cast(ResourceMgr::Instance().Load(chip.c_str())); const auto& image = bitmap->image; const std::uint32_t pixel = image.width > 2 && image.height > 2 ? image.pixels[2 + 2 * image.width] : 0x00FF0000u; this->viewer->textColor = 0xFF000000u | ((pixel & 255) << 16) | (pixel & 0xFF00) | ((pixel >> 16) & 255); @@ -297,8 +298,8 @@ void UIChooseSellBuyWnd::CreateViewer(int width, int height) { // OFFSET: 0x008C7420 // FUNCTION: fn_11931 -UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext) - : UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices(), m_controls(&controls), m_listContext(&listContext) { +UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext) + : UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices(), m_listContext(&listContext) { this->m_choices.reserve(6); } @@ -310,13 +311,13 @@ void UIChooseSellBuyWnd::Slot15(int width, int height) { this->AddChoice("btn_cancel", 185, 234, 96); this->m_message0 = 224; this->CreateViewer(width, height); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_acceptance->text.buttons.services.MessageText(92)), 38, 0, 0); + this->viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(92)), 38, 0, 0); } // OFFSET: 0x008DD9A0 // FUNCTION: fn_12163 void UIChooseWarpWnd::Slot15(int width, int height) { - auto* title = new UIStaticText(*this->m_context, *this->m_controls); + auto* title = new UIStaticText(*this->m_context); title->SetSize(this->geometry.width - 30, 15); title->Move(12, 9); title->SetText(LookupMessage(213), 0); @@ -345,7 +346,7 @@ void UIChooseWarpWnd::Slot15(int width, int height) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -378,7 +379,7 @@ void UIChooseWnd::Slot15(int width, int height) { this->AddChild(this->m_list); this->m_message0 = 184; - this->m_okButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_okButton = new UIBitmapButton(*this->m_context); this->m_okButton->SetBitmap("유저인터페이스\\btn_ok.bmp", 0, 0); this->m_okButton->SetBitmap("유저인터페이스\\btn_ok_a.bmp", 1, 0); this->m_okButton->SetBitmap("유저인터페이스\\btn_ok_b.bmp", 2, 0); @@ -387,7 +388,7 @@ void UIChooseWnd::Slot15(int width, int height) { this->m_okButton->SetId(184); this->AddChild(this->m_okButton); - this->m_cancelButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_cancelButton = new UIBitmapButton(*this->m_context); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel.bmp", 0, 0); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel_a.bmp", 1, 0); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel_b.bmp", 2, 0); @@ -401,7 +402,7 @@ void UIChooseWnd::Slot15(int width, int height) { // FUNCTION: fn_12169 void UIDisconnectedServerMsgWnd::Slot15(int width, int height) { auto& text = *this->m_textContext; - auto* button = new UIBitmapButton(*this->m_context, text.buttons); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\btn_ok.bmp", 0, 0); button->SetBitmap("유저인터페이스\\btn_ok_a.bmp", 1, 0); button->SetBitmap("유저인터페이스\\btn_ok_b.bmp", 2, 0); @@ -440,7 +441,7 @@ void UIEmailAddressWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 28; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -460,7 +461,7 @@ void __stdcall Nullsub301(int, int) { // FUNCTION: fn_12214 void UIChooseSellBuyWnd::Paint() { const std::string path = std::string(prefix) + "win_msgbox.bmp"; - const auto* bitmap = static_cast(this->m_acceptance->text.buttons.resources.Load(path.c_str())); + const auto* bitmap = static_cast(ResourceMgr::Instance().Load(path.c_str())); this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); } @@ -498,9 +499,8 @@ void UIDisconnectedServerMsgWnd::Paint() { // OFFSET: 0x008ED1F0 // FUNCTION: fn_12220 void UIEmailAddressWnd::Paint() { - auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(15, 6, controls.services.MessageText(g_serviceType == 0 ? 1815 : 299), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 6, LookupMessage(g_serviceType == 0 ? 1815 : 299), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008ED240 @@ -603,18 +603,16 @@ void UIEquipWnd::Paint() { // OFFSET: 0x008EE230 // FUNCTION: fn_12223 void UIGraffiStrboxWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(17, 23, controls.services.MessageText(436), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(16, 22, controls.services.MessageText(436), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 23, LookupMessage(436), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 22, LookupMessage(436), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008EE9D0 // FUNCTION: fn_12227 void UIItemParamChangeDisplayWnd::Paint() { - auto& controls = *this->m_controls; char text[128]; const auto drawArrow = [this](int x, int before, int after) { if (before < after) { @@ -628,7 +626,7 @@ void UIItemParamChangeDisplayWnd::Paint() { }; this->DrawBorder(0, 0, 0, 0); - std::sprintf(text, controls.services.MessageText(269)); + std::sprintf(text, LookupMessage(269)); this->DrawTextAt(20, 10, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%d", this->m_before); this->DrawTextAt(70, 10, text, 0, 0, 12, 0, 0, 0); @@ -636,7 +634,7 @@ void UIItemParamChangeDisplayWnd::Paint() { std::sprintf(text, "%d", this->m_after); this->DrawTextAt(110, 10, text, 0, 0, 12, 0, 0, 0); - std::sprintf(text, controls.services.MessageText(270)); + std::sprintf(text, LookupMessage(270)); this->DrawTextAt(152, 10, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%d", this->m_beforeSecond); this->DrawTextAt(202, 10, text, 0, 0, 12, 0, 0, 0); @@ -653,7 +651,6 @@ void UILoadingWnd::Paint() { // OFFSET: 0x008EED00 // FUNCTION: fn_12230 void UIMenuWnd::Paint() { - auto& controls = *this->m_controls; unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 6, 6, red, green, blue); this->ClearSurface(RGB(red, green, blue)); @@ -694,7 +691,6 @@ void UIMenuWnd::Paint() { // OFFSET: 0x008EF0A0 // FUNCTION: fn_12231 void UIMinimapZoomWnd::Paint() { - auto& controls = *this->m_controls; this->ClearSurface(0xFFFF00FF); int column = 0; int row = 0; @@ -718,7 +714,7 @@ void UIMinimapZoomWnd::Slot15(int, int) { buttons.clear(); for (int i = 0; i < 5; ++i) { const std::string name = prefix + names[i]; - UIWindow* button = this->AddNumberedButton(*this->m_controls, ids[i], xs[i], ys[i], name.c_str(), tooltips[i], true); + UIWindow* button = this->AddNumberedButton(ids[i], xs[i], ys[i], name.c_str(), tooltips[i], true); buttons.push_back(button); } @@ -815,7 +811,7 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum // OFFSET: 0x0090C020 // FUNCTION: fn_12437 void UIMinimapZoomWnd::AddTownButton(int index, TownInfo town) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap(town.image.c_str(), 0, 0); button->SetBitmap(town.image.c_str(), 1, 0); button->SetBitmap(town.image.c_str(), 2, 0); @@ -831,7 +827,6 @@ void UIMinimapZoomWnd::AddTownButton(int index, TownInfo town) { // OFFSET: 0x008EF1A0 // FUNCTION: fn_12232 void UIMonsterDisplayWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, "", 0); unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); @@ -930,7 +925,6 @@ void UINotifyQuestWnd::Paint() { // OFFSET: 0x008EF810 // FUNCTION: fn_12237 void UINpcEditDialogWnd::Paint() { - auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); this->DrawTextAt(15, 6, g_serviceType == 12 ? "Insira o Numero" : "Input number ", 0, 0, 12, 0, 0, 0); } @@ -1076,29 +1070,27 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x008EF9A0 // FUNCTION: fn_12239 void UIPartyInvitationToWnd::Paint() { - auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(2056), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(2056), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(10, 22, controls.services.MessageText(2058), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, LookupMessage(2058), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008EFA00 // FUNCTION: fn_12240 void UIPartySettingWnd::Paint() { - auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(this->m_mode == 50 ? 2054 : 291), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(this->m_mode == 50 ? 2054 : 291), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); if (this->m_mode == 70) { - this->DrawTextAt(10, 22, controls.services.MessageText(292), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, LookupMessage(292), 0, 0, 12, 0, 0, 0); } else if (this->m_mode == 50) { - this->DrawTextAt(10, 22, controls.services.MessageText(2057), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, LookupMessage(2057), 0, 0, 12, 0, 0, 0); } - this->DrawTextAt(10, this->m_mode + 82, controls.services.MessageText(738), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(10, this->m_mode + 17, controls.services.MessageText(293), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, this->m_mode + 82, LookupMessage(738), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, this->m_mode + 17, LookupMessage(293), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008EFAF0 @@ -1259,10 +1251,9 @@ int UIPasswordWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // OFFSET: 0x008EFCF0 // FUNCTION: fn_12244 void UIProhibitListWnd::Paint() { - auto& controls = *this->m_controls; char text[256]; - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(714), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(714), 0); this->DrawPanelBackground(titleHeight, 0, ""); const auto* left = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysboxs_ld.bmp"))); this->DrawBitmap(0, this->geometry.height - left->image.height, &left->image, false); @@ -1319,8 +1310,7 @@ void UISayDialogWnd::Paint() { // OFFSET: 0x008F0350 // FUNCTION: fn_12249 void UISelectCartWnd::Paint() { - auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(659), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(659), 0); this->DrawPanelBackground(titleHeight, 0, ""); const auto* left = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysboxs_ld.bmp"))); this->DrawBitmap(0, this->geometry.height - left->image.height, &left->image, false); @@ -1346,7 +1336,6 @@ void UISkillDescribeWnd::Paint() { // OFFSET: 0x008F04B0 // FUNCTION: fn_12251 void UISkillNameChangeWnd::Paint() { - auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); this->DrawTextAt(15, 6, this->m_name.c_str(), 0, 0, 12, 0, 0, 0); } @@ -1442,8 +1431,7 @@ UISpellListWnd::~UISpellListWnd() { } void UISpellListWnd::Paint() { - auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(697), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(697), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1486,8 +1474,7 @@ void CSession::ItemBitmapPath(const char* name, char* output) { // OFFSET: 0x008F2460 // FUNCTION: fn_12255 void UITipOfTheDayWnd::Paint() { - auto& controls = *this->m_controls; - this->DrawTitleBar(true, controls.services.MessageText(174), 0); + this->DrawTitleBar(true, LookupMessage(174), 0); if (this->geometry.height == 17) { return; @@ -1537,7 +1524,6 @@ void UIWaitWnd::Paint() { // OFFSET: 0x008F2AD0 // FUNCTION: fn_12259 void UIWhisperWnd::Paint() { - auto& controls = *this->m_controls; char title[128]; if (!this->m_code.empty()) { @@ -1875,7 +1861,7 @@ void UISelectCartWnd::AddCart(int index, int type) { y -= 10; break; } - UISpriteButton* button = new UISpriteButton(*this->m_context, *this->m_controls); + UISpriteButton* button = new UISpriteButton(*this->m_context); const std::string prefix = "이팩트\\"; button->SetSprite((prefix + name + ".spr").c_str()); button->SetActName((prefix + name + ".act").c_str()); @@ -2060,7 +2046,7 @@ void UIStatusWnd::Slot28(int x, int y) { int tipX = point.x - this->m_offsetX; int tipY = this->m_titleHeight - this->m_offsetY - 19 + point.y; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(statTexts[index], tipX, tipY, -1, true, true); + static_cast(g_charViewMode)->Show(statTexts[index], tipX, tipY, -1, true, true); break; } } @@ -2083,7 +2069,7 @@ void UIStatusWnd::Slot28(int x, int y) { int tipX = point.x - 16; int tipY = point.y - 13; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(traitTexts[index], tipX, tipY, -1, true, true); + static_cast(g_charViewMode)->Show(traitTexts[index], tipX, tipY, -1, true, true); return; } } @@ -3354,7 +3340,7 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (message == 91) { this->identity = static_cast(a); - const std::string text = this->m_acceptance->text.buttons.services.MessageText(2965); + const std::string text = LookupMessage(2965); this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; @@ -3407,7 +3393,7 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std std::string text = "("; text += reinterpret_cast(b); text += ")"; - text += this->m_acceptance->text.buttons.services.MessageText(794); + text += LookupMessage(794); this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; @@ -3716,7 +3702,7 @@ void UIBookWnd::Slot15(int width, int height) { const char* tooltips[4] = {LookupMessage(1296), LookupMessage(1297), LookupMessage(1298), LookupMessage(1299)}; for (int index = 0; index < 4; ++index) { - this->m_buttons[index] = new UISpriteButton(*this->m_context, this->m_book->text.buttons); + this->m_buttons[index] = new UISpriteButton(*this->m_context); this->m_buttons[index]->SetSprite((prefix + names[index] + ".spr").c_str()); this->m_buttons[index]->SetActName((prefix + names[index] + ".act").c_str()); this->m_buttons[index]->SetSize(this->m_buttons[index]->FrameWidth(0, 0), this->m_buttons[index]->FrameHeight(0, 0)); @@ -3739,10 +3725,10 @@ void UIItemCollectionWnd::Slot15(int width, int height) { this->m_viewer->Invalidate(); this->AddChild(this->m_viewer); - this->m_closeButton = this->AddCloseButton(*reinterpret_cast(nullptr), "ESC", 0); + this->m_closeButton = this->AddCloseButton("ESC", 0); std::string path = "유저인터페이스\\"; - this->m_viewButton = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_viewButton = new UIBitmapButton(*this->m_context); this->m_viewButton->SetBitmap((path + "btn_view" + ".bmp").c_str(), 0, 0); this->m_viewButton->SetBitmap((path + "btn_view_a" + ".bmp").c_str(), 1, 0); this->m_viewButton->SetBitmap((path + "btn_view_b" + ".bmp").c_str(), 2, 0); @@ -3756,7 +3742,7 @@ void UIItemCollectionWnd::Slot15(int width, int height) { const int ids[2] = {287, 288}; const char* names[2] = {"책읽기", "책읽기"}; for (int index = 0; index < 2; ++index) { - this->m_readButtons[index] = new UISpriteButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_readButtons[index] = new UISpriteButton(*this->m_context); this->m_readButtons[index]->SetSprite((prefix + names[index] + ".spr").c_str()); this->m_readButtons[index]->SetActName((prefix + names[index] + ".act").c_str()); this->m_readButtons[index]->SetSize(this->m_readButtons[index]->FrameWidth(0, 0), this->m_readButtons[index]->FrameHeight(0, 0)); @@ -3776,7 +3762,7 @@ void UIItemCollectionWnd::Slot15(int width, int height) { this->m_previewTick = 0; if (!this->m_moveInfo) { - this->m_moveInfo = new UIItemMoveInfo(*this->m_context, *reinterpret_cast(nullptr), g_windowMgr, + this->m_moveInfo = new UIItemMoveInfo(*this->m_context, g_windowMgr, *reinterpret_cast(nullptr)); this->m_moveInfo->Configure(LookupMessage(2796), 0, 0, 12, 0, 1); this->m_moveInfo->SetId(487); @@ -3786,7 +3772,7 @@ void UIItemCollectionWnd::Slot15(int width, int height) { this->AddChild(this->m_moveInfo); } - this->m_helpButton = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_helpButton = new UIBitmapButton(*this->m_context); this->m_helpButton->SetBitmap("유저인터페이스\\basic_interface\\btn_help_normal.bmp", 0, 0); this->m_helpButton->SetBitmap("유저인터페이스\\basic_interface\\btn_help_over.bmp", 1, 0); this->m_helpButton->SetBitmap("유저인터페이스\\basic_interface\\btn_help_pressed.bmp", 2, 0); @@ -3833,7 +3819,7 @@ void UIItemCollection_ComparisonWnd::Slot15(int width, int height) { void UICardItemIllustWnd::Slot15(int, int) { this->unknown_00E4 = 0; this->m_name = LookupMessage(527); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); } // OFFSET: 0x008E2590 @@ -3942,15 +3928,15 @@ void UISkillDescribeWnd::Slot15(int width, int height) { // OFFSET: 0x008E8DC0 // FUNCTION: fn_12201 void UIStatusWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "Alt+A", 0); - this->AddMinimizeButton(*this->m_controls, "Ctrl+A", 0); + this->AddBaseButton(); + this->AddCloseButton("Alt+A", 0); + this->AddMinimizeButton("Ctrl+A", 0); { const int ids[6] = {205, 206, 207, 208, 209, 210}; const std::string arrow = "유저인터페이스\\basic_interface\\arw_right.bmp"; for (int i = 0; i < 6; ++i) { - this->m_statButtons[i] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_statButtons[i] = new UIBitmapButton(*this->m_context); this->m_statButtons[i]->SetBitmap(arrow.c_str(), 0, 0); this->m_statButtons[i]->SetBitmap(arrow.c_str(), 1, 0); this->m_statButtons[i]->SetBitmap(arrow.c_str(), 2, 0); @@ -3965,7 +3951,7 @@ void UIStatusWnd::Slot15(int, int) { const int ids[6] = {551, 552, 553, 554, 555, 556}; const std::string arrow = "유저인터페이스\\basic_interface\\arw_right.bmp"; for (int i = 0; i < 6; ++i) { - this->m_extendedButtons[i] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_extendedButtons[i] = new UIBitmapButton(*this->m_context); this->m_extendedButtons[i]->SetBitmap(arrow.c_str(), 0, 0); this->m_extendedButtons[i]->SetBitmap(arrow.c_str(), 1, 0); this->m_extendedButtons[i]->SetBitmap(arrow.c_str(), 2, 0); @@ -3976,7 +3962,7 @@ void UIStatusWnd::Slot15(int, int) { } } - this->m_expandButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + this->m_expandButton = new UIBmpTextButton(*this->m_context); this->m_expandButton->SetBitmap("유저인터페이스\\statuswnd\\expand_on_normal.bmp", 0, 0); this->m_expandButton->SetBitmap("유저인터페이스\\statuswnd\\expand_on_normal.bmp", 1, 0); this->m_expandButton->SetBitmap("유저인터페이스\\statuswnd\\expand_on_press.bmp", 2, 0); @@ -4012,7 +3998,7 @@ void UISkillNameChangeWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 32; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -4064,17 +4050,17 @@ void UIToolTipWnd::Slot15(int width, int height) { // OFFSET: 0x008E7130 // FUNCTION: fn_12194 void UIProhibitListWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); char tooltip[] = "Command"; - auto* area = new UINoneVisibleButton(*this->m_context, *this->m_controls); + auto* area = new UINoneVisibleButton(*this->m_context); area->SetSize(120, 18); area->Move(350, 59); area->SetId(268); this->AddChild(area); const std::string prefix("유저인터페이스\\basic_interface\\"); - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "txtbox_btn_a" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "txtbox_btn_b" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "txtbox_btn_c" + ".bmp").c_str(), 2, 0); @@ -4217,7 +4203,7 @@ void UInCashWnd::DrawItems() { void UIMonsterDisplayWnd::Slot15(int, int) { this->unknown_00E4 = 0; this->unknown_00CC = LookupMessage(527); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); } // OFFSET: 0x008E3090 @@ -6231,20 +6217,20 @@ UINotifyQuestWnd::UINotifyQuestWnd(UIWindowContext& windows) // OFFSET: 0x008C8830 // FUNCTION: fn_11961 -UINpcEditDialogWnd::UINpcEditDialogWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UINpcEditDialogWnd::UINpcEditDialogWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x008C8890 // FUNCTION: fn_11962 -UINpcTextEditDialogWnd::UINpcTextEditDialogWnd(UIWindowContext& windows, UIButtonContext& controls) - : UINpcEditDialogWnd(windows, controls), m_tagCtrl(nullptr) { +UINpcTextEditDialogWnd::UINpcTextEditDialogWnd(UIWindowContext& windows) + : UINpcEditDialogWnd(windows), m_tagCtrl(nullptr) { } // OFFSET: 0x008C8B50 // FUNCTION: fn_11968 -UIProhibitListWnd::UIProhibitListWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits) - : UIFrameWnd(windows, 0), m_count(0), m_controls(&controls), m_edits(&edits) { +UIProhibitListWnd::UIProhibitListWnd(UIWindowContext& windows, UIEditContext& edits) + : UIFrameWnd(windows, 0), m_count(0), m_edits(&edits) { } // OFFSET: 0x008C8BB0 @@ -6261,8 +6247,8 @@ UIRestartWnd::UIRestartWnd(UIWindowContext& windows) // OFFSET: 0x008C93D0 // FUNCTION: fn_11980 -UITipOfTheDayWnd::UITipOfTheDayWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UITipOfTheDayWnd::UITipOfTheDayWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x008C9560 @@ -6386,32 +6372,32 @@ UIItemCollection_ComparisonWnd::UIItemCollection_ComparisonWnd(UIWindowContext& // OFFSET: 0x008C7070 // FUNCTION: fn_11927 -UICardItemIllustWnd::UICardItemIllustWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UICardItemIllustWnd::UICardItemIllustWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x008C8390 // FUNCTION: fn_11953 -UIMenuWnd::UIMenuWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_menuId(10041), m_selected(-1), m_itemHeight(14), unknown_00CC(0), unknown_00DC(0), m_controls(&controls) { +UIMenuWnd::UIMenuWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_menuId(10041), m_selected(-1), m_itemHeight(14), unknown_00CC(0), unknown_00DC(0) { } // OFFSET: 0x008C85A0 // FUNCTION: fn_11956 -UIMonsterDisplayWnd::UIMonsterDisplayWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIMonsterDisplayWnd::UIMonsterDisplayWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x008C8900 // FUNCTION: fn_11963 -UIPartyInvitationToWnd::UIPartyInvitationToWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIPartySettingWnd(windows, controls) { +UIPartyInvitationToWnd::UIPartyInvitationToWnd(UIWindowContext& windows) + : UIPartySettingWnd(windows) { } // OFFSET: 0x008C8980 // FUNCTION: fn_11964 -UIPartySettingWnd::UIPartySettingWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIPartySettingWnd::UIPartySettingWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { this->m_mode = 0; this->m_placement = nullptr; } @@ -6425,8 +6411,8 @@ UIPetTamingDeceiveWnd::UIPetTamingDeceiveWnd(UIWindowContext& windows) // OFFSET: 0x008C9060 // FUNCTION: fn_11975 -UISkillNameChangeWnd::UISkillNameChangeWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UISkillNameChangeWnd::UISkillNameChangeWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x008C91F0 @@ -6555,7 +6541,7 @@ void UINoticeConfirmWnd::Slot15(int width, int height) { int positions[2][2] = {{189, 96}, {234, 96}}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, this->m_textContext->buttons); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -6585,7 +6571,7 @@ void UINotifyLevelUpWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\basic_interface\\"); for (int i = 0; i < 1; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i] + "_off.bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i] + "_off.bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i] + "_on.bmp").c_str(), 2, 0); @@ -6605,7 +6591,7 @@ void UINotifyQuestWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\basic_interface\\"); for (int i = 0; i < 1; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i] + "_off.bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i] + "_off.bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i] + "_on.bmp").c_str(), 2, 0); @@ -6633,7 +6619,7 @@ void UINpcEditDialogWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 32; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -6663,7 +6649,7 @@ void UINpcTextEditDialogWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 32; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -6683,7 +6669,7 @@ void UIQuitWnd::Slot15(int, int) { const char* names[3][3] = {{"esc_01a", "esc_01b", "esc_01c"}, {"esc_03a", "esc_03b", "esc_03c"}, {"esc_02a", "esc_02b", "esc_02c"}}; for (int i = 0; i < 3; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -6706,7 +6692,7 @@ void UIRestartWnd::Slot15(int, int) { int positions[4][4] = {{29, 22, 0, 0}, {29, 45, 0, 0}, {29, 68, 0, 0}, {29, 96, 0, 0}}; for (int i = 0; i < 4; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -6722,7 +6708,7 @@ void UIRestartWnd::Slot15(int, int) { // OFFSET: 0x008EAE30 // FUNCTION: fn_12206 void UIWaitWnd::Slot15(int width, int height) { - this->m_button = new UIBitmapButton(*this->m_context, this->m_textContext->buttons); + this->m_button = new UIBitmapButton(*this->m_context); this->m_button->SetBitmap("유저인터페이스\\btn_cancel.bmp", 0, 0); this->m_button->SetBitmap("유저인터페이스\\btn_cancel_a.bmp", 1, 0); this->m_button->SetBitmap("유저인터페이스\\btn_cancel_b.bmp", 2, 0); @@ -6769,7 +6755,7 @@ void UIPartyInvitationToWnd::Slot15(int, int) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -7242,7 +7228,7 @@ void UIPasswordWnd::Slot15(int, int) { InputFocus focus{g_windowMgr.hoverWindow}; focus.Set(this->m_edit); - auto* title = new UIStaticText(*this->m_context, *this->m_controls); + auto* title = new UIStaticText(*this->m_context); this->unknown_00B8 = reinterpret_cast(title); title->SetSize(this->geometry.width - 30, 15); title->Move(15, 6); @@ -7252,7 +7238,7 @@ void UIPasswordWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 32; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -7265,8 +7251,8 @@ void UIPasswordWnd::Slot15(int, int) { this->unknown_00BC = 0; } // FUNCTION: fn_11978 -UIStatusWnd::UIStatusWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIStatusWnd::UIStatusWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { this->geometry.unknown_0030 = 0; this->m_info = nullptr; this->m_titleHeight = 17; @@ -7841,7 +7827,6 @@ void UIBookWnd::Paint() { // OFFSET: 0x008ECF50 // FUNCTION: fn_12212 void UICardItemIllustWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->m_bitmapPath.size() != 0) { this->DrawBitmap(0, 17, reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->m_bitmapPath.c_str()))), false); @@ -7857,7 +7842,7 @@ void UICardItemIllustWnd::Paint() { // OFFSET: 0x008E8480 // FUNCTION: fn_12198 void UISelectCartWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); const int levels[] = {0, 40, 65, 80, 90, 100, 110, 120, 130}; std::vector& carts = *reinterpret_cast*>(&this->unknown_00B8); @@ -7905,7 +7890,7 @@ int UISelectCartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std g_windowMgr.CloseWindow(95); } else if (message == 34) { this->DeleteChildren(); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); carts.clear(); this->unknown_00B4 = static_cast(c); const char* types = reinterpret_cast(a); @@ -8470,7 +8455,7 @@ void UIAutoMessageWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int x = this->geometry.width - 55; const int y = this->geometry.height - 32; - auto* button = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -8489,7 +8474,7 @@ void UInCash_CallWnd::Slot15(int, int) { const char* names[] = {"NC_CashShop"}; const std::string prefix("유저인터페이스\\basic_interface\\"); for (int index = 0; index < 1; ++index) { - auto* button = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index] + ".bmp").c_str(), 2, 0); @@ -9280,7 +9265,7 @@ void UITipOfTheDayWnd::Slot15(int width, int height) { const char* tooltips[3] = {"", "", "/tip"}; for (int index = 0; index < 3; ++index) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -9302,7 +9287,7 @@ void UITipOfTheDayWnd::Slot15(int width, int height) { this->AddChild(this->m_textViewer); this->m_showTipsAtStartup = g_window315Enabled; - UICheckBox* checkBox = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* checkBox = new UICheckBox(*this->m_context); checkBox->SetSize(this->TextWidth(LookupMessage(176), 0, 0, 12, 0, 0) + 12, 12); checkBox->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(176)); checkBox->Move(10, height - 20); @@ -10245,7 +10230,7 @@ int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s if (!IsMonsterJob(g_session.m_aid)) { return 0; } - counter = new UICntWnd(*this->m_context, *this->m_controls, *this->m_edits); + counter = new UICntWnd(*this->m_context, *this->m_edits); counter->SetSize(0xB6, 0x2E); counter->Move((g_renderer->viewport.width - 640) / 2 + 200, ScaleByScreenHeight(200)); g_windowMgr.AddRendered(counter); @@ -10260,7 +10245,7 @@ int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s if (a != 2 || !IsAdminAccount(g_session.m_aid)) { return 0; } - counter = new UICntWnd(*this->m_context, *this->m_controls, *this->m_edits); + counter = new UICntWnd(*this->m_context, *this->m_edits); counter->SetSize(0xB6, 0x2E); counter->Move((g_renderer->viewport.width - 640) / 2 + 200, ScaleByScreenHeight(200)); g_windowMgr.AddRendered(counter); diff --git a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp index 05602082..53bbfd01 100644 --- a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" #include "Client/ReplayPacketRecorder.h" #include "Contents/UserData/NormalItemSlots.h" @@ -66,7 +67,7 @@ int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::string text = "("; text += reinterpret_cast(a); text += ")"; - text += owner.text.buttons.services.MessageText(93); + text += LookupMessage(93); this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 138, 0, 0); text = "C-Code : "; diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp index 4693911f..d64bb1c3 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" #include "Client/ReplayPacketRecorder.h" #include "UI/Buttons/UIButton.h" @@ -36,7 +37,7 @@ int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a std::string text = "("; text += reinterpret_cast(b); text += ")"; - text += this->m_acceptance->text.buttons.services.MessageText(94); + text += LookupMessage(94); this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); diff --git a/Source/UI/Buttons/UIBasicButton.cpp b/Source/UI/Buttons/UIBasicButton.cpp index 6ab205d3..ae8d5605 100644 --- a/Source/UI/Buttons/UIBasicButton.cpp +++ b/Source/UI/Buttons/UIBasicButton.cpp @@ -7,7 +7,7 @@ // OFFSET: 0x0084EA20 // FUNCTION: fn_10649 -UIBasicButton::UIBasicButton(UIWindowContext& windows, UIButtonContext& controls) : UIButton(windows, controls), invalidateParent(0) { +UIBasicButton::UIBasicButton(UIWindowContext& windows) : UIButton(windows), invalidateParent(0) { this->geometry.height = 20; } @@ -49,7 +49,7 @@ void UIBasicButton::Paint() { static constexpr const char* skins[] = {"out", "over", "press", "disable"}; const std::string prefix = std::string("유저인터페이스\\basic_interface\\btn_") + skins[state]; const auto drawBitmap = [&](const char* suffix, int x) { - auto* bitmap = static_cast(this->m_buttonContext->resources.Load((prefix + suffix).c_str())); + auto* bitmap = static_cast(ResourceMgr::Instance().Load((prefix + suffix).c_str())); this->DrawBitmap(x, 0, bitmap ? &bitmap->image : nullptr, false); }; drawBitmap("_left.bmp", 0); diff --git a/Source/UI/Buttons/UIBasicButton.h b/Source/UI/Buttons/UIBasicButton.h index 53438030..4d3df606 100644 --- a/Source/UI/Buttons/UIBasicButton.h +++ b/Source/UI/Buttons/UIBasicButton.h @@ -6,7 +6,7 @@ class UIBasicButton : public UIButton { public: UIBasicButton(); - UIBasicButton(UIWindowContext& windows, UIButtonContext& controls); + UIBasicButton(UIWindowContext& windows); ~UIBasicButton() override; void Paint() override; bool Configure(int width, const char* value); diff --git a/Source/UI/Buttons/UIBitmapButton.cpp b/Source/UI/Buttons/UIBitmapButton.cpp index d0b56665..7b5bf470 100644 --- a/Source/UI/Buttons/UIBitmapButton.cpp +++ b/Source/UI/Buttons/UIBitmapButton.cpp @@ -4,8 +4,8 @@ // OFFSET: 0x0084EAB0 // FUNCTION: fn_10650 -UIBitmapButton::UIBitmapButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) - : UIButton(windowContext, buttonContext), m_bitmapWidth(0), m_bitmapHeight(0), m_invalidateParent(0) { +UIBitmapButton::UIBitmapButton(UIWindowContext& windowContext) + : UIButton(windowContext), m_bitmapWidth(0), m_bitmapHeight(0), m_invalidateParent(0) { } // OFFSET: 0x008511B0 diff --git a/Source/UI/Buttons/UIBitmapButton.h b/Source/UI/Buttons/UIBitmapButton.h index fdc3b3dc..1320f917 100644 --- a/Source/UI/Buttons/UIBitmapButton.h +++ b/Source/UI/Buttons/UIBitmapButton.h @@ -9,7 +9,7 @@ class UIBitmapButton : public UIButton { public: UIBitmapButton(); - UIBitmapButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); + UIBitmapButton(UIWindowContext& windowContext); ~UIBitmapButton() override; void Paint() override; bool SetBitmap(const char* name, int state, unsigned char exactSize); diff --git a/Source/UI/Buttons/UIBmpRadioBtn.cpp b/Source/UI/Buttons/UIBmpRadioBtn.cpp index 9745134b..0643a1a9 100644 --- a/Source/UI/Buttons/UIBmpRadioBtn.cpp +++ b/Source/UI/Buttons/UIBmpRadioBtn.cpp @@ -3,7 +3,7 @@ // OFFSET: 0x0086C590 // FUNCTION: fn_11028 -UIBmpRadioBtn::UIBmpRadioBtn(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), m_controls(&controls) { +UIBmpRadioBtn::UIBmpRadioBtn(UIWindowContext& windows) : UIWindow(windows, 0) { this->geometry.unknown_0030 = 0; this->geometry.id = 215; this->m_hovered = false; @@ -12,8 +12,8 @@ UIBmpRadioBtn::UIBmpRadioBtn(UIWindowContext& windows, UIButtonContext& controls // OFFSET: 0x0086C720 // FUNCTION: fn_11029 -UICaptchaImage::UICaptchaImage(UIWindowContext& windows, BitmapResourceContext& bitmaps, UIButtonContext& controls) - : UIWindow(windows, 0), m_bitmap(bitmaps), m_controls(&controls) { +UICaptchaImage::UICaptchaImage(UIWindowContext& windows, BitmapResourceContext& bitmaps) + : UIWindow(windows, 0), m_bitmap(bitmaps) { } // OFFSET: 0x00870390 diff --git a/Source/UI/Buttons/UIBmpRadioBtn.h b/Source/UI/Buttons/UIBmpRadioBtn.h index bba1f3c5..cc8f411a 100644 --- a/Source/UI/Buttons/UIBmpRadioBtn.h +++ b/Source/UI/Buttons/UIBmpRadioBtn.h @@ -8,7 +8,6 @@ #include #include -struct UIButtonContext; struct UIBmpRadioBtnText { /* 0000 */ int id; @@ -25,7 +24,7 @@ class UIBmpRadioBtn : public UIWindow { friend class UIRodexInboxWnd; public: - UIBmpRadioBtn(UIWindowContext& windows, UIButtonContext& controls); + UIBmpRadioBtn(UIWindowContext& windows); void Paint() override; void Slot25(int x, int y) override; void Slot28(int x, int y) override; @@ -39,7 +38,7 @@ protected: /* 00DC */ bool m_hovered; /* 00DD */ unsigned char unknown_00DD[3]; /* 00E0 */ std::string m_tooltip; - UIButtonContext* m_controls; + void* unknown_controls; /* 00FC */ int m_value; /* 0100 */ std::vector m_texts; /* 010C */ std::string m_label; @@ -49,7 +48,7 @@ protected: class UIBmpRadioBtn2 : public UIBmpRadioBtn { public: // INLINED - UIBmpRadioBtn2(UIWindowContext& windows, UIButtonContext& controls) : UIBmpRadioBtn(windows, controls) { + UIBmpRadioBtn2(UIWindowContext& windows) : UIBmpRadioBtn(windows) { } void Invalidate() override; void Slot47() override; @@ -59,7 +58,7 @@ public: class UICaptchaImage : public UIWindow { public: UICaptchaImage(); - UICaptchaImage(UIWindowContext& windows, BitmapResourceContext& bitmaps, UIButtonContext& controls); + UICaptchaImage(UIWindowContext& windows, BitmapResourceContext& bitmaps); ~UICaptchaImage() override; void Paint() override; void Slot28(int x, int y) override; @@ -68,7 +67,7 @@ public: protected: /* 01A0 */ std::string m_tooltip; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Buttons/UIBmpTextButton.cpp b/Source/UI/Buttons/UIBmpTextButton.cpp index 93885958..c3380946 100644 --- a/Source/UI/Buttons/UIBmpTextButton.cpp +++ b/Source/UI/Buttons/UIBmpTextButton.cpp @@ -8,7 +8,7 @@ // OFFSET: 0x0084ED30 // FUNCTION: fn_10652 -UIBmpTextButton::UIBmpTextButton(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls) { +UIBmpTextButton::UIBmpTextButton(UIWindowContext& windows) : UIBitmapButton(windows) { } // OFFSET: 0x00852360 @@ -39,7 +39,7 @@ void UIBmpTextButton::Paint() { if (disabled || state <= 2) { const char* path = this->m_names[disabled ? 3 : state].c_str(); - auto* resource = static_cast(this->m_buttonContext->resources.Load(path)); + auto* resource = static_cast(ResourceMgr::Instance().Load(path)); this->DrawBitmap(0, 0, resource ? &resource->image : nullptr, false); if (!this->text.empty()) { diff --git a/Source/UI/Buttons/UIBmpTextButton.h b/Source/UI/Buttons/UIBmpTextButton.h index 386de606..252b4882 100644 --- a/Source/UI/Buttons/UIBmpTextButton.h +++ b/Source/UI/Buttons/UIBmpTextButton.h @@ -18,7 +18,7 @@ struct BitmapButtonTextStyle { class UIBmpTextButton : public UIBitmapButton { public: UIBmpTextButton(); - UIBmpTextButton(UIWindowContext& windows, UIButtonContext& controls); + UIBmpTextButton(UIWindowContext& windows); ~UIBmpTextButton() override; void Paint() override; void SetText(std::string value); diff --git a/Source/UI/Buttons/UIBmpTextButton2.cpp b/Source/UI/Buttons/UIBmpTextButton2.cpp index 265fbbe6..6ea2aa71 100644 --- a/Source/UI/Buttons/UIBmpTextButton2.cpp +++ b/Source/UI/Buttons/UIBmpTextButton2.cpp @@ -5,7 +5,7 @@ // OFFSET: 0x0084ECB0 // FUNCTION: fn_10651 -UIBmpTextButton2::UIBmpTextButton2(UIWindowContext& windows, UIButtonContext& buttons) : UIBitmapButton(windows, buttons) { +UIBmpTextButton2::UIBmpTextButton2(UIWindowContext& windows) : UIBitmapButton(windows) { } // OFFSET: 0x0085BCF0 diff --git a/Source/UI/Buttons/UIBmpTextButton2.h b/Source/UI/Buttons/UIBmpTextButton2.h index 7efcbab1..44250656 100644 --- a/Source/UI/Buttons/UIBmpTextButton2.h +++ b/Source/UI/Buttons/UIBmpTextButton2.h @@ -20,7 +20,7 @@ struct BmpTextButtonLabel { class UIBmpTextButton2 : public UIBitmapButton { public: - UIBmpTextButton2(UIWindowContext& windows, UIButtonContext& buttons); + UIBmpTextButton2(UIWindowContext& windows); void Paint() override; void DrawLabels(); diff --git a/Source/UI/Buttons/UIButton.cpp b/Source/UI/Buttons/UIButton.cpp index d4ef8743..1a832bd6 100644 --- a/Source/UI/Buttons/UIButton.cpp +++ b/Source/UI/Buttons/UIButton.cpp @@ -1,3 +1,10 @@ +#include "Client/Replay.h" +#include "UI/Window/WindowPolicy.h" +#include "UI/Window/WindowDialogs.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" +#include "Contents/MessageTable.h" +#include "Client/Mode/CMode.h" #include "Client/Mode/ModeCursor.h" #include "Client/Mode/ModeEvents.h" #include "Resource/Bitmap/BitmapResource.h" @@ -5,14 +12,13 @@ #include "Script/LuaScript.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Buttons/UIButton.h" -#include "UI/Window/WindowPolicy.h" #include // OFFSET: 0x0084EDD0 // FUNCTION: fn_10653 -UIButton::UIButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) - : UIWindow(windowContext, 0), m_disabled(0), m_argument(0), m_buttonContext(&buttonContext) { +UIButton::UIButton(UIWindowContext& windowContext) + : UIWindow(windowContext, 0), m_disabled(0), m_argument(0) { this->geometry.unknown_0030 = 0; } @@ -37,13 +43,13 @@ void UIButton::Paint() { switch (this->geometry.unknown_0030) { case 0: - bitmap = static_cast(this->m_buttonContext->resources.Load(backgrounds[0])); + bitmap = static_cast(ResourceMgr::Instance().Load(backgrounds[0])); break; case 1: - bitmap = static_cast(this->m_buttonContext->resources.Load(backgrounds[1])); + bitmap = static_cast(ResourceMgr::Instance().Load(backgrounds[1])); break; case 2: - bitmap = static_cast(this->m_buttonContext->resources.Load(backgrounds[2])); + bitmap = static_cast(ResourceMgr::Instance().Load(backgrounds[2])); break; } @@ -87,7 +93,7 @@ void UIButton::Slot27(int x, int y) { } UIWindow* parent = this->parent; - if (parent == this->m_buttonContext->hoverParent) { + if (parent == g_windowMgr.unknown_01DC) { parent->SendMsg(this, 6, 271, state != 0, 0, 0); } } @@ -101,7 +107,7 @@ void UIButton::Slot28(int x, int y) { this->m_tooltip.clear(); } else { const char* text = nullptr; - if (this->m_buttonContext->behavior.Call("GetBeHaviorOfWindow", "d>s", parent->geometry.id, &text)) { + if (g_luaScript->Call("GetBeHaviorOfWindow", "d>s", parent->geometry.id, &text)) { this->m_tooltip.assign(text, std::strlen(text)); } } @@ -115,7 +121,7 @@ void UIButton::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - this->m_buttonContext->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } if (this->m_disabled == 0) { @@ -162,16 +168,16 @@ void UIButton::Slot31(int x, int y) { this->geometry.unknown_0030 = 1; UIWindow* parent = this->parent; if (parent) { - if (WindowPolicy(this->m_buttonContext->policy, this->m_buttonContext->restricted, 3, parent->geometry.id) != 0) { + if (WindowPolicy(g_windowMgr.policy[0].actions, g_replayAnimationScaling != 0, 3, parent->geometry.id) != 0) { int id = this->geometry.id; - if (id == 185 && this->m_context->mode && *this->m_buttonContext->activeModeType == 2) { - const char* text = this->m_buttonContext->services.MessageText(17); - if (this->m_buttonContext->services.Confirm(text, 2, 1, 0, "Message", 280, 120) == 187) { + if (id == 185 && this->m_context->mode && static_cast(g_charViewMode)->cursorType == 2) { + const char* text = LookupMessage(17); + if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { this->m_context->mode->SendModeMessage(2, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { - this->m_buttonContext->services.Submit(parent); + RecordEditTextsNoArg(parent); id = this->geometry.id; parent = this->parent; } diff --git a/Source/UI/Buttons/UIButton.h b/Source/UI/Buttons/UIButton.h index c8e96533..1e2219be 100644 --- a/Source/UI/Buttons/UIButton.h +++ b/Source/UI/Buttons/UIButton.h @@ -21,18 +21,6 @@ protected: ~ButtonServices() = default; }; -struct UIButtonContext { - ResourceMgr& resources; - LuaScript& behavior; - FontCache& fonts; - const TextLocale& locale; - ButtonServices& services; - const int* policy; - const bool& restricted; - const int* activeModeType; - UIWindow* const& hoverParent; -}; - class UIButton : public UIWindow { friend class UIAdvenPartyBoardWnd; friend class UIAchListWnd; @@ -43,7 +31,7 @@ class UIButton : public UIWindow { public: UIButton(); - UIButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); + UIButton(UIWindowContext& windowContext); ~UIButton() override; void Paint() override; void Slot25(int x, int y) override; @@ -77,7 +65,7 @@ protected: /* 00AC */ unsigned char m_disabled; /* 00AD */ unsigned char m_drawLabel; /* 00B0 */ int m_argument; - UIButtonContext* m_buttonContext; + void* unknown_buttonContext; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Buttons/UICashEmotionSprBtn.h b/Source/UI/Buttons/UICashEmotionSprBtn.h index d484e668..e7ad520e 100644 --- a/Source/UI/Buttons/UICashEmotionSprBtn.h +++ b/Source/UI/Buttons/UICashEmotionSprBtn.h @@ -7,7 +7,7 @@ class UICashEmotionSprBtn : public UISpriteButton2 { friend class UICashEmotionPiece; public: - UICashEmotionSprBtn(UIWindowContext& windowContext, UIButtonContext& buttonContext, UIWindow* target); + UICashEmotionSprBtn(UIWindowContext& windowContext, UIWindow* target); void Paint() override; void Slot28(int x, int y) override; diff --git a/Source/UI/Buttons/UICheckBox.cpp b/Source/UI/Buttons/UICheckBox.cpp index 88626060..fb1da416 100644 --- a/Source/UI/Buttons/UICheckBox.cpp +++ b/Source/UI/Buttons/UICheckBox.cpp @@ -1,3 +1,6 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" +#include "Client/Replay.h" #include "Client/Mode/ModeCursor.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" @@ -8,8 +11,8 @@ // OFFSET: 0x0084F010 // FUNCTION: fn_10656 -UICheckBox::UICheckBox(UIWindowContext& windowContext, UIButtonContext& controls) - : UIWindow(windowContext, 0), m_disabled(0), m_hidden(0), m_color(0), m_fontHeight(12), m_message(-1), m_notify(0), m_controls(&controls) { +UICheckBox::UICheckBox(UIWindowContext& windowContext) + : UIWindow(windowContext, 0), m_disabled(0), m_hidden(0), m_color(0), m_fontHeight(12), m_message(-1), m_notify(0) { this->geometry.unknown_0030 = 0; this->geometry.id = 213; } @@ -40,7 +43,7 @@ void UICheckBox::Paint() { int width = 0; if (this->geometry.unknown_0030 == 0 || this->geometry.unknown_0030 == 1) { const std::string& name = this->geometry.unknown_0030 == 0 ? this->m_unchecked : this->m_checked; - CBitmapRes* bitmap = static_cast(this->m_controls->resources.Load(name.c_str())); + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(name.c_str())); this->DrawBitmap(0, (this->geometry.height - bitmap->image.height) / 2, &bitmap->image, false); width = bitmap->image.width; } @@ -87,7 +90,7 @@ void UICheckBox::SetHidden(bool hidden) { // OFFSET: 0x0085EB90 // FUNCTION: fn_10841 void UICheckBox::Slot25(int, int) { - if (this->m_disabled != 0 || this->m_controls->restricted) { + if (this->m_disabled != 0 || g_replayAnimationScaling) { return; } @@ -118,7 +121,7 @@ void UICheckBox::Slot28(int x, int y) { } const std::string& tooltip = this->geometry.unknown_0030 != 0 || this->m_uncheckedTooltip.empty() ? this->m_tooltip : this->m_uncheckedTooltip; - this->m_controls->services.Tooltip(tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(tooltip.c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x0085F9C0 @@ -134,16 +137,16 @@ void UICheckBox::ResetCursor(int, int) { void UICheckBox::SetImages(const char* checked, const char* unchecked, const char* text) { this->m_checked = checked; this->m_unchecked = unchecked; - this->m_controls->resources.Load(this->m_unchecked.c_str()); + ResourceMgr::Instance().Load(this->m_unchecked.c_str()); this->m_text = text ? text : ""; if (!this->m_text.empty()) { const int width = this->TextWidth(this->m_text.c_str(), 0, 0, 12, 0, 0); CBitmapRes* bitmap = nullptr; if (this->geometry.unknown_0030 == 0) { - bitmap = static_cast(this->m_controls->resources.Load(this->m_unchecked.c_str())); + bitmap = static_cast(ResourceMgr::Instance().Load(this->m_unchecked.c_str())); } else if (this->geometry.unknown_0030 == 1) { - bitmap = static_cast(this->m_controls->resources.Load(this->m_checked.c_str())); + bitmap = static_cast(ResourceMgr::Instance().Load(this->m_checked.c_str())); } const int desired = ((bitmap->image.width + width) + 3); diff --git a/Source/UI/Buttons/UICheckBox.h b/Source/UI/Buttons/UICheckBox.h index 3a0efb5f..8c1c40aa 100644 --- a/Source/UI/Buttons/UICheckBox.h +++ b/Source/UI/Buttons/UICheckBox.h @@ -15,7 +15,7 @@ class UICheckBox : public UIWindow { public: UICheckBox(); - UICheckBox(UIWindowContext& windowContext, UIButtonContext& controls); + UICheckBox(UIWindowContext& windowContext); ~UICheckBox() override; void Paint() override; void Slot25(int x, int y) override; @@ -40,7 +40,7 @@ protected: /* 00EC */ int m_message; /* 00F0 */ int m_notify; /* 00F4 */ std::string m_uncheckedTooltip; - UIButtonContext* m_controls; + void* unknown_controls; private: void Notify(); diff --git a/Source/UI/Buttons/UIColorButton.cpp b/Source/UI/Buttons/UIColorButton.cpp index c71075c7..f3d13c25 100644 --- a/Source/UI/Buttons/UIColorButton.cpp +++ b/Source/UI/Buttons/UIColorButton.cpp @@ -5,7 +5,6 @@ // OFFSET: 0x0085C9A0 // FUNCTION: fn_10804 void UIColorButton::Paint() { - UIButtonContext& controls = *this->m_buttonContext; const int textWidth = this->TextWidth(this->label.c_str(), 0, 0, 12, 0, 0); unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 22, 2, red, green, blue); diff --git a/Source/UI/Buttons/UIItemMoveInfo.cpp b/Source/UI/Buttons/UIItemMoveInfo.cpp index 31c7c255..7b54e06c 100644 --- a/Source/UI/Buttons/UIItemMoveInfo.cpp +++ b/Source/UI/Buttons/UIItemMoveInfo.cpp @@ -2,6 +2,6 @@ // OFFSET: 0x0086D4D0 // FUNCTION: fn_11046 -UIItemMoveInfo::UIItemMoveInfo(UIWindowContext& windows, UIButtonContext& buttons, WindowManagerWindows& windowList, WindowVisibility& visibility) - : UITextButton(windows, buttons), m_windows(&windowList), m_visibility(&visibility), m_item() { +UIItemMoveInfo::UIItemMoveInfo(UIWindowContext& windows, WindowManagerWindows& windowList, WindowVisibility& visibility) + : UITextButton(windows), m_windows(&windowList), m_visibility(&visibility), m_item() { } diff --git a/Source/UI/Buttons/UIItemMoveInfo.h b/Source/UI/Buttons/UIItemMoveInfo.h index 593e92b8..bca6d2b5 100644 --- a/Source/UI/Buttons/UIItemMoveInfo.h +++ b/Source/UI/Buttons/UIItemMoveInfo.h @@ -11,7 +11,7 @@ class UIItemMoveInfo : public UITextButton { friend class UIItemCollectionWnd; public: - UIItemMoveInfo(UIWindowContext& windows, UIButtonContext& buttons, WindowManagerWindows& windowList, WindowVisibility& visibility); + UIItemMoveInfo(UIWindowContext& windows, WindowManagerWindows& windowList, WindowVisibility& visibility); void Paint() override; void Slot28(int x, int y) override; void Slot48() override; diff --git a/Source/UI/Buttons/UIItemTagButton.h b/Source/UI/Buttons/UIItemTagButton.h index c18be3d8..28c636f4 100644 --- a/Source/UI/Buttons/UIItemTagButton.h +++ b/Source/UI/Buttons/UIItemTagButton.h @@ -11,7 +11,7 @@ class UIItemTagButton : public UITextButton { public: UIItemTagButton(); - UIItemTagButton(UIWindowContext& windows, UIButtonContext& buttons); + UIItemTagButton(UIWindowContext& windows); void Paint() override; void Slot25(int x, int y) override; diff --git a/Source/UI/Buttons/UIJobSlotButton.cpp b/Source/UI/Buttons/UIJobSlotButton.cpp index 59daf4a6..44d45454 100644 --- a/Source/UI/Buttons/UIJobSlotButton.cpp +++ b/Source/UI/Buttons/UIJobSlotButton.cpp @@ -2,7 +2,7 @@ // OFFSET: 0x007BAD70 // FUNCTION: fn_09276 -UIJobSlotButton::UIJobSlotButton(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls), selected(0) { +UIJobSlotButton::UIJobSlotButton(UIWindowContext& windows) : UIBitmapButton(windows), selected(0) { } // OFFSET: 0x007BB6B0 diff --git a/Source/UI/Buttons/UIJobSlotButton.h b/Source/UI/Buttons/UIJobSlotButton.h index fa3f93be..f3c57ab9 100644 --- a/Source/UI/Buttons/UIJobSlotButton.h +++ b/Source/UI/Buttons/UIJobSlotButton.h @@ -5,7 +5,7 @@ class UIJobSlotButton : public UIBitmapButton { public: - UIJobSlotButton(UIWindowContext& windows, UIButtonContext& controls); + UIJobSlotButton(UIWindowContext& windows); ~UIJobSlotButton() override; void Slot31(int x, int y) override; void SetSelected(unsigned char value); diff --git a/Source/UI/Buttons/UINaviLinkButton.cpp b/Source/UI/Buttons/UINaviLinkButton.cpp index 388a8590..ab5ce81a 100644 --- a/Source/UI/Buttons/UINaviLinkButton.cpp +++ b/Source/UI/Buttons/UINaviLinkButton.cpp @@ -3,8 +3,8 @@ // OFFSET: 0x0086DF60 // FUNCTION: fn_11062 -UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows, UIButtonContext& buttons, NavigationDestination& navigation) - : UITextButton(windows, buttons), m_navigation(&navigation) { +UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation) + : UITextButton(windows), m_navigation(&navigation) { } // OFFSET: 0x00873A90 diff --git a/Source/UI/Buttons/UINaviLinkButton.h b/Source/UI/Buttons/UINaviLinkButton.h index fbd3105a..f4700afd 100644 --- a/Source/UI/Buttons/UINaviLinkButton.h +++ b/Source/UI/Buttons/UINaviLinkButton.h @@ -13,7 +13,7 @@ protected: class UINaviLinkButton : public UITextButton { public: - UINaviLinkButton(UIWindowContext& windows, UIButtonContext& buttons, NavigationDestination& navigation); + UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation); ~UINaviLinkButton() override; void Slot25(int x, int y) override; std::string Link(); diff --git a/Source/UI/Buttons/UINoneVisibleButton.cpp b/Source/UI/Buttons/UINoneVisibleButton.cpp index d0e7e08b..469c0f14 100644 --- a/Source/UI/Buttons/UINoneVisibleButton.cpp +++ b/Source/UI/Buttons/UINoneVisibleButton.cpp @@ -8,5 +8,5 @@ void UINoneVisibleButton::Paint() { // OFFSET: 0x0084FF80 // FUNCTION: fn_10669 -UINoneVisibleButton::UINoneVisibleButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIButton(windowContext, buttonContext) { +UINoneVisibleButton::UINoneVisibleButton(UIWindowContext& windowContext) : UIButton(windowContext) { } diff --git a/Source/UI/Buttons/UINoneVisibleButton.h b/Source/UI/Buttons/UINoneVisibleButton.h index 53b52e12..1639ca0f 100644 --- a/Source/UI/Buttons/UINoneVisibleButton.h +++ b/Source/UI/Buttons/UINoneVisibleButton.h @@ -5,7 +5,7 @@ class UINoneVisibleButton : public UIButton { public: - UINoneVisibleButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); + UINoneVisibleButton(UIWindowContext& windowContext); void Paint() override; }; diff --git a/Source/UI/Buttons/UIRadioBtn.cpp b/Source/UI/Buttons/UIRadioBtn.cpp index 607ed524..d91dc1dc 100644 --- a/Source/UI/Buttons/UIRadioBtn.cpp +++ b/Source/UI/Buttons/UIRadioBtn.cpp @@ -13,7 +13,6 @@ UIRadioBtn::~UIRadioBtn() = default; // OFFSET: 0x0085D470 // FUNCTION: fn_10814 void UIRadioBtn::Paint() { - UIButtonContext& controls = *this->m_controls; if (!this->checkedBitmap.empty() && !this->uncheckedBitmap.empty()) { this->ClearSurface(0xFFFF00FF); @@ -88,7 +87,7 @@ void UIRadioBtn::SetText(const char* value) { // OFFSET: 0x0084FFE0 // FUNCTION: fn_10670 -UIRadioBtn::UIRadioBtn(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), m_controls(&controls) { +UIRadioBtn::UIRadioBtn(UIWindowContext& windows) : UIWindow(windows, 0) { this->geometry.unknown_0030 = 0; this->enabled = 1; this->geometry.id = 215; diff --git a/Source/UI/Buttons/UIRadioBtn.h b/Source/UI/Buttons/UIRadioBtn.h index 743f9956..5b359afc 100644 --- a/Source/UI/Buttons/UIRadioBtn.h +++ b/Source/UI/Buttons/UIRadioBtn.h @@ -6,11 +6,10 @@ #include #include -struct UIButtonContext; class UIRadioBtn : public UIWindow { public: - UIRadioBtn(UIWindowContext& windows, UIButtonContext& controls); + UIRadioBtn(UIWindowContext& windows); ~UIRadioBtn() override; void Paint() override; void Slot25(int x, int y) override; @@ -29,7 +28,7 @@ public: /* 00EC */ std::uint32_t textColor; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Buttons/UIReplayButton.h b/Source/UI/Buttons/UIReplayButton.h index e0c187e0..cc46d886 100644 --- a/Source/UI/Buttons/UIReplayButton.h +++ b/Source/UI/Buttons/UIReplayButton.h @@ -5,7 +5,7 @@ class UIReplayButton : public UIBitmapButton { public: - UIReplayButton(UIWindowContext& windows, UIButtonContext& controls); + UIReplayButton(UIWindowContext& windows); void Slot31(int x, int y) override; }; diff --git a/Source/UI/Buttons/UISlotBmpButton.cpp b/Source/UI/Buttons/UISlotBmpButton.cpp index 9f95b08a..54f124fa 100644 --- a/Source/UI/Buttons/UISlotBmpButton.cpp +++ b/Source/UI/Buttons/UISlotBmpButton.cpp @@ -2,7 +2,7 @@ // OFFSET: 0x0086E8D0 // FUNCTION: fn_11078 -UISlotBmpButton::UISlotBmpButton(UIWindowContext& windows, UIButtonContext& buttons, int index, bool) - : UIBitmapButton(windows, buttons), m_index(index), unknown_0124(false), unknown_0128(0), m_slot(-1), icon(nullptr), unknown_0134(0), unknown_0136(5), +UISlotBmpButton::UISlotBmpButton(UIWindowContext& windows, int index, bool) + : UIBitmapButton(windows), m_index(index), unknown_0124(false), unknown_0128(0), m_slot(-1), icon(nullptr), unknown_0134(0), unknown_0136(5), m_inRange(false) { } diff --git a/Source/UI/Buttons/UISlotBmpButton.h b/Source/UI/Buttons/UISlotBmpButton.h index 01f0f105..88aeeb6a 100644 --- a/Source/UI/Buttons/UISlotBmpButton.h +++ b/Source/UI/Buttons/UISlotBmpButton.h @@ -9,7 +9,7 @@ class UISlotBmpButton : public UIBitmapButton { friend class UINewSelectCharWnd; public: - UISlotBmpButton(UIWindowContext& windows, UIButtonContext& buttons, int index, bool); + UISlotBmpButton(UIWindowContext& windows, int index, bool); void Slot15(int width, int height) override; void Slot19() override; void Paint() override; diff --git a/Source/UI/Buttons/UISpriteButton.h b/Source/UI/Buttons/UISpriteButton.h index 2a503561..8393242f 100644 --- a/Source/UI/Buttons/UISpriteButton.h +++ b/Source/UI/Buttons/UISpriteButton.h @@ -8,7 +8,7 @@ class UISpriteButton : public UIButton { public: UISpriteButton(); - UISpriteButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); + UISpriteButton(UIWindowContext& windowContext); ~UISpriteButton() override; void Paint() override; void Slot25(int x, int y) override; @@ -47,7 +47,7 @@ public: class UISpriteButton2 : public UISpriteButton { public: - UISpriteButton2(UIWindowContext& windowContext, UIButtonContext& buttonContext, UIWindow* target); + UISpriteButton2(UIWindowContext& windowContext, UIWindow* target); ~UISpriteButton2() override; void Slot25(int x, int y) override; void Slot26(int x, int y) override; diff --git a/Source/UI/Buttons/UITVBitmapButton.h b/Source/UI/Buttons/UITVBitmapButton.h index b73b3c77..3189c6c5 100644 --- a/Source/UI/Buttons/UITVBitmapButton.h +++ b/Source/UI/Buttons/UITVBitmapButton.h @@ -9,7 +9,7 @@ class UITVBitmapButton : public UIBitmapButton { public: UITVBitmapButton(); // INLINED - UITVBitmapButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIBitmapButton(windowContext, buttonContext), m_value(0) { + UITVBitmapButton(UIWindowContext& windowContext) : UIBitmapButton(windowContext), m_value(0) { } void Slot31(int x, int y) override; void Slot32(int x, int y) override; diff --git a/Source/UI/Buttons/UITVTextButton.h b/Source/UI/Buttons/UITVTextButton.h index d5edfb7f..aef5d25e 100644 --- a/Source/UI/Buttons/UITVTextButton.h +++ b/Source/UI/Buttons/UITVTextButton.h @@ -12,8 +12,8 @@ class UITVTextButton : public UIButton { public: UITVTextButton(); // INLINED - UITVTextButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) - : UIButton(windowContext, buttonContext), unknown_00B4(0), unknown_00B5(0), unknown_00B6(0), m_border(0), m_fill(0), m_fillColor(0xFFFFFF), + UITVTextButton(UIWindowContext& windowContext) + : UIButton(windowContext), unknown_00B4(0), unknown_00B5(0), unknown_00B6(0), m_border(0), m_fill(0), m_fillColor(0xFFFFFF), m_textColor(0), m_outlineColor(0xFFFFFF), m_highlightColor(0), m_outlined(0), m_fontHeight(12), m_fontFamily(0), m_value(0) { } void Paint() override; diff --git a/Source/UI/Buttons/UITagButton.cpp b/Source/UI/Buttons/UITagButton.cpp index 032a969e..d91a9c5d 100644 --- a/Source/UI/Buttons/UITagButton.cpp +++ b/Source/UI/Buttons/UITagButton.cpp @@ -9,7 +9,7 @@ std::string g_emptyString; // OFFSET: 0x009B52E0 // FUNCTION: fn_13842 -UITagButton::UITagButton(UIWindowContext& windows, UIButtonContext& buttons) : UITextButton(windows, buttons), item(), m_strings() { +UITagButton::UITagButton(UIWindowContext& windows) : UITextButton(windows), item(), m_strings() { } // OFFSET: 0x009B54A0 diff --git a/Source/UI/Buttons/UITagButton.h b/Source/UI/Buttons/UITagButton.h index ca2c3187..3df7a7b5 100644 --- a/Source/UI/Buttons/UITagButton.h +++ b/Source/UI/Buttons/UITagButton.h @@ -12,7 +12,7 @@ class UITagButton : public UITextButton { friend class UITagListBox; public: - UITagButton(UIWindowContext& windows, UIButtonContext& buttons); + UITagButton(UIWindowContext& windows); /* 00F8 */ ITEM_INFO item; /* 01F0 */ std::vector m_strings; diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index a21943a0..49c89d7c 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1,3 +1,8 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Replay.h" +#include "UI/Window/WindowPolicy.h" +#include "Render/Text/FontCache.h" +#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "UI/UIBarGraph.h" #include "UI/Buttons/UIBmpRadioBtn.h" @@ -32,7 +37,6 @@ #include "UI/Lists/UIListBoxID.h" #include "UI/Lists/UIScrollBarVariants.h" #include "UI/Lists/TableBox.h" -#include "UI/Window/WindowPolicy.h" #include "UI/Text/UITransBalloonText.h" #include "UI/Shortcuts/ShortcutVisibility.h" #include "UI/Text/UIString.h" @@ -57,7 +61,7 @@ int g_screenHeight; // OFFSET: 0x0086EEB0 // FUNCTION: fn_11085 -UITextButton::UITextButton(UIWindowContext& windows, UIButtonContext& buttons) : UIButton(windows, buttons), m_outlineColor(0xFFFFFF), m_value(0) { +UITextButton::UITextButton(UIWindowContext& windows) : UIButton(windows), m_outlineColor(0xFFFFFF), m_value(0) { } // OFFSET: 0x00874690 @@ -257,7 +261,7 @@ void UIBmpRadioBtn::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } } @@ -385,7 +389,7 @@ void UICaptchaImage::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } } @@ -407,7 +411,7 @@ void UIBarGraph4::Slot28(int, int) { std::memset(text, 0, sizeof(text)); const int permille = static_cast(static_cast(*this->m_current) / static_cast(*this->m_maximum) * 1000.0f); std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); - this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); } // OFFSET: 0x008918D0 @@ -428,7 +432,7 @@ void UIINT64BarGraph::Slot28(int, int) { std::memset(text, 0, sizeof(text)); const int permille = static_cast(static_cast(this->m_current) / static_cast(this->m_maximum) * 1000.0); std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); - this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); } // OFFSET: 0x00891A40 @@ -475,7 +479,7 @@ void UITabControl::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(this->tooltips[index].c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->tooltips[index].c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x00822660 @@ -521,7 +525,7 @@ void UIBasicItemCtrl::Slot28(int, int) { } if (!text.empty()) { - this->m_controls->services.Tooltip(text.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, -1, false, true); } } @@ -552,7 +556,7 @@ void UIBasicSkillCtrl::Slot28(int, int) { } if (!text.empty()) { - this->m_controls->services.Tooltip(text.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, -1, false, true); } } @@ -628,7 +632,7 @@ void UIMemberListBox::Slot28(int, int y) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(this->lines[line].c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->lines[line].c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x00891E40 @@ -650,7 +654,7 @@ void UIStaticItem::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); } // OFFSET: 0x00892040 @@ -1866,7 +1870,6 @@ void UIItemMoveInfo::Paint() { if (this->m_outline != 0) { DrawOutlinedText(*this, 1, 1, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0); } else { - auto& controls = *this->m_buttonContext; this->DrawTextAt(1, 1, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); } @@ -1887,7 +1890,6 @@ void UIItemTagButton::Paint() { if (this->m_outline != 0) { DrawOutlinedText(*this, 1, this->textY, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0); } else { - auto& controls = *this->m_buttonContext; this->DrawTextAt(1, this->textY, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); } @@ -2294,8 +2296,8 @@ void UIBasicSkillCtrl::Paint() { this->DrawBitmap(0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve(text)))->image, true); if (skill.level != 0) { std::sprintf(text, "%d", skill.level); - FontCache& fonts = this->m_controls->fonts; - const TextLocale& locale = this->m_controls->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; const int x = this->geometry.width - this->TextWidth(text, 0, 0, 11, 0, 0); this->DrawTextAt(x, 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); this->DrawTextAt(x - 2, 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); @@ -2331,8 +2333,8 @@ void UIBmpRadioBtn::Paint() { return; } - FontCache& fonts = this->m_controls->fonts; - const TextLocale& locale = this->m_controls->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; if (this->m_disabled == true) { for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { if (it->id == 3) { @@ -2549,7 +2551,7 @@ void UISlotBmpButton::Slot15(int, int) { const std::string path = "유저인터페이스\\renewalparty\\"; char name[256]; std::sprintf(name, "%sicon_jobs_%d.bmp", path.c_str(), 0); - this->icon = new UIStaticBitmap(*this->m_context, *this->m_buttonContext); + this->icon = new UIStaticBitmap(*this->m_context); this->icon->SetBitmap(name); this->icon->SetSize(this->icon->geometry.width, this->icon->geometry.height); this->icon->Move(118, 14); @@ -2627,7 +2629,7 @@ void UITreeView::AddNodeButtons(UITreeNode* node, int id) { std::string path = "유저인터페이스\\basic_interface\\"; for (int index = 0; index < 2; ++index) { - UITVBitmapButton* button = new UITVBitmapButton(*this->m_context, *this->m_controls); + UITVBitmapButton* button = new UITVBitmapButton(*this->m_context); button->SetBitmap((path + names[index]).c_str(), 0, 0); button->SetBitmap((path + names[index]).c_str(), 1, 0); button->SetBitmap((path + names[index]).c_str(), 2, 0); @@ -2652,7 +2654,7 @@ void UITreeView::AddNodeButtons(UITreeNode* node, int id) { // OFFSET: 0x008814C0 // FUNCTION: fn_11297 void UITreeView::AddNodeLabel(UITreeNode* node, int id) { - UITVTextButton* button = new UITVTextButton(*this->m_context, *this->m_controls); + UITVTextButton* button = new UITVTextButton(*this->m_context); button->SetSize(1, 1); button->SetLabel(node->name); button->ResizeToText(); @@ -3409,7 +3411,7 @@ void UIRPImageWnd::Paint() { // OFFSET: 0x0086EBB0 // FUNCTION: fn_11081 UITVBitmapButton::UITVBitmapButton() - : UIBitmapButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)), m_value(0) { + : UIBitmapButton(*reinterpret_cast(nullptr)), m_value(0) { } // OFFSET: 0x0086EC10 diff --git a/Source/UI/Buttons/UITextButton.h b/Source/UI/Buttons/UITextButton.h index 301543b1..c5cee0a4 100644 --- a/Source/UI/Buttons/UITextButton.h +++ b/Source/UI/Buttons/UITextButton.h @@ -31,7 +31,7 @@ public: friend void OpenTextButtonNavigation(UITextButton* button); UITextButton(); - UITextButton(UIWindowContext& windows, UIButtonContext& buttons); + UITextButton(UIWindowContext& windows); ~UITextButton() override; void Paint() override; void Slot27(int x, int y) override; diff --git a/Source/UI/Buttons/UITextureButton.cpp b/Source/UI/Buttons/UITextureButton.cpp index ecae9f30..ebfc51d6 100644 --- a/Source/UI/Buttons/UITextureButton.cpp +++ b/Source/UI/Buttons/UITextureButton.cpp @@ -1,7 +1,12 @@ +#include "Client/Replay.h" +#include "UI/Window/WindowPolicy.h" +#include "UI/Window/WindowDialogs.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "Contents/MessageTable.h" +#include "Client/Mode/CMode.h" #include "Client/Mode/ModeEvents.h" #include "UI/Buttons/UITextureButton.h" #include "UI/Window/UIWindowMgr.h" -#include "UI/Window/WindowPolicy.h" // OFFSET: 0x0085E070 // FUNCTION: fn_10822 @@ -30,16 +35,16 @@ void UITextureButton::Slot31(int x, int y) { this->geometry.unknown_0030 = 1; UIWindow* parent = this->parent; if (parent) { - if (WindowPolicy(this->m_buttonContext->policy, this->m_buttonContext->restricted, 3, parent->geometry.id) > 0) { + if (WindowPolicy(g_windowMgr.policy[0].actions, g_replayAnimationScaling != 0, 3, parent->geometry.id) > 0) { int id = this->geometry.id; - if (id == 185 && this->m_context->mode && *this->m_buttonContext->activeModeType == 2) { - const char* text = this->m_buttonContext->services.MessageText(17); - if (this->m_buttonContext->services.Confirm(text, 2, 1, 0, "Message", 280, 120) == 187) { + if (id == 185 && this->m_context->mode && static_cast(g_charViewMode)->cursorType == 2) { + const char* text = LookupMessage(17); + if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { this->m_context->mode->SendModeMessage(2, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { - this->m_buttonContext->services.Submit(parent); + RecordEditTextsNoArg(parent); id = this->geometry.id; } diff --git a/Source/UI/CashEmotion/UICashEmotionPiece.h b/Source/UI/CashEmotion/UICashEmotionPiece.h index c3eb34fd..b75df833 100644 --- a/Source/UI/CashEmotion/UICashEmotionPiece.h +++ b/Source/UI/CashEmotion/UICashEmotionPiece.h @@ -5,11 +5,9 @@ #include -struct UIButtonContext; class UICashEmotionSprBtn; struct UICashEmotionPieceContext { - UIButtonContext& buttons; }; class UICashEmotionPiece : public UIWindow { diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index 1e1a4981..bc3fc799 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -116,19 +116,19 @@ UICashShopWnd::UICashShopWnd(UIWindowContext& windows) // OFFSET: 0x007CD750 // FUNCTION: fn_09512 -UICashShopWnd_Banner::UICashShopWnd_Banner(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), m_index(0), m_lastTick(timeGetTime()), m_controls(&controls) { +UICashShopWnd_Banner::UICashShopWnd_Banner(UIWindowContext& windows) + : UIWindow(windows, 0), m_index(0), m_lastTick(timeGetTime()) { } // OFFSET: 0x007CD800 // FUNCTION: fn_09513 -UICashShopWnd_Cart::UICashShopWnd_Cart(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), m_scrollBar(nullptr), m_visibleCount(6), m_scrollIndex(0), m_controls(&controls) { +UICashShopWnd_Cart::UICashShopWnd_Cart(UIWindowContext& windows) + : UIWindow(windows, 0), m_scrollBar(nullptr), m_visibleCount(6), m_scrollIndex(0) { } // OFFSET: 0x007CD8C0 // FUNCTION: fn_09514 -UICashShopWnd_CartItem::UICashShopWnd_CartItem(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), m_controls(&controls) { +UICashShopWnd_CartItem::UICashShopWnd_CartItem(UIWindowContext& windows) : UIWindow(windows, 0) { } // OFFSET: 0x007CDE30 @@ -237,15 +237,15 @@ bool UICashShopWnd::Slot03() { // OFFSET: 0x007CE740 // FUNCTION: fn_09535 void UICashShopWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); - this->m_banner = new UICashShopWnd_Banner(*this->m_context, *this->m_controls); + this->m_banner = new UICashShopWnd_Banner(*this->m_context); this->m_banner->SetSize(0x213, 0x33); this->m_banner->Move(3, 0x12); this->AddChild(this->m_banner); if (g_session.unknown_5912) { - this->m_secondBanner = new UICashShopWnd_Banner(*this->m_context, *this->m_controls); + this->m_secondBanner = new UICashShopWnd_Banner(*this->m_context); this->m_secondBanner->SetSize(0xB0, 0x38); this->m_secondBanner->Move(0x21A, 0x1A9); this->AddChild(this->m_secondBanner); @@ -256,7 +256,7 @@ void UICashShopWnd::Slot15(int, int) { const int tooltips[11] = {0xCDA, 0xCDB, 0xCDC, 0xCDD, 0xCDE, 0xCDF, 0xCE0, 0xCE1, 0xCE2, 0xE48, 0xECE}; UIBmpRadioBtn* button = nullptr; if (tab != 8 && tab != 10) { - button = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + button = new UIBmpRadioBtn(*this->m_context); button->SetBitmap(FormatOwnedString("유저인터페이스\\cashshop\\img_shop_tap%d_off.bmp", tab).c_str(), 0); button->SetBitmap(FormatOwnedString("유저인터페이스\\cashshop\\img_shop_tap%d_off.bmp", tab).c_str(), 1); button->SetBitmap(FormatOwnedString("유저인터페이스\\cashshop\\img_shop_tap%d_on.bmp", tab).c_str(), 2); @@ -271,7 +271,7 @@ void UICashShopWnd::Slot15(int, int) { this->m_tabButtons.insert(std::make_pair(tab, button)); } - UIBitmapButton* previous = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* previous = new UIBitmapButton(*this->m_context); previous->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL_off.bmp", 0, 0); previous->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL_off.bmp", 1, 0); previous->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL_on.bmp", 2, 0); @@ -280,7 +280,7 @@ void UICashShopWnd::Slot15(int, int) { previous->SetId(0x13C); this->AddChild(previous); - UIBitmapButton* next = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* next = new UIBitmapButton(*this->m_context); next->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR_off.bmp", 0, 0); next->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR_off.bmp", 1, 0); next->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR_on.bmp", 2, 0); @@ -289,7 +289,7 @@ void UICashShopWnd::Slot15(int, int) { next->SetId(0x13D); this->AddChild(next); - UIBitmapButton* first = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* first = new UIBitmapButton(*this->m_context); first->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL2_off.bmp", 0, 0); first->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL2_off.bmp", 1, 0); first->SetBitmap("유저인터페이스\\cashshop\\bt_arrowL2_on.bmp", 2, 0); @@ -298,7 +298,7 @@ void UICashShopWnd::Slot15(int, int) { first->SetId(0x183); this->AddChild(first); - UIBitmapButton* last = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* last = new UIBitmapButton(*this->m_context); last->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR2_off.bmp", 0, 0); last->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR2_off.bmp", 1, 0); last->SetBitmap("유저인터페이스\\cashshop\\bt_arrowR2_on.bmp", 2, 0); @@ -307,7 +307,7 @@ void UICashShopWnd::Slot15(int, int) { last->SetId(0x184); this->AddChild(last); - UIBmpTextButton* charge = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* charge = new UIBmpTextButton(*this->m_context); charge->SetBitmap("유저인터페이스\\cashshop\\btn_charge_normal.bmp", 0, 0); charge->SetBitmap("유저인터페이스\\cashshop\\btn_charge_press.bmp", 1, 0); charge->SetBitmap("유저인터페이스\\cashshop\\btn_charge_press.bmp", 2, 0); @@ -317,7 +317,7 @@ void UICashShopWnd::Slot15(int, int) { charge->SetId(0x11C); this->AddChild(charge); - this->unknown_00E4 = new UIBmpTextButton(*this->m_context, *this->m_controls); + this->unknown_00E4 = new UIBmpTextButton(*this->m_context); this->unknown_00E4->SetBitmap("유저인터페이스\\cashshop\\btn_refresh_normal.bmp", 0, 0); this->unknown_00E4->SetBitmap("유저인터페이스\\cashshop\\btn_refresh_press.bmp", 1, 0); this->unknown_00E4->SetBitmap("유저인터페이스\\cashshop\\btn_refresh_press.bmp", 2, 0); @@ -335,7 +335,7 @@ void UICashShopWnd::Slot15(int, int) { this->unknown_00E0->TextColor(0xB1B1B1, 0xFFFFFFFFu); this->AddChild(this->unknown_00E0); - UIBitmapButton* search = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* search = new UIBitmapButton(*this->m_context); search->SetBitmap("유저인터페이스\\cashshop\\btn_searchbar_normal.bmp", 0, 0); search->SetBitmap("유저인터페이스\\cashshop\\btn_searchbar_over.bmp", 1, 0); search->SetBitmap("유저인터페이스\\cashshop\\btn_searchbar_press.bmp", 2, 0); @@ -344,7 +344,7 @@ void UICashShopWnd::Slot15(int, int) { search->SetId(0x141); this->AddChild(search); - UIBmpTextButton* buy = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* buy = new UIBmpTextButton(*this->m_context); buy->SetBitmap("유저인터페이스\\cashshop\\btn_buy_normal.bmp", 0, 0); buy->SetBitmap("유저인터페이스\\cashshop\\btn_buy_press.bmp", 1, 0); buy->SetBitmap("유저인터페이스\\cashshop\\btn_buy_press.bmp", 2, 0); @@ -364,7 +364,7 @@ void UICashShopWnd::Slot15(int, int) { this->AddChild(this->unknown_00F4); for (int index = 0; index < this->m_itemsPerPage; ++index) { - UICashShopWnd_Item* item = new UICashShopWnd_Item(*this->m_context, *this->m_controls); + UICashShopWnd_Item* item = new UICashShopWnd_Item(*this->m_context); item->SetSize(0xAC, 0x7E); item->Move(index % this->m_columns * 0xAF + 8, index / this->m_columns * 0x7F + 0x6B); item->Show(0); @@ -372,7 +372,7 @@ void UICashShopWnd::Slot15(int, int) { this->m_itemWindows.push_back(item); } - this->m_cart = new UICashShopWnd_Cart(*this->m_context, *this->m_controls); + this->m_cart = new UICashShopWnd_Cart(*this->m_context); this->m_cart->SetSize(0xB9, 0x15E); this->m_cart->Move(0x219, 0x48); this->AddChild(this->m_cart); @@ -399,7 +399,7 @@ void UICashShopWnd_Cart::Slot15(int, int) { int y = 5; for (int index = 0; index < this->m_visibleCount; ++index) { - UICashShopWnd_CartItem* item = new UICashShopWnd_CartItem(*this->m_context, *this->m_controls); + UICashShopWnd_CartItem* item = new UICashShopWnd_CartItem(*this->m_context); item->SetSize(0xAC, 0x36); item->Move(3, y); item->Show(0); @@ -412,7 +412,7 @@ void UICashShopWnd_Cart::Slot15(int, int) { // OFFSET: 0x007CFB20 // FUNCTION: fn_09537 void UICashShopWnd_CartItem::Slot15(int, int) { - UIBitmapButton* close = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* close = new UIBitmapButton(*this->m_context); close->SetBitmap("유저인터페이스\\cashshop\\btn_close.bmp", 0, 0); close->SetBitmap("유저인터페이스\\cashshop\\btn_close.bmp", 1, 0); close->SetBitmap("유저인터페이스\\cashshop\\btn_close.bmp", 2, 0); @@ -421,7 +421,7 @@ void UICashShopWnd_CartItem::Slot15(int, int) { close->SetId(0xD3); this->AddChild(close); - UIBitmapButton* plus = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* plus = new UIBitmapButton(*this->m_context); plus->SetBitmap("유저인터페이스\\cashshop\\btn_plus_normal.bmp", 0, 0); plus->SetBitmap("유저인터페이스\\cashshop\\btn_plus_over.bmp", 1, 0); plus->SetBitmap("유저인터페이스\\cashshop\\btn_plus_press.bmp", 2, 0); @@ -430,7 +430,7 @@ void UICashShopWnd_CartItem::Slot15(int, int) { plus->SetId(0x117); this->AddChild(plus); - UIBitmapButton* minus = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* minus = new UIBitmapButton(*this->m_context); minus->SetBitmap("유저인터페이스\\cashshop\\btn_minus_normal.bmp", 0, 0); minus->SetBitmap("유저인터페이스\\cashshop\\btn_minus_over.bmp", 1, 0); minus->SetBitmap("유저인터페이스\\cashshop\\btn_minus_press.bmp", 2, 0); @@ -443,7 +443,7 @@ void UICashShopWnd_CartItem::Slot15(int, int) { // OFFSET: 0x007CFD20 // FUNCTION: fn_09538 void UICashShopWnd_Item::Slot15(int, int) { - this->m_addButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + this->m_addButton = new UIBmpTextButton(*this->m_context); this->m_addButton->SetBitmap("유저인터페이스\\cashshop\\btn_add_normal.bmp", 0, 0); this->m_addButton->SetBitmap("유저인터페이스\\cashshop\\btn_add_press.bmp", 1, 0); this->m_addButton->SetBitmap("유저인터페이스\\cashshop\\btn_add_press.bmp", 2, 0); @@ -454,7 +454,7 @@ void UICashShopWnd_Item::Slot15(int, int) { this->m_addButton->SetId(0xE0); this->AddChild(this->m_addButton); - this->m_soldOut = new UIStaticBitmap(*this->m_context, *this->m_controls); + this->m_soldOut = new UIStaticBitmap(*this->m_context); this->m_soldOut->SetBitmap("유저인터페이스\\cashshop\\img_shop_soldout.bmp"); this->m_soldOut->SetSize(this->m_soldOut->geometry.width, this->m_soldOut->geometry.height); this->m_soldOut->Move(9, 9); @@ -782,7 +782,7 @@ void UICashShopWnd_CartItem::Slot35(int delta) { void UICashShopWnd_Banner::CreateButtons() { int index = 0; for (std::vector::iterator entry = this->m_entries.begin(); entry != this->m_entries.end(); ++entry) { - UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context); button->SetBitmap("유저인터페이스\\cashshop\\btn_ad_off.bmp", 0); button->SetBitmap("유저인터페이스\\cashshop\\btn_ad_off.bmp", 1); button->SetBitmap("유저인터페이스\\cashshop\\btn_ad_on.bmp", 2); diff --git a/Source/UI/CashShop/UICashShopWnd.h b/Source/UI/CashShop/UICashShopWnd.h index 7803617e..1ec01e1a 100644 --- a/Source/UI/CashShop/UICashShopWnd.h +++ b/Source/UI/CashShop/UICashShopWnd.h @@ -16,7 +16,6 @@ class UIEditCtrl; class UIEditCtrl_Custom; class UIScrollBar_Custom; class UIStaticBitmap; -struct UIButtonContext; struct UIEditContext; class UICashShopWnd_Banner : public UIWindow { @@ -26,7 +25,7 @@ public: /* 0018 */ std::string url; }; - UICashShopWnd_Banner(UIWindowContext& windows, UIButtonContext& controls); + UICashShopWnd_Banner(UIWindowContext& windows); void Slot19() override; void Paint() override; void ResetCursor(int x, int y) override; @@ -37,14 +36,14 @@ public: /* 0088 */ std::vector m_buttons; /* 0094 */ unsigned int m_index; /* 0098 */ std::uint32_t m_lastTick; - UIButtonContext* m_controls; + void* unknown_controls; void CreateButtons(); }; class UICashShopWnd_CartItem : public UIWindow { public: - UICashShopWnd_CartItem(UIWindowContext& windows, UIButtonContext& controls); + UICashShopWnd_CartItem(UIWindowContext& windows); void Slot10(int x, int y, std::intptr_t value) override; void Slot15(int width, int height) override; @@ -57,12 +56,12 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; /* 0080 */ ITEM_INFO m_item; - UIButtonContext* m_controls; + void* unknown_controls; }; class UICashShopWnd_Cart : public UIWindow { public: - UICashShopWnd_Cart(UIWindowContext& windows, UIButtonContext& controls); + UICashShopWnd_Cart(UIWindowContext& windows); void Slot10(int x, int y, std::intptr_t value) override; void Slot15(int width, int height) override; @@ -75,14 +74,14 @@ public: /* 0094 */ UIScrollBar_Custom* m_scrollBar; /* 0098 */ int m_visibleCount; /* 009C */ unsigned int m_scrollIndex; - UIButtonContext* m_controls; + void* unknown_controls; }; class UICashShopWnd_Item : public UIWindow { public: // INLINED - UICashShopWnd_Item(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), m_addButton(nullptr), m_largeLayout(false), m_soldOut(nullptr), m_controls(&controls) { + UICashShopWnd_Item(UIWindowContext& windows) + : UIWindow(windows, 0), m_addButton(nullptr), m_largeLayout(false), m_soldOut(nullptr) { } void Slot10(int x, int y, std::intptr_t value) override; @@ -97,7 +96,7 @@ public: /* 0080 */ ITEM_INFO m_item; /* 0178 */ bool m_largeLayout; /* 017C */ UIStaticBitmap* m_soldOut; - UIButtonContext* m_controls; + void* unknown_controls; }; class UICashShopWnd : public UIFrameWnd { @@ -129,7 +128,7 @@ public: /* 00F4 */ UIEditCtrl_Custom* unknown_00F4; /* 00F8 */ std::vector m_itemWindows; /* 0104 */ UICashShopWnd_Cart* m_cart; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Chat/UIChatRoomTitle.cpp b/Source/UI/Chat/UIChatRoomTitle.cpp index bd5fcf42..2fc1b768 100644 --- a/Source/UI/Chat/UIChatRoomTitle.cpp +++ b/Source/UI/Chat/UIChatRoomTitle.cpp @@ -20,7 +20,7 @@ UIChatRoomTitle::UIChatRoomTitle(UIWindowContext& context) : UIWindow(context, 0 // OFFSET: 0x0085AB80 // FUNCTION: fn_10785 void UIChatRoomTitle::Slot15(int, int) { - this->label = new UIStaticText(*this->m_context, *this->m_controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize(this->geometry.width - 34, 15); this->label->Move(31, 8); this->label->SetTextFitted(""); diff --git a/Source/UI/Chat/UIChatRoomTitle.h b/Source/UI/Chat/UIChatRoomTitle.h index ee61b2f0..13d9d38e 100644 --- a/Source/UI/Chat/UIChatRoomTitle.h +++ b/Source/UI/Chat/UIChatRoomTitle.h @@ -6,7 +6,6 @@ #include class UIStaticText; -struct UIButtonContext; class ForbiddenWords; struct ChatRoomTitleInfo { @@ -40,7 +39,7 @@ public: protected: /* 00BC */ int roomId; /* 00C0 */ short unknown_00C0; - UIButtonContext* m_controls; + void* unknown_controls; ForbiddenWords* m_forbiddenWords; }; diff --git a/Source/UI/Chat/UISubChatHisWnd.cpp b/Source/UI/Chat/UISubChatHisWnd.cpp index f63c6e5f..87b294f2 100644 --- a/Source/UI/Chat/UISubChatHisWnd.cpp +++ b/Source/UI/Chat/UISubChatHisWnd.cpp @@ -127,7 +127,7 @@ void UISubChatHisWnd::Slot11() { void UISubChatHisWnd::Slot15(int width, int height) { { const std::string name = "유저인터페이스\\basic_interface\\stickon"; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); this->m_stickButton = button; button->SetBitmap((name + "_a.bmp").c_str(), 0, 0); button->SetBitmap((name + "_b.bmp").c_str(), 1, 0); @@ -141,7 +141,7 @@ void UISubChatHisWnd::Slot15(int width, int height) { { std::string name = "유저인터페이스\\basic_interface\\battle_option"; name += "2"; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); this->m_optionButton = button; button->SetBitmap((name + "_a.bmp").c_str(), 0, 0); button->SetBitmap((name + "_b.bmp").c_str(), 1, 0); @@ -154,7 +154,7 @@ void UISubChatHisWnd::Slot15(int width, int height) { { const std::string name = "유저인터페이스\\basic_interface\\wnd_mini"; - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); this->m_miniButton = button; button->SetBitmap((name + "_a.bmp").c_str(), 0, 0); button->SetBitmap((name + "_b.bmp").c_str(), 1, 0); @@ -208,8 +208,8 @@ void UISubChatHisWnd::Slot15(int width, int height) { // OFFSET: 0x00912340 // FUNCTION: fn_12529 -UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edit, UIListBoxContext& list) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&edit), m_listContext(&list) { +UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list) + : UIFrameWnd(windows, 0), m_editContext(&edit), m_listContext(&list) { 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 f6047eb6..106ebcf0 100644 --- a/Source/UI/Chat/UISubChatHisWnd.h +++ b/Source/UI/Chat/UISubChatHisWnd.h @@ -11,7 +11,6 @@ class UIEditCtrl; class UIResizer; class UIWindowMgr; struct SubChatHisWndInfo; -struct UIButtonContext; struct UIEditContext; struct UIListBoxContext; @@ -30,7 +29,7 @@ class UISubChatHisWnd : public UIFrameWnd { public: UISubChatHisWnd(); - UISubChatHisWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edit, UIListBoxContext& list); + UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list); void Resize(int width, int height) override; void Move(int x, int y) override; void Slot11() override; @@ -62,7 +61,7 @@ private: /* 0111 */ unsigned char unknown_0111[3]; /* 0114 */ std::string m_name; /* 012C */ UIEditCtrl* m_edit; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; UIListBoxContext* m_listContext; }; diff --git a/Source/UI/Chat/UIWhisperWnd.h b/Source/UI/Chat/UIWhisperWnd.h index 5f2a0d7b..391d7a11 100644 --- a/Source/UI/Chat/UIWhisperWnd.h +++ b/Source/UI/Chat/UIWhisperWnd.h @@ -6,7 +6,6 @@ #include #include -struct UIButtonContext; struct WindowPlacement; class UIBitmapButton; class UIChatEditCtrl; @@ -45,7 +44,7 @@ public: void SaveChatLog(); protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Clan/UIClanWnd.cpp b/Source/UI/Clan/UIClanWnd.cpp index 14bd604d..12f5b3dc 100644 --- a/Source/UI/Clan/UIClanWnd.cpp +++ b/Source/UI/Clan/UIClanWnd.cpp @@ -30,12 +30,12 @@ int UIClanInfoManageWnd::Slot53() { void UIClanInfoManageWnd::Slot15(int width, int height) { if (!this->m_title) { const char* title = LookupMessage(2355); - this->m_title = new UIStaticText(*this->m_context, *this->m_controls); + this->m_title = new UIStaticText(*this->m_context); this->m_title->SetSize(62, 15); this->m_title->SetTextFitted(title); this->m_title->Move(3, 22); this->AddChild(this->m_title); - this->AddCloseButton(*this->m_controls, "Ctrl+G", 0); + this->AddCloseButton("Ctrl+G", 0); } this->unknown_00BC = -1; @@ -51,7 +51,6 @@ void UIClanInfoManageWnd::Slot15(int width, int height) { // FUNCTION: fn_10630 void UIClanInfoManageWnd::Paint() { UIClanWnd::Paint(); - auto& controls = *this->m_controls; char text[1024]; std::memset(text, 0, sizeof(text)); std::sprintf(text, "%s : %s", LookupMessage(2357), g_clanInfo->m_clanName.c_str()); @@ -152,7 +151,6 @@ void UIClanWnd::Paint() { this->FillRegion(0, 17, this->geometry.width, 24, RGB(red, green, blue)); SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(1, 18, 64, 23, RGB(red, green, blue)); - auto& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); SkinPaletteChannels(ResourceMgr::Instance(), 14, 6, red, green, blue); this->FillRegion(0, 41, this->geometry.width, this->geometry.height - 41, RGB(red, green, blue)); diff --git a/Source/UI/Clan/UIClanWnd.h b/Source/UI/Clan/UIClanWnd.h index 03bfa8aa..f514f5a5 100644 --- a/Source/UI/Clan/UIClanWnd.h +++ b/Source/UI/Clan/UIClanWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct ClanWndInfo; class CBitmapRes; class UIStaticText; @@ -19,7 +18,7 @@ public: virtual int Slot53() = 0; protected: - UIButtonContext* m_controls; + void* unknown_controls; /* 00B4 */ ClanWndInfo* m_saved; /* 00B8 */ UIStaticText* m_title; }; diff --git a/Source/UI/Dialogs/UIChooseWarpWnd.h b/Source/UI/Dialogs/UIChooseWarpWnd.h index fb18c5be..c9cc39af 100644 --- a/Source/UI/Dialogs/UIChooseWarpWnd.h +++ b/Source/UI/Dialogs/UIChooseWarpWnd.h @@ -6,13 +6,12 @@ #include #include -struct UIButtonContext; struct UIListBoxContext; class UIListBox; class UIChooseWarpWnd : public UIFrameWnd { public: - UIChooseWarpWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext); + UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext); void Slot15(int width, int height) override; void Paint() override; std::vector Slot44() override; @@ -23,7 +22,7 @@ public: /* 00BC */ std::vector m_choices; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; }; diff --git a/Source/UI/Dialogs/UIChooseWnd.cpp b/Source/UI/Dialogs/UIChooseWnd.cpp index f476aa5e..f6cd8b88 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, UIButtonContext& controls, UIListBoxContext& lists) - : UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr), m_controls(&controls), m_listContext(&lists) { +UIChooseWnd::UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists) + : UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr), m_listContext(&lists) { this->unknown_00B4 = -1; this->m_placement = nullptr; } diff --git a/Source/UI/Dialogs/UIChooseWnd.h b/Source/UI/Dialogs/UIChooseWnd.h index e81c92ce..8be8d8b2 100644 --- a/Source/UI/Dialogs/UIChooseWnd.h +++ b/Source/UI/Dialogs/UIChooseWnd.h @@ -6,14 +6,13 @@ #include struct ChooseWndInfo; -struct UIButtonContext; struct UIListBoxContext; class UIBitmapButton; class UIListBox; class UIChooseWnd : public UIFrameWnd { public: - UIChooseWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists); + UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists); ~UIChooseWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -30,7 +29,7 @@ public: /* 00D4 */ UIBitmapButton* m_cancelButton; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; }; diff --git a/Source/UI/Dialogs/UIEditctrlWnd.cpp b/Source/UI/Dialogs/UIEditctrlWnd.cpp index 2c3541f2..45b48aa0 100644 --- a/Source/UI/Dialogs/UIEditctrlWnd.cpp +++ b/Source/UI/Dialogs/UIEditctrlWnd.cpp @@ -42,14 +42,14 @@ const char* g_miniMapMemoLineFormat = "%d\t%d\t%s\r\n"; // OFFSET: 0x0099B0C0 // FUNCTION: fn_13549 -UIEditctrlWnd::UIEditctrlWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edit) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&edit) { +UIEditctrlWnd::UIEditctrlWnd(UIWindowContext& windows, UIEditContext& edit) + : UIFrameWnd(windows, 0), m_editContext(&edit) { } // OFFSET: 0x0099B120 // FUNCTION: fn_13550 -UIMiniMapWnd::UIMiniMapWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIMiniMapWnd::UIMiniMapWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { this->dragging = 0; this->unknown_0114 = 0; this->unknown_011C = nullptr; @@ -74,7 +74,7 @@ void UIMiniMapWnd::AddTownMarks() { mark.y = static_cast(this->originY - (static_cast(info.y) * this->scale + 6.0f)); this->warpMarks.push_back(mark); } else { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap(info.image.c_str(), 0, 0); button->SetBitmap(info.image.c_str(), 1, 0); button->SetBitmap(info.image.c_str(), 2, 0); @@ -152,8 +152,8 @@ int UIMiniMapWnd::LoadMemos() { // OFFSET: 0x0099C090 // FUNCTION: fn_13556 void UIEditctrlWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, LookupMessage(2741), 0); - this->AddNumberedButton(*this->m_controls, 184, 205, 19, "minimap\\memo_ok", LookupMessage(2754), true); + this->AddCloseButton(LookupMessage(2741), 0); + this->AddNumberedButton(184, 205, 19, "minimap\\memo_ok", LookupMessage(2754), true); this->edit = new UIEditCtrl(*this->m_context, *this->m_editContext); this->edit->SetSize(200, 18); @@ -187,22 +187,21 @@ void UIMiniMapWnd::Slot15(int width, int height) { this->originY = 531.0f - margin; } - UIButtonContext& controls = *this->m_controls; const int y = bottom - 19; - this->unknown_011C = this->AddCheckBox(controls, 361, 100, 12, LookupMessage(2742), 20, y, 1, LookupMessage(2743)); - this->unknown_0120 = this->AddCheckBox(controls, 194, 100, 12, LookupMessage(2744), 120, y, 1, LookupMessage(2745)); - this->unknown_0124 = this->AddCheckBox(controls, 373, 100, 12, LookupMessage(2746), 220, y, 1, LookupMessage(2747)); - this->AddCloseButton(controls, LookupMessage(2741), 0); - this->AddNumberedButton(controls, 356, this->geometry.width - 120, bottom - 23, "minimap\\memo_ready", LookupMessage(2748), true); + this->unknown_011C = this->AddCheckBox(361, 100, 12, LookupMessage(2742), 20, y, 1, LookupMessage(2743)); + this->unknown_0120 = this->AddCheckBox(194, 100, 12, LookupMessage(2744), 120, y, 1, LookupMessage(2745)); + this->unknown_0124 = this->AddCheckBox(373, 100, 12, LookupMessage(2746), 220, y, 1, LookupMessage(2747)); + this->AddCloseButton(LookupMessage(2741), 0); + this->AddNumberedButton(356, this->geometry.width - 120, bottom - 23, "minimap\\memo_ready", LookupMessage(2748), true); this->AddTownMarks(); - this->unknown_012C = this->AddNumberedButton(controls, 205, -100, -100, "minimap\\boss", LookupMessage(2749), true); + this->unknown_012C = this->AddNumberedButton(205, -100, -100, "minimap\\boss", LookupMessage(2749), true); static_cast(g_modeMgr.GetGameMode())->ResendMinimapMarkers(); for (int index = 0; index < 20; ++index) { - this->memoButtons[index] = this->AddNumberedButton(controls, index + 601, -100, -100, "minimap\\memopoint", nullptr, true); + this->memoButtons[index] = this->AddNumberedButton(index + 601, -100, -100, "minimap\\memopoint", nullptr, true); } this->LoadMemos(); - this->m_playerHead = new UIHeadsprButton(*this->m_context, controls); + this->m_playerHead = new UIHeadsprButton(*this->m_context); this->UpdatePlayerHead(); this->m_playerHead->Move(-100, -100); this->m_playerHead->unknown_00BC = 0; @@ -216,7 +215,6 @@ void UIMiniMapWnd::Slot15(int width, int height) { // OFFSET: 0x0099C530 // FUNCTION: fn_13558 void UIEditctrlWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFFFFFFFF); this->DrawTitleBar(true, LookupMessage(2755), 0); } @@ -328,7 +326,6 @@ void UIMiniMapWnd::Paint() { static_cast(g_modeMgr.GetGameMode())->PlayerCell(&column, &row); const std::string title = FormatOwnedString("%s ( %s ) %d %d", g_session.GetPlayerMapDisplayName(), g_session.m_navigationPlayerMap, column, row); - UIButtonContext& controls = *this->m_controls; this->DrawPanelBackground(this->DrawTitleBar(true, title.c_str(), 0), 0, ""); this->DrawButtonBar(1, 0, 1); this->FillRegion(2, 19, 512, 512, 0xFFAAAAAA); @@ -505,7 +502,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 case 485: { const int id = static_cast(this->questButtons.size()) + 2001; const std::string name = FormatOwnedString("유저인터페이스\\minimap\\Quest_%d_%d.bmp", argument1, argument2); - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap(name.c_str(), 0, 0); button->SetBitmap(name.c_str(), 1, 0); button->SetBitmap(name.c_str(), 2, 0); diff --git a/Source/UI/Dialogs/UIEditctrlWnd.h b/Source/UI/Dialogs/UIEditctrlWnd.h index ae212af8..08494a91 100644 --- a/Source/UI/Dialogs/UIEditctrlWnd.h +++ b/Source/UI/Dialogs/UIEditctrlWnd.h @@ -3,13 +3,12 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; class UIEditCtrl; class UIEditctrlWnd : public UIFrameWnd { public: - UIEditctrlWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edit); + UIEditctrlWnd(UIWindowContext& windows, UIEditContext& edit); 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; @@ -17,7 +16,7 @@ public: /* 00B4 */ UIEditCtrl* edit; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Dialogs/UIEmailAddressWnd.cpp b/Source/UI/Dialogs/UIEmailAddressWnd.cpp index c47869c1..d0b58736 100644 --- a/Source/UI/Dialogs/UIEmailAddressWnd.cpp +++ b/Source/UI/Dialogs/UIEmailAddressWnd.cpp @@ -20,6 +20,6 @@ int UIEmailAddressWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // OFFSET: 0x008C7800 // FUNCTION: fn_11939 -UIEmailAddressWnd::UIEmailAddressWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&edits) { +UIEmailAddressWnd::UIEmailAddressWnd(UIWindowContext& windows, UIEditContext& edits) + : UIFrameWnd(windows, 0), m_editContext(&edits) { } diff --git a/Source/UI/Dialogs/UIEmailAddressWnd.h b/Source/UI/Dialogs/UIEmailAddressWnd.h index 5186f69f..8e3a0c35 100644 --- a/Source/UI/Dialogs/UIEmailAddressWnd.h +++ b/Source/UI/Dialogs/UIEmailAddressWnd.h @@ -3,19 +3,18 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; class UIEditCtrl; class UIEmailAddressWnd : public UIFrameWnd { public: - UIEmailAddressWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits); + UIEmailAddressWnd(UIWindowContext& windows, UIEditContext& edits); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ UIEditCtrl* m_edit; diff --git a/Source/UI/Dialogs/UIGraffiStrboxWnd.cpp b/Source/UI/Dialogs/UIGraffiStrboxWnd.cpp index 18fff6f6..cf1a274d 100644 --- a/Source/UI/Dialogs/UIGraffiStrboxWnd.cpp +++ b/Source/UI/Dialogs/UIGraffiStrboxWnd.cpp @@ -24,7 +24,7 @@ void UIGraffiStrboxWnd::Slot15(int, int) { int positions[2][2] = {{189, 96}, {234, 96}}; for (int index = 0; index < 2; ++index) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -39,6 +39,6 @@ void UIGraffiStrboxWnd::Slot15(int, int) { // OFFSET: 0x008C7C50 // FUNCTION: fn_11942 -UIGraffiStrboxWnd::UIGraffiStrboxWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&edits) { +UIGraffiStrboxWnd::UIGraffiStrboxWnd(UIWindowContext& windows, UIEditContext& edits) + : UIFrameWnd(windows, 0), m_editContext(&edits) { } diff --git a/Source/UI/Dialogs/UIGraffiStrboxWnd.h b/Source/UI/Dialogs/UIGraffiStrboxWnd.h index 0cf871e4..252fd70b 100644 --- a/Source/UI/Dialogs/UIGraffiStrboxWnd.h +++ b/Source/UI/Dialogs/UIGraffiStrboxWnd.h @@ -3,19 +3,18 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; class UIEditCtrl; class UIGraffiStrboxWnd : public UIFrameWnd { public: - UIGraffiStrboxWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits); + UIGraffiStrboxWnd(UIWindowContext& windows, UIEditContext& edits); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: int area[4]; diff --git a/Source/UI/Dialogs/UIMemorialDunWnd.h b/Source/UI/Dialogs/UIMemorialDunWnd.h index f586bed9..43c98982 100644 --- a/Source/UI/Dialogs/UIMemorialDunWnd.h +++ b/Source/UI/Dialogs/UIMemorialDunWnd.h @@ -5,14 +5,13 @@ class UIBitmapButton; class UIBasicButton; -struct UIButtonContext; extern int g_memorialDunWndX; extern int g_memorialDunWndY; class UIMemorialDunWnd : public UIFrameWnd { public: - UIMemorialDunWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMemorialDunWnd(UIWindowContext& windows); void Move(int x, int y) override; void Slot15(int width, int height) override; void Paint() override; @@ -23,7 +22,7 @@ public: private: /* 00B4 */ UIBitmapButton* m_actionButton; /* 00B8 */ UIBasicButton* m_partyButton; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UIMenuWnd.h b/Source/UI/Dialogs/UIMenuWnd.h index 6a9f298b..791e8cb4 100644 --- a/Source/UI/Dialogs/UIMenuWnd.h +++ b/Source/UI/Dialogs/UIMenuWnd.h @@ -7,10 +7,9 @@ #include #include -struct UIButtonContext; class UIMenuWnd : public UIFrameWnd { public: - UIMenuWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMenuWnd(UIWindowContext& windows); /* 00B4 */ int m_menuId; /* 00B8 */ int m_selected; /* 00BC */ int m_itemHeight; @@ -31,7 +30,7 @@ public: int ItemAt(int x, int y); protected: - UIButtonContext* m_controls; + void* unknown_controls; }; extern const char* g_menuSeparator; diff --git a/Source/UI/Dialogs/UIMiniMapWnd.h b/Source/UI/Dialogs/UIMiniMapWnd.h index 292eb3de..7eada2f4 100644 --- a/Source/UI/Dialogs/UIMiniMapWnd.h +++ b/Source/UI/Dialogs/UIMiniMapWnd.h @@ -11,7 +11,6 @@ class UIButton; class UICheckBox; class UIHeadsprButton; struct MiniMapWndInfo; -struct UIButtonContext; struct MiniMapMark { /* 0000 */ int x; @@ -20,7 +19,7 @@ struct MiniMapMark { class UIMiniMapWnd : public UIFrameWnd { public: - UIMiniMapWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMiniMapWnd(UIWindowContext& windows); void Slot11() override; void Slot15(int width, int height) override; void Paint() override; @@ -52,7 +51,7 @@ public: /* 0160 */ std::vector warpMarks; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UIMinimapZoomWnd.h b/Source/UI/Dialogs/UIMinimapZoomWnd.h index e397a18f..09be0168 100644 --- a/Source/UI/Dialogs/UIMinimapZoomWnd.h +++ b/Source/UI/Dialogs/UIMinimapZoomWnd.h @@ -6,7 +6,6 @@ #include struct TownInfo; -struct UIButtonContext; class UIMinimapZoomWnd : public UIFrameWnd { public: @@ -24,7 +23,7 @@ public: /* 00C4 */ int unknown_00C4; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UINotifyLevelUpWnd.h b/Source/UI/Dialogs/UINotifyLevelUpWnd.h index af3c7292..02f57c31 100644 --- a/Source/UI/Dialogs/UINotifyLevelUpWnd.h +++ b/Source/UI/Dialogs/UINotifyLevelUpWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UINotifyLevelUpWnd : public UIFrameWnd { public: @@ -13,7 +12,7 @@ public: void Slot15(int width, int height) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UINotifyQuestWnd.h b/Source/UI/Dialogs/UINotifyQuestWnd.h index 30b4f4f7..5e6eb9a7 100644 --- a/Source/UI/Dialogs/UINotifyQuestWnd.h +++ b/Source/UI/Dialogs/UINotifyQuestWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UINotifyQuestWnd : public UIFrameWnd { public: @@ -13,7 +12,7 @@ public: void Slot15(int width, int height) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UINpcEditDialogWnd.h b/Source/UI/Dialogs/UINpcEditDialogWnd.h index 0cdcdb02..7ee8cbde 100644 --- a/Source/UI/Dialogs/UINpcEditDialogWnd.h +++ b/Source/UI/Dialogs/UINpcEditDialogWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIEditCtrl; class UIItemTagOnMegaPhone; struct ITEM_INFO; @@ -12,13 +11,13 @@ struct UIEditContext; class UINpcEditDialogWnd : public UIFrameWnd { public: - UINpcEditDialogWnd(UIWindowContext& windows, UIButtonContext& controls); + UINpcEditDialogWnd(UIWindowContext& windows); void Paint() override; void Slot15(int width, int height) override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ UIEditCtrl* edit; @@ -30,7 +29,7 @@ protected: class UINpcTextEditDialogWnd : public UINpcEditDialogWnd { public: - UINpcTextEditDialogWnd(UIWindowContext& windows, UIButtonContext& controls); + UINpcTextEditDialogWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void InsertItemTag(const ITEM_INFO& item); void InsertSkillTag(int tagId); diff --git a/Source/UI/Dialogs/UIPasswordWnd.cpp b/Source/UI/Dialogs/UIPasswordWnd.cpp index 2c6363c8..faf8992f 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.cpp +++ b/Source/UI/Dialogs/UIPasswordWnd.cpp @@ -54,7 +54,7 @@ void UIPasswordWnd::CreateKeypad(unsigned int seed) { const int commandPositions[5][2] = {{414, 192}, {414, 220}, {414, 248}, {414, 192}, {414, 276}}; for (int i = 0; i < 5; ++i) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->unknown_0150[i] = button; button->SetBitmap((prefix + commandNames[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + commandNames[i][1] + ".bmp").c_str(), 1, 0); @@ -79,7 +79,7 @@ void UIPasswordWnd::CreateKeypad(unsigned int seed) { for (int i = 0; i < 10; ++i) { const int digit = this->m_digits[i]; - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->unknown_0124[i] = button; button->SetBitmap((prefix + keyNames[digit][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + keyNames[digit][1] + ".bmp").c_str(), 1, 0); @@ -90,7 +90,7 @@ void UIPasswordWnd::CreateKeypad(unsigned int seed) { this->AddChild(button); } - UIBitmapButton* reset = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* reset = new UIBitmapButton(*this->m_context); this->unknown_0124[10] = reset; reset->SetBitmap((prefix + keyNames[10][0] + ".bmp").c_str(), 0, 0); reset->SetBitmap((prefix + keyNames[10][1] + ".bmp").c_str(), 1, 0); @@ -114,13 +114,13 @@ void UIPasswordWnd::CreateKeypad(unsigned int seed) { } this->unknown_0150[2]->Enable(0); - this->unknown_0164 = new UIStaticText(*this->m_context, *this->m_controls); + this->unknown_0164 = new UIStaticText(*this->m_context); this->unknown_0164->SetSize(300, 15); this->unknown_0164->SetText(LookupMessage(0x771), 0); this->unknown_0164->Move(200, 30); this->AddChild(this->unknown_0164); - UIStaticText* notice = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* notice = new UIStaticText(*this->m_context); notice->SetSize(320, 15); notice->SetText(LookupMessage(0x772), 0); notice->Move(200, 50); diff --git a/Source/UI/Dialogs/UIPasswordWnd.h b/Source/UI/Dialogs/UIPasswordWnd.h index dc3c79f1..a3477cf4 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.h +++ b/Source/UI/Dialogs/UIPasswordWnd.h @@ -6,7 +6,6 @@ class UIButton; class UIEditCtrl; class UIStaticText; -struct UIButtonContext; struct UIEditContext; class UIItemDropCntWnd : public UIFrameWnd { @@ -50,7 +49,7 @@ public: void Slot15(int width, int height) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Dialogs/UIProhibitListWnd.h b/Source/UI/Dialogs/UIProhibitListWnd.h index bac68ab6..c11f2d82 100644 --- a/Source/UI/Dialogs/UIProhibitListWnd.h +++ b/Source/UI/Dialogs/UIProhibitListWnd.h @@ -3,12 +3,11 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; class UIProhibitListWnd : public UIFrameWnd { public: - UIProhibitListWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits); + UIProhibitListWnd(UIWindowContext& windows, UIEditContext& edits); /* 00B4 */ int m_count; /* 00B8 */ std::uint32_t m_aid; @@ -18,7 +17,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_edits; }; diff --git a/Source/UI/Dialogs/UIQuitWnd.h b/Source/UI/Dialogs/UIQuitWnd.h index 7586af42..d5ea4884 100644 --- a/Source/UI/Dialogs/UIQuitWnd.h +++ b/Source/UI/Dialogs/UIQuitWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIQuitWnd : public UIFrameWnd { public: @@ -13,7 +12,7 @@ public: void Slot15(int width, int height) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UIRestartWnd.h b/Source/UI/Dialogs/UIRestartWnd.h index a67c700c..834e76e1 100644 --- a/Source/UI/Dialogs/UIRestartWnd.h +++ b/Source/UI/Dialogs/UIRestartWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIRestartWnd : public UIFrameWnd { public: @@ -13,7 +12,7 @@ public: void Slot15(int width, int height) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UISelectCartWnd.h b/Source/UI/Dialogs/UISelectCartWnd.h index c87b3ef8..df1a4aeb 100644 --- a/Source/UI/Dialogs/UISelectCartWnd.h +++ b/Source/UI/Dialogs/UISelectCartWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UISelectCartWnd : public UIFrameWnd { public: @@ -15,7 +14,7 @@ public: void AddCart(int index, int type); protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ int unknown_00B4; diff --git a/Source/UI/Dialogs/UITipOfTheDayWnd.h b/Source/UI/Dialogs/UITipOfTheDayWnd.h index c0ac7110..c8a454b1 100644 --- a/Source/UI/Dialogs/UITipOfTheDayWnd.h +++ b/Source/UI/Dialogs/UITipOfTheDayWnd.h @@ -3,14 +3,13 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UITextViewer; extern int g_window315Enabled; class UITipOfTheDayWnd : public UIFrameWnd { public: - UITipOfTheDayWnd(UIWindowContext& windows, UIButtonContext& controls); + UITipOfTheDayWnd(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; @@ -20,7 +19,7 @@ public: /* 00BC */ int m_showTipsAtStartup; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Dialogs/UITipboxWnd.h b/Source/UI/Dialogs/UITipboxWnd.h index 0fcdc9aa..ace60797 100644 --- a/Source/UI/Dialogs/UITipboxWnd.h +++ b/Source/UI/Dialogs/UITipboxWnd.h @@ -12,7 +12,6 @@ class UIEditCtrl; class UIListBoxID; class UITagTextViewer; class UIBitmapButton; -struct UIButtonContext; struct UIEditContext; struct TipBoxAnimation { @@ -70,7 +69,7 @@ public: /* 0100 */ int unknown_0100; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp b/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp index 2b0e0615..bf5a1abb 100644 --- a/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp +++ b/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp @@ -73,7 +73,7 @@ UIWaitDBSaveWnd::UIWaitDBSaveWnd(UIWindowContext& windowContext, UIWaitDBSaveWnd // OFFSET: 0x00AB4CE0 // FUNCTION: fn_17448 void UIWaitDBSaveWnd::Slot15(int width, int height) { - UIButton* button = new UIButton(*this->m_context, this->m_waitContext.buttons); + UIButton* button = new UIButton(*this->m_context); button->SetSize(width, height); button->Move(0, 0); button->SetId(0); diff --git a/Source/UI/Dialogs/UIWaitDBSaveWnd.h b/Source/UI/Dialogs/UIWaitDBSaveWnd.h index d854b458..bc961e3e 100644 --- a/Source/UI/Dialogs/UIWaitDBSaveWnd.h +++ b/Source/UI/Dialogs/UIWaitDBSaveWnd.h @@ -8,11 +8,9 @@ class CActRes; class CSprRes; #include "UI/Window/WindowManagerWindows.h" -struct UIButtonContext; struct UIWaitDBSaveWndContext { WindowManagerWindows& windows; - UIButtonContext& buttons; }; class UIWaitDBSaveWnd : public UIWindow { diff --git a/Source/UI/Edit/ItemTagRetirement.cpp b/Source/UI/Edit/ItemTagRetirement.cpp index c4382a1a..c6b0e177 100644 --- a/Source/UI/Edit/ItemTagRetirement.cpp +++ b/Source/UI/Edit/ItemTagRetirement.cpp @@ -212,7 +212,7 @@ void UIItemTagCtrl::sub_89CFE0(const ITEM_INFO& item, unsigned int color) { tag += item.DisplayName(0); tag += ">"; - UIItemTagButton* button = new UIItemTagButton(*this->m_context, this->m_edit->buttons); + UIItemTagButton* button = new UIItemTagButton(*this->m_context); std::string label = "<"; label += FitText(*this->geometry.surface, item.DisplayName(0), this->tagWidth / 2); diff --git a/Source/UI/Edit/UICandidateWnd.cpp b/Source/UI/Edit/UICandidateWnd.cpp index ce4bd8aa..4fe94f2c 100644 --- a/Source/UI/Edit/UICandidateWnd.cpp +++ b/Source/UI/Edit/UICandidateWnd.cpp @@ -39,7 +39,6 @@ void UIKeyStrokeWnd::Slot15(int, int) {} // OFFSET: 0x0096D720 // FUNCTION: fn_13203 void UICandidateWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); char text[65]; switch (g_language) { @@ -137,7 +136,6 @@ int UICandidateWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (message != 65) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - UIButtonContext& controls = *this->m_controls; const std::string* candidates = reinterpret_cast(argument1); for (int i = 0; i < 9; ++i) { this->m_candidates[i] = candidates[i]; diff --git a/Source/UI/Edit/UICandidateWnd.h b/Source/UI/Edit/UICandidateWnd.h index c5fd1133..696eb6e8 100644 --- a/Source/UI/Edit/UICandidateWnd.h +++ b/Source/UI/Edit/UICandidateWnd.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; class UICandidateWnd : public UIFrameWnd { public: @@ -20,7 +19,7 @@ protected: /* 0190 */ int m_page; /* 0194 */ int m_lastPage; /* 0198 */ int m_count; - UIButtonContext* m_controls; + void* unknown_controls; }; class UICompositionWnd : public UIFrameWnd { @@ -32,7 +31,7 @@ public: protected: /* 00B4 */ std::string m_text; - UIButtonContext* m_controls; + void* unknown_controls; }; class UIKeyStrokeWnd : public UIFrameWnd { diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index be9e09df..ec868b6e 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "Client/Input/InputCharset.h" #include "Client/Input/Language.h" #include "Client/Replay.h" @@ -497,7 +498,7 @@ void UIEditCtrl::Slot28(int x, int y) { top += window->geometry.y; } - this->m_edit->buttons.services.Tooltip(this->tooltip.c_str(), left, top, -1, false, true); + static_cast(g_charViewMode)->Show(this->tooltip.c_str(), left, top, -1, false, true); } } @@ -575,8 +576,8 @@ void UIEditCtrl::PaintTextWithPolicy(bool alternate, const std::string* placehol this->m_edit->input, state, *this->geometry.surface, - this->m_edit->buttons.fonts, - this->m_edit->buttons.locale + g_fontCache, + this->m_context->locale }; UIWindow* parent = this->parent; int left = 0, top = 0; @@ -612,8 +613,8 @@ void UIEditCtrl::PaintTextWithPolicy(bool alternate, const std::string* placehol this->m_edit->charset, viewport, *this->geometry.surface, - this->m_edit->buttons.fonts, - this->m_edit->buttons.locale, + g_fontCache, + this->m_context->locale, this->m_edit->colorChip, parent, this->m_edit->candidateWindow, @@ -645,8 +646,8 @@ void UIEditCtrl::Synchronize() { this->m_edit->input, state, *this->geometry.surface, - this->m_edit->buttons.fonts, - this->m_edit->buttons.locale + g_fontCache, + this->m_context->locale }; viewport.Synchronize(); } @@ -781,7 +782,7 @@ void UIEditCtrl::DrawSelectionAt(int x, int y, int width) { if (left < right && extent > 0) { unsigned red, green, blue; - SkinPaletteChannels(this->m_edit->buttons.resources, 6, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); this->FillRegion(left, y, left + extent > right ? right - left : extent, 14, RGB(red, green, blue)); } } @@ -795,7 +796,7 @@ void UIEditCtrl::DrawSelection(int x, int width) { if (left < right && extent > 0) { unsigned red, green, blue; - SkinPaletteChannels(this->m_edit->buttons.resources, 6, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); this->FillRegion(left, 0, left + extent > right ? right - left : extent, this->geometry.height, RGB(red, green, blue)); } } @@ -1068,7 +1069,7 @@ int UISpriteButton::FrameWidth(int action, int frame) { // OFFSET: 0x0097D220 // FUNCTION: fn_13325 void UINoticeMessageBox_LockSellItem::Slot15(int, int) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\inventory\\bt_close.bmp", 0, 0); button->SetBitmap("유저인터페이스\\inventory\\bt_close.bmp", 1, 0); button->SetBitmap("유저인터페이스\\inventory\\bt_close.bmp", 2, 0); @@ -1113,8 +1114,8 @@ void UIEditCtrl_Custom::Synchronize() { this->firstVisible = 0; } - FontCache& fonts = this->m_edit->buttons.fonts; - const TextLocale& locale = this->m_edit->buttons.locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; const int available = this->geometry.width - 12; if (this->cursor > previousCursor || clamped) { @@ -1588,7 +1589,6 @@ void UIItemDropCntWnd::Paint() { // OFFSET: 0x0097E3F0 // FUNCTION: fn_13328 void UIItemBaseWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -1608,7 +1608,7 @@ void UIItemBaseWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); @@ -1638,9 +1638,9 @@ void UIItemBaseWnd::Paint() { const int x = visible % this->columns * 32 + 44; if (this->showQuantity != 0) { - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); } else { - DrawItemIcon(*this, controls.resources, descriptions, x, top + 21, *it, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, x, top + 21, *it, 0); } if (it->unknown_0088 > 0) { @@ -1672,7 +1672,6 @@ void UIMerchantItemMyShopWnd::Paint() { const int remaining = this->duration - (timeGetTime() - this->startTick); if (remaining > 0) { - UIButtonContext& controls = *this->m_controls; const int days = remaining / 86400000; const int hours = remaining / 3600000 % 24; const int minutes = remaining / 60000 % 60; @@ -1704,14 +1703,14 @@ void UIMerchantItemMyShopWnd::Paint() { // OFFSET: 0x0097A670 // FUNCTION: fn_13319 void UIMerchantItemPurchaseMSGWnd::Slot15(int, int) { - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(100, 15); this->title->SetTextFitted(LookupMessage(2326)); this->title->Move(16, 2); this->title->shadow = 1; this->AddChild(this->title); - this->buyButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buyButton = new UIBitmapButton(*this->m_context); this->buyButton->SetBitmap("유저인터페이스\\btn_buy.bmp", 0, 0); this->buyButton->SetBitmap("유저인터페이스\\btn_buy_a.bmp", 1, 0); this->buyButton->SetBitmap("유저인터페이스\\btn_buy_b.bmp", 2, 0); @@ -1720,7 +1719,7 @@ void UIMerchantItemPurchaseMSGWnd::Slot15(int, int) { this->buyButton->SetId(184); this->AddChild(this->buyButton); - this->cancelButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->cancelButton = new UIBitmapButton(*this->m_context); this->cancelButton->SetBitmap("유저인터페이스\\btn_cancel.bmp", 0, 0); this->cancelButton->SetBitmap("유저인터페이스\\btn_cancel_a.bmp", 1, 0); this->cancelButton->SetBitmap("유저인터페이스\\btn_cancel_b.bmp", 2, 0); @@ -1729,18 +1728,18 @@ void UIMerchantItemPurchaseMSGWnd::Slot15(int, int) { this->cancelButton->SetId(185); this->AddChild(this->cancelButton); - this->firstLine = new UIStaticText(*this->m_context, *this->m_controls); + this->firstLine = new UIStaticText(*this->m_context); this->firstLine->SetSize(200, 15); this->firstLine->SetText(LookupMessage(2327), 0); this->firstLine->Move(10, 20); this->AddChild(this->firstLine); - this->secondLine = new UIStaticText(*this->m_context, *this->m_controls); + this->secondLine = new UIStaticText(*this->m_context); this->secondLine->SetSize(200, 15); this->secondLine->Move(10, 40); this->AddChild(this->secondLine); - this->thirdLine = new UIStaticText(*this->m_context, *this->m_controls); + this->thirdLine = new UIStaticText(*this->m_context); this->thirdLine->SetSize(200, 15); this->thirdLine->SetText(LookupMessage(2329), 0); this->thirdLine->Move(10, 60); @@ -1760,7 +1759,6 @@ void UIMerchantItemPurchaseMSGWnd::Paint() { void UIMerchantItemWnd::Paint() { UIItemBaseWnd::Paint(); - UIButtonContext& controls = *this->m_controls; const auto* count = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\inventory\\icon_num.bmp"))); this->DrawBitmap(10, this->geometry.height - 22, &count->image, true); @@ -2561,7 +2559,7 @@ void UIMerchantShopMakeWnd::SendShopRequest() { // OFFSET: 0x00974820 // FUNCTION: fn_13306 void UIMerchantShopMakeWnd::AddActionButton() { - this->unknown_0168 = new UIBasicButton(*this->m_context, *this->m_controls); + this->unknown_0168 = new UIBasicButton(*this->m_context); this->unknown_0168->Configure(60, LookupMessage(3637)); this->unknown_0168->Move(this->geometry.width - 156, this->geometry.height - 24); this->unknown_0168->SetTooltip(LookupMessage(3638)); @@ -2808,7 +2806,7 @@ void UIMerchantShopMakeWnd::SetItems(int count, const short* ids) { void UIMerchantItemMyShopWnd::OpenShop() { this->shopOpen = 1; if (!this->actionButton) { - this->actionButton = new UIBasicButton(*this->m_context, *this->m_controls); + this->actionButton = new UIBasicButton(*this->m_context); this->actionButton->Configure(42, LookupMessage(2925)); this->actionButton->Move(this->geometry.width - this->actionButton->geometry.width - 66, this->geometry.height - 24); this->actionButton->SetId(506); @@ -3318,7 +3316,7 @@ void UIMerchantItemWnd::Slot10(int x, int y, std::intptr_t value) { // FUNCTION: fn_13321 void UIMerchantItemShopWnd::Slot15(int width, int height) { if (this->unknown_010C) { - this->notice = new UIStaticText(*this->m_context, *this->m_controls); + this->notice = new UIStaticText(*this->m_context); this->notice->SetSize(160, 15); char text[80]; std::sprintf(text, LookupMessage(1735), 0); @@ -3524,7 +3522,7 @@ std::string UIEditCtrl3::PlaceLineLinks(const char* line, std::string& text, con break; } - UIItemTagButton* button = new (std::nothrow) UIItemTagButton(*this->m_context, this->m_edit->buttons); + UIItemTagButton* button = new (std::nothrow) UIItemTagButton(*this->m_context); reinterpret_cast(button->unknown_00F8) = item; button->Configure(name.c_str(), 0x82F2E1, 0, 12, 0, 0); button->SetTooltip(item.DisplayName(0).c_str()); @@ -3681,13 +3679,13 @@ void UIEditCtrl3::WrapLines(std::vector& lines) { // OFFSET: 0x00975CD0 // FUNCTION: fn_13310 void UIItemSellWnd2::Slot15(int width, int height) { - this->total = new UIStaticText(*this->m_context, *this->m_controls); + this->total = new UIStaticText(*this->m_context); this->total->SetSize(160, 15); this->total->SetTextAutoWidth(""); this->total->Move(12, this->geometry.height - 21); this->AddChild(this->total); - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(90, 15); title->SetText(LookupMessage(1569), 0); title->Move(16, 2); @@ -3712,7 +3710,7 @@ void UIItemSellWnd2::Slot15(int width, int height) { int positions[2][2] = {{this->geometry.width - 106, this->geometry.height - 24}, {this->geometry.width - 61, this->geometry.height - 24}}; int ids[2] = {184, 185}; for (int index = 0; index < 2; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->buttons[index]); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); @@ -3731,7 +3729,7 @@ void UIItemSellWnd2::Slot15(int width, int height) { // OFFSET: 0x009768A0 // FUNCTION: fn_13311 void UIItemSellWnd::Slot15(int width, int height) { - this->total = new UIStaticText(*this->m_context, *this->m_controls); + this->total = new UIStaticText(*this->m_context); this->total->SetSize(160, 15); char text[80]; std::sprintf(text, "Total : %d Zeny", 0); @@ -3739,7 +3737,7 @@ void UIItemSellWnd::Slot15(int width, int height) { this->total->Move(12, this->geometry.height - 21); this->AddChild(this->total); - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(90, 15); title->SetText(LookupMessage(168), 0); title->Move(16, 2); @@ -3764,7 +3762,7 @@ void UIItemSellWnd::Slot15(int width, int height) { int positions[2][2] = {{this->geometry.width - 106, this->geometry.height - 24}, {this->geometry.width - 61, this->geometry.height - 24}}; int ids[2] = {184, 185}; for (int index = 0; index < 2; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->buttons[index]); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); @@ -3783,7 +3781,7 @@ void UIItemSellWnd::Slot15(int width, int height) { // OFFSET: 0x00977510 // FUNCTION: fn_13312 void UIItemShopWnd2::Slot15(int width, int height) { - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(70, 15); this->title->SetText(LookupMessage(167), 0); this->title->Move(16, 2); @@ -3798,7 +3796,7 @@ void UIItemShopWnd2::Slot15(int width, int height) { static_cast(this->resizer)->SetColors(0xFFFF00FF, 0xFFFF00FF); this->AddChild(this->resizer); - this->checkBox = new UICheckBox(*this->m_context, *this->m_controls); + this->checkBox = new UICheckBox(*this->m_context); this->checkBox->SetSize(200, 12); this->checkBox->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(295)); this->checkBox->Move(12, this->geometry.height - 20); @@ -3818,7 +3816,7 @@ void UIItemShopWnd2::Slot15(int width, int height) { // OFFSET: 0x009777B0 // FUNCTION: fn_13313 void UIItemShopWnd::Slot15(int width, int height) { - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(70, 15); this->title->SetText(LookupMessage(167), 0); this->title->Move(16, 2); @@ -3833,7 +3831,7 @@ void UIItemShopWnd::Slot15(int width, int height) { static_cast(this->resizer)->SetColors(0xFFFF00FF, 0xFFFF00FF); this->AddChild(this->resizer); - this->checkBox = new UICheckBox(*this->m_context, *this->m_controls); + this->checkBox = new UICheckBox(*this->m_context); this->checkBox->SetSize(200, 12); this->checkBox->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(295)); this->checkBox->Move(12, this->geometry.height - 20); @@ -3859,7 +3857,7 @@ void UIItemStoreFindWnd::Slot15(int width, int height) { char text[64]; std::sprintf(text, "서브창고"); - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(this->geometry.width - 32, 15); this->title->SetTextFitted(text); this->title->Move(16, 2); @@ -3874,7 +3872,7 @@ void UIItemStoreFindWnd::Slot15(int width, int height) { this->resizeHandle->SetColors(0xFFFF00FF, 0xFFFF00FF); this->AddChild(this->resizeHandle); - this->closeButton = this->AddCloseButton(*this->m_controls, "", 0); + this->closeButton = this->AddCloseButton("", 0); this->closeButton->Move(width - 16, 3); } @@ -3887,7 +3885,7 @@ void UIItemStoreSubWnd::Slot15(int width, int height) { char text[64]; std::sprintf(text, "서브창고"); - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(this->geometry.width - 32, 15); this->title->SetTextFitted(text); this->title->Move(16, 2); @@ -3906,14 +3904,14 @@ void UIItemStoreSubWnd::Slot15(int width, int height) { // OFFSET: 0x0097BD30 // FUNCTION: fn_13322 void UIMerchantItemWnd::Slot15(int width, int height) { - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(90, 15); title->SetText(LookupMessage(222), 0); title->Move(16, 2); title->shadow = 1; this->AddChild(title); - this->info = new UIStaticText(*this->m_context, *this->m_controls); + this->info = new UIStaticText(*this->m_context); this->info->SetSize(220, 15); char text[128]; std::sprintf(text, "Num: %d/%d Weight: %d/%d", g_session.cartCount, g_session.cartMaxCount, g_session.cartWeight, g_session.cartMaxWeight); @@ -3934,7 +3932,7 @@ void UIMerchantItemWnd::Slot15(int width, int height) { scrollBar->Configure(this->geometry.width - 15, 14, 1, this->geometry.height - 38); this->AddChild(this->scrollBar); - this->closeButton = this->AddCloseButton(*this->m_controls, "Alt+W", 0); + this->closeButton = this->AddCloseButton("Alt+W", 0); this->columns = (width - 40) / 32; this->visibleRows = (height - 38) / 32; this->SendMsg(nullptr, 23, 0, 0, 0, 0); @@ -3944,7 +3942,7 @@ void UIMerchantItemWnd::Slot15(int width, int height) { // OFFSET: 0x0097BFF0 // FUNCTION: fn_13323 void UIMerchantMirrorItemWnd::Slot15(int width, int height) { - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(150, 15); int messageId; if (this->unknown_00F4 == 1) { @@ -5572,7 +5570,7 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x0097AA00 // FUNCTION: fn_13320 void UIMerchantItemPurchaseWnd::Slot15(int width, int height) { - this->total = new UIStaticText(*this->m_context, *this->m_controls); + this->total = new UIStaticText(*this->m_context); this->total->SetSize(160, 15); char text[80]; std::sprintf(text, "Total : %d Zeny", 0); @@ -5580,7 +5578,7 @@ void UIMerchantItemPurchaseWnd::Slot15(int width, int height) { this->total->Move(12, this->geometry.height - 21); this->AddChild(this->total); - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(160, 15); title->SetText(LookupMessage(this->unknown_0108 ? 168 : 228), 0); title->Move(16, 2); @@ -5593,7 +5591,7 @@ void UIMerchantItemPurchaseWnd::Slot15(int width, int height) { if (this->unknown_0108) { const char* names[2][3] = {{"btn_sell", "btn_sell_a", "btn_sell_b"}, {"btn_cancel", "btn_cancel_a", "btn_cancel_b"}}; for (int index = 0; index < 2; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->buttons[index]); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); @@ -5606,7 +5604,7 @@ void UIMerchantItemPurchaseWnd::Slot15(int width, int height) { } else { const char* names[2][3] = {{"btn_buy", "btn_buy_a", "btn_buy_b"}, {"btn_cancel", "btn_cancel_a", "btn_cancel_b"}}; for (int index = 0; index < 2; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->buttons[index]); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); @@ -5628,7 +5626,7 @@ void UIMerchantItemPurchaseWnd::Slot15(int width, int height) { // FUNCTION: fn_13318 void UIMerchantItemMyShopWnd::Slot15(int width, int height) { if (this->unknown_0100) { - this->notice = new UIStaticText(*this->m_context, *this->m_controls); + this->notice = new UIStaticText(*this->m_context); this->notice->SetSize(160, 15); char text[80]; std::sprintf(text, LookupMessage(1735), 0); @@ -5637,7 +5635,7 @@ void UIMerchantItemMyShopWnd::Slot15(int width, int height) { this->AddChild(this->notice); } - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(240, 15); this->title->SetText(LookupMessage(this->unknown_0100 ? 1734 : 3237), 0); this->title->Move(16, 2); @@ -5657,7 +5655,7 @@ void UIMerchantItemMyShopWnd::Slot15(int width, int height) { scrollBar->Configure(this->geometry.width - 15, 14, 1, this->geometry.height - this->unknown_011C - 17); this->AddChild(this->scrollBar); - this->saleAlarm = new UICheckBox(*this->m_context, *this->m_controls); + this->saleAlarm = new UICheckBox(*this->m_context); this->saleAlarm->SetSize(240, 12); this->saleAlarm->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(this->unknown_0100 ? 2698 : 2642)); this->saleAlarm->FitToText(); @@ -5670,7 +5668,7 @@ void UIMerchantItemMyShopWnd::Slot15(int width, int height) { int positions[1][2] = {{this->geometry.width - 61, this->geometry.height - 24}}; int ids[1] = {201}; for (int index = 0; index < 1; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->buttons[index]); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); @@ -6561,7 +6559,6 @@ UIItemBaseWnd::UIItemBaseWnd(UIWindowContext& windowContext) this->unknown_00B8 = 0; this->buttons[0] = nullptr; this->buttons[1] = nullptr; - this->m_controls = nullptr; this->scroll = 0; } @@ -6686,14 +6683,14 @@ void UIItemWnd::Slot15(int width, int height) { this->AddChild(this->scrollBar); this->baseButton = this->AddBaseButton(); - this->minimizeButton = this->AddMinimizeButton(*this->m_controls, "Ctrl+E", 0); + this->minimizeButton = this->AddMinimizeButton("Ctrl+E", 0); this->closeButton = this->AddCloseButton("Alt+E", 0); this->unknown_0110 = this->geometry.height; this->columns = (width - 40) / 32; this->visibleRows = (height - 38) / 32; this->SendMsg(nullptr, 23, 0, 0, 0, 0); - this->tabs = new (std::nothrow) UITabControl(*this->m_context, *this->m_controls); + this->tabs = new (std::nothrow) UITabControl(*this->m_context); this->tabs->Configure(0, 17, 10, 1, 0, 1, 0, 0, 0, 0, 0, 0); this->tabs->Move(3, 18); this->AddChild(this->tabs); @@ -6705,7 +6702,7 @@ void UIItemWnd::Slot15(int width, int height) { this->tabs->colors[3] = SkinPaletteColor(ResourceMgr::Instance(), cell, g_skinInfo.Selected()); this->tabs->Invalidate(); - this->lockDropBox = new (std::nothrow) UICheckBox(*this->m_context, *this->m_controls); + this->lockDropBox = new (std::nothrow) UICheckBox(*this->m_context); this->lockDropBox->SetSize(14, 11); this->lockDropBox->SetBitmaps("유저인터페이스\\inventory\\item_drop_lock_on.bmp", "유저인터페이스\\inventory\\item_drop_lock_off.bmp"); this->lockDropBox->Move(79, height - 16); @@ -6713,7 +6710,7 @@ void UIItemWnd::Slot15(int width, int height) { this->lockDropBox->SetTooltip(LookupMessage(2843)); this->AddChild(this->lockDropBox); - UICheckBox* compare = new (std::nothrow) UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* compare = new (std::nothrow) UICheckBox(*this->m_context); this->optionBox = compare; compare->SetSize(12, 12); static_cast(this->optionBox)->SetBitmaps("유저인터페이스\\inventory\\item_compare_on.bmp", "유저인터페이스\\inventory\\item_compare_off.bmp"); @@ -6723,7 +6720,7 @@ void UIItemWnd::Slot15(int width, int height) { static_cast(this->optionBox)->SetTooltip(LookupMessage(2842)); this->AddChild(this->optionBox); - this->countButton = new (std::nothrow) UIBitmapButton(*this->m_context, *this->m_controls); + this->countButton = new (std::nothrow) UIBitmapButton(*this->m_context); this->countButton->SetBitmap("유저인터페이스\\inventory\\icon_num.bmp", 0, 0); this->countButton->SetBitmap("유저인터페이스\\inventory\\icon_num.bmp", 1, 0); this->countButton->SetBitmap("유저인터페이스\\inventory\\icon_num.bmp", 2, 0); @@ -6733,7 +6730,7 @@ void UIItemWnd::Slot15(int width, int height) { this->countButton->SetTooltip(LookupMessage(3560)); this->AddChild(this->countButton); - UIBitmapButton* lockDeal = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* lockDeal = new UIBitmapButton(*this->m_context); this->unknown_0124 = lockDeal; lockDeal->SetBitmap(g_session.m_blockPrivateTab != 1 ? "유저인터페이스\\inventory\\bt_itemDeal_lock_off.bmp" : "유저인터페이스\\inventory\\bt_itemdeal_lock_on.bmp", 0, 0); static_cast(this->unknown_0124)->SetBitmap("유저인터페이스\\inventory\\bt_itemDeal_lock_over.bmp", 1, 0); @@ -6744,7 +6741,7 @@ void UIItemWnd::Slot15(int width, int height) { this->unknown_0124->SetId(507); this->AddChild(this->unknown_0124); - this->unknown_012C = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_012C = new UIBitmapButton(*this->m_context); this->RefreshSortButton(); this->unknown_012C->SetSize(static_cast(this->unknown_012C)->BitmapWidth(), static_cast(this->unknown_012C)->BitmapHeight()); this->unknown_012C->Move(157, this->geometry.height - 19); @@ -6793,7 +6790,6 @@ UIMerchantItemPurchaseMSGWnd::UIMerchantItemPurchaseMSGWnd(UIWindowContext& wind this->secondLine = nullptr; this->buyButton = nullptr; this->cancelButton = nullptr; - this->m_controls = nullptr; this->unknown_00D0 = 0; } @@ -7132,11 +7128,10 @@ void UIChatEditCtrl::InsertItemLink(const ITEM_INFO& item) { // OFFSET: 0x00980340 // FUNCTION: fn_13335 void UIItemStoreFindWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(true, "", 0); unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(0, 17, this->geometry.width, this->geometry.height - 38, RGB(red, green, blue)); this->DrawButtonBar(0, 0, 1); @@ -7148,7 +7143,7 @@ void UIItemStoreFindWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, rows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -7168,7 +7163,7 @@ void UIItemStoreFindWnd::Paint() { const int left = visible % this->columns * 32 + 10; const int width = this->geometry.width - left - 66; const int x = left + 4; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawWrappedItemName(left + 40, top + 29, width, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { @@ -7192,11 +7187,10 @@ void UIItemStoreFindWnd::Paint() { // OFFSET: 0x00980610 // FUNCTION: fn_13336 void UIItemStoreSubWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(true, "", 0); unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(0, 17, this->geometry.width, this->geometry.height - 38, RGB(red, green, blue)); this->DrawButtonBar(0, 0, 1); @@ -7208,7 +7202,7 @@ void UIItemStoreSubWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, rows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -7228,7 +7222,7 @@ void UIItemStoreSubWnd::Paint() { const int left = visible % this->columns * 32 + 10; const int width = this->geometry.width - left - 66; const int x = left + 4; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawWrappedItemName(left + 40, top + 29, width, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { @@ -7252,7 +7246,6 @@ void UIItemStoreSubWnd::Paint() { // OFFSET: 0x0097E7A0 // FUNCTION: fn_13330 void UIItemPurchaseWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -7272,13 +7265,13 @@ void UIItemPurchaseWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); const int height = this->geometry.height; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(40, 17, this->geometry.width - 50, (height - 38) / 32 * 32, RGB(red, green, blue)); int slots = (height - 58) / 32; @@ -7303,12 +7296,12 @@ void UIItemPurchaseWnd::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); int nameWidth = 110; const int amount = static_cast(it->unknown_0014[0]); @@ -7378,7 +7371,6 @@ void UIItemPurchaseWnd::Paint() { // OFFSET: 0x0097F220 // FUNCTION: fn_13332 void UIItemSellWnd::Paint() { - UIButtonContext& controls = *this->m_controls; char price[64]; char text[64]; this->DrawTitleBar(false, "", 0); @@ -7400,7 +7392,7 @@ void UIItemSellWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); @@ -7413,7 +7405,7 @@ void UIItemSellWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -7433,12 +7425,12 @@ void UIItemSellWnd::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); int nameWidth = 100; const int amount = static_cast(it->unknown_0014[0]); @@ -7482,7 +7474,6 @@ void UIItemSellWnd::Paint() { // OFFSET: 0x0097FBF0 // FUNCTION: fn_13334 void UIItemShopWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -7502,7 +7493,7 @@ void UIItemShopWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - this->unknown_0104 - 17, RGB(red, green, blue)); this->FillRegion( 20, (this->geometry.height - this->unknown_0104 - 17) / 32 * 32 + 17, this->geometry.width - 24, @@ -7520,7 +7511,7 @@ void UIItemShopWnd::Paint() { if (this->unknown_010C != 0) { slotRows = (this->geometry.height - this->unknown_0104 - 17) / 32; } - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(red, green, blue)); if (this->unknown_010C != 0) { this->FillRegion(40, slotRows * 32 - 15, 32, 32, RGB(red, green, blue)); @@ -7543,12 +7534,12 @@ void UIItemShopWnd::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); int nameWidth = 100; const int amount = static_cast(it->unknown_0014[0]); @@ -7628,7 +7619,6 @@ void UIItemShopWnd::Paint() { // OFFSET: 0x009808E0 // FUNCTION: fn_13337 void UIItemStoreWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -7648,7 +7638,7 @@ void UIItemStoreWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 3 : 0, 0, 1); @@ -7658,7 +7648,7 @@ void UIItemStoreWnd::Paint() { if (!this->unknown_0190) { this->scrollBar->Show(0); unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(40, 17, columns * 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); DrawRoundedBorder(*this, 55, 131, 187, 139, 0xCE9484); DrawFilledRoundedBorder(*this, 56, 132, 185, 137, 0xFFE7DE); @@ -7678,7 +7668,7 @@ void UIItemStoreWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -7697,7 +7687,7 @@ void UIItemStoreWnd::Paint() { const int top = visible / this->columns * 32; const int column = visible % this->columns * 32; const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawWrappedItemName(column + 80, top + 29, 180, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { @@ -7726,7 +7716,6 @@ void UIItemStoreWnd::Paint() { // OFFSET: 0x009819C0 // FUNCTION: fn_13341 void UIMerchantItemPurchaseWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -7746,7 +7735,7 @@ void UIMerchantItemPurchaseWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); @@ -7759,7 +7748,7 @@ void UIMerchantItemPurchaseWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -7775,12 +7764,12 @@ void UIMerchantItemPurchaseWnd::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawWrappedItemName(column + 76, top + 29, 90, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { @@ -7811,12 +7800,11 @@ void UIMerchantItemPurchaseWnd::Paint() { // OFFSET: 0x00982A80 // FUNCTION: fn_13344 void UIMerchantShopMakeWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFF); this->DrawTitleBar(false, "", 0); unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(0, 17, this->geometry.width, this->geometry.height - 38, RGB(red, green, blue)); int barHeight; @@ -7979,7 +7967,7 @@ void UIMerchantShopMakeWnd::Paint() { const int top = visible / this->columns * 42; const int column = visible % this->columns * 42; const int x = column + 7; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 48, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 48, *it, 0, 0); this->DrawWrappedItemName(column + 39, top + 57, 100, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { @@ -8556,7 +8544,6 @@ bool UIEditCtrl3::LinkDisplayName(const std::string& encoded, std::string& outpu } // FUNCTION: fn_13342 void UIMerchantItemShopWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -8578,7 +8565,7 @@ void UIMerchantItemShopWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - this->unknown_0118 - 17, RGB(red, green, blue)); this->FillRegion( 20, static_cast(this->geometry.height - this->unknown_0118 - 17) / 32 * 32 + 17, this->geometry.width - 24, @@ -8594,7 +8581,7 @@ void UIMerchantItemShopWnd::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); { @@ -8625,7 +8612,7 @@ void UIMerchantItemShopWnd::Paint() { const int left = column + 40; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(left + 32, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } @@ -8637,10 +8624,10 @@ void UIMerchantItemShopWnd::Paint() { this->TextWidth(price, 0, 0, 12, 0, 0) - 18; this->DrawTextAt(quantityX, top + 29, price, 0, 0, 12, 0xFF, 0, 0); x = left + 4; - DrawItemIcon(*this, controls.resources, descriptions, x, top + 21, *it, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, x, top + 21, *it, 0); } else { x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); } if (it->unknown_0088 > 0) { @@ -8919,7 +8906,6 @@ void UISkillListWnd::Slot28(int x, int y) { // OFFSET: 0x0097EDE0 // FUNCTION: fn_13331 void UIItemSellWnd2::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -8939,7 +8925,7 @@ void UIItemSellWnd2::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); @@ -8952,7 +8938,7 @@ void UIItemSellWnd2::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -8972,12 +8958,12 @@ void UIItemSellWnd2::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawFittedItemName(column + 76, top + 29, &*it, 0, 0, 12, 0); if (it->unknown_0088 > 0) { @@ -8999,7 +8985,6 @@ void UIItemSellWnd2::Paint() { // OFFSET: 0x0097F790 // FUNCTION: fn_13333 void UIItemShopWnd2::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -9019,7 +9004,7 @@ void UIItemShopWnd2::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - this->unknown_0104 - 17, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - this->unknown_0104 - 17) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - this->unknown_0104 - 17) % 32, RGB(red, green, blue)); this->DrawButtonBar(this->unknown_00B8 != 0 ? 2 : 0, 0, 1); @@ -9032,7 +9017,7 @@ void UIItemShopWnd2::Paint() { } unsigned fillRed, fillGreen, fillBlue; - SkinPaletteChannels(controls.resources, 2, 2, fillRed, fillGreen, fillBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, fillRed, fillGreen, fillBlue); this->FillRegion(72, 17, columns * 32 - 32, slotRows * 32, RGB(fillRed, fillGreen, fillBlue)); ItemDescriptions descriptions{g_itemDescriptions}; @@ -9052,12 +9037,12 @@ void UIItemShopWnd2::Paint() { const int top = visible / this->columns * 32; if (this->hovered == index) { unsigned hoverRed, hoverGreen, hoverBlue; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawFittedItemName(column + 76, top + 29, &*it, 0, 0, 12, 0); if (it->unknown_0088 > 0) { @@ -9215,7 +9200,6 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // OFFSET: 0x00980F50 // FUNCTION: fn_13338 void UIItemWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(true, LookupMessage(106), 0); if (this->geometry.height == 17) { @@ -9239,10 +9223,10 @@ void UIItemWnd::Paint() { unsigned red, green, blue; if (this->unknown_010C == 3 && g_session.m_blockPrivateTab == 1) { - SkinPaletteChannels(controls.resources, 0, 8, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 0, 8, red, green, blue); this->FillRegion(20, 17, this->geometry.width - 21, this->geometry.height - 38, RGB(red, green, blue)); } else { - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(20, 17, (this->geometry.width - 60) % 32, this->geometry.height - 38, RGB(red, green, blue)); this->FillRegion(20, (this->geometry.height - 38) / 32 * 32 + 17, this->geometry.width - 24, (this->geometry.height - 38) % 32, RGB(red, green, blue)); } @@ -9317,7 +9301,7 @@ void UIItemWnd::Paint() { const int top = visible / this->columns * 32; const int x = visible % this->columns * 32 + 44; const int y = top + 21; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, y, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, y, *it, 0, 0); if (it->unknown_0088 > 0) { this->DrawBitmap( diff --git a/Source/UI/Edit/UIEditCtrl.h b/Source/UI/Edit/UIEditCtrl.h index 92567c1e..36ed364a 100644 --- a/Source/UI/Edit/UIEditCtrl.h +++ b/Source/UI/Edit/UIEditCtrl.h @@ -10,7 +10,6 @@ struct InputFocus; struct CLanguage; struct InputCharset; -struct UIButtonContext; struct BitmapImage; #include "UI/Window/WindowManagerWindows.h" class NavigationDestination; @@ -24,7 +23,6 @@ struct UIEditContext { CLanguage& input; unsigned char& password; const InputCharset& charset; - UIButtonContext& buttons; WindowManagerWindows& windows; NavigationDestination& navigation; const BitmapImage& colorChip; diff --git a/Source/UI/Edit/UIEditLinks.cpp b/Source/UI/Edit/UIEditLinks.cpp index 67bfb8d6..621b6066 100644 --- a/Source/UI/Edit/UIEditLinks.cpp +++ b/Source/UI/Edit/UIEditLinks.cpp @@ -253,7 +253,7 @@ void UIEditCtrl::InsertLink(const char* value) { this->anchor = this->cursor = static_cast(this->text.size()); this->m_edit->input.Select(this->cursor, this->cursor); - auto* button = new UINaviLinkButton(*this->m_context, this->m_edit->buttons, this->m_edit->navigation); + auto* button = new UINaviLinkButton(*this->m_context, this->m_edit->navigation); button->Configure(display.c_str(), 0x009E68F0, 0, 12, 0, 0); button->SetId(438); diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index 364ea90d..2df17f6f 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -442,8 +442,8 @@ void UIEditCtrl_OldList::RecallHistory(int step) { // OFFSET: 0x008551B0 // FUNCTION: fn_10753 void UIEditCtrl3::PaintText() { - FontCache& fonts = this->m_edit->buttons.fonts; - const TextLocale& locale = this->m_edit->buttons.locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; int x = 3; if (this->invalidatesParent == 0 && this->firstVisible != 0) { diff --git a/Source/UI/Emotion/UIEmotionWnd.cpp b/Source/UI/Emotion/UIEmotionWnd.cpp index 8e6aa8ae..1978558f 100644 --- a/Source/UI/Emotion/UIEmotionWnd.cpp +++ b/Source/UI/Emotion/UIEmotionWnd.cpp @@ -27,7 +27,7 @@ UIBitmapButton* UIEmotionWnd::AddCloseButton(const char* tooltip, int width) { width = this->geometry.width; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_off.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 2, 0); @@ -59,7 +59,7 @@ void UIEmotionWnd::Slot15(int, int) { char buffer[16]; std::sprintf(buffer, "Alt + %d", i + 1); - UIStaticText* label = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); + UIStaticText* label = new UIStaticText(*this->m_context); this->m_labels[i] = label; label->SetSize(70, 16); label->Move(20, y); @@ -70,10 +70,10 @@ void UIEmotionWnd::Slot15(int, int) { } this->m_labels[9]->SetText("Alt + 0", 0); - this->UIFrameWnd::AddCloseButton(*reinterpret_cast(nullptr), "Alt+M", 0); + this->UIFrameWnd::AddCloseButton("Alt+M", 0); std::string path = "유저인터페이스\\"; - this->viewButton = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->viewButton = new UIBitmapButton(*this->m_context); this->viewButton->SetBitmap((path + "btn_view" + ".bmp").c_str(), 0, 0); this->viewButton->SetBitmap((path + "btn_view_a" + ".bmp").c_str(), 1, 0); this->viewButton->SetBitmap((path + "btn_view_b" + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index 9091aded..7eade0c1 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp @@ -43,7 +43,6 @@ void UIEntryQueueHelpWnd::Slot18() { // OFFSET: 0x00BA4270 // FUNCTION: fn_19681 void UIEntryQueueHelpWnd::Paint() { - auto& controls = this->m_entryQueue->text.buttons; this->DrawTitleBar(true, LookupMessage(2125), 0); this->DrawPanelBackground(17, 0, ""); } @@ -110,11 +109,10 @@ UIEntryQueueRequestWnd::UIEntryQueueRequestWnd(UIWindowContext& windows, UIEntry // FUNCTION: fn_19691 bool UIEntryQueueRequestWnd::Create() { auto& text = this->m_entryQueue->text; - auto& controls = text.buttons; this->Resize(300, 250); - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->SetSize(300, 250); this->Slot15(300, 250); this->Slot22(300, 250); @@ -145,7 +143,7 @@ bool UIEntryQueueRequestWnd::Create() { const std::string path = "유저인터페이스\\"; - this->m_ok = new UIBitmapButton(*this->m_context, controls); + this->m_ok = new UIBitmapButton(*this->m_context); this->m_ok->SetBitmap((path + "btn_ok" + ".bmp").c_str(), 0, 0); this->m_ok->SetBitmap((path + "btn_ok_a" + ".bmp").c_str(), 1, 0); this->m_ok->SetBitmap((path + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -154,7 +152,7 @@ bool UIEntryQueueRequestWnd::Create() { this->m_ok->SetId(0); this->AddChild(this->m_ok); - this->m_cancel = new UIBitmapButton(*this->m_context, controls); + this->m_cancel = new UIBitmapButton(*this->m_context); this->m_cancel->SetBitmap((path + "btn_cancel" + ".bmp").c_str(), 0, 0); this->m_cancel->SetBitmap((path + "btn_cancel_a" + ".bmp").c_str(), 1, 0); this->m_cancel->SetBitmap((path + "btn_cancel_b" + ".bmp").c_str(), 2, 0); @@ -163,7 +161,7 @@ bool UIEntryQueueRequestWnd::Create() { this->m_cancel->SetId(1); this->AddChild(this->m_cancel); - this->m_countdown = new UIStaticText(*this->m_context, controls); + this->m_countdown = new UIStaticText(*this->m_context); this->m_countdown->SetSize(150, 20); this->m_countdown->Move(10, this->geometry.height - 20); this->AddChild(this->m_countdown); @@ -178,7 +176,6 @@ void UIEntryQueueRequestWnd::Slot18() { // OFFSET: 0x00BA5390 // FUNCTION: fn_19693 void UIEntryQueueRequestWnd::Paint() { - auto& controls = this->m_entryQueue->text.buttons; this->DrawTitleBar(true, LookupMessage(2133), 0); this->DrawPanelBackground(17, 0, ""); @@ -242,10 +239,9 @@ UIEntryQueueStandByWnd::UIEntryQueueStandByWnd(UIWindowContext& windows, UIEntry // FUNCTION: fn_19698 bool UIEntryQueueStandByWnd::Create() { auto& text = this->m_entryQueue->text; - auto& controls = text.buttons; this->Resize(280, 120); - this->AddBaseButton(controls); + this->AddBaseButton(); this->SetSize(280, 120); this->Slot15(280, 120); this->Slot22(280, 120); @@ -261,7 +257,7 @@ bool UIEntryQueueStandByWnd::Create() { const std::string path = "유저인터페이스\\"; - this->m_cancel = new UIBitmapButton(*this->m_context, controls); + this->m_cancel = new UIBitmapButton(*this->m_context); this->m_cancel->SetBitmap((path + "cancel_waiting" + ".bmp").c_str(), 0, 0); this->m_cancel->SetBitmap((path + "cancel_waiting_a" + ".bmp").c_str(), 1, 0); this->m_cancel->SetBitmap((path + "cancel_waiting_b" + ".bmp").c_str(), 2, 0); @@ -270,7 +266,7 @@ bool UIEntryQueueStandByWnd::Create() { this->m_cancel->SetId(0); this->AddChild(this->m_cancel); - this->m_close = new UIBitmapButton(*this->m_context, controls); + this->m_close = new UIBitmapButton(*this->m_context); this->m_close->SetBitmap((path + "btn_close" + ".bmp").c_str(), 0, 0); this->m_close->SetBitmap((path + "btn_close_a" + ".bmp").c_str(), 1, 0); this->m_close->SetBitmap((path + "btn_close_b" + ".bmp").c_str(), 2, 0); @@ -289,7 +285,6 @@ void UIEntryQueueStandByWnd::Slot18() { // OFFSET: 0x00BA5E60 // FUNCTION: fn_19700 void UIEntryQueueStandByWnd::Paint() { - auto& controls = this->m_entryQueue->text.buttons; this->DrawTitleBar(true, LookupMessage(2135), 0); this->DrawPanelBackground(17, 0, ""); } @@ -353,11 +348,10 @@ int UIEntryQueueWnd::SelectedIndex() { // OFFSET: 0x00BA6420 // FUNCTION: fn_19707 void UIEntryQueueWnd::Slot15(int width, int height) { - auto& controls = this->m_entryQueue->text.buttons; this->Resize(350, 350); - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->m_list = new UIEntryQueueListBox(*this->m_context, *this->m_listContext); this->m_list->SetSize(130, 270); @@ -380,7 +374,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { }; int index = 0; for (int y = 165; y < 305; y += 20, ++index) { - this->m_labels[index] = new UIStaticText(*this->m_context, controls); + this->m_labels[index] = new UIStaticText(*this->m_context); if (this->m_labels[index]) { const char* label = labels[index]; const TextLocale locale = {}; @@ -392,7 +386,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { } for (int value = 0; value < 7; ++value) { - this->m_values[value] = new UIStaticText(*this->m_context, controls); + this->m_values[value] = new UIStaticText(*this->m_context); if (this->m_labels[value]) { this->m_values[value]->SetSize(157, 25); this->AddChild(this->m_values[value]); @@ -409,7 +403,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { int id = 0; const char** name = names; for (int x = 8; x < 287; x += 93, name += 3) { - this->m_applyButtons[id] = new UIBitmapButton(*this->m_context, controls); + this->m_applyButtons[id] = new UIBitmapButton(*this->m_context); this->m_applyButtons[id]->SetBitmap((path + name[0] + ".bmp").c_str(), 0, 0); this->m_applyButtons[id]->SetBitmap((path + name[1] + ".bmp").c_str(), 1, 0); this->m_applyButtons[id]->SetBitmap((path + name[2] + ".bmp").c_str(), 2, 0); @@ -420,7 +414,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { ++id; } - this->m_helpButton = new UIBitmapButton(*this->m_context, controls); + this->m_helpButton = new UIBitmapButton(*this->m_context); this->m_helpButton->SetBitmap((path + "btn_help" + ".bmp").c_str(), 0, 0); this->m_helpButton->SetBitmap((path + "btn_help" + "_a.bmp").c_str(), 1, 0); this->m_helpButton->SetBitmap((path + "btn_help" + "_b.bmp").c_str(), 2, 0); @@ -644,7 +638,6 @@ void UIEntryQueueWnd::Slot11() { // FUNCTION: fn_19679 void UIEntryQueueHelpWnd::Slot15(int width, int height) { auto& text = this->m_entryQueue->text; - auto& controls = text.buttons; this->Resize(280, 280); @@ -679,7 +672,7 @@ void UIEntryQueueHelpWnd::Slot15(int width, int height) { const std::string path = "유저인터페이스\\"; - this->m_close = new UIBitmapButton(*this->m_context, controls); + this->m_close = new UIBitmapButton(*this->m_context); this->m_close->SetBitmap((path + "btn_close" + ".bmp").c_str(), 0, 0); this->m_close->SetBitmap((path + "btn_close_a" + ".bmp").c_str(), 1, 0); this->m_close->SetBitmap((path + "btn_close_b" + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 3b0011bf..07732814 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -29,7 +29,6 @@ UIAgitMessageBox::UIAgitMessageBox() // OFFSET: 0x0095D580 // FUNCTION: fn_13068 void UIAgitMessageBox::Paint() { - auto& controls = this->m_dialog->buttons; this->DrawTitleBar(true, LookupMessage(3640), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); diff --git a/Source/UI/Guild/UIAgitWnd.h b/Source/UI/Guild/UIAgitWnd.h index f7eaf1d0..b3bce238 100644 --- a/Source/UI/Guild/UIAgitWnd.h +++ b/Source/UI/Guild/UIAgitWnd.h @@ -6,11 +6,9 @@ #include -struct UIButtonContext; struct WindowResponseRecorder; struct UIAgitMessageBoxContext { - UIButtonContext& buttons; WindowResponseRecorder& recorder; }; diff --git a/Source/UI/Guild/UIGuildHelperWnd.cpp b/Source/UI/Guild/UIGuildHelperWnd.cpp index d04d81c7..990237d0 100644 --- a/Source/UI/Guild/UIGuildHelperWnd.cpp +++ b/Source/UI/Guild/UIGuildHelperWnd.cpp @@ -53,7 +53,6 @@ UIGuildBanReasonDescWnd::UIGuildBanReasonDescWnd() { // OFFSET: 0x0095DB20 // FUNCTION: fn_13071 void UIGuildHelperWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, LookupMessage(2074), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -97,7 +96,6 @@ void UIGuildHelperWnd::Slot27(int x, int y) { // OFFSET: 0x0095D5C0 // FUNCTION: fn_13069 void UICreateGuildWnd::Paint() { - auto& controls = *this->m_controls; this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); int text; @@ -131,7 +129,6 @@ void UICreateGuildWnd::Slot31(int, int) { // OFFSET: 0x0095F420 // FUNCTION: fn_13078 void UIGuildTipWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, LookupMessage(2078), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -288,7 +285,7 @@ void UICreateGuildWnd::Slot15(int, int) { int ids[2] = {184, 185}; for (unsigned int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -313,7 +310,7 @@ void UIGuildHelperWnd::Slot15(int width, int height) { int x = 8; for (int i = 0; i < 3; ++i) { - this->m_button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_button = new UIBitmapButton(*this->m_context); this->m_button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); this->m_button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); this->m_button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/Guild/UIGuildHelperWnd.h b/Source/UI/Guild/UIGuildHelperWnd.h index 2ab62d5d..c7d7993f 100644 --- a/Source/UI/Guild/UIGuildHelperWnd.h +++ b/Source/UI/Guild/UIGuildHelperWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; struct GuildHelperWndInfo; class UIBitmapButton; @@ -29,7 +28,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; /* 00B4 */ UIBitmapButton* m_button; /* 00B8 */ GuildHelperWndInfo* m_saved; }; @@ -53,13 +52,13 @@ protected: class UIGuildTipWnd : public UIFrameWnd { public: - UIGuildTipWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildTipWnd(UIWindowContext& windows); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; /* 00B4 */ UITextViewer* m_textViewer; /* 00B8 */ UIBitmapButton* m_closeButton; }; diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index f7185d74..def03f2e 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -119,7 +119,6 @@ void UIGuildWnd::Paint() { this->FillRegion(x, 18, 64, 23, RGB(red, green, blue)); } - auto& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); unsigned borderRed, borderGreen, borderBlue; SkinPaletteChannels(ResourceMgr::Instance(), 14, 6, borderRed, borderGreen, borderBlue); @@ -292,24 +291,24 @@ void UIGuildTotalInfoWnd::Slot35(int delta) { // OFFSET: 0x00954020 // FUNCTION: fn_13005 -UIGuildWnd::UIGuildWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_saved(nullptr), m_tabs{}, m_controls(&controls) {} +UIGuildWnd::UIGuildWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_saved(nullptr), m_tabs{} {} // OFFSET: 0x00953900 // FUNCTION: fn_12995 -UIGuildBanishedMemberWnd::UIGuildBanishedMemberWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIGuildWnd(windows, controls) { +UIGuildBanishedMemberWnd::UIGuildBanishedMemberWnd(UIWindowContext& windows) + : UIGuildWnd(windows) { } // OFFSET: 0x009539C0 // FUNCTION: fn_12997 -UIGuildInfoManageWnd::UIGuildInfoManageWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIGuildWnd(windows, controls), unknown_00D8(), unknown_00E0(), unknown_00EC(0), unknown_00F0(0), m_guildId(g_guildInfo.m_guildId) { +UIGuildInfoManageWnd::UIGuildInfoManageWnd(UIWindowContext& windows) + : UIGuildWnd(windows), unknown_00D8(), unknown_00E0(), unknown_00EC(0), unknown_00F0(0), m_guildId(g_guildInfo.m_guildId) { } // OFFSET: 0x00953B00 // FUNCTION: fn_12999 -UIGuildMemberManageWnd::UIGuildMemberManageWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIGuildWnd(windows, controls), unknown_0150(), m_scrollTop(0), m_hoverRow(10), m_columns(1), m_visibleRows(6), unknown_016C(0), +UIGuildMemberManageWnd::UIGuildMemberManageWnd(UIWindowContext& windows) + : UIGuildWnd(windows), unknown_0150(), m_scrollTop(0), m_hoverRow(10), m_columns(1), m_visibleRows(6), unknown_016C(0), m_scrollable(0), m_rowSpacing(0), m_members(), unknown_0180(), m_sortOrders() { this->m_buttonTime = 0; this->m_scrollBar = nullptr; @@ -325,13 +324,13 @@ UIGuildMemberManageWnd::UIGuildMemberManageWnd(UIWindowContext& windows, UIButto // OFFSET: 0x00953D10 // FUNCTION: fn_13000 -UIGuildNoticeWnd::UIGuildNoticeWnd(UIWindowContext& windows, UIButtonContext& controls) : UIGuildWnd(windows, controls) { +UIGuildNoticeWnd::UIGuildNoticeWnd(UIWindowContext& windows) : UIGuildWnd(windows) { } // OFFSET: 0x00953D70 // FUNCTION: fn_13001 -UIGuildPositionManageWnd::UIGuildPositionManageWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIGuildWnd(windows, controls), m_buttonTime(0) { +UIGuildPositionManageWnd::UIGuildPositionManageWnd(UIWindowContext& windows) + : UIGuildWnd(windows), m_buttonTime(0) { for (int index = 0; index < 11; ++index) { this->unknown_00D0[index] = 0; this->unknown_00FC[index] = 0; @@ -345,7 +344,7 @@ UIGuildPositionManageWnd::UIGuildPositionManageWnd(UIWindowContext& windows, UIB // OFFSET: 0x00953E80 // FUNCTION: fn_13002 -UIGuildSkillWnd::UIGuildSkillWnd(UIWindowContext& windows, UIButtonContext& controls) : UIGuildWnd(windows, controls) { +UIGuildSkillWnd::UIGuildSkillWnd(UIWindowContext& windows) : UIGuildWnd(windows) { this->m_actionButtons[0] = nullptr; this->m_actionButtons[1] = nullptr; this->m_hoverIndex = -1; @@ -636,7 +635,7 @@ __declspec(noinline) void UIGuildWnd::CreateTabs() { const char** name = names; UIStaticText** tab = this->m_tabs; for (int x = 3; x < 399; x += 66) { - *tab = new UIStaticText(*this->m_context, *this->m_controls); + *tab = new UIStaticText(*this->m_context); (*tab)->SetSize(62, 15); (*tab)->SetTextFitted(*name); (*tab)->Move(x, 22); @@ -645,7 +644,7 @@ __declspec(noinline) void UIGuildWnd::CreateTabs() { ++tab; } - this->AddCloseButton(*this->m_controls, "Alt+G", 0); + this->AddCloseButton("Alt+G", 0); } // OFFSET: 0x00964D50 @@ -936,7 +935,7 @@ void UIGuildTotalInfoWnd::Slot15(int, int) { this->AddChild(this->m_scrollBar); for (int index = 0; index < 12; ++index) { - this->m_rows[index] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_rows[index] = new UIStaticText(*this->m_context); this->m_rows[index]->SetSize(g_guildBanishedColumnWidths[0] - 4, 15); this->m_rows[index]->SetTextFitted(""); this->m_rows[index]->Move(8, index * g_guildTotalInfoRowHeight + 63); @@ -966,13 +965,13 @@ void UIGuildBanishedMemberWnd::Slot15(int, int) { this->AddChild(this->m_scrollBar); for (int index = 0; index < 11; ++index) { - this->m_names[index] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_names[index] = new UIStaticText(*this->m_context); this->m_names[index]->SetSize(g_guildBanishedColumnWidths[0] - 4, 15); this->m_names[index]->SetTextFitted(""); this->m_names[index]->Move(8, index * g_guildBanishedRowHeight + 63); this->AddChild(this->m_names[index]); - this->m_reasons[index] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_reasons[index] = new UIStaticText(*this->m_context); this->m_reasons[index]->SetSize(g_guildBanishedColumnWidths[1] - 4, 15); this->m_reasons[index]->SetTextFitted(""); this->m_reasons[index]->Move(g_guildMemberColumnWidths[0] + 58, index * g_guildBanishedRowHeight + 63); @@ -1001,7 +1000,7 @@ void UIGuildInfoManageWnd::Slot15(int, int) { { const std::string prefix("유저인터페이스\\"); - this->m_editButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_editButton = new UIBitmapButton(*this->m_context); this->m_editButton->SetBitmap((prefix + "btn_edit" + ".bmp").c_str(), 0, 0); this->m_editButton->SetBitmap((prefix + "btn_edit_a" + ".bmp").c_str(), 1, 0); this->m_editButton->SetBitmap((prefix + "btn_edit_b" + ".bmp").c_str(), 2, 0); @@ -1014,7 +1013,7 @@ void UIGuildInfoManageWnd::Slot15(int, int) { this->m_editButton->SetId(278); this->AddChild(this->m_editButton); - this->m_disbandButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_disbandButton = new UIBitmapButton(*this->m_context); this->m_disbandButton->SetBitmap("유저인터페이스\\btn_disBand.bmp", 0, 0); this->m_disbandButton->SetBitmap("유저인터페이스\\btn_disBand_a.bmp", 1, 0); this->m_disbandButton->SetBitmap("유저인터페이스\\btn_disBand_b.bmp", 2, 0); @@ -1155,7 +1154,6 @@ void UIGuildNoticeWnd::Paint() { UIGuildWnd::Paint(); char label[64]; std::sprintf(label, "%s:", LookupMessage(515)); - auto& controls = *this->m_controls; this->DrawTextAt(5, 67, label, 0, 0, 12, 0, 0, 0); this->DrawTextAt(5, 86, LookupMessage(516), 0, 0, 12, 0, 0, 0); this->DrawRightAlignedText(this->geometry.width - 7, 266, FormatOwnedString("[%d/%d]", this->m_bodyEdit->Length(), 119).c_str(), 0, 0, 12, 0, 0); @@ -1314,7 +1312,6 @@ void UIGuildMemberManageWnd::Slot25(int x, int y) { // FUNCTION: fn_13077 void UIGuildSkillWnd::Paint() { UIGuildWnd::Paint(); - auto& controls = *this->m_controls; int drawn = 0; int index = 0; for (auto skill = this->m_skills.begin(); skill != this->m_skills.end(); ++skill, ++index) { @@ -1421,7 +1418,6 @@ void UIGuildPositionManageWnd::Paint() { headers[3] = LookupMessage(513); headers[4] = LookupMessage(2499); headers[5] = LookupMessage(514); - auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 6; ++column) { this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); @@ -1515,7 +1511,6 @@ void UIGuildPositionManageWnd::Paint() { // FUNCTION: fn_13072 void UIGuildInfoManageWnd::Paint() { UIGuildWnd::Paint(); - auto& controls = *this->m_controls; GuildInfo& guild = g_guildInfo; char text[1024]; std::sprintf(text, "%s : %s", LookupMessage(328), guild.unknown_0000.c_str()); @@ -1672,7 +1667,6 @@ void UIGuildTotalInfoWnd::Paint() { headers[1] = LookupMessage(518); headers[2] = LookupMessage(519); headers[3] = LookupMessage(520); - auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 4; ++column) { this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); @@ -1725,25 +1719,25 @@ void UIGuildMemberManageWnd::Slot15(int, int) { this->m_rowSpacing += 8; for (int row = 0; row < 6; ++row) { - this->m_rowTexts[1][row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_rowTexts[1][row] = new UIStaticText(*this->m_context); this->m_rowTexts[1][row]->SetSize(g_guildMemberColumnWidths[0] / 2 + 2, 15); this->m_rowTexts[1][row]->SetTextFitted(""); this->m_rowTexts[1][row]->Move(8, (this->m_rowSpacing + 36) * row + 63); this->AddChild(this->m_rowTexts[1][row]); - this->m_rowTexts[2][row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_rowTexts[2][row] = new UIStaticText(*this->m_context); this->m_rowTexts[2][row]->SetSize(g_guildMemberColumnWidths[1] - 16, 15); this->m_rowTexts[2][row]->SetTextFitted(""); this->m_rowTexts[2][row]->Move(g_guildMemberColumnWidths[0] + 8, (this->m_rowSpacing + 36) * row + 63); this->AddChild(this->m_rowTexts[2][row]); - this->m_rowTexts[3][row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_rowTexts[3][row] = new UIStaticText(*this->m_context); this->m_rowTexts[3][row]->SetSize(39, 15); this->m_rowTexts[3][row]->SetTextFitted(""); this->m_rowTexts[3][row]->Move(g_guildMemberColumnWidths[0] + 58, (this->m_rowSpacing + 36) * row + 63); this->AddChild(this->m_rowTexts[3][row]); - this->m_rowTexts[0][row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_rowTexts[0][row] = new UIStaticText(*this->m_context); this->m_rowTexts[0][row]->SetSize(39, 15); this->m_rowTexts[0][row]->SetTextFitted(""); this->m_rowTexts[0][row]->Move(g_guildMemberColumnWidths[0] + 101, (this->m_rowSpacing + 36) * row + 63); @@ -1754,7 +1748,7 @@ void UIGuildMemberManageWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\basic_interface\\"); UIBitmapButton** button = this->m_rowButtons; for (int y = 82; y < 298; y += 36, ++button) { - *button = new UIBitmapButton(*this->m_context, *this->m_controls); + *button = new UIBitmapButton(*this->m_context); (*button)->SetBitmap((prefix + "txtbox_btn_a" + ".bmp").c_str(), 0, 0); (*button)->SetBitmap((prefix + "txtbox_btn_b" + ".bmp").c_str(), 1, 0); (*button)->SetBitmap((prefix + "txtbox_btn_c" + ".bmp").c_str(), 2, 0); @@ -1773,7 +1767,7 @@ void UIGuildMemberManageWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); int x = this->geometry.width - 61; int y = this->geometry.height - 23; - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->m_button = button; button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); @@ -1790,7 +1784,7 @@ void UIGuildMemberManageWnd::Slot15(int, int) { this->m_message0 = 184; } - this->m_onlineCheck = new UICheckBox(*this->m_context, *this->m_controls); + this->m_onlineCheck = new UICheckBox(*this->m_context); this->m_onlineCheck->SetSize(240, 12); this->m_onlineCheck->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(2864)); this->m_onlineCheck->FitToText(); @@ -1864,7 +1858,6 @@ void UIGuildBanishedMemberWnd::Paint() { const char* headers[2]; headers[0] = LookupMessage(407); headers[1] = LookupMessage(462); - auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 2; ++column) { this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); @@ -2001,7 +1994,6 @@ bool UIGuildMemberManageWnd::DrawMember(GuildInfo::Member& member, int& index, i } else { lastLogin[0] = '\0'; } - auto& controls = *this->m_controls; this->DrawTextAt(8, y + 17, FormatOwnedString(LookupMessage(3012), lastLogin).c_str(), 0, 0, 11, 0x404040, 0, 0); return true; } @@ -2038,7 +2030,7 @@ void UIGuildNoticeWnd::Slot15(int, int) { this->m_bodyEdit->SetText(g_guildInfo.unknown_0048.c_str()); const std::string prefix("유저인터페이스\\"); - this->m_sendButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_sendButton = new UIBitmapButton(*this->m_context); this->m_sendButton->SetBitmap((prefix + "btn_send" + ".bmp").c_str(), 0, 0); this->m_sendButton->SetBitmap((prefix + "btn_send_a" + ".bmp").c_str(), 1, 0); this->m_sendButton->SetBitmap((prefix + "btn_send_b" + ".bmp").c_str(), 2, 0); @@ -2061,7 +2053,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s } else if (a1 == 277) { std::string body(this->m_bodyEdit->Text()); if (g_forbiddenWords.Contains(this->m_titleEdit->Text()) == true || g_forbiddenWords.Contains(body.c_str()) == true) { - this->m_controls->services.Confirm(LookupMessage(14), 0, 1, 0, "Message", 280, 120); + reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); } else { if (g_guildInfo.unknown_00B4) { g_modeMgr.gameMode->SendMsg(118, g_guildInfo.m_guildId, reinterpret_cast(this->m_titleEdit->Text()), reinterpret_cast(body.c_str()), 0); @@ -2253,14 +2245,14 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st // OFFSET: 0x00953F60 // FUNCTION: fn_13003 -UIGuildTipWnd::UIGuildTipWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIGuildTipWnd::UIGuildTipWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x00953FC0 // FUNCTION: fn_13004 -UIGuildTotalInfoWnd::UIGuildTotalInfoWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIGuildWnd(windows, controls) { +UIGuildTotalInfoWnd::UIGuildTotalInfoWnd(UIWindowContext& windows) + : UIGuildWnd(windows) { } // OFFSET: 0x00954120 @@ -2292,7 +2284,7 @@ void UIGuildSkillWnd::Slot15(int, int height) { UIBitmapButton** button = this->m_levelUpButtons; int* id = ids; for (int y = 45; y < 283; y += 34, ++button, ++id) { - *button = new UIBitmapButton(*this->m_context, *this->m_controls); + *button = new UIBitmapButton(*this->m_context); (*button)->SetBitmap(normal.c_str(), 0, 0); (*button)->SetBitmap(hover.c_str(), 1, 0); (*button)->SetBitmap(pressed.c_str(), 2, 0); @@ -2309,7 +2301,7 @@ void UIGuildSkillWnd::Slot15(int, int height) { UIBitmapButton** button = this->m_previousButtons; int* id = ids; for (int y = 58; y < 296; y += 34, ++button, ++id) { - *button = new UIBitmapButton(*this->m_context, *this->m_controls); + *button = new UIBitmapButton(*this->m_context); (*button)->SetBitmap(bitmap.c_str(), 0, 0); (*button)->SetBitmap(bitmap.c_str(), 1, 0); (*button)->SetBitmap(bitmap.c_str(), 2, 0); @@ -2326,7 +2318,7 @@ void UIGuildSkillWnd::Slot15(int, int height) { UIBitmapButton** button = this->m_nextButtons; int* id = ids; for (int y = 58; y < 296; y += 34, ++button, ++id) { - *button = new UIBitmapButton(*this->m_context, *this->m_controls); + *button = new UIBitmapButton(*this->m_context); (*button)->SetBitmap(bitmap.c_str(), 0, 0); (*button)->SetBitmap(bitmap.c_str(), 1, 0); (*button)->SetBitmap(bitmap.c_str(), 2, 0); @@ -2350,7 +2342,7 @@ void UIGuildSkillWnd::Slot15(int, int height) { }; UIBitmapButton** button = this->m_actionButtons; for (int index = 0; index < 2; ++index, ++button) { - *button = new UIBitmapButton(*this->m_context, *this->m_controls); + *button = new UIBitmapButton(*this->m_context); (*button)->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); (*button)->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); (*button)->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -2556,7 +2548,6 @@ void UIGuildMemberManageWnd::Paint() { headers[3] = LookupMessage(408); headers[4] = LookupMessage(506); headers[5] = LookupMessage(507); - auto& controls = *this->m_controls; int textX = 10; for (int column = 0; column < 6; ++column) { const char* header = headers[column]; @@ -2865,7 +2856,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->m_rowButtons[index]->Enable(enabled); } else { const std::string prefix("유저인터페이스\\basic_interface\\"); - this->m_rowButtons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_rowButtons[index] = new UIBitmapButton(*this->m_context); this->m_rowButtons[index]->SetBitmap((prefix + "txtbox_btn_a" + ".bmp").c_str(), 0, 0); this->m_rowButtons[index]->SetBitmap((prefix + "txtbox_btn_b" + ".bmp").c_str(), 1, 0); this->m_rowButtons[index]->SetBitmap((prefix + "txtbox_btn_c" + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/Guild/UIGuildWnd.h b/Source/UI/Guild/UIGuildWnd.h index f3d41201..be94793b 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 UIButtonContext; struct UIListBoxContext; struct GuildWndInfo; class ForbiddenWords; @@ -65,7 +64,7 @@ struct GuildWndNameEntry { class UIGuildWnd : public UIFrameWnd { public: - UIGuildWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildWnd(UIWindowContext& windows); void Slot11() override; void Paint() override; void Slot25(int x, int y) override; @@ -78,12 +77,12 @@ protected: /* 00B4 */ GuildWndInfo* m_saved; /* 00B8 */ UIStaticText* m_tabs[6]; - UIButtonContext* m_controls; + void* unknown_controls; }; class UIGuildBanishedMemberWnd : public UIGuildWnd { public: - UIGuildBanishedMemberWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildBanishedMemberWnd(UIWindowContext& windows); int Tab() override; void Slot15(int width, int height) override; void Paint() override; @@ -106,7 +105,7 @@ protected: class UIGuildInfoManageWnd : public UIGuildWnd { public: - UIGuildInfoManageWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildInfoManageWnd(UIWindowContext& windows); int Tab() override; void Slot15(int width, int height) override; void Slot19() override; @@ -136,7 +135,7 @@ protected: class UIGuildMemberManageWnd : public UIGuildWnd { public: - UIGuildMemberManageWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildMemberManageWnd(UIWindowContext& windows); int Tab() override; void Slot15(int width, int height) override; void Slot19() override; @@ -175,7 +174,7 @@ protected: class UIGuildNoticeWnd : public UIGuildWnd { public: - UIGuildNoticeWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildNoticeWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Paint() override; void Slot25(int x, int y) override; @@ -189,7 +188,7 @@ protected: class UIGuildPositionManageWnd : public UIGuildWnd { public: - UIGuildPositionManageWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildPositionManageWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Slot19() override; void Paint() override; @@ -225,7 +224,7 @@ protected: class UIGuildSkillWnd : public UIGuildWnd { public: - UIGuildSkillWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildSkillWnd(UIWindowContext& windows); int Tab() override; void Slot15(int width, int height) override; void Paint() override; @@ -259,7 +258,7 @@ protected: class UIGuildTotalInfoWnd : public UIGuildWnd { public: - UIGuildTotalInfoWnd(UIWindowContext& windows, UIButtonContext& controls); + UIGuildTotalInfoWnd(UIWindowContext& windows); int Tab() override; void Slot15(int width, int height) override; void Paint() override; diff --git a/Source/UI/Guild/UIGuild_Storage_Log.h b/Source/UI/Guild/UIGuild_Storage_Log.h index 13ce5e3d..53d160c6 100644 --- a/Source/UI/Guild/UIGuild_Storage_Log.h +++ b/Source/UI/Guild/UIGuild_Storage_Log.h @@ -7,7 +7,6 @@ #include #include -struct UIButtonContext; class UIStaticText; class UITabControl; @@ -51,7 +50,7 @@ protected: /* 0184 */ std::uint32_t* unknown_0184; /* 0188 */ std::uint32_t* unknown_0188; /* 018C */ std::uint32_t* unknown_018C; - UIButtonContext* m_controls; + void* unknown_controls; void FillRows(); }; diff --git a/Source/UI/Item/UIItemBaseWnd.h b/Source/UI/Item/UIItemBaseWnd.h index e040c380..58827b42 100644 --- a/Source/UI/Item/UIItemBaseWnd.h +++ b/Source/UI/Item/UIItemBaseWnd.h @@ -7,7 +7,6 @@ #include #include -struct UIButtonContext; class UIItemBaseWnd : public UIFrameWnd { public: @@ -32,7 +31,7 @@ public: /* 00C4 */ UIWindow* buttons[2]; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00D8 */ int scroll; diff --git a/Source/UI/Item/UIMerchantItemLogWnd.cpp b/Source/UI/Item/UIMerchantItemLogWnd.cpp index d746e4ed..05956433 100644 --- a/Source/UI/Item/UIMerchantItemLogWnd.cpp +++ b/Source/UI/Item/UIMerchantItemLogWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/Item/UIMerchantItemLogWnd.h" #include "Client/Mode/ModeTooltip.h" @@ -36,7 +37,7 @@ UIMerchantItemLogWnd::UIMerchantItemLogWnd(UIWindowContext& windows, int mode) : // OFFSET: 0x0099E510 // FUNCTION: fn_13575 void UIMerchantItemLogWnd::Slot15(int width, int height) { - UIStaticText* title = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize(160, 15); title->SetText(LookupMessage(2559 + (this->unknown_00FC != 0)), 0); title->Move(16, 2); @@ -57,7 +58,7 @@ void UIMerchantItemLogWnd::Slot15(int width, int height) { scrollBar->Configure(this->geometry.width - 15, 14, 1, this->geometry.height - 38); this->AddChild(scrollBar); - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->buttons[0] = button; button->SetBitmap("유저인터페이스\\btn_close.bmp", 0, 0); button->SetBitmap("유저인터페이스\\btn_close_a.bmp", 1, 0); @@ -74,7 +75,6 @@ void UIMerchantItemLogWnd::Slot15(int width, int height) { // OFFSET: 0x0099E7A0 // FUNCTION: fn_13576 void UIMerchantItemLogWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -82,7 +82,7 @@ void UIMerchantItemLogWnd::Paint() { } unsigned red, green, blue; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(0, 17, this->geometry.width, this->geometry.height - 38, RGB(red, green, blue)); int rows = (this->geometry.height - 38) / 8 + ((this->geometry.height - 38) % 8 != 0); @@ -121,7 +121,7 @@ void UIMerchantItemLogWnd::Paint() { const int top = visible / this->columns * 32; const int x = visible % this->columns * 32 + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); if (it->unknown_0088 > 0) { this->DrawBitmap( diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 92af52a3..4bbfd597 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/Item/UIParaItemShopWnd.h" #include "Client/Input/InputCharset.h" @@ -229,12 +230,12 @@ void __stdcall Nullsub344(int, int) { // OFFSET: 0x009A83C0 // FUNCTION: fn_13750 void UIParaResultWnd::Slot15(int width, int height) { - this->total = new UIStaticText(*this->m_context, *this->m_controls); + this->total = new UIStaticText(*this->m_context); this->total->SetSize(160, 15); this->total->Move(12, this->geometry.height - 21); this->AddChild(this->total); - this->title = new UIStaticText(*this->m_context, *this->m_controls); + this->title = new UIStaticText(*this->m_context); this->title->SetSize(70, 15); this->title->SetText(LookupMessage(2530), 0); this->title->Move(16, 2); @@ -259,7 +260,7 @@ void UIParaResultWnd::Slot15(int width, int height) { const std::string prefix = "유저인터페이스\\"; const int x = this->geometry.width - 61; const int y = this->geometry.height - 24; - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->buttons[0] = button; button->SetBitmap((prefix + "btn_ok.bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a.bmp").c_str(), 1, 0); @@ -674,7 +675,6 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std // OFFSET: 0x009A8820 // FUNCTION: fn_13751 void UIParaItemShopWnd::Paint() { - UIButtonContext& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); if (titleHeight == this->geometry.height) { return; @@ -682,7 +682,7 @@ void UIParaItemShopWnd::Paint() { const int barHeight = this->DrawButtonBar(this->unknown_00B8 == 1 ? 2 : 0, 0, 1); unsigned red = 0xFF, green = 0xFF, blue = 0xFF; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); const int height = this->geometry.height - barHeight - titleHeight; this->FillRegion(0, titleHeight, this->geometry.width, height, RGB(red, green, blue)); @@ -728,14 +728,14 @@ void UIParaItemShopWnd::Paint() { const int top = visible * 32 + titleHeight; if (this->hovered == index) { unsigned hoverRed = 0xFF, hoverGreen = 0xFF, hoverBlue = 0xFF; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(72, top + 2, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } if (this->unknown_00F8 == 1 || it->quantity != 0) { - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, 34, top + 4, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, 34, top + 4, *it, 0, 0); } else { - DrawItemWithQuantityAuxiliary(*this, descriptions, controls.fonts, controls.locale, 1, 34, top + 4, *it, 0, 0); + DrawItemWithQuantityAuxiliary(*this, descriptions, g_fontCache, this->m_context->locale, 1, 34, top + 4, *it, 0, 0); } this->DrawWrappedItemName(70, top + 12, 120, &*it, 0, 0, 12); @@ -797,7 +797,6 @@ void UIParaItemShopWnd::Paint() { // OFFSET: 0x009A90E0 // FUNCTION: fn_13752 void UIParaResultWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -818,7 +817,7 @@ void UIParaResultWnd::Paint() { { unsigned red = 0, green = 0, blue = 0; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); const int listHeight = this->geometry.height - this->unknown_00FC - 17; this->FillRegion(20, 17, (this->geometry.width - 60) % 32, listHeight, RGB(red, green, blue)); this->FillRegion(20, listHeight / 32 * 32 + 17, this->geometry.width - 24, listHeight % 32, RGB(red, green, blue)); @@ -833,7 +832,7 @@ void UIParaResultWnd::Paint() { { unsigned red = 0, green = 0, blue = 0; - SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); + SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(72, 17, columns * 32 - 32, slots * 32, RGB(red, green, blue)); } @@ -854,12 +853,12 @@ void UIParaResultWnd::Paint() { const int top = visible / this->columns * 32; if (this->unknown_00F8 == index) { unsigned hoverRed = 0, hoverGreen = 0, hoverBlue = 0; - SkinPaletteChannels(controls.resources, 6, 2, hoverRed, hoverGreen, hoverBlue); + SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(column + 72, top + 19, 191, 28, RGB(hoverRed, hoverGreen, hoverBlue)); } const int x = column + 44; - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, top + 21, *it, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, top + 21, *it, 0, 0); this->DrawWrappedItemName(column + 76, top + 29, 110, &*it, 0, 0, 12); if (it->unknown_0088 > 0) { diff --git a/Source/UI/Items/MergeItemWnd.cpp b/Source/UI/Items/MergeItemWnd.cpp index 3439e12b..ebb2d1c7 100644 --- a/Source/UI/Items/MergeItemWnd.cpp +++ b/Source/UI/Items/MergeItemWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/Items/MergeItemWnd.h" #include "Client/Input/InputCharset.h" @@ -89,7 +90,7 @@ int CMergeItemWnd::ItemIdOf(int id) { // OFFSET: 0x007DF580 // FUNCTION: fn_09664 void CMergeItemWnd::CreateControls() { - this->m_mergeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_mergeButton = new UIBitmapButton(*this->m_context); this->m_mergeButton->SetBitmap("유저인터페이스\\btn_ok.bmp", 0, 0); this->m_mergeButton->SetBitmap("유저인터페이스\\btn_ok_a.bmp", 1, 0); this->m_mergeButton->SetBitmap("유저인터페이스\\btn_ok_b.bmp", 2, 0); @@ -97,7 +98,7 @@ void CMergeItemWnd::CreateControls() { this->m_mergeButton->SetId(184); this->AddChild(this->m_mergeButton); - this->m_cancelButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_cancelButton = new UIBitmapButton(*this->m_context); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel.bmp", 0, 0); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel_a.bmp", 1, 0); this->m_cancelButton->SetBitmap("유저인터페이스\\btn_cancel_b.bmp", 2, 0); @@ -105,7 +106,7 @@ void CMergeItemWnd::CreateControls() { this->m_cancelButton->SetId(185); this->AddChild(this->m_cancelButton); - this->m_closeButton = this->AddCloseButton(*this->m_controls, "", 240); + this->m_closeButton = this->AddCloseButton("", 240); this->m_resizer = new UIResizer(*this->m_context); this->m_resizer->SetSize(16, 16); @@ -129,7 +130,6 @@ void CMergeItemWnd::Slot15(int, int) { // OFFSET: 0x007DF850 // FUNCTION: fn_09666 void CMergeItemWnd::Paint() { - auto& controls = *this->m_controls; unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->DrawTitleBar(true, LookupMessage(2169), 0); @@ -161,7 +161,7 @@ void CMergeItemWnd::Paint() { box->Move(this->m_checkOffsetX + x, this->m_checkOffsetY + y); ItemDescriptions descriptions{g_itemDescriptions}; DrawItemWithQuantity( - *this, controls.resources, descriptions, controls.fonts, controls.locale, this->m_slotOffsetX + x, this->m_slotOffsetY + y, item, 0, 0 + *this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, this->m_slotOffsetX + x, this->m_slotOffsetY + y, item, 0, 0 ); } } @@ -359,7 +359,7 @@ int CMergeItemWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std: this->m_itemCount = argument2; const std::int16_t* ids = reinterpret_cast(argument1); for (int index = 0; index < this->m_itemCount; ++index) { - UICheckBox* box = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* box = new UICheckBox(*this->m_context); box->SetSize(120, 12); box->SetBitmaps("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp"); box->m_message = ids[index]; diff --git a/Source/UI/Items/MergeItemWnd.h b/Source/UI/Items/MergeItemWnd.h index 2003c43c..0c052752 100644 --- a/Source/UI/Items/MergeItemWnd.h +++ b/Source/UI/Items/MergeItemWnd.h @@ -10,7 +10,6 @@ class UIBitmapButton; class UICheckBox; class UIResizer; class UIScrollBar; -struct UIButtonContext; class CMergeItemWnd : public UIFrameWnd { public: @@ -57,7 +56,7 @@ public: /* 0114 */ int m_scrollable; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Items/UICardItemIllustWnd.h b/Source/UI/Items/UICardItemIllustWnd.h index 8e5f1ae6..24e21664 100644 --- a/Source/UI/Items/UICardItemIllustWnd.h +++ b/Source/UI/Items/UICardItemIllustWnd.h @@ -5,11 +5,10 @@ #include -struct UIButtonContext; class UICardItemIllustWnd : public UIFrameWnd { public: - UICardItemIllustWnd(UIWindowContext& windows, UIButtonContext& controls); + UICardItemIllustWnd(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; @@ -19,7 +18,7 @@ public: /* 00E4 */ unsigned char unknown_00E4; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Items/UIIllustWnd.cpp b/Source/UI/Items/UIIllustWnd.cpp index 2d6fc9cf..fbb65a3a 100644 --- a/Source/UI/Items/UIIllustWnd.cpp +++ b/Source/UI/Items/UIIllustWnd.cpp @@ -116,7 +116,7 @@ int UIIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_titled = 1; return 0; } - this->AddCloseButton(*this->m_controls, "", 0)->Move(this->geometry.width - 16, 3); + this->AddCloseButton("", 0)->Move(this->geometry.width - 16, 3); this->m_closable = 1; this->Invalidate(); return 0; @@ -187,7 +187,7 @@ int UIMultiIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->m_closable = 0; return 0; } - this->AddCloseButton(*this->m_controls, "", 0)->Move(this->geometry.width - 16, 3); + this->AddCloseButton("", 0)->Move(this->geometry.width - 16, 3); this->m_closable = 1; this->Invalidate(); return 0; diff --git a/Source/UI/Items/UIIllustWnd.h b/Source/UI/Items/UIIllustWnd.h index 0fcf2dd5..b6178b7c 100644 --- a/Source/UI/Items/UIIllustWnd.h +++ b/Source/UI/Items/UIIllustWnd.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; class UIIllustWnd : public UIFrameWnd { public: @@ -21,7 +20,7 @@ protected: /* 00B4 */ int m_titled; /* 00B8 */ int m_closable; /* 00BC */ std::string m_bitmapName; - UIButtonContext* m_controls; + void* unknown_controls; }; class UIMultiIllustWnd : public UIFrameWnd { @@ -40,7 +39,7 @@ protected: /* 00B8 */ int m_closable; /* 00BC */ std::string m_bitmapName; /* 00D4 */ int m_state; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Items/UIItemParamChangeDisplayWnd.h b/Source/UI/Items/UIItemParamChangeDisplayWnd.h index d8e8346e..abe6d537 100644 --- a/Source/UI/Items/UIItemParamChangeDisplayWnd.h +++ b/Source/UI/Items/UIItemParamChangeDisplayWnd.h @@ -7,7 +7,6 @@ #include #include -struct UIButtonContext; struct WindowPlacement; class UIItemParamChangeDisplayWnd : public UIFrameWnd { @@ -35,7 +34,7 @@ public: void SumEquippedStats(); protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index b65143d1..4d6288ed 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "UI/Items/UIItemRepairWnd.h" #include "Client/Input/InputCharset.h" @@ -26,7 +27,6 @@ // OFFSET: 0x009A3860 // FUNCTION: fn_13609 void UIItemRepairWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(true, LookupMessage(812), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -35,7 +35,6 @@ void UIItemRepairWnd::Paint() { // OFFSET: 0x009A3B50 // FUNCTION: fn_13612 void UIMakeTargetResultWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -69,7 +68,7 @@ void UIItemRepairWnd::Slot15(int width, int height) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -99,7 +98,7 @@ void UIMakeTargetListWnd::Slot15(int width, int height) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -121,7 +120,7 @@ void UIMakeTargetProcessWnd::Slot15(int width, int height) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -139,7 +138,7 @@ void UIMakeTargetProcessWnd::Slot15(int width, int height) { void UIMakeTargetResultWnd::Slot15(int width, int height) { const std::string prefix("유저인터페이스\\"); - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -168,7 +167,7 @@ void UIWeaponRefineWnd::Slot15(int width, int height) { int ids[2] = {184, 185}; for (int i = 0; i < 2; ++i) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -310,7 +309,7 @@ int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x0099F780 // FUNCTION: fn_13587 -UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, +UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder) : UIFrameWnd(windows, 0), itemIds(), indices(), entries() { } @@ -318,7 +317,7 @@ UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIButtonContext& cont // OFFSET: 0x0099F850 // FUNCTION: fn_13588 UIMakeTargetListWnd::UIMakeTargetListWnd( - UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, WindowResponseRecorder& recorder + UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder ) : UIFrameWnd(windows, 0), itemIds() { } @@ -326,14 +325,14 @@ UIMakeTargetListWnd::UIMakeTargetListWnd( // OFFSET: 0x0099F8D0 // FUNCTION: fn_13589 UIMakeTargetProcessWnd::UIMakeTargetProcessWnd( - UIWindowContext& windows, UIButtonContext& controls, WindowResponseRecorder& recorder + UIWindowContext& windows, WindowResponseRecorder& recorder ) : UIFrameWnd(windows, 0), materials() { } // OFFSET: 0x0099F950 // FUNCTION: fn_13590 -UIMakeTargetResultWnd::UIMakeTargetResultWnd(UIWindowContext& windows, UIButtonContext& controls) +UIMakeTargetResultWnd::UIMakeTargetResultWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { this->succeeded = false; this->makeType = 0; @@ -342,7 +341,7 @@ UIMakeTargetResultWnd::UIMakeTargetResultWnd(UIWindowContext& windows, UIButtonC // OFFSET: 0x0099F9C0 // FUNCTION: fn_13591 UIWeaponRefineWnd::UIWeaponRefineWnd( - UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, WindowResponseRecorder& recorder + UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder ) : UIFrameWnd(windows, 0), itemIds(), indices() { } diff --git a/Source/UI/Items/UIItemRepairWnd.h b/Source/UI/Items/UIItemRepairWnd.h index 92f1bca3..c7e8e58f 100644 --- a/Source/UI/Items/UIItemRepairWnd.h +++ b/Source/UI/Items/UIItemRepairWnd.h @@ -7,7 +7,6 @@ #include #include -struct UIButtonContext; struct WindowResponseRecorder; struct UIListBoxContext; class UIListBox; @@ -24,7 +23,7 @@ static_assert(sizeof(UIItemRepairEntry) == 0x18); class UIItemRepairWnd : public UIFrameWnd { public: - UIItemRepairWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); ~UIItemRepairWnd() override; void Slot15(int width, int height) override; void Paint() override; @@ -32,7 +31,7 @@ public: std::vector BuildReplayRecords(); protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; public: diff --git a/Source/UI/Items/UIMakeTargetListWnd.cpp b/Source/UI/Items/UIMakeTargetListWnd.cpp index 1aebb9f8..2b2b8b88 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.cpp +++ b/Source/UI/Items/UIMakeTargetListWnd.cpp @@ -41,7 +41,6 @@ std::vector UIMakeTargetListWnd::BuildReplayRecords() { // OFFSET: 0x009A38A0 // FUNCTION: fn_13610 void UIMakeTargetListWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(true, LookupMessage(425), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); diff --git a/Source/UI/Items/UIMakeTargetListWnd.h b/Source/UI/Items/UIMakeTargetListWnd.h index 76b02dd0..17fc6468 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.h +++ b/Source/UI/Items/UIMakeTargetListWnd.h @@ -5,14 +5,13 @@ #include -struct UIButtonContext; struct WindowResponseRecorder; struct UIListBoxContext; class UIListBox; class UIMakeTargetListWnd : public UIFrameWnd { public: - UIMakeTargetListWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIMakeTargetListWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -21,7 +20,7 @@ public: /* 00B4 */ UIListBox* m_list; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; public: diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.cpp b/Source/UI/Items/UIMakeTargetProcessWnd.cpp index 285ac6ee..056bc522 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.cpp +++ b/Source/UI/Items/UIMakeTargetProcessWnd.cpp @@ -119,7 +119,6 @@ ITEM_INFO UIMakeTargetProcessWnd::GetItemAt(int x, int y) { // OFFSET: 0x009A38E0 // FUNCTION: fn_13611 void UIMakeTargetProcessWnd::Paint() { - UIButtonContext& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -140,7 +139,7 @@ void UIMakeTargetProcessWnd::Paint() { auto* bar = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\btnbar_right2.bmp"))); DrawItemSlotBackground(*this, x - 4, this->geometry.height - bar->image.height - 32); if (material->unknown_0000[1] != 0) { - DrawItemIcon(*this, controls.resources, descriptions, x, this->geometry.height - bar->image.height - 28, *material, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, x, this->geometry.height - bar->image.height - 28, *material, 0); } } break; diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.h b/Source/UI/Items/UIMakeTargetProcessWnd.h index 13fd5a74..aedcd578 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.h +++ b/Source/UI/Items/UIMakeTargetProcessWnd.h @@ -6,12 +6,11 @@ #include -struct UIButtonContext; struct WindowResponseRecorder; class UIMakeTargetProcessWnd : public UIFrameWnd { public: - UIMakeTargetProcessWnd(UIWindowContext& windows, UIButtonContext& controls, WindowResponseRecorder& recorder); + UIMakeTargetProcessWnd(UIWindowContext& windows, WindowResponseRecorder& recorder); void Paint() override; void Slot10(int x, int y, std::intptr_t value) override; void Slot15(int width, int height) override; @@ -24,7 +23,7 @@ public: /* 00B8 */ ITEM_INFO materials[3]; protected: - UIButtonContext* m_controls; + void* unknown_controls; WindowResponseRecorder* m_recorder; }; diff --git a/Source/UI/Items/UIMakeTargetResultWnd.h b/Source/UI/Items/UIMakeTargetResultWnd.h index 1f1729c1..917c9605 100644 --- a/Source/UI/Items/UIMakeTargetResultWnd.h +++ b/Source/UI/Items/UIMakeTargetResultWnd.h @@ -3,17 +3,16 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIMakeTargetResultWnd : public UIFrameWnd { public: - UIMakeTargetResultWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMakeTargetResultWnd(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; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ int makeType; diff --git a/Source/UI/Items/UISpellListWnd.h b/Source/UI/Items/UISpellListWnd.h index d3a77b78..42de3d8c 100644 --- a/Source/UI/Items/UISpellListWnd.h +++ b/Source/UI/Items/UISpellListWnd.h @@ -6,7 +6,6 @@ #include #include -struct UIButtonContext; class UISpellListWnd : public UIItemIdentifyWnd { public: @@ -19,7 +18,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Items/UISwapEquipmentWnd.cpp b/Source/UI/Items/UISwapEquipmentWnd.cpp index 45e9d790..e11861c6 100644 --- a/Source/UI/Items/UISwapEquipmentWnd.cpp +++ b/Source/UI/Items/UISwapEquipmentWnd.cpp @@ -288,7 +288,7 @@ ITEM_INFO UISwapEquipmentWnd::GetSlotItem(int slot) { // OFFSET: 0x00830760 // FUNCTION: fn_10394 void UISwapEquipmentWnd::Slot15(int width, int height) { - this->m_swapButton = new (std::nothrow) UISwapBitmapButton(*this->m_context, *this->m_controls); + this->m_swapButton = new (std::nothrow) UISwapBitmapButton(*this->m_context); this->m_swapButton->SetBitmap("유저인터페이스\\swap_equipment\\btn_change2_normal.bmp", 0, 0); this->m_swapButton->SetBitmap("유저인터페이스\\swap_equipment\\btn_change2_over.bmp", 1, 0); this->m_swapButton->SetBitmap("유저인터페이스\\swap_equipment\\btn_change2_press.bmp", 2, 0); @@ -301,7 +301,7 @@ void UISwapEquipmentWnd::Slot15(int width, int height) { this->m_swapButton->SetId(0x1FC); this->AddChild(this->m_swapButton); - UIBasicButton* close = new (std::nothrow) UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* close = new (std::nothrow) UIBasicButton(*this->m_context); close->Configure(0x32, LookupMessage(0xDA)); close->Move(0xE0, 0x9B); close->SetId(0xB9); diff --git a/Source/UI/Items/UISwapEquipmentWnd.h b/Source/UI/Items/UISwapEquipmentWnd.h index 3d920749..87244d27 100644 --- a/Source/UI/Items/UISwapEquipmentWnd.h +++ b/Source/UI/Items/UISwapEquipmentWnd.h @@ -7,7 +7,6 @@ #include struct ITEM_INFO; -struct UIButtonContext; extern unsigned long g_swapEquipmentTick; @@ -49,7 +48,7 @@ protected: /* 00D4 */ int unknown_00D4; /* 00D8 */ int unknown_00D8; /* 00DC */ int unknown_00DC; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Items/UIWeaponRefineWnd.cpp b/Source/UI/Items/UIWeaponRefineWnd.cpp index 43c6046e..1350d8fd 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.cpp +++ b/Source/UI/Items/UIWeaponRefineWnd.cpp @@ -42,7 +42,6 @@ std::vector UIWeaponRefineWnd::BuildReplayRecords() { // OFFSET: 0x009A3CD0 // FUNCTION: fn_13613 void UIWeaponRefineWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(true, LookupMessage(910), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); diff --git a/Source/UI/Items/UIWeaponRefineWnd.h b/Source/UI/Items/UIWeaponRefineWnd.h index bd8a613b..91a18828 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.h +++ b/Source/UI/Items/UIWeaponRefineWnd.h @@ -5,14 +5,13 @@ #include -struct UIButtonContext; struct WindowResponseRecorder; struct UIListBoxContext; class UIListBox; class UIWeaponRefineWnd : public UIFrameWnd { public: - UIWeaponRefineWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& listContext, WindowResponseRecorder& recorder); + UIWeaponRefineWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder); std::vector BuildReplayRecords(); void Slot15(int width, int height) override; void Paint() override; @@ -21,7 +20,7 @@ public: /* 00B4 */ UIListBox* m_list; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; public: diff --git a/Source/UI/Lists/UIComboBoxDefWnd.cpp b/Source/UI/Lists/UIComboBoxDefWnd.cpp index 215a0709..f44cb59c 100644 --- a/Source/UI/Lists/UIComboBoxDefWnd.cpp +++ b/Source/UI/Lists/UIComboBoxDefWnd.cpp @@ -1,10 +1,11 @@ +#include "Client/Replay.h" +#include "UI/Window/WindowPolicy.h" #include "Render/DeviceContext/DeviceContext.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Lists/UIComboBoxDefWnd.h" #include "UI/Lists/UIItemStoreComboBox.h" #include "UI/Lists/UIListBox.h" #include "UI/Text/UIStaticText.h" -#include "UI/Window/WindowPolicy.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Lists/UIComboBoxWnd.h" #include @@ -46,8 +47,7 @@ UIComboBoxDefWnd::~UIComboBoxDefWnd() = default; // OFFSET: 0x00885920 // FUNCTION: fn_11319 void UIComboBoxDefWnd::Slot15(int, int) { - auto& controls = this->m_controls->buttons; - this->button = new UIBitmapButton(*this->m_context, controls); + this->button = new UIBitmapButton(*this->m_context); const char* names[] = {"txtbox_btn_a.bmp", "txtbox_btn_b.bmp", "txtbox_btn_c.bmp"}; for (int state = 0; state < 3; ++state) { @@ -64,7 +64,7 @@ void UIComboBoxDefWnd::Slot15(int, int) { this->list->Move(0, this->button->BitmapHeight()); this->AddChild(this->list); - this->label = new UIStaticText(*this->m_context, controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize((this->geometry.width - this->button->BitmapWidth()), this->button->BitmapHeight()); this->label->SetText("(NO SELECT)", 0); this->label->Move(2, 3); @@ -78,9 +78,8 @@ void UIComboBox_BmpWnd::Create(int width, int height, const char* path, const ch UIWindow::Resize(width, height); this->name = name; const std::string base(path); - auto& controls = this->m_controls->buttons; - this->button = new UIBitmapButton(*this->m_context, controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((base + "_out.bmp").c_str(), 0, 0); this->button->SetBitmap((base + "_over.bmp").c_str(), 1, 0); this->button->SetBitmap((base + "_press.bmp").c_str(), 2, 0); @@ -96,7 +95,7 @@ void UIComboBox_BmpWnd::Create(int width, int height, const char* path, const ch char text[12] = {}; std::sprintf(text, "(NO SELECT)"); - this->label = new UIStaticText(*this->m_context, controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize((this->geometry.width - this->button->BitmapWidth()), this->button->BitmapHeight()); this->label->SetText(text, 0); this->label->Move(2, 3); @@ -190,7 +189,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st return 0; case 39: - if (WindowPolicy(this->m_controls->buttons.policy, this->m_controls->buttons.restricted, 3, this->parent->geometry.id) == 0 || + if (WindowPolicy(g_windowMgr.policy[0].actions, g_replayAnimationScaling != 0, 3, this->parent->geometry.id) == 0 || value < 0) { return 0; } @@ -268,10 +267,9 @@ UIComboBoxDef2Wnd::~UIComboBoxDef2Wnd() = default; // OFFSET: 0x00885250 // FUNCTION: fn_11318 void UIComboBoxDef2Wnd::Slot15(int width, int) { - auto& controls = this->m_controls->buttons; const std::string path = std::string(prefix) + (this->skin == 1 ? "login_interface\\" : "UIadventurerAgency\\"); - this->button = new UIBitmapButton(*this->m_context, controls); + this->button = new UIBitmapButton(*this->m_context); const char* names[] = {"btn_dropdown_out.bmp", "btn_dropdown_over.bmp", "btn_dropdown_press.bmp"}; for (int state = 0; state < 3; ++state) { @@ -290,7 +288,7 @@ void UIComboBoxDef2Wnd::Slot15(int width, int) { list->Move(0, this->button->BitmapHeight()); this->AddChild(list); - this->label = new UIStaticText(*this->m_context, controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize((this->geometry.width - this->button->BitmapWidth()), (this->button->BitmapHeight() - 6)); this->label->SetText("", 0); int x = 0; @@ -318,7 +316,6 @@ void UIComboBoxDef2Wnd::Paint() { return; } - auto& controls = this->m_controls->buttons; const int width = this->TextWidth(this->label->text.c_str(), 0, 0, 12, 0, 0); const int x = static_cast(static_cast(this->geometry.width) * 0.5f - static_cast(width) * 0.5f); @@ -333,7 +330,7 @@ void UIComboBoxDef2Wnd::Paint() { // FUNCTION: fn_11329 void UINewComboBoxCtrl::Slot15(int, int) { const std::string base = "유저인터페이스\\basic_interface\\txtbox_btn_"; - this->button = new UIBitmapButton(*this->m_context, *this->m_buttons); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((base + "a.bmp").c_str(), 0, 0); this->button->SetBitmap((base + "b.bmp").c_str(), 1, 0); this->button->SetBitmap((base + "c.bmp").c_str(), 2, 0); @@ -342,7 +339,7 @@ void UINewComboBoxCtrl::Slot15(int, int) { this->button->SetId(273); this->AddChild(this->button); - this->label = new UIStaticText(*this->m_context, *this->m_buttons); + this->label = new UIStaticText(*this->m_context); this->label->SetSize((this->geometry.width - this->button->BitmapWidth()), this->button->BitmapHeight()); this->label->SetText("(No Select)", 0); this->label->Move(2, 3); diff --git a/Source/UI/Lists/UIComboBoxDefWnd.h b/Source/UI/Lists/UIComboBoxDefWnd.h index c20ace4f..e5f1d9c8 100644 --- a/Source/UI/Lists/UIComboBoxDefWnd.h +++ b/Source/UI/Lists/UIComboBoxDefWnd.h @@ -6,11 +6,9 @@ class UIBitmapButton; class UIStaticText; -struct UIButtonContext; struct UIComboBoxHeaderContext { UIComboBoxContext& combo; - UIButtonContext& buttons; }; class UIComboBoxDefWnd : public UIWindow { @@ -56,7 +54,7 @@ public: /* 0080 */ UIStaticText* label; protected: - UIButtonContext* m_buttons; + void* unknown_buttons; public: /* 0084 */ unsigned char borderless; diff --git a/Source/UI/Lists/UIItemStoreComboBox.cpp b/Source/UI/Lists/UIItemStoreComboBox.cpp index 32a4b230..f7324edd 100644 --- a/Source/UI/Lists/UIItemStoreComboBox.cpp +++ b/Source/UI/Lists/UIItemStoreComboBox.cpp @@ -19,8 +19,7 @@ void UIItemStoreComboBoxWnd::Slot15(int, int) { const char* pressed = this->pink == 1 ? "combo_btn_pink_b" : "combo_btn_b"; const char* disabled = this->pink == 1 ? "combo_btn_pink_c" : "combo_btn_c"; - auto& controls = this->m_controls->buttons; - this->button = new UIBitmapButton(*this->m_context, controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((path + "combo_btn_a" + ".bmp").c_str(), 0, 0); this->button->SetBitmap((path + pressed + ".bmp").c_str(), 1, 0); this->button->SetBitmap((path + disabled + ".bmp").c_str(), 2, 0); @@ -39,7 +38,7 @@ void UIItemStoreComboBoxWnd::Slot15(int, int) { char text[12] = {}; std::sprintf(text, "(NO SELECT)"); - this->label = new UIStaticText(*this->m_context, controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize(this->geometry.width - this->button->BitmapWidth(), this->button->BitmapHeight()); this->label->SetText(text, 0); this->label->Move(2, 3); diff --git a/Source/UI/Lists/UIListBox.h b/Source/UI/Lists/UIListBox.h index 9ced52c1..7e928217 100644 --- a/Source/UI/Lists/UIListBox.h +++ b/Source/UI/Lists/UIListBox.h @@ -11,7 +11,6 @@ class ResourceMgr; class UIScrollBar; #include "UI/Window/WindowManagerWindows.h" class NavigationDestination; -struct UIButtonContext; struct UIListBoxContext { FrameFocus& capture; @@ -20,7 +19,6 @@ struct UIListBoxContext { const TextLocale& locale; const unsigned short& codePage; WindowManagerWindows& windows; - UIButtonContext& buttons; NavigationDestination& navigation; }; diff --git a/Source/UI/Lists/UIMemberListBox.h b/Source/UI/Lists/UIMemberListBox.h index cc9ea295..b50a3d6d 100644 --- a/Source/UI/Lists/UIMemberListBox.h +++ b/Source/UI/Lists/UIMemberListBox.h @@ -3,7 +3,6 @@ #include "UI/Lists/UIChatHisBox.h" -struct UIButtonContext; class UIChatHisBox2 : public UIChatHisBox { public: @@ -42,7 +41,7 @@ public: void Slot33(int x, int y) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 261b2a44..141f734c 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/ModeCursor.h" #include "Render/DeviceContext/DeviceContext.h" @@ -438,8 +439,8 @@ int UIImgMenu::ItemAt(int x, int y) { // OFFSET: 0x0086ECF0 // FUNCTION: fn_11083 -UITabControl::UITabControl(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), unknown_00E8(12), flags(), m_controls(&controls) { +UITabControl::UITabControl(UIWindowContext& windows) + : UIWindow(windows, 0), unknown_00E8(12), flags() { this->unknown_007C = -1; this->dragX = 0; this->dragY = 0; @@ -653,8 +654,8 @@ void UIEditCtrl_Custom::PaintText() { int x = this->unknown_0120 + 3; const int y = this->unknown_0124 + this->textY; std::string display; - FontCache& fonts = this->m_edit->buttons.fonts; - const TextLocale& locale = this->m_edit->buttons.locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; const auto align = [&]() { if (this->unknown_0128 == 1) { x = this->geometry.width - x - this->TextWidth(display.c_str(), 0, 0, 12, this->unknown_011C, 0); @@ -736,8 +737,8 @@ void UIBasicItemCtrl::DrawItemIcon(int x, int y, int, bool compact) { } const std::string count = FormatOwnedString("%d", this->m_item.quantity); - FontCache& fonts = this->m_controls->fonts; - const TextLocale& locale = this->m_controls->locale; + FontCache& fonts = g_fontCache; + const TextLocale& locale = this->m_context->locale; int textY; if (compact) { textY = y + 20; @@ -1868,7 +1869,7 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou break; } - UIItemTagButton* button = new (std::nothrow) UIItemTagButton(*this->m_context, this->m_listContext->buttons); + UIItemTagButton* button = new (std::nothrow) UIItemTagButton(*this->m_context); if (button) { std::memcpy(button->unknown_00F8, &item, sizeof(item)); button->Configure(label.c_str(), 0x82F2E1, 0, 12, 0, 0); @@ -1962,7 +1963,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->buttons, this->m_listContext->navigation); + UINaviLinkButton* button = new (std::nothrow) UINaviLinkButton(*this->m_context, this->m_listContext->navigation); if (button) { button->link = link; button->Configure(label.c_str(), 0x82F2E1, 0, 12, 0, 0); diff --git a/Source/UI/Lists/UITabControl.h b/Source/UI/Lists/UITabControl.h index 89f600a4..89317859 100644 --- a/Source/UI/Lists/UITabControl.h +++ b/Source/UI/Lists/UITabControl.h @@ -6,12 +6,11 @@ #include #include -struct UIButtonContext; class UIEditCtrl; class UITabControl : public UIWindow { public: - UITabControl(UIWindowContext& windows, UIButtonContext& controls); + UITabControl(UIWindowContext& windows); int TabCount(); int TabAt(int x, int y); void FillTab(int index, int x, int y, int width, int height, std::uint32_t color); @@ -65,7 +64,7 @@ public: /* 00EC */ std::vector flags; private: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Lists/UITagListBox.cpp b/Source/UI/Lists/UITagListBox.cpp index b82049e6..8fb68bd1 100644 --- a/Source/UI/Lists/UITagListBox.cpp +++ b/Source/UI/Lists/UITagListBox.cpp @@ -666,7 +666,7 @@ void UITagListBox::AddTagButton(STagInfoV2 tag, int lineCount) { return; } - UITagButton* button = new UITagButton(*this->m_context, this->m_listContext->buttons); + UITagButton* button = new UITagButton(*this->m_context); button->Configure(tag.unknown_0010.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; button->ResizeToTextClipped( diff --git a/Source/UI/Lists/UITreeView.cpp b/Source/UI/Lists/UITreeView.cpp index 3824f88a..8df13410 100644 --- a/Source/UI/Lists/UITreeView.cpp +++ b/Source/UI/Lists/UITreeView.cpp @@ -2,7 +2,7 @@ // OFFSET: 0x0086F180 // FUNCTION: fn_11087 -UITreeView::UITreeView(UIWindowContext& windows, UIEditContext& edit, UIButtonContext& controls) : UIWindow(windows, 0), m_edit(&edit), m_controls(&controls) { +UITreeView::UITreeView(UIWindowContext& windows, UIEditContext& edit) : UIWindow(windows, 0), m_edit(&edit) { this->itemPadding = 5; this->itemHeight = 20; this->itemCount = 0; diff --git a/Source/UI/Lists/UITreeView.h b/Source/UI/Lists/UITreeView.h index 60e3a93a..2b26c62d 100644 --- a/Source/UI/Lists/UITreeView.h +++ b/Source/UI/Lists/UITreeView.h @@ -12,7 +12,6 @@ class UIEditCtrl2; struct UIEditContext; class UITVBitmapButton; class UITVTextButton; -struct UIButtonContext; struct UITreeNode { /* 0000 */ int id; @@ -38,7 +37,7 @@ static_assert(offsetof(UITreeNode, children) == 0x180); class UITreeView : public UIWindow { public: - UITreeView(UIWindowContext& windows, UIEditContext& edit, UIButtonContext& controls); + UITreeView(UIWindowContext& windows, UIEditContext& edit); void Resize(int width, int height) override; void Slot15(int width, int height) override; void Paint() override; @@ -72,7 +71,7 @@ protected: /* 00AC */ unsigned char unknown_00AC; UIEditContext* m_edit; - UIButtonContext* m_controls; + void* unknown_controls; /* 00B0 */ int unknown_00B0; }; diff --git a/Source/UI/Navigation/UINavigationV4Wnd.cpp b/Source/UI/Navigation/UINavigationV4Wnd.cpp index 29bef9b3..40f4e13d 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, UIButtonContext& controls, UIListBoxContext& lists) - : UIFrameWnd(windows, 0), m_controls(&controls), m_listContext(&lists) { +UINavigationRuideWnd::UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists) + : UIFrameWnd(windows, 0), m_listContext(&lists) { } // OFFSET: 0x005C28C0 @@ -16,6 +16,6 @@ UINavigationV4Wnd::UINavigationV4Wnd(UIWindowContext& windows) : UIFrameWnd(wind // OFFSET: 0x005C2960 // FUNCTION: fn_03538 -UINavigationroadiconWnd::UINavigationroadiconWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UINavigationroadiconWnd::UINavigationroadiconWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } diff --git a/Source/UI/Navigation/UINavigationV4Wnd.h b/Source/UI/Navigation/UINavigationV4Wnd.h index ec0cb9ef..628efa35 100644 --- a/Source/UI/Navigation/UINavigationV4Wnd.h +++ b/Source/UI/Navigation/UINavigationV4Wnd.h @@ -12,7 +12,6 @@ class CTexture; class UIListBox_NaviSearch; struct UIListBoxContext; class UIStaticText; -struct UIButtonContext; struct NavigationWindowInfo { /* 0000 */ int x; @@ -75,7 +74,7 @@ public: /* 0114 */ int unknown_0114; /* 0118 */ int unknown_0118; /* 011C */ int unknown_011C; - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; }; @@ -83,7 +82,7 @@ class UIStaticBitmap; class UINavigationroadiconWnd : public UIFrameWnd { public: - UINavigationroadiconWnd(UIWindowContext& windows, UIButtonContext& controls); + UINavigationroadiconWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Paint() override; void Slot31(int x, int y) override; @@ -92,19 +91,19 @@ public: /* 00B4 */ UIStaticBitmap* icon; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UINavigationRuideWnd : public UIFrameWnd { public: - UINavigationRuideWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists); + UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists); 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; void RefreshRoute(); protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ UIListBox_NaviSearch* routeList; diff --git a/Source/UI/Navigation/UIPrivateAirplaneWnd.h b/Source/UI/Navigation/UIPrivateAirplaneWnd.h index 6741cb6e..03f36399 100644 --- a/Source/UI/Navigation/UIPrivateAirplaneWnd.h +++ b/Source/UI/Navigation/UIPrivateAirplaneWnd.h @@ -6,7 +6,6 @@ #include #include -class UIButtonContext; class UIBasicButton; class UIPrivateAirplaneWnd : public UIFrameWnd { @@ -19,7 +18,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - /* 00B4 */ UIButtonContext* m_controls; + /* 00B4 */ void* unknown_controls; /* 00B8 */ std::string m_text; /* 00D0 */ std::vector m_buttons; }; diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp index fc21d446..f05bb391 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Client/Input/Language.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/Party/AgencyRequestContext.h" @@ -52,7 +53,6 @@ void UIAdvenPartyBoardWnd::Slot11() { // FUNCTION: fn_09298 void UIAdvenPartyBoardWnd::Slot15(int, int) { auto& owner = *this->m_board; - auto& controls = owner.buttons; this->minimum = new UIEditCtrl2(*this->m_context, owner.edits); this->minimum->SetSize(25, 14); @@ -82,14 +82,14 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { const int tooltips[] = {3420, 3491, 3444, 3508}; for (int index = 0; index < 4; ++index) { - auto* job = new UIJobSlotButton(*this->m_context, controls); + auto* job = new UIJobSlotButton(*this->m_context); this->jobs[index] = job; job->SetSize(16, 16); job->Move(160 + index * 18, 23); job->selectedImage = std::string(prefix) + "btn_job_" + roles[index] + "_on.bmp"; job->unselectedImage = std::string(prefix) + "btn_job_" + roles[index] + "_off.bmp"; job->SetSelected(0); - job->SetTooltip(controls.services.MessageText(tooltips[index])); + job->SetTooltip(LookupMessage(tooltips[index])); this->AddChild(job); } @@ -99,7 +99,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { memo->maximum = 150; memo->TextColor(0, 0xFFFFFFFFu); memo->placeholderEnabled = 1; - memo->placeholder = controls.services.MessageText(3419); + memo->placeholder = LookupMessage(3419); memo->placeholderColor = 0x646464; memo->Move(238, 24); memo->Background(255, 255, 255); @@ -114,28 +114,28 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { button->SetSize(button->BitmapWidth(), button->BitmapHeight()); }; - auto* search = new UIBmpTextButton(*this->m_context, controls); + auto* search = new UIBmpTextButton(*this->m_context); artwork(search, "btn_search"); search->Move(354, 22); search->SetId(365); - search->SetText(controls.services.MessageText(3366)); + search->SetText(LookupMessage(3366)); this->AddChild(search); - auto* reset = new UIBmpTextButton(*this->m_context, controls); + auto* reset = new UIBmpTextButton(*this->m_context); artwork(reset, "btn_initialize"); reset->Move(401, 22); reset->SetId(363); - reset->SetText(controls.services.MessageText(3367)); + reset->SetText(LookupMessage(3367)); this->AddChild(reset); - this->refresh = new UIBitmapButton(*this->m_context, controls); + this->refresh = new UIBitmapButton(*this->m_context); artwork(this->refresh, "btn_refresh"); this->refresh->Move(452, 22); this->refresh->SetId(415); this->AddChild(this->refresh); const auto arrow = [&](const char* name, int id, int x) { - auto* button = new UIBitmapButton(*this->m_context, controls); + auto* button = new UIBitmapButton(*this->m_context); for (int state = 0; state < 4; ++state) { button->SetBitmap((std::string(prefix) + name + (state == 3 ? "_disable.bmp" : ".bmp")).c_str(), state, 0); @@ -152,7 +152,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->next = arrow("btn_list_right", 218, 265); for (int index = 0; index < 10; ++index) { - auto* row = new UIPartyInfoWnd(*this->m_context, controls, owner.rows); + auto* row = new UIPartyInfoWnd(*this->m_context, owner.rows); this->rows[index] = row; artwork(row, "btn_list"); row->Move(1, 73 + index * 24); @@ -164,7 +164,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->AddChild(row); } - this->ownParty = new UIPartyInfoWnd(*this->m_context, controls, owner.rows); + this->ownParty = new UIPartyInfoWnd(*this->m_context, owner.rows); const char* ownImages[] = {"btn_recruit_on.bmp", "btn_recruit_on.bmp", "btn_recruiting_press.bmp", "btn_recruiting_disable.bmp"}; for (int state = 0; state < 4; ++state) { @@ -177,7 +177,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->ownParty->Enable(0); this->AddChild(this->ownParty); - auto* recruit = new UIBmpTextButton(*this->m_context, controls); + auto* recruit = new UIBmpTextButton(*this->m_context); this->recruit = recruit; artwork(recruit, "btn_recruit"); recruit->Move(1, 49); @@ -192,11 +192,11 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->AddChild(this->types); for (int type = 0; type <= 6; ++type) { - this->types->AddOption(UIPartyInfoWnd::TypeName(type, controls.services), 0); + this->types->AddOption(UIPartyInfoWnd::TypeName(type), 0); } this->types->Select(0); - this->pageText = new UIStaticText(*this->m_context, controls); + this->pageText = new UIStaticText(*this->m_context); this->pageText->SetSize(this->geometry.width, 18); const int textWidth = this->TextWidth("1/1", 0, 0, 12, 0, 0); this->pageText->Resize((textWidth + 1), 16); @@ -206,21 +206,21 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->LoadPage(1); this->m_message0 = 365; - auto* close = new UIBasicButton(*this->m_context, controls); - close->Configure(42, controls.services.MessageText(3045)); + auto* close = new UIBasicButton(*this->m_context); + close->Configure(42, LookupMessage(3045)); close->Move(this->geometry.width - close->geometry.width - 10, 317); close->SetId(201); this->AddChild(close); - this->stop = new UIBasicButton(*this->m_context, controls); - const char* stopText = controls.services.MessageText(3375); + this->stop = new UIBasicButton(*this->m_context); + const char* stopText = LookupMessage(3375); this->stop->Configure((this->TextWidth(stopText, 0, 0, 12, 0, 0) + 10), stopText); this->stop->Move(close->geometry.x - this->stop->geometry.width - 5, 317); this->stop->SetId(410); this->AddChild(this->stop); this->stop->Enable(0); - auto* titleClose = new UIBitmapButton(*this->m_context, controls); + auto* titleClose = new UIBitmapButton(*this->m_context); const std::string basic = std::string("유저인터페이스\\basic_interface\\"); titleClose->SetBitmap((basic + "sys_close_off.bmp").c_str(), 0, 0); titleClose->SetBitmap((basic + "sys_close_on.bmp").c_str(), 1, 0); @@ -254,7 +254,6 @@ void UIAdvenPartyBoardWnd::LoadPage(int pageValue) { // OFFSET: 0x007C2120 // FUNCTION: fn_09322 void UIAdvenPartyBoardWnd::Registration(bool value) { - auto& controls = this->m_board->buttons; if (this->m_board->partyMember != 0) { this->recruit->SetTooltip(""); @@ -268,7 +267,7 @@ void UIAdvenPartyBoardWnd::Registration(bool value) { this->stop->SetDisabled(value ? 0 : 1); this->stop->Invalidate(); } else { - this->recruit->SetTooltip(controls.services.MessageText(2047)); + this->recruit->SetTooltip(LookupMessage(2047)); this->ownParty->Enable(0); this->ownParty->SetDisabled(1); this->ownParty->Invalidate(); @@ -304,7 +303,6 @@ void UIAdvenPartyBoardWnd::RefreshRows() { char text[1024] = {}; _snprintf_s(text, sizeof(text), _TRUNCATE, "%d / %d", this->page, this->totalPages); - auto& controls = this->m_board->buttons; const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->pageText->Resize((width + 1), 16); this->pageText->SetText(text, 0); @@ -556,9 +554,8 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a // OFFSET: 0x007BF520 // FUNCTION: fn_09302 void UIAdvenPartyBoardWnd::Paint() { - auto& controls = this->m_board->buttons; this->geometry.surface->Fill(nullptr, 0xFFFF00FFu); - const auto load = [&](const char* path) { return static_cast(controls.resources.Load(path)); }; + const auto load = [&](const char* path) { return static_cast(ResourceMgr::Instance().Load(path)); }; auto* background = load((std::string(prefix) + "bg_agencyList.bmp").c_str()); this->DrawBitmap(0, 0, background ? &background->image : nullptr, false); constexpr char basic[] = "유저인터페이스\\basic_interface\\"; @@ -587,7 +584,7 @@ void UIAdvenPartyBoardWnd::Paint() { } } - const char* title = controls.services.MessageText(3504); + const char* title = LookupMessage(3504); this->DrawTextAt(19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); this->DrawTextAt(18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); auto* icon = skin("sys_base_off.bmp"); diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.h b/Source/UI/Party/UIAdvenPartyBoardWnd.h index bf6d3d26..b9c9f3a4 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.h +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.h @@ -30,7 +30,6 @@ struct StopRecruitingContext; struct WindowOrdering; struct UIAdvenPartyBoardContext { - UIButtonContext& buttons; UIEditContext& edits; UIComboBoxHeaderContext& combos; PartyRowContext& rows; diff --git a/Source/UI/Party/UIApplyForPartyWnd.cpp b/Source/UI/Party/UIApplyForPartyWnd.cpp index 6299b595..16a6c1a9 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.cpp +++ b/Source/UI/Party/UIApplyForPartyWnd.cpp @@ -1,3 +1,7 @@ +#include "Client/Mode/ModeTooltip.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "Contents/MessageTable.h" +#include "UI/Window/UIWindowMgr.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/Party/AgencyRequestContext.h" #include "Render/DeviceContext/DeviceContext.h" @@ -42,14 +46,13 @@ void UIApplyForPartyWnd::Slot11() { // OFFSET: 0x007BD970 // FUNCTION: fn_09299 void UIApplyForPartyWnd::Slot15(int, int) { - auto& controls = this->m_application->buttons; const int messages[] = {3374, 3373, 3045}; const int ids[] = {381, 271, 201}; const int positions[] = {51, 108, 173}; for (int index = 0; index < 3; ++index) { - auto* button = new UIBasicButton(*this->m_context, controls); - const char* label = controls.services.MessageText(messages[index]); + auto* button = new UIBasicButton(*this->m_context); + const char* label = LookupMessage(messages[index]); const int width = this->TextWidth(label, 0, 0, 12, 0, 0); button->Configure(width + 10, label); button->Move(positions[index], 165); @@ -58,11 +61,11 @@ void UIApplyForPartyWnd::Slot15(int, int) { } std::vector lines; - WrapPlainText(controls.services.MessageText(3370), lines, 40, this->m_application->codePage); + WrapPlainText(LookupMessage(3370), lines, 40, this->m_application->codePage); int y = 136; for (const auto& line : lines) { - auto* label = new UIStaticText(*this->m_context, controls); + auto* label = new UIStaticText(*this->m_context); label->SetSize(this->geometry.width - 18, 15); label->Move(9, y); label->SetText(line.c_str(), 0); @@ -74,7 +77,7 @@ void UIApplyForPartyWnd::Slot15(int, int) { y += 12; } - auto* close = new UIBitmapButton(*this->m_context, controls); + auto* close = new UIBitmapButton(*this->m_context); const std::string off = std::string(prefix) + "basic_interface\\big_sys_close_off.bmp"; const std::string on = std::string(prefix) + "basic_interface\\big_sys_close_on.bmp"; close->SetBitmap(off.c_str(), 0, 0); @@ -97,9 +100,8 @@ void UIApplyForPartyWnd::SetInfo(CAdvenPartyInfo value) { // OFFSET: 0x007BF5A0 // FUNCTION: fn_09303 void UIApplyForPartyWnd::Paint() { - auto& controls = this->m_application->buttons; this->geometry.surface->Fill(nullptr, 0xFFFF00FFu); - const auto load = [&](const char* name) { return static_cast(controls.resources.Load((std::string(prefix) + name).c_str())); }; + const auto load = [&](const char* name) { return static_cast(ResourceMgr::Instance().Load((std::string(prefix) + name).c_str())); }; const auto* background = load("UIadventurerAgency\\bg_agency_register.bmp"); this->DrawBitmap(0, 0, background ? &background->image : nullptr, false); int leftWidth = 0; @@ -127,22 +129,22 @@ void UIApplyForPartyWnd::Paint() { } } - const char* caption = controls.services.MessageText(3368); + const char* caption = LookupMessage(3368); this->DrawTextAt(19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); this->DrawTextAt(18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); const auto* base = load("basic_interface\\sys_base_off.bmp"); this->DrawBitmap(3, 3, base ? &base->image : nullptr, true); const auto text = [&](int x, int y, const char* value) { this->DrawTextAt(x, y, value, 0, 0, 12, 0, 0, 0); }; - text(10, 25, controls.services.MessageText(3415)); + text(10, 25, LookupMessage(3415)); const std::string fitted = FitText(*this->geometry.surface, this->info.characterName, 119); text(60, 25, fitted.c_str()); - text(10, 49, controls.services.MessageText(408)); + text(10, 49, LookupMessage(408)); char levels[10] = {}; _snprintf_s(levels, sizeof(levels), _TRUNCATE, "%d~%d", this->info.minimumLevel, this->info.maximumLevel); text(60, 49, levels); - text(10, 73, controls.services.MessageText(3369)); - text(60, 73, UIPartyInfoWnd::TypeName(this->info.type, controls.services)); - text(10, 97, controls.services.MessageText(504)); + text(10, 73, LookupMessage(3369)); + text(60, 73, UIPartyInfoWnd::TypeName(this->info.type)); + text(10, 97, LookupMessage(504)); const char* jobs[] = {"def", "heal", "atk", "buf"}; const bool selected[] = {this->info.tanker, this->info.healer, this->info.dealer, this->info.assist}; @@ -152,7 +154,7 @@ void UIApplyForPartyWnd::Paint() { this->DrawBitmap(60 + index * 18, 95, icon ? &icon->image : nullptr, false); } - text(10, 121, controls.services.MessageText(3359)); + text(10, 121, LookupMessage(3359)); text(60, 121, this->info.memo.c_str()); } @@ -168,13 +170,13 @@ void UIApplyForPartyWnd::Slot28(int x, int y) { for (int index = 0; index < 4; ++index) { if (x > positions[index] && x < positions[index] + 16) { - const char* label = this->m_application->buttons.services.MessageText(messages[index]); + const char* label = LookupMessage(messages[index]); if (*label != '\0') { int screenX = positions[index]; int screenY = 75; this->ToScreen(screenX, screenY); - this->m_application->buttons.services.Tooltip(label, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(label, screenX, screenY, -1, false, true); } break; @@ -197,7 +199,7 @@ int UIApplyForPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, break; case 381: { const std::string name = this->info.characterName; - const char* relationship = owner.rows.services.IsFriend(name) ? owner.buttons.services.MessageText(102) : nullptr; + const char* relationship = owner.rows.services.IsFriend(name) ? LookupMessage(102) : nullptr; if (owner.rows.services.IsGuildMember(this->info.accountId)) { relationship = "GuildMember"; diff --git a/Source/UI/Party/UIApplyForPartyWnd.h b/Source/UI/Party/UIApplyForPartyWnd.h index 7dbc790a..87bb0094 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.h +++ b/Source/UI/Party/UIApplyForPartyWnd.h @@ -10,7 +10,6 @@ struct AgencyRequestContext; struct PartyInfoContext; struct UIApplyForPartyContext { - UIButtonContext& buttons; PartyRowContext& rows; AgencyRequestContext& requests; PartyInfoContext& completion; diff --git a/Source/UI/Party/UIPartyInfoWnd.cpp b/Source/UI/Party/UIPartyInfoWnd.cpp index 9f677ae0..45e3d941 100644 --- a/Source/UI/Party/UIPartyInfoWnd.cpp +++ b/Source/UI/Party/UIPartyInfoWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -8,8 +9,8 @@ // OFFSET: 0x007BAE20 // FUNCTION: fn_09277 -UIPartyInfoWnd::UIPartyInfoWnd(UIWindowContext& windows, UIButtonContext& buttons, PartyRowContext& row) - : UIBitmapButton(windows, buttons), tanker(0), dealer(0), healer(0), assist(0), m_row(&row) { +UIPartyInfoWnd::UIPartyInfoWnd(UIWindowContext& windows, PartyRowContext& row) + : UIBitmapButton(windows), tanker(0), dealer(0), healer(0), assist(0), m_row(&row) { this->m_drawLabel = 0; } @@ -24,12 +25,12 @@ CAdvenPartyInfo* UIPartyInfoWnd::Info() { // OFFSET: 0x007BBF00 // FUNCTION: fn_09294 -const char* UIPartyInfoWnd::TypeName(int value, ButtonServices& services) { +const char* UIPartyInfoWnd::TypeName(int value) { if (value == 0) { - return services.MessageText(3377); + return LookupMessage(3377); } - return value >= 1 && value <= 6 ? services.MessageText(3359 + value) : ""; + return value >= 1 && value <= 6 ? LookupMessage(3359 + value) : ""; } // OFFSET: 0x007C1E20 @@ -73,15 +74,14 @@ void UIPartyInfoWnd::Paint() { return; } - auto& controls = *this->m_buttonContext; CBitmapRes* background = nullptr; if (this->geometry.unknown_0030 <= 2) { - background = static_cast(controls.resources.Load(this->m_names[this->geometry.unknown_0030].c_str())); + background = static_cast(ResourceMgr::Instance().Load(this->m_names[this->geometry.unknown_0030].c_str())); } if (this->m_disabled != 0 && !this->m_names[3].empty()) { - background = static_cast(controls.resources.Load(this->m_names[3].c_str())); + background = static_cast(ResourceMgr::Instance().Load(this->m_names[3].c_str())); } if (background) { @@ -90,14 +90,14 @@ void UIPartyInfoWnd::Paint() { const auto text = [&](int x, const char* value, int bytes = 0) { this->DrawTextAt(x, 5, value, bytes, 0, 12, 0, 0, 0); }; text(11, this->levels.c_str()); - text(64, TypeName(this->type, controls.services)); + text(64, TypeName(this->type)); constexpr char prefix[] = "유저인터페이스\\UIadventurerAgency\\"; const char* jobs[] = {"def", "heal", "atk", "buf"}; const bool flags[] = {this->info.tanker, this->info.healer, this->info.dealer, this->info.assist}; for (int index = 0; index < 4; ++index) { const std::string path = std::string(prefix) + "btn_job_" + jobs[index] + (flags[index] ? "_on.bmp" : "_off.bmp"); - auto* resource = static_cast(controls.resources.Load(path.c_str())); + auto* resource = static_cast(ResourceMgr::Instance().Load(path.c_str())); this->DrawBitmap(109 + index * 18, 3, resource ? &resource->image : nullptr, false); } @@ -126,7 +126,7 @@ void UIPartyInfoWnd::Slot33(int, int) { } const std::string name = this->info.characterName; - const char* relationship = this->m_row->services.IsFriend(name) ? this->m_buttonContext->services.MessageText(102) : nullptr; + const char* relationship = this->m_row->services.IsFriend(name) ? LookupMessage(102) : nullptr; if (this->m_row->services.IsGuildMember(this->info.accountId)) { relationship = "GuildMember"; diff --git a/Source/UI/Party/UIPartyInfoWnd.h b/Source/UI/Party/UIPartyInfoWnd.h index 0215d01c..fed7f367 100644 --- a/Source/UI/Party/UIPartyInfoWnd.h +++ b/Source/UI/Party/UIPartyInfoWnd.h @@ -23,7 +23,7 @@ struct PartyRowContext { class UIPartyInfoWnd : public UIBitmapButton { public: - UIPartyInfoWnd(UIWindowContext& windows, UIButtonContext& buttons, PartyRowContext& row); + UIPartyInfoWnd(UIWindowContext& windows, PartyRowContext& row); ~UIPartyInfoWnd() override; void Paint() override; void Slot31(int x, int y) override; @@ -31,7 +31,7 @@ public: void SetInfo(const CAdvenPartyInfo& value); void Reset(); CAdvenPartyInfo* Info(); - static const char* TypeName(int type, ButtonServices& services); + static const char* TypeName(int type); /* 0120 */ std::string memo; /* 0138 */ std::string levels; diff --git a/Source/UI/Party/UIPartySettingWnd.h b/Source/UI/Party/UIPartySettingWnd.h index af718fdf..fc996bff 100644 --- a/Source/UI/Party/UIPartySettingWnd.h +++ b/Source/UI/Party/UIPartySettingWnd.h @@ -5,13 +5,12 @@ #include "UI/Window/UIFrameWnd.h" class UIEditCtrl; -struct UIButtonContext; struct UIEditContext; struct WindowPlacement; class UIPartySettingWnd : public UIFrameWnd { public: - UIPartySettingWnd(UIWindowContext& windows, UIButtonContext& controls); + UIPartySettingWnd(UIWindowContext& windows); void Slot11() override; int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; /* 00B4 */ UIRadioBtn* m_expShareButtons[2]; @@ -29,7 +28,7 @@ public: void Slot25(int x, int y) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00E0 */ UIEditCtrl* m_edit; @@ -40,7 +39,7 @@ protected: class UIPartyInvitationToWnd : public UIPartySettingWnd { public: - UIPartyInvitationToWnd(UIWindowContext& windows, UIButtonContext& controls); + UIPartyInvitationToWnd(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; diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index 1376c8fb..6812caac 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Client/Input/Language.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/Party/AgencyRequestContext.h" @@ -69,10 +70,9 @@ void UIRegisterPartyWnd::Slot11() { // FUNCTION: fn_09300 void UIRegisterPartyWnd::Slot15(int, int) { auto& owner = *this->m_registration; - auto& controls = owner.buttons; const auto label = [&](const char* text, int x, int y, int width) { - auto* value = new UIStaticText(*this->m_context, controls); + auto* value = new UIStaticText(*this->m_context); value->SetSize(width, 15); value->Move(x, y); value->SetText(text, 0); @@ -83,11 +83,11 @@ void UIRegisterPartyWnd::Slot15(int, int) { return value; }; - label(controls.services.MessageText(3415), 10, 23, 40); + label(LookupMessage(3415), 10, 23, 40); this->character = label(owner.characterName.c_str(), 60, 23, 119); this->character->text = FitText(*this->character->geometry.surface, owner.characterName, 119); this->character->tooltipEnabled = this->character->text != owner.characterName; - label(controls.services.MessageText(408), 10, 49, 40); + label(LookupMessage(408), 10, 49, 40); const int level = owner.playerLevel; const auto edit = [&](int x, int value) { @@ -106,25 +106,25 @@ void UIRegisterPartyWnd::Slot15(int, int) { }; this->minimum = edit(60, std::max((level - 5), 1)); this->maximum = edit(96, (level + 5)); - label(controls.services.MessageText(3369), 10, 73, this->geometry.width); - auto* roleLabel = label(controls.services.MessageText(504), 10, 97, this->geometry.width); + label(LookupMessage(3369), 10, 73, this->geometry.width); + auto* roleLabel = label(LookupMessage(504), 10, 97, this->geometry.width); roleLabel->outline = 1; const char* roles[] = {"def", "heal", "atk", "buf"}; const int tooltips[] = {3420, 3491, 3444, 3508}; for (int index = 0; index < 4; ++index) { - auto* job = new UIJobSlotButton(*this->m_context, controls); + auto* job = new UIJobSlotButton(*this->m_context); this->jobs[index] = job; job->SetSize(16, 16); job->Move(60 + index * 18, 95); job->selectedImage = std::string(prefix) + "UIadventurerAgency\\btn_job_" + roles[index] + "_on.bmp"; job->unselectedImage = std::string(prefix) + "UIadventurerAgency\\btn_job_" + roles[index] + "_off.bmp"; job->SetSelected(1); - job->SetTooltip(controls.services.MessageText(tooltips[index])); + job->SetTooltip(LookupMessage(tooltips[index])); this->AddChild(job); } - label(controls.services.MessageText(3359), 10, 121, this->geometry.width - 32); + label(LookupMessage(3359), 10, 121, this->geometry.width - 32); this->memo = new UIEditCtrl(*this->m_context, owner.edits); this->memo->SetSize(139, 14); this->memo->maximum = 24; @@ -133,9 +133,9 @@ void UIRegisterPartyWnd::Slot15(int, int) { this->memo->Background(232, 232, 232); this->AddChild(this->memo); - auto* submit = new UIBasicButton(*this->m_context, controls); + auto* submit = new UIBasicButton(*this->m_context); const bool registered = g_adventurerAgencyMgr->registered; - const char* title = controls.services.MessageText(registered ? 3376 : 3371); + const char* title = LookupMessage(registered ? 3376 : 3371); submit->Configure(this->TextWidth(title, 0, 0, 12, 0, 0) + 10, title); submit->Move(108, 165); submit->SetId(registered ? 564 : 565); @@ -149,7 +149,7 @@ void UIRegisterPartyWnd::Slot15(int, int) { this->m_message0 = registered ? 564 : 565; this->AddChild(submit); std::vector lines; - WrapPlainText(controls.services.MessageText(3370), lines, 40, owner.codePage); + WrapPlainText(LookupMessage(3370), lines, 40, owner.codePage); int y = 136; for (const auto& line : lines) { @@ -159,7 +159,7 @@ void UIRegisterPartyWnd::Slot15(int, int) { y += 12; } - auto* close = new UIBitmapButton(*this->m_context, controls); + auto* close = new UIBitmapButton(*this->m_context); const char* suffixes[] = {"", "_a", "_b"}; for (int state = 0; state < 3; ++state) { @@ -177,14 +177,14 @@ void UIRegisterPartyWnd::Slot15(int, int) { this->types->SetSize(63, 18); this->types->Move(60, 70); this->AddChild(this->types); - this->types->AddOption(controls.services.MessageText(3377), 0); + this->types->AddOption(LookupMessage(3377), 0); for (int id = 3360; id <= 3365; ++id) { - this->types->AddOption(controls.services.MessageText(id), 0); + this->types->AddOption(LookupMessage(id), 0); } this->types->Select(0); - auto* titleClose = new UIBitmapButton(*this->m_context, controls); + auto* titleClose = new UIBitmapButton(*this->m_context); const std::string off = std::string(prefix) + "basic_interface\\big_sys_close_off.bmp"; const std::string on = std::string(prefix) + "basic_interface\\big_sys_close_on.bmp"; titleClose->SetBitmap(off.c_str(), 0, 0); @@ -242,9 +242,8 @@ void UIRegisterPartyWnd::NormalizeLevels() { // OFFSET: 0x007BFBB0 // FUNCTION: fn_09305 void UIRegisterPartyWnd::Paint() { - auto& controls = this->m_registration->buttons; this->geometry.surface->Fill(nullptr, 0xFFFF00FFu); - const auto load = [&](const char* name) { return static_cast(controls.resources.Load((std::string(prefix) + name).c_str())); }; + const auto load = [&](const char* name) { return static_cast(ResourceMgr::Instance().Load((std::string(prefix) + name).c_str())); }; const auto* background = load("UIadventurerAgency\\bg_agency_register.bmp"); this->DrawBitmap(0, 0, background ? &background->image : nullptr, false); this->DrawTextAt(86, 50, "~", 0, 0, 12, 0, 0, 0); @@ -273,7 +272,7 @@ void UIRegisterPartyWnd::Paint() { } } - const char* caption = controls.services.MessageText(3356); + const char* caption = LookupMessage(3356); this->DrawTextAt(19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); this->DrawTextAt(18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); const auto* base = load("basic_interface\\sys_base_off.bmp"); @@ -295,7 +294,7 @@ int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, const auto notify = [&](int id) { char text[256] = {}; - _snprintf_s(text, sizeof(text), _TRUNCATE, owner.buttons.services.MessageText(id)); + _snprintf_s(text, sizeof(text), _TRUNCATE, LookupMessage(id)); owner.completion.messages.Message(text, 0xFF); }; diff --git a/Source/UI/Party/UIRegisterPartyWnd.h b/Source/UI/Party/UIRegisterPartyWnd.h index a754a84c..ff5f1ba3 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.h +++ b/Source/UI/Party/UIRegisterPartyWnd.h @@ -16,7 +16,6 @@ struct UIEditContext; struct UIComboBoxHeaderContext; struct UIRegisterPartyContext { - UIButtonContext& buttons; UIEditContext& edits; UIComboBoxHeaderContext& combos; ForbiddenWords& forbidden; diff --git a/Source/UI/Party/UIRequestJoinPartyWnd.cpp b/Source/UI/Party/UIRequestJoinPartyWnd.cpp index f8cf60c0..3add855c 100644 --- a/Source/UI/Party/UIRequestJoinPartyWnd.cpp +++ b/Source/UI/Party/UIRequestJoinPartyWnd.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" #include "Client/Session.h" #include "Render/DeviceContext/DeviceContext.h" @@ -32,9 +33,8 @@ UIRequestJoinPartyWnd::~UIRequestJoinPartyWnd() = default; // FUNCTION: fn_09301 void UIRequestJoinPartyWnd::Slot15(int, int) { auto& text = this->m_request->text; - auto& controls = text.buttons; - this->icon = new UIBitmapButton(*this->m_context, controls); + this->icon = new UIBitmapButton(*this->m_context); this->icon->SetSize(25, 25); const std::string initial = std::string(prefix) + "renewalparty\\icon_jobs_4046.bmp"; @@ -45,7 +45,7 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { this->icon->Move(12, 29); this->AddChild(this->icon); - this->levelText = new UIStaticText(*this->m_context, controls); + this->levelText = new UIStaticText(*this->m_context); this->levelText->SetSize(25, 14); this->levelText->Move(16, 56); this->levelText->SetText("1", 0); @@ -58,8 +58,8 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { const int x[] = {122, 169}; for (int index = 0; index < 2; ++index) { - auto* button = new UIBasicButton(*this->m_context, controls); - const char* label = controls.services.MessageText(messages[index]); + auto* button = new UIBasicButton(*this->m_context); + const char* label = LookupMessage(messages[index]); button->Configure(this->TextWidth(label, 0, 0, 12, 0, 0) + 10, label); button->Move(x[index], 136); button->SetId(ids[index]); @@ -73,7 +73,7 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { this->details->Invalidate(); this->AddChild(this->details); - this->block = new UICheckBox(*this->m_context, controls); + this->block = new UICheckBox(*this->m_context); this->block->SetSize(24, 47); const std::string checked = std::string(prefix) + "uiadventureragency\\btn_block_on.bmp"; const std::string unchecked = std::string(prefix) + "uiadventureragency\\btn_block_off.bmp"; @@ -83,7 +83,7 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { this->block->SetId(213); this->AddChild(this->block); std::vector unused; - WrapPlainText(controls.services.MessageText(3518), unused, 30, text.list.codePage); + WrapPlainText(LookupMessage(3518), unused, 30, text.list.codePage); this->blockText = new UITextViewer(*this->m_context, text); this->blockText->Configure(31, 81, 182, 47, 0); @@ -91,9 +91,9 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { this->blockText->Invalidate(); this->AddChild(this->blockText); this->blockText->lineHeight = 15; - this->blockText->SendMsg(nullptr, 29, reinterpret_cast(controls.services.MessageText(3518)), 30, 0, 0); + this->blockText->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3518)), 30, 0, 0); - auto* close = new UIBitmapButton(*this->m_context, controls); + auto* close = new UIBitmapButton(*this->m_context); const std::string off = std::string(prefix) + "basic_interface\\big_sys_close_off.bmp"; const std::string on = std::string(prefix) + "basic_interface\\big_sys_close_on.bmp"; close->SetBitmap(off.c_str(), 0, 0); @@ -109,8 +109,7 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { // OFFSET: 0x007BFC20 // FUNCTION: fn_09306 void UIRequestJoinPartyWnd::Paint() { - auto& controls = this->m_request->text.buttons; - const auto load = [&](const char* name) { return static_cast(controls.resources.Load((std::string(prefix) + name).c_str())); }; + const auto load = [&](const char* name) { return static_cast(ResourceMgr::Instance().Load((std::string(prefix) + name).c_str())); }; const auto* background = load("UIadventurerAgency\\bg_agency_admit.bmp"); this->DrawBitmap(0, 0, background ? &background->image : nullptr, false); int leftWidth = 0; @@ -138,7 +137,7 @@ void UIRequestJoinPartyWnd::Paint() { } } - const char* caption = controls.services.MessageText(3505); + const char* caption = LookupMessage(3505); this->DrawTextAt(19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); this->DrawTextAt(18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); const auto* base = load("basic_interface\\sys_base_off.bmp"); @@ -191,12 +190,11 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t char level[5] = {}; _snprintf_s(level, sizeof(level), _TRUNCATE, "%d", this->level); this->levelText->SetText(level, 0); - auto& controls = this->m_request->text.buttons; const int width = this->TextWidth(level, 0, 0, 12, 0, 0); this->levelText->Move(25 - width / 2, 56); this->details->Clear(); char messageText[1024] = {}; - _snprintf_s(messageText, sizeof(messageText), _TRUNCATE, controls.services.MessageText(3378), request.name); + _snprintf_s(messageText, sizeof(messageText), _TRUNCATE, LookupMessage(3378), request.name); this->details->SendMsg(nullptr, 29, reinterpret_cast(messageText), 0, 0, 1); this->details->Move(43, static_cast(this->details->lines.size()) - 3u >= 1u ? 30 : 20); this->Invalidate(); diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index 46785dbd..fab20012 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -572,7 +572,7 @@ void UIRenewDetailQuestInfoWnd::Slot15(int, int) { this->m_recommendedWnd->Move(0, 62); this->AddChild(this->m_recommendedWnd); - this->m_closeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_closeButton = new UIBitmapButton(*this->m_context); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close.bmp", 0, 0); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close_a.bmp", 1, 0); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close_b.bmp", 2, 0); @@ -698,9 +698,9 @@ UIRenewQuestScrollBar::UIRenewQuestScrollBar(UIWindowContext& windows) : UIScrol // OFFSET: 0x007FBFD0 // FUNCTION: fn_09967 -UIRenewQuestWnd::UIRenewQuestWnd(UIWindowContext& windows, UIButtonContext& controls) +UIRenewQuestWnd::UIRenewQuestWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), m_tabs(nullptr), m_scrollBar(nullptr), m_optionCheckBox(nullptr), m_closeButton(nullptr), m_tab(0), m_scroll(0), - m_selected(0), m_scrollable(false), m_pressed(0), m_controls(&controls) { + m_selected(0), m_scrollable(false), m_pressed(0) { std::memset(&this->m_rows, 0, sizeof(this->m_rows)); this->m_questIds[0].clear(); this->m_questIds[1].clear(); @@ -722,12 +722,11 @@ void UIRenewQuestWnd::Slot15(int, int) { g_windowMgr.EnsureWindow(204); } const bool checked = g_windowMgr.window_0428->geometry.visible != 0; - this->m_optionCheckBox = this->AddStyledCheckBox( - *this->m_controls, 213, 10, 12, LookupMessage(2019), 38, 447, checked, nullptr, 12, 0x212121, "유저인터페이스\\renew_questui\\checkbox_on.bmp", + this->m_optionCheckBox = this->AddStyledCheckBox(213, 10, 12, LookupMessage(2019), 38, 447, checked, nullptr, 12, 0x212121, "유저인터페이스\\renew_questui\\checkbox_on.bmp", "유저인터페이스\\renew_questui\\checkbox_off.bmp" ); - this->m_closeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_closeButton = new UIBitmapButton(*this->m_context); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close.bmp", 0, 0); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close_a.bmp", 1, 0); this->m_closeButton->SetBitmap("유저인터페이스\\basic_interface\\btn_close_b.bmp", 2, 0); @@ -743,8 +742,7 @@ void UIRenewQuestWnd::Slot15(int, int) { for (int index = 0; index < 9; ++index) { const int y = 46 + index * 46; - UICheckBox* check = this->AddStyledCheckBox( - *this->m_controls, 389 + index, 14, 14, nullptr, 350, y - 19, true, nullptr, 0, 0, "유저인터페이스\\renew_questui\\bt_check_on.bmp", + UICheckBox* check = this->AddStyledCheckBox(389 + index, 14, 14, nullptr, 350, y - 19, true, nullptr, 0, 0, "유저인터페이스\\renew_questui\\bt_check_on.bmp", "유저인터페이스\\renew_questui\\bt_check_off.bmp" ); this->m_rows.checkBoxes[index] = check; @@ -752,15 +750,14 @@ void UIRenewQuestWnd::Slot15(int, int) { this->m_rows.checkBoxes[index]->SetTooltip(LookupMessage(3409)); this->m_rows.checkBoxes[index]->SetHidden(true); - UICheckBox* lock = this->AddStyledCheckBox( - *this->m_controls, 389 + index, 20, 17, nullptr, 344, y, true, nullptr, 0, 0, "유저인터페이스\\renew_questui\\bt_lock_open.bmp", + UICheckBox* lock = this->AddStyledCheckBox(389 + index, 20, 17, nullptr, 344, y, true, nullptr, 0, 0, "유저인터페이스\\renew_questui\\bt_lock_open.bmp", "유저인터페이스\\renew_questui\\bt_lock.bmp" ); this->m_rows.lockBoxes[index] = lock; lock->m_message = 1; this->m_rows.lockBoxes[index]->SetHidden(true); - this->m_rows.icons[index] = new UIStaticBitmap(*this->m_context, *this->m_controls); + this->m_rows.icons[index] = new UIStaticBitmap(*this->m_context); this->m_rows.icons[index]->SetBitmap("유저인터페이스\\renew_questui\\ico_nq.bmp"); this->m_rows.icons[index]->SetSize(this->m_rows.icons[index]->geometry.width, this->m_rows.icons[index]->geometry.height); this->m_rows.icons[index]->Move(46, y - 15); diff --git a/Source/UI/Quest/UIRenewQuestWnd.h b/Source/UI/Quest/UIRenewQuestWnd.h index 48213ba5..f60261a5 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.h +++ b/Source/UI/Quest/UIRenewQuestWnd.h @@ -17,7 +17,6 @@ class UICheckBox; class UIStaticBitmap; class UIStaticText; class UITab; -struct UIButtonContext; class UINpcSprWnd : public UIWindow { public: @@ -96,7 +95,7 @@ public: /* 00F4 */ bool m_recommended; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIRenewQuestScrollBar : public UIScrollBar { @@ -113,7 +112,7 @@ struct RenewQuestRowControls { class UIRenewQuestWnd : public UIFrameWnd { public: - UIRenewQuestWnd(UIWindowContext& windows, UIButtonContext& controls); + UIRenewQuestWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Paint() override; void Slot25(int x, int y) override; @@ -138,7 +137,7 @@ public: /* 0144 */ std::vector m_questIds[4]; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index 3061fb2e..1fcad812 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -134,10 +134,10 @@ bool UIRodexInboxWnd::Slot03() { // FUNCTION: fn_10047 void UIRodexInboxWnd::Slot15(int width, int height) { g_rodexMailStore->PurgeFlagged(); - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); - this->unknown_0138 = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + this->unknown_0138 = new UIBmpRadioBtn(*this->m_context); this->unknown_0138->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); this->unknown_0138->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_over.bmp", 1); this->unknown_0138->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_press.bmp", 2); @@ -159,7 +159,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->AddChild(this->unknown_0138); this->unknown_0138->SendMsg(this, 13, 0, 0, 0, 0); - this->unknown_0134 = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + this->unknown_0134 = new UIBmpRadioBtn(*this->m_context); this->unknown_0134->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); this->unknown_0134->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_over.bmp", 1); this->unknown_0134->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_press.bmp", 2); @@ -181,7 +181,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->AddChild(this->unknown_0134); this->unknown_0134->SendMsg(this, 13, 0, 0, 0, 0); - this->unknown_0130 = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + this->unknown_0130 = new UIBmpRadioBtn(*this->m_context); this->unknown_0130->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); this->unknown_0130->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_over.bmp", 1); this->unknown_0130->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_press.bmp", 2); @@ -215,7 +215,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { break; } - this->unknown_013C = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_013C = new UIBitmapButton(*this->m_context); this->unknown_013C->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_refresh_out.bmp", 0, 0); this->unknown_013C->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_refresh_over.bmp", 1, 0); this->unknown_013C->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_refresh_press.bmp", 2, 0); @@ -225,7 +225,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_013C->SetId(0x19F); this->AddChild(this->unknown_013C); - this->unknown_0140 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0140 = new UIBitmapButton(*this->m_context); this->unknown_0140->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_write_out.bmp", 0, 0); this->unknown_0140->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_write_over.bmp", 1, 0); this->unknown_0140->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_write_press.bmp", 2, 0); @@ -236,7 +236,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->AddChild(this->unknown_0140); for (int y = 0x66, row = 0; y < 0x16E; y += 0x2C, ++row) { - this->checks[row] = new UICheckBox(*this->m_context, *this->m_controls); + this->checks[row] = new UICheckBox(*this->m_context); this->checks[row]->SetSize(14, 14); this->checks[row]->SetBitmaps("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\checkbox_on.bmp", "유저인터페이스\\basic_interface\\rodexsystem\\renewal\\checkbox_off.bmp"); this->checks[row]->Move(0x11, y + 6); @@ -245,7 +245,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->checks[row]->Show(0); this->AddChild(this->checks[row]); - this->unknown_015C[row] = new UITextButton(*this->m_context, *this->m_controls); + this->unknown_015C[row] = new UITextButton(*this->m_context); this->unknown_015C[row]->Configure("", 0, 0, 12, 0, 0); this->unknown_015C[row]->m_hoverColor = 0x51417E; this->unknown_015C[row]->Move(0x45, y); @@ -254,7 +254,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_015C[row]->Enable(0); this->AddChild(this->unknown_015C[row]); - this->unknown_0144[row] = new UITextButton(*this->m_context, *this->m_controls); + this->unknown_0144[row] = new UITextButton(*this->m_context); this->unknown_0144[row]->Configure("", 0x844A42, 0, 11, 1, 0); this->unknown_0144[row]->m_hoverColor = 0x51417E; this->unknown_0144[row]->Move(0x47, y + 0x10); @@ -263,7 +263,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_0144[row]->Enable(0); this->AddChild(this->unknown_0144[row]); - this->unknown_01A8[row] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_01A8[row] = new UIBitmapButton(*this->m_context); this->unknown_01A8[row]->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_return_out.bmp", 0, 0); this->unknown_01A8[row]->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_return_over.bmp", 1, 0); this->unknown_01A8[row]->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_return_press.bmp", 2, 0); @@ -275,21 +275,21 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->AddChild(this->unknown_01A8[row]); } - UIBasicButton* button = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* button = new UIBasicButton(*this->m_context); this->unknown_018C = button; button->Configure(0x46, LookupMessage(0xE05)); this->unknown_018C->SetId(0x222); this->unknown_018C->Move(4, 0x178); this->AddChild(this->unknown_018C); - button = new UIBasicButton(*this->m_context, *this->m_controls); + button = new UIBasicButton(*this->m_context); this->unknown_0190 = button; button->Configure(0x46, LookupMessage(0xE08)); this->unknown_0190->Move(0x54, 0x188); this->unknown_0190->SetId(0x224); this->AddChild(this->unknown_0190); - this->unknown_0194 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0194 = new UIBitmapButton(*this->m_context); this->unknown_0194->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_prev_out.bmp", 0, 0); this->unknown_0194->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_prev_over.bmp", 1, 0); this->unknown_0194->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_prev_press.bmp", 2, 0); @@ -299,7 +299,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_0194->SetId(0x13C); this->AddChild(this->unknown_0194); - this->unknown_0198 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0198 = new UIBitmapButton(*this->m_context); this->unknown_0198->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_next_out.bmp", 0, 0); this->unknown_0198->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_next_over.bmp", 1, 0); this->unknown_0198->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_next_press.bmp", 2, 0); @@ -311,7 +311,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { const int searchTexts[2] = {0xC78, 0xC79}; for (int x = 0x16, index = 0; x < 0x7C; x += 0x33, ++index) { - this->unknown_01C0[index] = new UIRadioBtn(*this->m_context, *this->m_controls); + this->unknown_01C0[index] = new UIRadioBtn(*this->m_context); this->unknown_01C0[index]->SetSize(0x33, 12); { UIRadioBtn* radio = this->unknown_01C0[index]; @@ -338,7 +338,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_01C8->preserveInput = 1; this->AddChild(this->unknown_01C8); - this->unknown_01CC = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_01CC = new UIBitmapButton(*this->m_context); this->unknown_01CC->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_search_out.bmp", 0, 0); this->unknown_01CC->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_search_over.bmp", 1, 0); this->unknown_01CC->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_search_press.bmp", 2, 0); @@ -347,7 +347,7 @@ void UIRodexInboxWnd::Slot15(int width, int height) { this->unknown_01CC->SetId(0x141); this->AddChild(this->unknown_01CC); - this->unknown_01D0 = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + this->unknown_01D0 = new UIBmpRadioBtn(*this->m_context); this->unknown_01D0->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); this->unknown_01D0->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_over.bmp", 1); this->unknown_01D0->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_press.bmp", 2); diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 50aa6f90..44214619 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowDialogs.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/ModeTooltip.h" #include "Contents/Items/RuneSystem.h" @@ -103,7 +104,7 @@ void UIRune_Info::Slot15(int, int) { this->m_activeWnd->SetSize(0xEA, 0x78); this->m_activeWnd->Move(0xC5, 0x159); - this->m_activateButton = new (std::nothrow) UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_activateButton = new (std::nothrow) UIBitmapButton(*this->m_context); this->AddChild(this->m_activateButton); this->m_activateButton->SetBitmap("유저인터페이스\\runesystem\\bt_active_nomal.bmp", 0, 0); this->m_activateButton->SetBitmap("유저인터페이스\\runesystem\\bt_active_mouseon.bmp", 1, 0); @@ -983,7 +984,6 @@ void UIRune_Decom::Slot32(int x, int y) { // OFFSET: 0x0081AC30 // FUNCTION: fn_10189 void UIRuneSystem_Decom_RadioBtn::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFFFF00FF); if (this->checkedBitmap.empty() || this->uncheckedBitmap.empty() || this->m_disabledBitmap.empty()) { return; @@ -1529,9 +1529,9 @@ UIRuneSystem_ActiveWnd::UIRuneSystem_ActiveWnd(UIWindowContext& windows) : UIWin // OFFSET: 0x00814EE0 // FUNCTION: fn_10139 -UIRuneSystem_DecomResultWnd::UIRuneSystem_DecomResultWnd(UIWindowContext& windows, UIButtonContext& controls) +UIRuneSystem_DecomResultWnd::UIRuneSystem_DecomResultWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), m_total(0) { - UIBitmapButton* button = new UIBitmapButton(windows, controls); + UIBitmapButton* button = new UIBitmapButton(windows); this->AddChild(button); button->SetBitmap("유저인터페이스\\runesystem\\bt_ok_nomal.bmp", 0, 0); button->SetBitmap("유저인터페이스\\runesystem\\bt_ok_mouseon.bmp", 1, 0); @@ -1545,14 +1545,14 @@ UIRuneSystem_DecomResultWnd::UIRuneSystem_DecomResultWnd(UIWindowContext& window // OFFSET: 0x00815020 // FUNCTION: fn_10140 -UIRuneSystem_Decom_RadioBtn::UIRuneSystem_Decom_RadioBtn(UIWindowContext& windows, UIButtonContext& controls) : UIRadioBtn(windows, controls) { +UIRuneSystem_Decom_RadioBtn::UIRuneSystem_Decom_RadioBtn(UIWindowContext& windows) : UIRadioBtn(windows) { } // OFFSET: 0x008150A0 // FUNCTION: fn_10141 -UIRuneSystem_tagListWnd::UIRuneSystem_tagListWnd(UIWindowContext& windows, UIButtonContext& controls) +UIRuneSystem_tagListWnd::UIRuneSystem_tagListWnd(UIWindowContext& windows) : UIWindow(windows, 0), m_firstTag(0), m_visibleCount(9) { - this->m_rightButton = new UIBitmapButton(windows, controls); + this->m_rightButton = new UIBitmapButton(windows); this->AddChild(this->m_rightButton); this->m_rightButton->SetBitmap("유저인터페이스\\runesystem\\bt_tag_right_nomal.bmp", 0, 0); this->m_rightButton->SetBitmap("유저인터페이스\\runesystem\\bt_tag_right_mouseon.bmp", 1, 0); @@ -1562,7 +1562,7 @@ UIRuneSystem_tagListWnd::UIRuneSystem_tagListWnd(UIWindowContext& windows, UIBut this->m_rightButton->Move(267, 9); this->m_rightButton->SetId(0x13D); - this->m_leftButton = new UIBitmapButton(windows, controls); + this->m_leftButton = new UIBitmapButton(windows); this->AddChild(this->m_leftButton); this->m_leftButton->SetBitmap("유저인터페이스\\runesystem\\bt_tag_left_nomal.bmp", 0, 0); this->m_leftButton->SetBitmap("유저인터페이스\\runesystem\\bt_tag_left_mouseon.bmp", 1, 0); @@ -1727,7 +1727,7 @@ void UIRune_ViewInfo::Slot15(int, int) { this->m_gauge->m_fullBitmap = "유저인터페이스\\runesystem\\view_gage_full.bmp"; this->m_gauge->m_maxBitmap = "유저인터페이스\\runesystem\\view_gage_max.bmp"; - UIStaticText* title = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); + UIStaticText* title = new UIStaticText(*this->m_context); this->AddChild(title); std::string text = "룬타블렛-룬도감"; int width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); @@ -1737,7 +1737,7 @@ void UIRune_ViewInfo::Slot15(int, int) { title->SetText(text.c_str(), 1); title->SetColor(0xFF, 0xFF, 0xFF); - UIStaticText* rate = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); + UIStaticText* rate = new UIStaticText(*this->m_context); this->AddChild(rate); text = "수집률"; width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); @@ -1783,7 +1783,7 @@ int UIRune_Decom::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 // OFFSET: 0x00817EA0 // FUNCTION: fn_10173 void UIRune_Decom::Slot15(int, int) { - this->m_decomButton = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_decomButton = new UIBitmapButton(*this->m_context); this->AddChild(this->m_decomButton); this->m_decomButton->SetBitmap("유저인터페이스\\runesystem\\bt_decom_nomal.bmp", 0, 0); this->m_decomButton->SetBitmap("유저인터페이스\\runesystem\\bt_decom_mouseon.bmp", 1, 0); @@ -1795,7 +1795,7 @@ void UIRune_Decom::Slot15(int, int) { int index = 0; for (int x = 0xDD; x < 0x1AF; x += 0x69) { - this->m_radioButtons[index] = new UIRuneSystem_Decom_RadioBtn(*this->m_context, *reinterpret_cast(nullptr)); + this->m_radioButtons[index] = new UIRuneSystem_Decom_RadioBtn(*this->m_context); this->m_radioButtons[index]->SetSize(0x68, 0x0E); this->m_radioButtons[index]->Move(x, 0x153); const std::string text = FormatOwnedString(LookupMessage(4074), g_runeSystemMgr->GetDecomItem(index)); @@ -1827,7 +1827,7 @@ void UIRuneSystemWnd::Slot15(int, int) { this->m_equipRuneSet->SetSize(0x11B, 0x52); this->m_equipRuneSet->Move(0, top); - this->m_tagList = new UIRuneSystem_tagListWnd(*this->m_context, *reinterpret_cast(nullptr)); + this->m_tagList = new UIRuneSystem_tagListWnd(*this->m_context); this->AddChild(this->m_tagList); this->m_tagList->SetSize(0x11B, 0x20); this->m_tagList->m_firstTag = 0; @@ -1878,7 +1878,7 @@ void UIRuneSystemWnd::Slot15(int, int) { this->m_runeDecom->SetSize(0x273, 0x20A); this->m_runeDecom->Move(0x11B, 0x11); - this->AddCloseButton(*reinterpret_cast(nullptr), LookupMessage(3045), 0); + this->AddCloseButton(LookupMessage(3045), 0); this->SelectTab(); g_session.CollectCardItems(); } @@ -1891,7 +1891,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->m_activeWnd->SetSize(0xE6, 0x8C); this->m_activeWnd->Move(0x46, 0x156); - this->unknown_0084 = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->unknown_0084 = new UIBitmapButton(*this->m_context); this->AddChild(this->unknown_0084); this->unknown_0084->SetBitmap("유저인터페이스\\runesystem\\bt_active_nomal.bmp", 0, 0); this->unknown_0084->SetBitmap("유저인터페이스\\runesystem\\bt_active_mouseon.bmp", 1, 0); @@ -1901,7 +1901,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->unknown_0084->Move(0x6F, 0x1EC); this->unknown_0084->SetId(0x23C); - this->unknown_0088 = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->unknown_0088 = new UIBitmapButton(*this->m_context); this->AddChild(this->unknown_0088); this->unknown_0088->SetBitmap("유저인터페이스\\runesystem\\bt_equip_nomal.bmp", 0, 0); this->unknown_0088->SetBitmap("유저인터페이스\\runesystem\\bt_equip_mouseon.bmp", 1, 0); @@ -1911,7 +1911,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->unknown_0088->Move(0x6F, 0x1EC); this->unknown_0088->SetId(0xC3); - this->unknown_008C = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->unknown_008C = new UIBitmapButton(*this->m_context); this->AddChild(this->unknown_008C); this->unknown_008C->SetBitmap("유저인터페이스\\runesystem\\bt_equiptakeoff_nomal.bmp", 0, 0); this->unknown_008C->SetBitmap("유저인터페이스\\runesystem\\bt_equiptakeoff_mouseon.bmp", 1, 0); @@ -1933,7 +1933,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->m_gauge->SetSize(0x89, 0x7F); this->m_gauge->Move(0x1B1, 0x51); - this->m_gradeText = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); + this->m_gradeText = new UIStaticText(*this->m_context); this->AddChild(this->m_gradeText); this->m_gradeText->SetSize(0x89, 0x7F); const std::string gradeTitle = LookupMessage(4044); @@ -1947,7 +1947,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->m_gradeItems->SetSize(0xE6, 0x8C); this->m_gradeItems->Move(0x17D, 0x130); - this->m_gradeButton = new UIBitmapButton(*this->m_context, *reinterpret_cast(nullptr)); + this->m_gradeButton = new UIBitmapButton(*this->m_context); this->AddChild(this->m_gradeButton); this->m_gradeButton->SetBitmap("유저인터페이스\\runesystem\\bt_upgrade_nomal.bmp", 0, 0); this->m_gradeButton->SetBitmap("유저인터페이스\\runesystem\\bt_upgrade_mouseon.bmp", 1, 0); @@ -1971,7 +1971,7 @@ void UIRuneSet_Info::Slot15(int, int) { const int rewardY[6] = {97, 122, 197, 290, 365, 391}; const int rewardIds[6] = {0x24E, 0x24F, 0x250, 0x251, 0x252, 0x253}; for (int index = 0; index < 6; ++index) { - this->m_rewards[index] = new UIRuneSetReWard(*this->m_context, *reinterpret_cast(nullptr)); + this->m_rewards[index] = new UIRuneSetReWard(*this->m_context); this->AddChild(this->m_rewards[index]); this->m_rewards[index]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_nomal.tga", 0, 0); this->m_rewards[index]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_mouseon.tga", 1, 0); @@ -1986,7 +1986,7 @@ void UIRuneSet_Info::Slot15(int, int) { this->m_rewards[index]->SendMsg(this, 0x66, 0, 0, 0, 0); } - this->m_rewards[6] = new UIRuneSetReWard(*this->m_context, *reinterpret_cast(nullptr)); + this->m_rewards[6] = new UIRuneSetReWard(*this->m_context); this->AddChild(this->m_rewards[6]); this->m_rewards[6]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_l_nomal.tga", 0, 0); this->m_rewards[6]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_l_mouseon.tga", 1, 0); @@ -2450,7 +2450,7 @@ UIRuneSetList::UIRuneSetList(UIWindowContext& windows) : UIScrollBar(windows), m // OFFSET: 0x008149C0 // FUNCTION: fn_10133 -UIRuneSetReWard::UIRuneSetReWard(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls), m_itemId(0), m_state(0) { +UIRuneSetReWard::UIRuneSetReWard(UIWindowContext& windows) : UIBitmapButton(windows), m_itemId(0), m_state(0) { } // OFFSET: 0x00814A50 diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.h b/Source/UI/RuneSystem/UIRuneSystemWnd.h index 8432f0b4..ef494999 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.h +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.h @@ -37,7 +37,7 @@ class RuneSetData; class UIRuneSetReWard : public UIBitmapButton { public: - UIRuneSetReWard(UIWindowContext& windows, UIButtonContext& controls); + UIRuneSetReWard(UIWindowContext& windows); void Paint() override; void Slot28(int x, int y) override; @@ -73,7 +73,7 @@ public: class UIRuneSystem_tagListWnd : public UIWindow { public: - UIRuneSystem_tagListWnd(UIWindowContext& windows, UIButtonContext& controls); + UIRuneSystem_tagListWnd(UIWindowContext& windows); void Paint() override; void Slot25(int x, int y) override; void Slot28(int x, int y) override; @@ -182,7 +182,7 @@ public: class UIRuneSystem_Decom_RadioBtn : public UIRadioBtn { public: - UIRuneSystem_Decom_RadioBtn(UIWindowContext& windows, UIButtonContext& controls); + UIRuneSystem_Decom_RadioBtn(UIWindowContext& windows); void Paint() override; @@ -304,7 +304,7 @@ struct RuneDecomResultPacket { class UIRuneSystem_DecomResultWnd : public UIFrameWnd { public: - UIRuneSystem_DecomResultWnd(UIWindowContext& windows, UIButtonContext& controls); + UIRuneSystem_DecomResultWnd(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; diff --git a/Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h b/Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h index f78699bc..721cac54 100644 --- a/Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h +++ b/Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h @@ -5,7 +5,6 @@ class UIBitmapButton; class UIStaticText; -struct UIButtonContext; class UIMerchantItemPurchaseMSGWnd : public UIFrameWnd { public: @@ -25,7 +24,7 @@ public: /* 00D0 */ int unknown_00D0; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Shop/UIMerchantShopMakeWnd.h b/Source/UI/Shop/UIMerchantShopMakeWnd.h index 8918fc45..fb35b183 100644 --- a/Source/UI/Shop/UIMerchantShopMakeWnd.h +++ b/Source/UI/Shop/UIMerchantShopMakeWnd.h @@ -13,7 +13,6 @@ class UIBasicButton; class UIEditCtrl; -struct UIButtonContext; class UIMerchantShopMakeWnd : public UIFrameWnd { public: @@ -68,7 +67,7 @@ public: /* 018C */ short unknown_018C; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Shop/UIMerchantShopTitle.cpp b/Source/UI/Shop/UIMerchantShopTitle.cpp index a8b05375..d5501b70 100644 --- a/Source/UI/Shop/UIMerchantShopTitle.cpp +++ b/Source/UI/Shop/UIMerchantShopTitle.cpp @@ -14,7 +14,7 @@ // OFFSET: 0x0085ACE0 // FUNCTION: fn_10788 void UIMerchantShopTitle::Slot15(int, int) { - this->label = new UIStaticText(*this->m_context, *this->m_controls); + this->label = new UIStaticText(*this->m_context); this->label->SetSize(this->geometry.width - 34, 15); this->label->Move(31, 8); this->label->SetTextFitted(""); @@ -89,8 +89,8 @@ void UIMerchantShopTitle::Slot32(int, int) { // OFFSET: 0x0084FE60 // FUNCTION: fn_10667 -UIMerchantShopTitle::UIMerchantShopTitle(UIWindowContext& windows, UIButtonContext& controls, ForbiddenWords& forbiddenWords, int buyingShop) - : UIWindow(windows, 0), buyingShop(buyingShop), m_controls(&controls), m_forbiddenWords(&forbiddenWords) { +UIMerchantShopTitle::UIMerchantShopTitle(UIWindowContext& windows, ForbiddenWords& forbiddenWords, int buyingShop) + : UIWindow(windows, 0), buyingShop(buyingShop), m_forbiddenWords(&forbiddenWords) { this->geometry.id = 189; } diff --git a/Source/UI/Shop/UIMerchantShopTitle.h b/Source/UI/Shop/UIMerchantShopTitle.h index bbf69bc3..636fc05d 100644 --- a/Source/UI/Shop/UIMerchantShopTitle.h +++ b/Source/UI/Shop/UIMerchantShopTitle.h @@ -6,12 +6,11 @@ #include class UIStaticText; -struct UIButtonContext; struct ForbiddenWords; class UIMerchantShopTitle : public UIWindow { public: - UIMerchantShopTitle(UIWindowContext& windows, UIButtonContext& controls, ForbiddenWords& forbiddenWords, int buyingShop); + UIMerchantShopTitle(UIWindowContext& windows, ForbiddenWords& forbiddenWords, int buyingShop); void Slot15(int width, int height) override; void Paint() override; void Slot25(int x, int y) override; @@ -27,7 +26,7 @@ public: /* 0088 */ int buyingShop; protected: - UIButtonContext* m_controls; + void* unknown_controls; ForbiddenWords* m_forbiddenWords; }; diff --git a/Source/UI/Shop/UINoticeMessageBox_LockSellItem.h b/Source/UI/Shop/UINoticeMessageBox_LockSellItem.h index 9dd91262..a2d571e0 100644 --- a/Source/UI/Shop/UINoticeMessageBox_LockSellItem.h +++ b/Source/UI/Shop/UINoticeMessageBox_LockSellItem.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; class UINoticeMessageBox_LockSellItem : public UIFrameWnd { public: @@ -19,7 +18,7 @@ public: /* 00B8 */ std::uint32_t duration; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Shortcuts/ShortcutControls.cpp b/Source/UI/Shortcuts/ShortcutControls.cpp index 76f0e03c..8bea7278 100644 --- a/Source/UI/Shortcuts/ShortcutControls.cpp +++ b/Source/UI/Shortcuts/ShortcutControls.cpp @@ -1,3 +1,4 @@ +#include "Contents/MessageTable.h" #include "UI/Shortcuts/ShortcutControls.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UICheckBox.h" @@ -10,16 +11,16 @@ // OFFSET: 0x0092A190 // FUNCTION: fn_12654 ShortcutControls ShortcutControls::Create( - UIFrameWnd& frame, UIWindowContext& windows, UIButtonContext& buttons, int bankOption, NormalItemSlot** slots, NormalItemSlot** itemSlots + UIFrameWnd& frame, UIWindowContext& windows, int bankOption, NormalItemSlot** slots, NormalItemSlot** itemSlots ) { ShortcutControls result; - frame.AddCloseButton(buttons, "F12", 0)->Move(frame.geometry.width - 10, 0); + frame.AddCloseButton("F12", 0)->Move(frame.geometry.width - 10, 0); for (int index = 0; index < 36; ++index) { slots[index] = nullptr; } - result.bank = new (std::nothrow) UICheckBox(windows, buttons); + result.bank = new (std::nothrow) UICheckBox(windows); result.bank->SetSize(10, 26); result.bank->SetImages( "유저인터페이스\\shortcut_2_bts.bmp", @@ -28,14 +29,14 @@ ShortcutControls ShortcutControls::Create( result.bank->SetId(549); result.bank->Move(3, 4); result.bank->SetChecked(bankOption); - result.bank->SetTooltip(buttons.services.MessageText(3596)); + result.bank->SetTooltip(LookupMessage(3596)); frame.AddChild(result.bank); const auto create = [&]( int id, int x, int y, unsigned char disabled, unsigned char enabled, const char* normal, const char* over, const char* pressed, const char* unavailable ) { - UIBitmapButton* button = new UIBitmapButton(windows, buttons); + UIBitmapButton* button = new UIBitmapButton(windows); button->SetBitmap(normal, 0, 0); button->SetBitmap(over, 1, 0); button->SetBitmap(pressed, 2, 0); diff --git a/Source/UI/Shortcuts/ShortcutControls.h b/Source/UI/Shortcuts/ShortcutControls.h index f2e2e3fb..353be867 100644 --- a/Source/UI/Shortcuts/ShortcutControls.h +++ b/Source/UI/Shortcuts/ShortcutControls.h @@ -2,7 +2,6 @@ #define RAGNAROK_SOURCE_UI_SHORTCUTS_SHORTCUTCONTROLS_H struct UIWindowContext; -struct UIButtonContext; class UIFrameWnd; class UICheckBox; class UIBitmapButton; @@ -16,7 +15,7 @@ struct ShortcutControls { UIBitmapButton* hideItems; static ShortcutControls - Create(UIFrameWnd& frame, UIWindowContext& windows, UIButtonContext& buttons, int bankOption, NormalItemSlot** slots, NormalItemSlot** itemSlots); + Create(UIFrameWnd& frame, UIWindowContext& windows, int bankOption, NormalItemSlot** slots, NormalItemSlot** itemSlots); }; #endif diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index 53f07d3a..1c3c5c92 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UINewSelectCharWnd.h" #include "Client/Session.h" #include "Contents/UserData/NormalItemSlots.h" #include "Resource/Bitmap/BitmapResource.h" @@ -346,7 +347,6 @@ void UISeekPartyListWnd::Paint() { // OFFSET: 0x0092E230 // FUNCTION: fn_12676 void UISeekPartyMBWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, "", 0); if (this->m_minimized) { return; @@ -368,7 +368,6 @@ void UISeekPartyMBWnd::Paint() { // OFFSET: 0x0092E300 // FUNCTION: fn_12677 void UISeekPartyWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, "", 0); unsigned red; @@ -786,7 +785,6 @@ void UISelCharForUServerWnd::Paint() { // OFFSET: 0x0092EBE0 // FUNCTION: fn_12679 void UISerachStoreInfoWnd::Paint() { - UIButtonContext& controls = *this->m_controls; const bool empty = std::string(this->m_edits[1]->Text()).size() == 0; this->m_findButton->SetDisabled(empty); this->m_findButton->Invalidate(); @@ -856,7 +854,7 @@ void UISerachStoreInfoWnd::Paint() { const int top = this->unknown_00E8 * row + 100; const int y = top + 7; - DrawItemIcon(*this, controls.resources, descriptions, 13, top, entry->item, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 13, top, entry->item, 0); if (entry->item.unknown_0088 > 0) { this->DrawBitmap( 13, y + 5, diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 264217de..86bb43f0 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -158,7 +158,7 @@ void UIShortCutWnd::Show(int visible) { // OFFSET: 0x0092A190 void UIShortCutWnd::Slot15(int, int) { this->m_controls = - ShortcutControls::Create(*this, *this->m_context, this->m_shortcuts->buttons, g_session.GetOption(10), this->m_slots, this->m_itemSlots); + ShortcutControls::Create(*this, *this->m_context, g_session.GetOption(10), this->m_slots, this->m_itemSlots); } // OFFSET: 0x00932F30 @@ -745,12 +745,12 @@ void UIMemorialDunWnd::Move(int x, int y) { // OFFSET: 0x00921260 // FUNCTION: fn_12641 void UIMemorialDunWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "Alt+B", 0); + this->AddBaseButton(); + this->AddCloseButton("Alt+B", 0); { const std::string name = "유저인터페이스\\btn_ok"; - this->m_actionButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_actionButton = new UIBitmapButton(*this->m_context); this->m_actionButton->SetBitmap((name + ".bmp").c_str(), 0, 0); this->m_actionButton->SetBitmap((name + "_a.bmp").c_str(), 1, 0); this->m_actionButton->SetBitmap((name + "_b.bmp").c_str(), 2, 0); @@ -760,7 +760,7 @@ void UIMemorialDunWnd::Slot15(int, int) { this->AddChild(this->m_actionButton); } - this->m_partyButton = new (std::nothrow) UIBasicButton(*this->m_context, *this->m_controls); + this->m_partyButton = new (std::nothrow) UIBasicButton(*this->m_context); this->m_partyButton->Configure(125, LookupMessage(3270)); this->m_partyButton->Move(-100, -100); this->m_partyButton->SetId(211); @@ -1120,8 +1120,8 @@ bool UINavigationWnd::LoadRoute(int index) { // OFFSET: 0x00911490 // FUNCTION: fn_12515 -UIMemorialDunWnd::UIMemorialDunWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_partyButton(nullptr), m_controls(&controls) { +UIMemorialDunWnd::UIMemorialDunWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_partyButton(nullptr) { } // OFFSET: 0x00912460 diff --git a/Source/UI/Shortcuts/UIShortCutWnd.h b/Source/UI/Shortcuts/UIShortCutWnd.h index c5e855ec..f183337c 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.h +++ b/Source/UI/Shortcuts/UIShortCutWnd.h @@ -13,7 +13,6 @@ struct ShortcutTooltip; struct ShortcutDetails; struct ShortcutUse; struct ShortcutVisibility; -struct UIButtonContext; struct CooldownClock; struct ModeDragState; struct NormalItemSlot; @@ -21,7 +20,6 @@ struct NormalItemSlotWindow; class AutomaticSkills; struct ShortcutWindowContext { - UIButtonContext& buttons; ShortcutBindings& bindings; ShortcutPainting& painting; ShortcutPress& press; diff --git a/Source/UI/Skill/UISkillNameChangeWnd.h b/Source/UI/Skill/UISkillNameChangeWnd.h index 8ac467e7..4b376238 100644 --- a/Source/UI/Skill/UISkillNameChangeWnd.h +++ b/Source/UI/Skill/UISkillNameChangeWnd.h @@ -5,12 +5,11 @@ #include -struct UIButtonContext; class UIEditCtrl; class UISkillNameChangeWnd : public UIFrameWnd { public: - UISkillNameChangeWnd(UIWindowContext& windows, UIButtonContext& controls); + UISkillNameChangeWnd(UIWindowContext& windows); /* 00B4 */ UIEditCtrl* m_edit; /* 00B8 */ int m_skillId; /* 00BC */ std::string m_name; @@ -20,7 +19,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Status/UIStatusWnd.h b/Source/UI/Status/UIStatusWnd.h index 1883af10..0efb0cc2 100644 --- a/Source/UI/Status/UIStatusWnd.h +++ b/Source/UI/Status/UIStatusWnd.h @@ -3,7 +3,6 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct StatusWndInfo; class UIBitmapButton; @@ -11,7 +10,7 @@ class UIBmpTextButton; class UIStatusWnd : public UIFrameWnd { public: - UIStatusWnd(UIWindowContext& windows, UIButtonContext& controls); + UIStatusWnd(UIWindowContext& windows); /* 00B4 */ UIBitmapButton* m_statButtons[6]; /* 00CC */ int m_expandedHeight; /* 00D0 */ StatusWndInfo* m_info; @@ -33,7 +32,7 @@ public: void ValidatePlacement(); protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index 1723e78d..1ec3dad3 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -1,3 +1,8 @@ +#include "Client/Replay.h" +#include "UI/Window/WindowPolicy.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" +#include "Client/Mode/CMode.h" #include "UI/StylingShop/UIStylingShopWnd.h" #include "Client/Mode/ModeEvents.h" #include "Client/Session.h" @@ -11,7 +16,6 @@ #include "Script/LuaScript.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowDialogs.h" -#include "UI/Window/WindowPolicy.h" #include #include @@ -163,16 +167,16 @@ void UIStylingShopButton::Slot31(int, int) { this->geometry.unknown_0030 = 2; UIWindow* parent = this->parent; if (parent) { - if (WindowPolicy(this->m_buttonContext->policy, this->m_buttonContext->restricted, 3, parent->geometry.id) != 0) { + if (WindowPolicy(g_windowMgr.policy[0].actions, g_replayAnimationScaling != 0, 3, parent->geometry.id) != 0) { int id = this->geometry.id; - if (id == 185 && this->m_context->mode && *this->m_buttonContext->activeModeType == 2) { - const char* text = this->m_buttonContext->services.MessageText(17); - if (this->m_buttonContext->services.Confirm(text, 2, 1, 0, "Message", 280, 120) == 187) { + if (id == 185 && this->m_context->mode && static_cast(g_charViewMode)->cursorType == 2) { + const char* text = LookupMessage(17); + if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { this->m_context->mode->SendModeMessage(2, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { - this->m_buttonContext->services.Submit(parent); + RecordEditTextsNoArg(parent); id = this->geometry.id; parent = this->parent; } @@ -202,7 +206,7 @@ void UIStylingShopButton::Slot28(int, int) { screenY += window->geometry.y; } - this->m_buttonContext->services.Tooltip("No Color", screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show("No Color", screenX, screenY, -1, false, true); } // OFFSET: 0x0082A210 @@ -1322,8 +1326,8 @@ UISlotOfMyStyleWnd::UISlotOfMyStyleWnd(UIWindowContext& context) : UIStylingshop // OFFSET: 0x00823370 // FUNCTION: fn_10293 -UIStylingShopWnd::UIStylingShopWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIStylingShopWnd::UIStylingShopWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } #include "Contents/Items/ItemInfo.h" @@ -1509,7 +1513,7 @@ struct StyleChangePacket { // OFFSET: 0x00827AE0 // FUNCTION: fn_10331 void UIStylingShopWnd::AddTab(const char* normal, const char* hover, const char* pressed, const int& id, UIStylingshopTabParentWnd* tab, const char* tooltip) { - UIStylingShopButton* button = new (std::nothrow) UIStylingShopButton(*this->m_context, *this->m_controls); + UIStylingShopButton* button = new (std::nothrow) UIStylingShopButton(*this->m_context); button->SetBitmap(normal, 0, 0); button->SetBitmap(hover, 1, 0); button->SetBitmap(pressed, 2, 0); @@ -1553,7 +1557,7 @@ void UISlotOfMyStyleWnd::Slot15(int, int) { // OFFSET: 0x008294D0 // FUNCTION: fn_10340 void UIStylingShopWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); UIBasicStylingWnd* basic = new (std::nothrow) UIBasicStylingWnd(*this->m_context); this->AddTab("유저인터페이스\\styleshop\\tab_hair_off.bmp", "유저인터페이스\\styleshop\\tab_hair_off.bmp", "유저인터페이스\\styleshop\\tab_hair_on.bmp", 200, basic, @@ -1584,7 +1588,7 @@ void UIStylingShopWnd::Slot15(int, int) { this->m_preview->Show(0); this->AddChild(this->m_preview); - this->m_buyButton = static_cast(new (std::nothrow) UIBitmapButton(*this->m_context, *this->m_controls)); + this->m_buyButton = static_cast(new (std::nothrow) UIBitmapButton(*this->m_context)); this->m_buyButton->SetBitmap("유저인터페이스\\styleshop\\btn_buy_out.bmp", 0, 0); this->m_buyButton->SetBitmap("유저인터페이스\\styleshop\\btn_buy_over.bmp", 1, 0); this->m_buyButton->SetBitmap("유저인터페이스\\styleshop\\btn_buy_down.bmp", 2, 0); @@ -1599,7 +1603,7 @@ void UIStylingShopWnd::Slot15(int, int) { text += FormatGroupedInteger(g_session.m_zeny, zeny, 256); text += "\tz"; - UIStaticText* label = new (std::nothrow) UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* label = new (std::nothrow) UIStaticText(*this->m_context); label->SetSize(200, 12); label->Move(9, 310); label->SetFont(0, 11, 0, 0); diff --git a/Source/UI/StylingShop/UIStylingShopWnd.h b/Source/UI/StylingShop/UIStylingShopWnd.h index eb433c06..4957a283 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.h +++ b/Source/UI/StylingShop/UIStylingShopWnd.h @@ -119,12 +119,12 @@ void ToggleStylingAccessory(int itemId, int slot); class UIStylingShopWnd : public UIFrameWnd { public: - UIStylingShopWnd(UIWindowContext& windows, UIButtonContext& controls); + UIStylingShopWnd(UIWindowContext& windows); /* 00B4 */ UIStylingShopButton* m_buyButton; /* 00B8 */ UIDisplayCharacter* m_preview; /* 00BC */ std::map m_tabs; - UIButtonContext* m_controls; + void* unknown_controls; void Slot15(int width, int height) override; void Slot19() override; @@ -231,7 +231,7 @@ public: UI2ndCostumeCheckBox() : UICheckBox() { } // INLINED - UI2ndCostumeCheckBox(UIWindowContext& windowContext, UIButtonContext& controls) : UICheckBox(windowContext, controls) { + UI2ndCostumeCheckBox(UIWindowContext& windowContext) : UICheckBox(windowContext) { } void Slot25(int x, int y) override; }; @@ -242,7 +242,7 @@ public: UIStylingShopButton() : UIBitmapButton() { } // INLINED - UIStylingShopButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIBitmapButton(windowContext, buttonContext) { + UIStylingShopButton(UIWindowContext& windowContext) : UIBitmapButton(windowContext) { } // INLINED void SetArgument(int argument) { diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index 22c974ac..6a9188f4 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -1,3 +1,4 @@ +#include "Script/LuaScript.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Items/ItemInfo.h" @@ -42,8 +43,8 @@ namespace { // OFFSET: 0x007B2420 // FUNCTION: fn_09186 -UIAchievementWnd::UIAchievementWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), upper(nullptr), tab(nullptr), list(nullptr), group(0), sub(-1), m_controls(&controls) { +UIAchievementWnd::UIAchievementWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), upper(nullptr), tab(nullptr), list(nullptr), group(0), sub(-1) { } // OFFSET: 0x007B2E80 @@ -93,7 +94,7 @@ void UIAchListWnd::Create(int width, int height, int rows) { this->buttons = new UIButton*[this->rowCount]; for (int index = 0; index < this->rowCount; ++index) { - this->buttons[index] = new UIButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIButton(*this->m_context); this->buttons[index]->SetSize(30, 30); this->buttons[index]->Move(5, this->unknown_0084 * index + 5); this->buttons[index]->SetId(index); @@ -108,7 +109,6 @@ void UIAchListWnd::Create(int width, int height, int rows) { // OFFSET: 0x007B3DA0 // FUNCTION: fn_09209 void UIAchTab::DrawGroup(int group) { - UIButtonContext& controls = *this->m_controls; int y = this->groupHeight * group; std::string name = this->groups[group].name; int textY = (this->groupHeight - this->TextHeight(name.c_str(), 0, 0, this->fontHeight, 0, 0)) / 2 + y; @@ -196,7 +196,7 @@ bool UIAchTab::sub_7B4370(int x, int y, int* a, int* b) { // OFFSET: 0x007B4470 // FUNCTION: fn_09212 void UIAchievementWnd::CreateTab() { - UIAchTab* tab = new (std::nothrow) UIAchTab(*this->m_context, *this->m_controls); + UIAchTab* tab = new (std::nothrow) UIAchTab(*this->m_context); this->tab = tab; tab->Slot15(0, 0); tab->tabWidth = 102; @@ -266,7 +266,7 @@ void UIAchUpperWnd::Slot15(int, int) { int index = 0; UIWindow** slot = this->buttons; for (int y = 10; y < 40; y += 15) { - *slot = new UIRadioBtn(*this->m_context, *this->m_controls); + *slot = new UIRadioBtn(*this->m_context); (*slot)->SetSize(12, 12); (*slot)->Move(150, y); (*slot)->SendMsg(this, 13, index == this->selected, 0, 0, 0); @@ -280,7 +280,7 @@ void UIAchUpperWnd::Slot15(int, int) { // FUNCTION: fn_09215 void UIAchViewWnd::Slot15(int, int) { const std::string name = "유저인터페이스\\achievement_re\\btn_receive"; - this->receiveButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->receiveButton = new UIBitmapButton(*this->m_context); this->receiveButton->SetBitmap((name + "_out.bmp").c_str(), 0, 0); this->receiveButton->SetBitmap((name + "_over.bmp").c_str(), 1, 0); this->receiveButton->SetBitmap((name + "_press.bmp").c_str(), 2, 0); @@ -332,7 +332,6 @@ void UIAchViewWnd::Slot15(int, int) { // OFFSET: 0x007B5FF0 // FUNCTION: fn_09217 void UIAchListWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawBitmap(0, 0, AchievementBitmap("유저인터페이스\\achievement_re\\bg_list.bmp"), false); std::map* achievements = reinterpret_cast*>(this->unknown_00AC); @@ -402,26 +401,26 @@ void UIAchListWnd::Paint() { // OFFSET: 0x007B5B60 // FUNCTION: fn_09216 void UIAchievementWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); - this->upper = new (std::nothrow) UIAchUpperWnd(*this->m_context, *this->m_controls); + this->upper = new (std::nothrow) UIAchUpperWnd(*this->m_context); this->upper->SetSize(this->geometry.width, 46); this->upper->Move(0, 17); this->AddChild(this->upper); this->CreateTab(); - this->list = new (std::nothrow) UIAchListWnd(*this->m_context, *this->m_controls); + this->list = new (std::nothrow) UIAchListWnd(*this->m_context); this->list->Create(320, 405, 5); this->list->Move(102, 63); this->AddChild(this->list); - this->view = new UIAchViewWnd(*this->m_context, *this->m_controls); + this->view = new UIAchViewWnd(*this->m_context); this->view->SetSize(328, 405); this->view->Move(422, 63); this->AddChild(this->view); - this->summary = new UIAchSummaryWnd(*this->m_context, *this->m_controls); + this->summary = new UIAchSummaryWnd(*this->m_context); this->summary->SetSize(648, 404); this->summary->Move(102, 63); this->AddChild(this->summary); @@ -493,7 +492,6 @@ void UIAchTV::Paint() { // OFFSET: 0x007B67B0 // FUNCTION: fn_09219 void UIAchSummaryWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawBitmap(0, 0, AchievementBitmap("유저인터페이스\\achievement_re\\bg_summary.bmp"), false); this->DrawTextAt(82, 27, LookupMessage(2679), 0, 0, 12, 0xA55239, 1, 0); this->DrawRightAlignedText(600, 28, FormatOwnedString("%d/%d", this->gauges[0]->value, this->gauges[0]->maximum).c_str(), 0, 0, 11, 0x635AA5, 0); @@ -544,7 +542,6 @@ void UIAchTab::Paint() { // OFFSET: 0x007B7010 // FUNCTION: fn_09222 void UIAchUpperWnd::Paint() { - UIButtonContext& controls = *this->m_controls; int visible; if (this->title == LookupMessage(2679)) { @@ -580,7 +577,6 @@ void UIAchUpperWnd::Paint() { // OFFSET: 0x007B7420 // FUNCTION: fn_09223 void UIAchViewWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->DrawBitmap(0, 0, AchievementBitmap("유저인터페이스\\achievement_re\\bg_detail.bmp"), false); if (this->achievementId == -1 || this->info == nullptr) { return; @@ -1058,12 +1054,12 @@ void UIAchTracingWnd::Slot11() { // FUNCTION: fn_09268 void UIAchTracingWnd::Slot15(int, int) { for (int index = 0; index < 3; ++index) { - this->toggleButtons[index] = new UITextButton(*this->m_context, *this->m_controls); + this->toggleButtons[index] = new UITextButton(*this->m_context); this->toggleButtons[index]->Configure("", 0, 0, 12, 1, 0); this->toggleButtons[index]->SetId(478); this->AddChild(this->toggleButtons[index]); - this->openButtons[index] = new UITextButton(*this->m_context, *this->m_controls); + this->openButtons[index] = new UITextButton(*this->m_context); this->openButtons[index]->Configure("▶", 0, 0, 12, 1, 0); this->openButtons[index]->SetId(479); this->AddChild(this->openButtons[index]); @@ -1073,7 +1069,6 @@ void UIAchTracingWnd::Slot15(int, int) { // OFFSET: 0x007BA590 // FUNCTION: fn_09269 void UIAchTracingWnd::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFFFF00FF); int y = 10; @@ -1212,7 +1207,7 @@ void UIAchSummaryWnd::Slot15(int, int) { UIWindow** slot = this->buttons; for (int x = 62; x < 694; x += 316) { - UITextButton* button = new UITextButton(*this->m_context, *this->m_controls); + UITextButton* button = new UITextButton(*this->m_context); *slot = button; button->Configure("", 0x997836, 0, 12, 1, 0); static_cast(*slot)->m_hoverColor = 0x635AA5; @@ -1479,9 +1474,9 @@ void UIAchViewWnd::UpdateInfo() { // OFFSET: 0x007B1E60 // FUNCTION: fn_09181 -UIAchListWnd::UIAchListWnd(UIWindowContext& windows, UIButtonContext& controls) +UIAchListWnd::UIAchListWnd(UIWindowContext& windows) : UIWindow(windows, 0), buttons(nullptr), unknown_0084(0), rowCount(0), unknown_008C(0), selectedIndex(0), unknown_0094(11), scrollable(0), - unknown_009C(0), unknown_00AC(nullptr), scrollBar(nullptr), m_controls(&controls) { + unknown_009C(0), unknown_00AC(nullptr), scrollBar(nullptr) { } // OFFSET: 0x007B1F40 @@ -1493,19 +1488,19 @@ UIAchScrollBar::UIAchScrollBar(UIWindowContext& windows) : UIScrollBar(windows) // OFFSET: 0x007B1FB0 // FUNCTION: fn_09183 -UIAchSummaryWnd::UIAchSummaryWnd(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), unknown_007C(7), m_controls(&controls) { +UIAchSummaryWnd::UIAchSummaryWnd(UIWindowContext& windows) : UIWindow(windows, 0), unknown_007C(7) { } // OFFSET: 0x007B21D0 // FUNCTION: fn_09184 -UIAchUpperWnd::UIAchUpperWnd(UIWindowContext& windows, UIButtonContext& controls) +UIAchUpperWnd::UIAchUpperWnd(UIWindowContext& windows) : UIWindow(windows, 0), unknown_0094(0), unknown_0098(0), unknown_009C(0), unknown_00A0(0), unknown_00A4(nullptr), unknown_00A8(nullptr), buttons{}, - selected(0), m_controls(&controls) { + selected(0) { } // OFFSET: 0x007B22B0 // FUNCTION: fn_09185 -UIAchViewWnd::UIAchViewWnd(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), achievementId(-1), info(nullptr), m_controls(&controls) { +UIAchViewWnd::UIAchViewWnd(UIWindowContext& windows) : UIWindow(windows, 0), achievementId(-1), info(nullptr) { this->receiveButton = nullptr; this->description = nullptr; for (int index = 0; index < 10; ++index) { diff --git a/Source/UI/Text/UIAchWnd.h b/Source/UI/Text/UIAchWnd.h index c6edcb3f..c033592f 100644 --- a/Source/UI/Text/UIAchWnd.h +++ b/Source/UI/Text/UIAchWnd.h @@ -51,7 +51,7 @@ public: class UIAchListWnd : public UIWindow { public: - UIAchListWnd(UIWindowContext& windows, UIButtonContext& controls); + UIAchListWnd(UIWindowContext& windows); ~UIAchListWnd() override; /* 0080 */ UIButton** buttons; @@ -78,7 +78,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; struct UIAchTabGroup { @@ -89,9 +89,9 @@ struct UIAchTabGroup { class UIAchTab : public UIWindow { public: // INLINED - UIAchTab(UIWindowContext& windows, UIButtonContext& controls) + UIAchTab(UIWindowContext& windows) : UIWindow(windows, 0), unknown_007C(-1), unknown_0080(-1), fontHeight(0), hoverGroup(0), hoverSub(0), scrollBar(nullptr), scrollable(0), - scrollBarX(13), visibleSubs(3), m_controls(&controls) { + scrollBarX(13), visibleSubs(3) { this->fontHeight = 12; this->scrollPos = 0; } @@ -132,7 +132,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIAchTV : public UITextViewer { @@ -174,7 +174,7 @@ private: class UIAchViewWnd : public UIWindow { public: - UIAchViewWnd(UIWindowContext& windows, UIButtonContext& controls); + UIAchViewWnd(UIWindowContext& windows); /* 007C */ UIBitmapButton* receiveButton; /* 0080 */ UIAchTV* description; @@ -191,12 +191,12 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIAchUpperWnd : public UIWindow { public: - UIAchUpperWnd(UIWindowContext& windows, UIButtonContext& controls); + UIAchUpperWnd(UIWindowContext& windows); /* 007C */ std::string title; /* 0094 */ int unknown_0094; @@ -213,12 +213,12 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIAchSummaryWnd : public UIWindow { public: - UIAchSummaryWnd(UIWindowContext& windows, UIButtonContext& controls); + UIAchSummaryWnd(UIWindowContext& windows); /* 007C */ int unknown_007C; /* 0080 */ std::vector gauges; @@ -233,12 +233,12 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIAchievementWnd : public UIFrameWnd { public: - UIAchievementWnd(UIWindowContext& windows, UIButtonContext& controls); + UIAchievementWnd(UIWindowContext& windows); ~UIAchievementWnd() override; /* 00B4 */ UIAchUpperWnd* upper; @@ -259,7 +259,7 @@ public: void SelectTab(int group, int sub); private: - UIButtonContext* m_controls; + void* unknown_controls; }; @@ -292,7 +292,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; private: - UIButtonContext* m_controls; + void* unknown_controls; }; extern std::vector g_achievementTracking; diff --git a/Source/UI/Text/UIStaticText.cpp b/Source/UI/Text/UIStaticText.cpp index 485ef2d7..f63c1260 100644 --- a/Source/UI/Text/UIStaticText.cpp +++ b/Source/UI/Text/UIStaticText.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "UI/Buttons/UIButton.h" #include "UI/Buttons/UIBmpTextButton.h" @@ -7,9 +9,9 @@ // OFFSET: 0x00850550 // FUNCTION: fn_10678 -__declspec(noinline) UIStaticText::UIStaticText(UIWindowContext& windows, UIButtonContext& controls) +__declspec(noinline) UIStaticText::UIStaticText(UIWindowContext& windows) : UIWindow(windows, 0), red(0), green(0), blue(0), shadow(0), outline(0), background(0xFFFF00FFu), outlineColor(0x969696), fontHeight(12), fontFamily(0), - bold(0), italic(0), tooltipEnabled(0), m_controls(&controls) { + bold(0), italic(0), tooltipEnabled(0) { } // OFFSET: 0x00853050 @@ -197,7 +199,7 @@ void UIStaticText::Slot28(int, int) { y = (y + node->geometry.y); } - this->m_controls->services.Tooltip(this->tooltip.c_str(), x, y, -1, false, true); + static_cast(g_charViewMode)->Show(this->tooltip.c_str(), x, y, -1, false, true); } // OFFSET: 0x0085FAB0 @@ -233,7 +235,6 @@ void UIStaticText::Slot35(int value) { // OFFSET: 0x0085DAF0 // FUNCTION: fn_10818 void UIStaticText2::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(this->background); if (this->shadow != 0) { @@ -255,7 +256,6 @@ void UIStaticText2::Paint() { // OFFSET: 0x0085DCA0 // FUNCTION: fn_10819 void UIStaticText3::Paint() { - UIButtonContext& controls = *this->m_controls; this->ClearSurface(this->background); if (this->shadow != 0) { @@ -360,5 +360,5 @@ void UIStaticText::SetTextWithinWidth(const char* value, int outlineValue) { // OFFSET: 0x008504F0 // FUNCTION: fn_10677 -UIStaticText3::UIStaticText3(UIWindowContext& windows, UIButtonContext& controls) : UIStaticText(windows, controls), textX(0) { +UIStaticText3::UIStaticText3(UIWindowContext& windows) : UIStaticText(windows), textX(0) { } diff --git a/Source/UI/Text/UIStaticText.h b/Source/UI/Text/UIStaticText.h index 66306d1f..e798a680 100644 --- a/Source/UI/Text/UIStaticText.h +++ b/Source/UI/Text/UIStaticText.h @@ -5,12 +5,11 @@ #include -struct UIButtonContext; class UIStaticText : public UIWindow { public: UIStaticText(); - UIStaticText(UIWindowContext& windows, UIButtonContext& controls); + UIStaticText(UIWindowContext& windows); ~UIStaticText() override; void Paint() override; void Slot25(int x, int y) override; @@ -48,7 +47,7 @@ public: /* 00C0 */ std::string tooltip; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIStaticText2 : public UIStaticText { @@ -58,7 +57,7 @@ public: class UIStaticText3 : public UIStaticText { public: - UIStaticText3(UIWindowContext& windows, UIButtonContext& controls); + UIStaticText3(UIWindowContext& windows); void Paint() override; /* 00D8 */ int textX; diff --git a/Source/UI/Text/UITextViewer.cpp b/Source/UI/Text/UITextViewer.cpp index 560269b7..3fd518b5 100644 --- a/Source/UI/Text/UITextViewer.cpp +++ b/Source/UI/Text/UITextViewer.cpp @@ -360,7 +360,7 @@ int UITextViewEX::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } } -UIItemTagButton::UIItemTagButton(UIWindowContext& windows, UIButtonContext& buttons) : UITextButton(windows, buttons), unknown_01F8(0), textY(1) { +UIItemTagButton::UIItemTagButton(UIWindowContext& windows) : UITextButton(windows), unknown_01F8(0), textY(1) { } // OFFSET: 0x00874A40 @@ -374,7 +374,7 @@ std::string UIItemTagCtrl::sub_874A40(int tagId, unsigned int color) { UIItemTagButton* button; { const std::string text = "<" + label + ">"; - button = new (std::nothrow) UIItemTagButton(*this->m_context, this->m_edit->buttons); + button = new (std::nothrow) UIItemTagButton(*this->m_context); if (button) { button->Configure(text.c_str(), 0x7F00E4, 0, 12, 0, 0); if (title != label) { diff --git a/Source/UI/Text/UITextViewer.h b/Source/UI/Text/UITextViewer.h index 20909ee3..b735296a 100644 --- a/Source/UI/Text/UITextViewer.h +++ b/Source/UI/Text/UITextViewer.h @@ -6,7 +6,6 @@ #include class UITextButton; -struct UIButtonContext; struct ItemNaming; struct TipBoxTitles; struct ItemLinkDisplay; @@ -24,7 +23,6 @@ protected: struct UITextViewerContext { UIListBoxContext& list; - UIButtonContext& buttons; ItemNaming& items; const TipBoxTitles& tips; TextViewerActions& actions; diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 7cfc2eb9..7a6eea6c 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -79,7 +79,7 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { } for (const auto& link : extracted) { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); @@ -124,7 +124,7 @@ bool UITextViewer::AddNaviLinks(std::string text, unsigned addedLines) { } for (const auto& link : extracted) { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); @@ -224,7 +224,7 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { } for (const auto& link : extracted) { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); @@ -308,7 +308,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { } for (unsigned fragment = 0; fragment < labels.size(); ++fragment) { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(labels[fragment].c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; const int width = this->TextWidth(labels[fragment].c_str(), 0, 0, 12, 0, 0); @@ -323,7 +323,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { this->links.push_back(button); } } else { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); @@ -369,7 +369,7 @@ bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) { } for (const auto& link : extracted) { - auto* button = new UITextButton(*this->m_context, this->m_text->buttons); + auto* button = new UITextButton(*this->m_context); button->Configure(link.display.c_str(), 0x00E6A300, 0, 12, 0, 1); button->m_hoverColor = 0x00EFB700; button->SetId(437); diff --git a/Source/UI/UIBarGraph.h b/Source/UI/UIBarGraph.h index 667922a0..9b80bb9b 100644 --- a/Source/UI/UIBarGraph.h +++ b/Source/UI/UIBarGraph.h @@ -6,7 +6,6 @@ #include #include -struct UIButtonContext; class UIBarGraph : public UIWindow { public: @@ -58,7 +57,7 @@ public: /* 0084 */ bool m_plainColor; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UIINT64BarGraph : public UIWindow { @@ -76,7 +75,7 @@ public: protected: /* 0080 */ std::int64_t m_current; /* 0088 */ std::int64_t m_maximum; - UIButtonContext* m_controls; + void* unknown_controls; }; class UIPetInfoBarGraph : public UIWindow { diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index 371ebc0b..231fb62d 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -1705,7 +1705,7 @@ void UIBarterItemPurchaseWnd::Paint() { } const ITEM_INFO item = it->ToItemInfo(); - DrawItemWithQuantity(*this, this->m_controls->resources, descriptions, this->m_controls->fonts, this->m_controls->locale, x + 44, y + 21, item, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x + 44, y + 21, item, 0, 0); this->DrawItemName(x + 76, y + 29, 100, &item, 0, 0, 12); const std::string iconId = std::to_string(it->field_2c); DrawItemIconById(*this, descriptions, this->geometry.width - 70, y + 21, iconId.c_str(), 1); @@ -1787,9 +1787,9 @@ void UIBartermarketWnd::Paint() { const ITEM_INFO item = it->ToItemInfo(); if (it->flag_38) { - DrawItemIcon(*this, this->m_controls->resources, descriptions, x + 44, y + 21, item, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, x + 44, y + 21, item, 0); } else { - DrawItemWithQuantity(*this, this->m_controls->resources, descriptions, this->m_controls->fonts, this->m_controls->locale, x + 44, y + 21, item, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x + 44, y + 21, item, 0, 0); } this->DrawItemName(x + 76, y + 29, 120, &item, 0, 0, 12); const std::string iconId = std::to_string(it->field_2c); diff --git a/Source/UI/UIBasicCtrl.cpp b/Source/UI/UIBasicCtrl.cpp index 51113b83..fcc5cf09 100644 --- a/Source/UI/UIBasicCtrl.cpp +++ b/Source/UI/UIBasicCtrl.cpp @@ -2,13 +2,13 @@ // OFFSET: 0x0086C410 // FUNCTION: fn_11026 -UIBasicItemCtrl::UIBasicItemCtrl(UIWindowContext& windows, ItemNaming& naming, UIButtonContext& controls, WindowManagerWindows& windowList) - : UIWindow(windows, 0), m_itemType(-1), m_itemMask(-1), m_identified(0), m_tooltip(""), m_item(0), m_naming(&naming), m_controls(&controls), +UIBasicItemCtrl::UIBasicItemCtrl(UIWindowContext& windows, ItemNaming& naming, WindowManagerWindows& windowList) + : UIWindow(windows, 0), m_itemType(-1), m_itemMask(-1), m_identified(0), m_tooltip(""), m_item(0), m_naming(&naming), m_windows(&windowList) { } // OFFSET: 0x0086C4C0 // FUNCTION: fn_11027 -UIBasicSkillCtrl::UIBasicSkillCtrl(UIWindowContext& windows, ClientSkills& skills, UIButtonContext& controls) - : UIWindow(windows, 0), m_skillId(-1), m_skills(&skills), m_controls(&controls), m_level(0) { +UIBasicSkillCtrl::UIBasicSkillCtrl(UIWindowContext& windows, ClientSkills& skills) + : UIWindow(windows, 0), m_skillId(-1), m_skills(&skills), m_level(0) { } diff --git a/Source/UI/UIBasicCtrl.h b/Source/UI/UIBasicCtrl.h index dcd00eb7..0c56efb9 100644 --- a/Source/UI/UIBasicCtrl.h +++ b/Source/UI/UIBasicCtrl.h @@ -8,12 +8,11 @@ struct ItemNaming; struct ClientSkills; -struct UIButtonContext; #include "UI/Window/WindowManagerWindows.h" class UIBasicItemCtrl : public UIWindow { public: - UIBasicItemCtrl(UIWindowContext& windows, ItemNaming& naming, UIButtonContext& controls, WindowManagerWindows& windowList); + UIBasicItemCtrl(UIWindowContext& windows, ItemNaming& naming, WindowManagerWindows& windowList); void Slot10(int argument1, int argument2, std::intptr_t argument3) override; void Paint() override; void Slot26(int x, int y) override; @@ -28,13 +27,13 @@ protected: /* 0088 */ std::string m_tooltip; /* 00A0 */ ITEM_INFO m_item; ItemNaming* m_naming; - UIButtonContext* m_controls; + void* unknown_controls; WindowManagerWindows* m_windows; }; class UIBasicSkillCtrl : public UIWindow { public: - UIBasicSkillCtrl(UIWindowContext& windows, ClientSkills& skills, UIButtonContext& controls); + UIBasicSkillCtrl(UIWindowContext& windows, ClientSkills& skills); void Slot10(int argument1, int argument2, std::intptr_t argument3) override; void Paint() override; void Slot26(int x, int y) override; @@ -44,7 +43,7 @@ public: protected: /* 007C */ int m_skillId; ClientSkills* m_skills; - UIButtonContext* m_controls; + void* unknown_controls; int m_level; }; diff --git a/Source/UI/UIBroadcastBalloon.cpp b/Source/UI/UIBroadcastBalloon.cpp index 660df765..faa0c86d 100644 --- a/Source/UI/UIBroadcastBalloon.cpp +++ b/Source/UI/UIBroadcastBalloon.cpp @@ -9,7 +9,7 @@ // OFFSET: 0x007C27B0 // FUNCTION: fn_09330 -UIBroadcastBalloon::UIBroadcastBalloon(UIWindowContext& windows, UIButtonContext& controls) : UIWindow(windows, 0), m_controls(&controls) { +UIBroadcastBalloon::UIBroadcastBalloon(UIWindowContext& windows) : UIWindow(windows, 0) { } // OFFSET: 0x007C2D70 diff --git a/Source/UI/UIBroadcastBalloon.h b/Source/UI/UIBroadcastBalloon.h index 94fec535..ec864412 100644 --- a/Source/UI/UIBroadcastBalloon.h +++ b/Source/UI/UIBroadcastBalloon.h @@ -10,7 +10,6 @@ #include #include -struct UIButtonContext; struct BroadcastBalloonLine { /* 0000 */ std::string text; @@ -30,7 +29,7 @@ struct BroadcastBalloonMessage { class UIBroadcastBalloon : public UIWindow { public: - UIBroadcastBalloon(UIWindowContext& windows, UIButtonContext& controls); + UIBroadcastBalloon(UIWindowContext& windows); void Paint() override; bool CanHitTest() override; void Slot19() override; @@ -45,7 +44,7 @@ public: protected: /* 007C */ std::map> m_messages; - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/UICaptchaPreviewWnd.cpp b/Source/UI/UICaptchaPreviewWnd.cpp index 37d295e0..ea8aa77a 100644 --- a/Source/UI/UICaptchaPreviewWnd.cpp +++ b/Source/UI/UICaptchaPreviewWnd.cpp @@ -68,7 +68,7 @@ void UICaptchaPreviewWnd::Slot15(int, int) { this->m_image->SetSize(220, 90); this->m_image->Move(0, 0); this->AddChild(this->m_image); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); } // OFFSET: 0x007ED710 diff --git a/Source/UI/UICaptchaPreviewWnd.h b/Source/UI/UICaptchaPreviewWnd.h index f28cb430..cf6dd107 100644 --- a/Source/UI/UICaptchaPreviewWnd.h +++ b/Source/UI/UICaptchaPreviewWnd.h @@ -4,7 +4,6 @@ #include "UI/Window/UIFrameWnd.h" class UICaptchaImage; -struct UIButtonContext; class UICaptchaPreviewWnd : public UIFrameWnd { public: @@ -22,7 +21,7 @@ public: /* 00BC */ unsigned char* m_imageData; /* 00C0 */ int m_imageSize; /* 00C4 */ int m_imageReceived; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UICaptchaRegisterWnd.cpp b/Source/UI/UICaptchaRegisterWnd.cpp index 494f803c..585a0853 100644 --- a/Source/UI/UICaptchaRegisterWnd.cpp +++ b/Source/UI/UICaptchaRegisterWnd.cpp @@ -120,7 +120,6 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) { // OFFSET: 0x007EA8D0 // FUNCTION: fn_09789 void UICaptchaRegisterWnd::Paint() { - UIButtonContext& controls = *this->m_controls; DrawFilledRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height, 0xFFFFFFFF); this->DrawTitleBar(true, "", 0); DrawRectangleBorder(*this, 34, 80, 222, 92, 0); diff --git a/Source/UI/UICaptchaRegisterWnd.h b/Source/UI/UICaptchaRegisterWnd.h index 211339e0..a5b4a363 100644 --- a/Source/UI/UICaptchaRegisterWnd.h +++ b/Source/UI/UICaptchaRegisterWnd.h @@ -10,7 +10,6 @@ class UIComboBoxDefWnd; class UIStaticBitmap; class UIEditCtrl; class UIBitmapButton; -struct UIButtonContext; class UICaptchaRegisterWnd : public UIFrameWnd { public: @@ -33,7 +32,7 @@ public: /* 00E4 */ unsigned int m_decompressedSize; protected: - /* 00E8 */ UIButtonContext* m_controls; + /* 00E8 */ void* unknown_controls; }; #endif diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 0c8fd594..0ec0543d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/UIChangeMaterialWnd.h" #include "Client/Input/InputCharset.h" @@ -36,10 +37,9 @@ // OFFSET: 0x005E03B0 // FUNCTION: fn_03861 -UIChangeMaterialWnd::UIChangeMaterialWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits) +UIChangeMaterialWnd::UIChangeMaterialWnd(UIWindowContext& windows, UIEditContext& edits) : UIFrameWnd(windows, 0), m_sortBox(nullptr), m_button(nullptr), m_resultX(168), m_resultY(131), m_resultItem(), - m_materialPos{{90, 86}, {246, 86}, {168, 222}, {168, 40}, {90, 176}, {246, 176}}, m_materials(), m_resultAmount(0), m_resultText(), - m_controls(&controls), m_editContext(&edits) { + m_materialPos{{90, 86}, {246, 86}, {168, 222}, {168, 40}, {90, 176}, {246, 176}}, m_materials(), m_resultAmount(0), m_resultText(), m_editContext(&edits) { *reinterpret_cast(reinterpret_cast(this) + 0xB4) = 0; *reinterpret_cast(reinterpret_cast(this) + 0xB8) = 0; } @@ -547,13 +547,13 @@ void UIChangeMaterialWnd::Paint() { const MaterialSlotPos* position = this->m_materialPos; for (auto it = this->m_materials.begin(); it != this->m_materials.end(); ++it, ++position) { if (it->identified == 1) { - DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, controls.fonts, controls.locale, position->x, position->y, *it, 1, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, position->x, position->y, *it, 1, 0); } else { - DrawItemWithQuantityAuxiliary(*this, descriptions, controls.fonts, controls.locale, 1, position->x, position->y, *it, 1, 0); + DrawItemWithQuantityAuxiliary(*this, descriptions, g_fontCache, this->m_context->locale, 1, position->x, position->y, *it, 1, 0); } } - DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, controls.fonts, controls.locale, this->m_resultX, this->m_resultY, this->m_resultItem, 1, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, this->m_resultX, this->m_resultY, this->m_resultItem, 1, 0); const std::string amount = FormatOwnedString(LookupMessage(0xE8C), this->m_resultAmount / 10); const int width = this->TextWidth(amount.c_str(), 0, 0x1D, 0x17, 1, 0); @@ -698,7 +698,7 @@ void UIChangeMaterialWnd_List::Slot28(int x, int y) { // OFFSET: 0x005E1320 // FUNCTION: fn_03876 void UIChangeMaterialWnd::Slot15(int width, int height) { - UIBitmapButton* close = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* close = new UIBitmapButton(*this->m_context); close->SetBitmap("유저인터페이스\\basic_interface\\sys_close_off.bmp", 0, 0); close->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 1, 0); close->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 2, 0); @@ -719,7 +719,7 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { edit->topPadding = -1; this->AddChild(edit); - UIBmpTextButton* search = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* search = new UIBmpTextButton(*this->m_context); search->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_search.bmp", 0, 0); search->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_search_over.bmp", 1, 0); search->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_search_press.bmp", 2, 0); @@ -730,7 +730,7 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { search->SetId(321); this->AddChild(search); - UIBitmapButton* refresh = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* refresh = new UIBitmapButton(*this->m_context); refresh->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_refresh.bmp", 0, 0); refresh->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_refresh_over.bmp", 1, 0); refresh->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_refresh_press.bmp", 2, 0); @@ -740,7 +740,7 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { refresh->SetId(415); this->AddChild(refresh); - this->m_sortBox = new UIChangeMaterialWnd_CheckBox(*this->m_context, *this->m_controls); + this->m_sortBox = new UIChangeMaterialWnd_CheckBox(*this->m_context); this->m_sortBox->SetSize(74, 14); this->m_sortBox->SetBitmaps("유저인터페이스\\ChangeMaterial\\btn_sort_up.bmp", "유저인터페이스\\ChangeMaterial\\btn_sort_down.bmp"); this->m_sortBox->ascendingText = LookupMessage(3722); @@ -751,7 +751,7 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { this->m_sortBox->SetChecked(1); this->AddChild(this->m_sortBox); - UIBitmapButton* change = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* change = new UIBitmapButton(*this->m_context); this->m_button = change; change->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_change_start.bmp", 0, 0); change->SetBitmap("유저인터페이스\\ChangeMaterial\\btn_change_over.bmp", 1, 0); @@ -762,7 +762,7 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { change->SetId(184); this->AddChild(change); - UIBasicButton* cancel = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* cancel = new UIBasicButton(*this->m_context); cancel->Configure(42, LookupMessage(3045)); cancel->Move(width - cancel->geometry.width - 55, height - cancel->geometry.height - 12); cancel->SetId(201); diff --git a/Source/UI/UIChangeMaterialWnd.h b/Source/UI/UIChangeMaterialWnd.h index a185a37e..15d31bed 100644 --- a/Source/UI/UIChangeMaterialWnd.h +++ b/Source/UI/UIChangeMaterialWnd.h @@ -11,7 +11,6 @@ #include class UIButton; -struct UIButtonContext; struct UIEditContext; struct MaterialSlotPos { @@ -53,7 +52,7 @@ public: class UIChangeMaterialWnd_CheckBox : public UICheckBox { public: // INLINED - UIChangeMaterialWnd_CheckBox(UIWindowContext& windows, UIButtonContext& controls) : UICheckBox(windows, controls) {} + UIChangeMaterialWnd_CheckBox(UIWindowContext& windows) : UICheckBox(windows) {} void Paint() override; /* 010C */ std::string ascendingText; @@ -62,7 +61,7 @@ public: class UIChangeMaterialWnd : public UIFrameWnd { public: - UIChangeMaterialWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits); + UIChangeMaterialWnd(UIWindowContext& windows, UIEditContext& edits); void Slot15(int width, int height) override; bool Slot02() override; void Paint() override; @@ -85,7 +84,7 @@ public: /* 0208 */ std::string m_resultText; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/UICheckAttendanceWnd.cpp b/Source/UI/UICheckAttendanceWnd.cpp index f242c54d..f742ed79 100644 --- a/Source/UI/UICheckAttendanceWnd.cpp +++ b/Source/UI/UICheckAttendanceWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/UICheckAttendanceWnd.h" #include "Client/Mode/CMode.h" @@ -94,8 +95,8 @@ int UICheckAttendanceWnd::SlotAt(int x, int y) { } // INLINED -UICheckAttendanceWnd_Banner::UICheckAttendanceWnd_Banner(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), m_current(0), m_lastSwitch(timeGetTime()), m_controls(&controls) { +UICheckAttendanceWnd_Banner::UICheckAttendanceWnd_Banner(UIWindowContext& windows) + : UIWindow(windows, 0), m_current(0), m_lastSwitch(timeGetTime()) { } // OFFSET: 0x007DCF50 @@ -118,7 +119,7 @@ void UICheckAttendanceWnd::Slot15(int, int) { this->m_daysLeft = _localtime32(&remaining)->tm_yday; } - this->m_notice = new UIBmpTextButton(*this->m_context, *this->m_controls); + this->m_notice = new UIBmpTextButton(*this->m_context); this->m_notice->SetBitmap("유저인터페이스\\check_attendance\\bt_ok_normal.bmp", 0, 0); this->m_notice->SetBitmap("유저인터페이스\\check_attendance\\bt_ok_normal.bmp", 1, 0); this->m_notice->SetBitmap("유저인터페이스\\check_attendance\\bt_ok_press.bmp", 2, 0); @@ -131,7 +132,7 @@ void UICheckAttendanceWnd::Slot15(int, int) { this->m_notice->SetId(201); this->AddChild(this->m_notice); - this->m_banner = new UICheckAttendanceWnd_Banner(*this->m_context, *this->m_controls); + this->m_banner = new UICheckAttendanceWnd_Banner(*this->m_context); this->m_banner->SetSize(441, 41); this->m_banner->Move(this->geometry.width / 2 - this->m_banner->geometry.width / 2, 85); this->AddChild(this->m_banner); @@ -207,7 +208,7 @@ void UICheckAttendanceWnd::Paint() { const int x = (day - 1) % 5 * 62; const int y = (day - 1) / 5 * 64; - DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, controls.fonts, controls.locale, x + 43, y + 109 + bannerHeight, item, 1, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x + 43, y + 109 + bannerHeight, item, 1, 0); this->DrawCenteredText(x + 26, y + 140 + bannerHeight, FormatOwnedString(LookupMessage(3467), day).c_str(), 58, 0, 12, 0xA44F3B, 1); } } @@ -344,7 +345,7 @@ void UICheckAttendanceWnd_Banner::CreateButtons() { if (this->m_entries.size() > 1) { int index = 0; for (auto it = this->m_entries.begin(); it != this->m_entries.end(); ++it) { - UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context); button->SetBitmap("유저인터페이스\\check_attendance\\btn_ad_off.bmp", 0); button->SetBitmap("유저인터페이스\\check_attendance\\btn_ad_off.bmp", 1); button->SetBitmap("유저인터페이스\\check_attendance\\btn_ad_on.bmp", 2); diff --git a/Source/UI/UICheckAttendanceWnd.h b/Source/UI/UICheckAttendanceWnd.h index 0f2bfc64..1a5878e9 100644 --- a/Source/UI/UICheckAttendanceWnd.h +++ b/Source/UI/UICheckAttendanceWnd.h @@ -8,7 +8,6 @@ #include class UIBmpTextButton; -struct UIButtonContext; struct AttendanceBanner { /* 0000 */ std::string image; @@ -19,7 +18,7 @@ struct AttendanceBanner { class UICheckAttendanceWnd_Banner : public UIWindow { public: - UICheckAttendanceWnd_Banner(UIWindowContext& windows, UIButtonContext& controls); + UICheckAttendanceWnd_Banner(UIWindowContext& windows); ~UICheckAttendanceWnd_Banner() override; void Slot19() override; void Paint() override; @@ -35,7 +34,7 @@ public: /* 0098 */ std::uint32_t m_lastSwitch; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UICheckAttendanceWnd : public UIFrameWnd { @@ -67,7 +66,7 @@ public: /* 00CC */ UIBmpTextButton* m_notice; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIGradeEnchantWnd.cpp b/Source/UI/UIGradeEnchantWnd.cpp index 1bd3f68c..f299ad6c 100644 --- a/Source/UI/UIGradeEnchantWnd.cpp +++ b/Source/UI/UIGradeEnchantWnd.cpp @@ -1,3 +1,6 @@ +#include "UI/Window/WindowDialogs.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "UI/UIGradeEnchantWnd.h" #include "Client/Application/ApplicationWindow.h" @@ -54,18 +57,18 @@ UIGradeEnchantWnd::UIGradeEnchantWnd() // OFFSET: 0x007E6A60 // FUNCTION: fn_09739 -UIGradeEnchant_BtnEnhancedDown::UIGradeEnchant_BtnEnhancedDown(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls) { +UIGradeEnchant_BtnEnhancedDown::UIGradeEnchant_BtnEnhancedDown(UIWindowContext& windows) : UIBitmapButton(windows) { } // OFFSET: 0x007E6AC0 // FUNCTION: fn_09740 -UIGradeEnchant_BtnEnhancedUp::UIGradeEnchant_BtnEnhancedUp(UIWindowContext& windows, UIButtonContext& controls) - : UIBitmapButton(windows, controls), tooltipValue(0), tooltipEnabled(0) { +UIGradeEnchant_BtnEnhancedUp::UIGradeEnchant_BtnEnhancedUp(UIWindowContext& windows) + : UIBitmapButton(windows), tooltipValue(0), tooltipEnabled(0) { } // OFFSET: 0x007E6B30 // FUNCTION: fn_09741 -UIGradeEnchant_BtnStart::UIGradeEnchant_BtnStart(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls) { +UIGradeEnchant_BtnStart::UIGradeEnchant_BtnStart(UIWindowContext& windows) : UIBitmapButton(windows) { } // OFFSET: 0x007E7500 @@ -130,17 +133,17 @@ int UIGradeEnchantWnd::SuccessRate() { // OFFSET: 0x007E7780 // FUNCTION: fn_09753 void UIGradeEnchantWnd::Slot15(int, int) { - if (UIBitmapButton* close = this->AddCloseButton(*this->m_controls, "", 0)) { + if (UIBitmapButton* close = this->AddCloseButton("", 0)) { close->Move(0x180, 0x14); } - auto* title = new UIBasicButton(*this->m_context, *this->m_controls); + auto* title = new UIBasicButton(*this->m_context); title->Configure(0x2A, LookupMessage(0x513)); title->Move(0x159, 299); title->SetId(0xB9); this->AddChild(title); - this->startButton = new UIGradeEnchant_BtnStart(*this->m_context, *this->m_controls); + this->startButton = new UIGradeEnchant_BtnStart(*this->m_context); this->startButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_start.bmp", 0, 0); this->startButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_start_over.bmp", 1, 0); this->startButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_start_press.bmp", 2, 0); @@ -152,7 +155,7 @@ void UIGradeEnchantWnd::Slot15(int, int) { this->startButton->Invalidate(); this->AddChild(this->startButton); - this->enhancedUpButton = new UIGradeEnchant_BtnEnhancedUp(*this->m_context, *this->m_controls); + this->enhancedUpButton = new UIGradeEnchant_BtnEnhancedUp(*this->m_context); this->enhancedUpButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_up.bmp", 0, 0); this->enhancedUpButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_up_over.bmp", 1, 0); this->enhancedUpButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_up_pick.bmp", 2, 0); @@ -163,7 +166,7 @@ void UIGradeEnchantWnd::Slot15(int, int) { this->enhancedUpButton->Invalidate(); this->AddChild(this->enhancedUpButton); - this->enhancedDownButton = new UIGradeEnchant_BtnEnhancedDown(*this->m_context, *this->m_controls); + this->enhancedDownButton = new UIGradeEnchant_BtnEnhancedDown(*this->m_context); this->enhancedDownButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_down.bmp", 0, 0); this->enhancedDownButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_down_over.bmp", 1, 0); this->enhancedDownButton->SetBitmap("유저인터페이스\\grade_enchant\\btn_chance_down_pick.bmp", 2, 0); @@ -174,7 +177,7 @@ void UIGradeEnchantWnd::Slot15(int, int) { this->enhancedDownButton->Invalidate(); this->AddChild(this->enhancedDownButton); - auto* help = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* help = new UIBitmapButton(*this->m_context); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_normal.bmp", 0, 0); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_over.bmp", 1, 0); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_pressed.bmp", 2, 0); @@ -330,7 +333,7 @@ void UIGradeEnchantWnd::Slot31(int x, int y) { if (this->selectedMaterial != row) { if (this->unknown_0114 > 0) { - this->m_controls->services.Confirm(LookupMessage(3831), 0, 1, 0, "Message", 280, 120); + reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3831), 0, true, false, 0, "Message", 280, 120, 0); } this->selectedMaterial = row; @@ -375,7 +378,7 @@ void UIGradeEnchant_BtnEnhancedUp::Slot28(int x, int y) { screenY += window->geometry.y; } - this->m_buttonContext->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x007E8CC0 @@ -493,7 +496,7 @@ int UIGradeEnchantWnd::SendMsg( const int quantity = LookupClientItem(g_session.m_inventoryItems, this->materials[this->selectedMaterial].itemId, 0).quantity; if (quantity >= this->materials[this->selectedMaterial].amount && g_session.m_zeny >= this->SelectedMaterialZeny()) { if (this->unknown_0110 != 0 || this->unknown_0114 != 0 || - this->m_controls->services.Confirm(LookupMessage(3823), 2, 1, 0, "Message", 280, 120) != 188) { + reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(3823), 2, true, false, 0, "Message", 280, 120, 0) != 188) { this->unknown_0220 = 1; GradeEnchantRequestPacket packet; diff --git a/Source/UI/UIGradeEnchantWnd.h b/Source/UI/UIGradeEnchantWnd.h index 51b8ea69..4e259beb 100644 --- a/Source/UI/UIGradeEnchantWnd.h +++ b/Source/UI/UIGradeEnchantWnd.h @@ -32,14 +32,14 @@ static_assert(sizeof(GradeEnchantInfo) == 16); class UIGradeEnchant_BtnStart : public UIBitmapButton { public: - UIGradeEnchant_BtnStart(UIWindowContext& windows, UIButtonContext& controls); + UIGradeEnchant_BtnStart(UIWindowContext& windows); void Paint() override; void Enable(unsigned char value) override; }; class UIGradeEnchant_BtnEnhancedUp : public UIBitmapButton { public: - UIGradeEnchant_BtnEnhancedUp(UIWindowContext& windows, UIButtonContext& controls); + UIGradeEnchant_BtnEnhancedUp(UIWindowContext& windows); void Paint() override; void Slot28(int x, int y) override; void Enable(unsigned char value) override; @@ -50,7 +50,7 @@ public: class UIGradeEnchant_BtnEnhancedDown : public UIBitmapButton { public: - UIGradeEnchant_BtnEnhancedDown(UIWindowContext& windows, UIButtonContext& controls); + UIGradeEnchant_BtnEnhancedDown(UIWindowContext& windows); void Paint() override; void Enable(unsigned char value) override; }; @@ -104,7 +104,7 @@ public: /* 00BC */ UIGradeEnchant_BtnEnhancedDown* enhancedDownButton; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIHotkeyGuideWnd.cpp b/Source/UI/UIHotkeyGuideWnd.cpp index 874f6f50..fd933679 100644 --- a/Source/UI/UIHotkeyGuideWnd.cpp +++ b/Source/UI/UIHotkeyGuideWnd.cpp @@ -1,3 +1,5 @@ +#include "Script/LuaScript.h" +#include "UI/Window/UIWindowMgr.h" #include "UI/UIHotkeyGuideWnd.h" #include "Contents/Hotkeys/HotkeyInfo.h" @@ -15,8 +17,8 @@ // OFFSET: 0x009663D0 // FUNCTION: fn_13154 -UIHotkeyGuideWnd::UIHotkeyGuideWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIHotkeyGuideWnd::UIHotkeyGuideWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { this->m_current = 4698; } @@ -53,15 +55,14 @@ HotkeyGuideLabel::~HotkeyGuideLabel() { // OFFSET: 0x00966C70 // FUNCTION: fn_13164 void UIHotkeyGuideWnd::Slot15(int, int) { - UIButtonContext& controls = *this->m_controls; - UIBitmapButton* base = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* base = new UIBitmapButton(*this->m_context); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_off.bmp", 0, 0); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 1, 0); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 2, 0); base->SetSize(base->BitmapWidth(), base->BitmapHeight()); base->Move(3, 3); this->AddChild(base); - this->AddCloseButton(controls, "", 0); + this->AddCloseButton("", 0); this->m_labels[8] = HotkeyGuideLabel("←", HotkeyGuideKey(528, 93, 0, 75, 15, 36), HotkeyGuideKey()); this->m_labels[9] = HotkeyGuideLabel("Tab", HotkeyGuideKey(21, 132, 0, 55, 15, 36), HotkeyGuideKey()); @@ -166,7 +167,7 @@ void UIHotkeyGuideWnd::Slot15(int, int) { int messages[18] = {105, 104, 283, 106, 103, 3134, 1317, 2859, 2353, 265, 3135, 2350, 3136, 2646, 3225, 3137, 574, 3138}; int hotkeys[18] = {47, 1, 2, 9, 5, 10, 3, 8, 42, -1, 46, 38, 51, 49, 6, 37, 17, 12}; for (int i = 0; i < 18; ++i) { - HotkeyInfo hotkey = GetHotkeyInfo(controls.behavior, 1, hotkeys[i]); + HotkeyInfo hotkey = GetHotkeyInfo(*g_luaScript, 1, hotkeys[i]); if (messages[i] == 265) { this->m_entries.push_back(HotkeyGuideEntry(messages[i], 27, 0)); } else { @@ -176,7 +177,7 @@ void UIHotkeyGuideWnd::Slot15(int, int) { int index = 0; for (auto entry = this->m_entries.begin(); entry != this->m_entries.end(); ++entry) { - UIBasicButton* tab = new UIBasicButton(*this->m_context, controls); + UIBasicButton* tab = new UIBasicButton(*this->m_context); tab->Configure(118, LookupMessage(entry->id)); tab->Move(index / 6 * 246 + 26, index % 6 * 30 + 310); tab->SetId(entry->id); @@ -185,7 +186,7 @@ void UIHotkeyGuideWnd::Slot15(int, int) { ++index; } - UIBmpTextButton* settings = new UIBmpTextButton(*this->m_context, controls); + UIBmpTextButton* settings = new UIBmpTextButton(*this->m_context); settings->SetBitmap("유저인터페이스\\hotkey_guide\\bt_keysettings_normal.bmp", 0, 0); settings->SetBitmap("유저인터페이스\\hotkey_guide\\bt_keysettings_over.bmp", 1, 0); settings->SetBitmap("유저인터페이스\\hotkey_guide\\bt_keysettings_press.bmp", 2, 0); @@ -199,7 +200,6 @@ void UIHotkeyGuideWnd::Slot15(int, int) { // OFFSET: 0x0096B730 // FUNCTION: fn_13165 void UIHotkeyGuideWnd::Paint() { - UIButtonContext& controls = *this->m_controls; auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\hotkey_guide\\bg_shortcuts.bmp"))); this->DrawBitmap(0, 0, &background->image, false); this->DrawTitleBar(false, LookupMessage(3128), 0); @@ -332,7 +332,6 @@ void UIHotkeyGuideWnd::DrawKey(const HotkeyGuideKey* key) { // OFFSET: 0x0096C730 // FUNCTION: fn_13174 void UIHotkeyGuideWnd::DrawKeyLabel(std::string text, const HotkeyGuideKey* key) { - UIButtonContext& controls = *this->m_controls; int x = key->x; if (key->align == 6) { int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); diff --git a/Source/UI/UIHotkeyGuideWnd.h b/Source/UI/UIHotkeyGuideWnd.h index b5c45e34..9078f334 100644 --- a/Source/UI/UIHotkeyGuideWnd.h +++ b/Source/UI/UIHotkeyGuideWnd.h @@ -7,7 +7,6 @@ #include #include -struct UIButtonContext; struct HotkeyGuideEntry { /* 0000 */ int id; @@ -45,7 +44,7 @@ struct HotkeyGuideLabel { class UIHotkeyGuideWnd : public UIFrameWnd { public: - UIHotkeyGuideWnd(UIWindowContext& windows, UIButtonContext& controls); + UIHotkeyGuideWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Slot19() override; void Paint() override; @@ -60,7 +59,7 @@ protected: /* 00C8 */ std::vector m_tabs; /* 00D4 */ int m_current; /* 00D8 */ std::vector m_keys; - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/UIIngredientInfoWnd.h b/Source/UI/UIIngredientInfoWnd.h index 7420c5bb..1d1e65b3 100644 --- a/Source/UI/UIIngredientInfoWnd.h +++ b/Source/UI/UIIngredientInfoWnd.h @@ -6,7 +6,6 @@ #include -struct UIButtonContext; class UILapineBox_IngredientListWnd; class UIIngredientInfoWnd : public UIFrameWnd { diff --git a/Source/UI/UIItemReformWnd.cpp b/Source/UI/UIItemReformWnd.cpp index c1ddbc9b..a6e73c08 100644 --- a/Source/UI/UIItemReformWnd.cpp +++ b/Source/UI/UIItemReformWnd.cpp @@ -89,16 +89,16 @@ void UIItemReformWnd_List::Move(int x, int y) { // OFFSET: 0x005FCD20 // FUNCTION: fn_04108 void UIItemReformWnd::Slot15(int width, int height) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); - UIBasicButton* cancel = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* cancel = new UIBasicButton(*this->m_context); cancel->Configure(60, LookupMessage(218)); cancel->Move(300, 236); cancel->SetId(201); this->AddChild(cancel); - this->reformButton = new UIBasicButton(*this->m_context, *this->m_controls); + this->reformButton = new UIBasicButton(*this->m_context); this->reformButton->Configure(60, LookupMessage(3847)); this->reformButton->Move(365, 236); this->reformButton->SetId(184); @@ -129,7 +129,7 @@ void UIItemReformWnd::Slot15(int width, int height) { this->materialIcons.push_back(icon); } - this->detailButton = new UIItemReformWnd_DetailBtn(*this->m_context, *this->m_controls); + this->detailButton = new UIItemReformWnd_DetailBtn(*this->m_context); this->detailButton->SetSize(149, 14); this->detailButton->Move(36, 124); this->detailButton->Enable(0); @@ -183,7 +183,6 @@ void UIItemReformWnd::Paint() { void UIItemReformWnd_DetailBtn::Paint() { this->ClearSurface(0xFFFF00FF); std::string text = LookupMessage(3854); - UIButtonContext& controls = *this->m_buttonContext; const unsigned int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); this->DrawCenteredText(0, 0, text.c_str(), this->geometry.width, 0, 12, 0, 0); this->FillRegion((this->geometry.width - textWidth) * 0.5, 12, textWidth, 1, 0); diff --git a/Source/UI/UIItemReformWnd.h b/Source/UI/UIItemReformWnd.h index 993f7810..9630cc94 100644 --- a/Source/UI/UIItemReformWnd.h +++ b/Source/UI/UIItemReformWnd.h @@ -50,7 +50,7 @@ public: class UIItemReformWnd_DetailBtn : public UIButton { public: // INLINED - UIItemReformWnd_DetailBtn(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIButton(windowContext, buttonContext) { + UIItemReformWnd_DetailBtn(UIWindowContext& windowContext) : UIButton(windowContext) { } void Paint() override; void Slot47() override; @@ -89,7 +89,7 @@ public: /* 02D0 */ std::vector materials; /* 02DC */ std::string information; /* 02F4 */ std::string warning; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UILapineScrollBar.cpp b/Source/UI/UILapineScrollBar.cpp index 9a61bc39..b1eceb47 100644 --- a/Source/UI/UILapineScrollBar.cpp +++ b/Source/UI/UILapineScrollBar.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/UIIngredientInfoWnd.h" #include "UI/UILapineScrollBar.h" @@ -148,22 +149,21 @@ void UILapineBox_IngredientListWnd::Slot10(int, int, std::intptr_t value) { // OFFSET: 0x005FF920 // FUNCTION: fn_04153 void UILapineBoxWnd::Slot15(int, int) { - UIButtonContext& controls = *this->m_controls; - UIBitmapButton* base = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* base = new UIBitmapButton(*this->m_context); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_off.bmp", 0, 0); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 1, 0); base->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 2, 0); base->SetSize(base->BitmapWidth(), base->BitmapHeight()); base->Move(3, 3); this->AddChild(base); - this->AddCloseButton(controls, "", 0); + this->AddCloseButton("", 0); UILapineBox_IngredientListWnd* list = new UILapineBox_IngredientListWnd(*this->m_context, 150, 204); this->ingredientList = list; list->Move(241, 17); this->AddChild(list); - UIBitmapButton* cancel = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* cancel = new UIBitmapButton(*this->m_context); this->cancelButton = cancel; cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_out.bmp", 0, 0); cancel->SetBitmap("유저인터페이스\\lapine\\btn_cancel_over.bmp", 1, 0); @@ -174,7 +174,7 @@ void UILapineBoxWnd::Slot15(int, int) { cancel->SetId(201); this->AddChild(cancel); - UIBitmapButton* make = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* make = new UIBitmapButton(*this->m_context); this->makeButton = make; make->SetBitmap("유저인터페이스\\lapine\\btn_make_out.bmp", 0, 0); make->SetBitmap("유저인터페이스\\lapine\\btn_make_over.bmp", 1, 0); @@ -185,7 +185,7 @@ void UILapineBoxWnd::Slot15(int, int) { make->SetId(503); this->AddChild(make); - UIBitmapButton* move = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* move = new UIBitmapButton(*this->m_context); this->moveButton = move; move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_out.bmp", 0, 0); move->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_over.bmp", 1, 0); @@ -242,7 +242,6 @@ void UIIngredientInfoWnd::Paint() { // OFFSET: 0x005FFF90 // FUNCTION: fn_04156 void UILapineBoxWnd::Paint() { - UIButtonContext& controls = *this->m_controls; CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\bg_lapine.bmp"))); this->DrawBitmap(0, 0, &background->image, true); @@ -279,7 +278,7 @@ void UILapineBoxWnd::Paint() { } CBitmapRes* slot = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\shadow_item_off.bmp"))); this->DrawBitmap(x - 4, y + 11, &slot->image, true); - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, y, this->items[index], 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, y, this->items[index], 0, 0); } if (timeGetTime() < this->noticeTick + this->noticeDuration) { diff --git a/Source/UI/UILapineScrollBar.h b/Source/UI/UILapineScrollBar.h index eb45608d..a8191b7c 100644 --- a/Source/UI/UILapineScrollBar.h +++ b/Source/UI/UILapineScrollBar.h @@ -13,7 +13,6 @@ #include class UIBitmapButton; -struct UIButtonContext; class UILapineUpgradeBox_IngredientInfoWnd; class UILapineBoxWnd; @@ -120,7 +119,7 @@ public: /* 0128 */ unsigned char waiting; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 6b656909..70f32642 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "UI/UILapineUpgradeBoxWnd.h" #include "Client/Mode/ModeMgr.h" @@ -46,9 +48,9 @@ namespace { // OFFSET: 0x00602D30 // FUNCTION: fn_04187 -UILapineUpgradeBoxWnd::UILapineUpgradeBoxWnd(UIWindowContext& windows, UIButtonContext& controls) +UILapineUpgradeBoxWnd::UILapineUpgradeBoxWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), closeButton(nullptr), upgradeButton(nullptr), selectButton(nullptr), ingredientList(nullptr), ingredientId(0), - noticeTick(0), noticeDuration(3000), waiting(0), m_controls(&controls) { + noticeTick(0), noticeDuration(3000), waiting(0) { } // OFFSET: 0x00602E60 @@ -74,15 +76,14 @@ void UILapineUpgradeBoxWndNoop() {} // OFFSET: 0x006036E0 // FUNCTION: fn_04198 void UILapineUpgradeBoxWnd::Slot15(int, int) { - UIButtonContext& controls = *this->m_controls; - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->ingredientList = new UILapineUpgradeBox_IngredientListWnd(*this->m_context, 150, 204); this->ingredientList->Move(241, 17); this->AddChild(this->ingredientList); - this->closeButton = new UIBitmapButton(*this->m_context, controls); + this->closeButton = new UIBitmapButton(*this->m_context); this->closeButton->SetBitmap("유저인터페이스\\lapine\\btn_cancel_out.bmp", 0, 0); this->closeButton->SetBitmap("유저인터페이스\\lapine\\btn_cancel_over.bmp", 1, 0); this->closeButton->SetBitmap("유저인터페이스\\lapine\\btn_cancel_press.bmp", 2, 0); @@ -92,7 +93,7 @@ void UILapineUpgradeBoxWnd::Slot15(int, int) { this->closeButton->SetId(201); this->AddChild(this->closeButton); - this->upgradeButton = new UIBitmapButton(*this->m_context, controls); + this->upgradeButton = new UIBitmapButton(*this->m_context); this->upgradeButton->SetBitmap("유저인터페이스\\lapine\\btn_make_out.bmp", 0, 0); this->upgradeButton->SetBitmap("유저인터페이스\\lapine\\btn_make_over.bmp", 1, 0); this->upgradeButton->SetBitmap("유저인터페이스\\lapine\\btn_make_press.bmp", 2, 0); @@ -102,7 +103,7 @@ void UILapineUpgradeBoxWnd::Slot15(int, int) { this->upgradeButton->SetId(509); this->AddChild(this->upgradeButton); - this->selectButton = new UIBitmapButton(*this->m_context, controls); + this->selectButton = new UIBitmapButton(*this->m_context); this->selectButton->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_out.bmp", 0, 0); this->selectButton->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_over.bmp", 1, 0); this->selectButton->SetBitmap("유저인터페이스\\lapine\\btn_moveitem_press.bmp", 2, 0); @@ -137,9 +138,8 @@ void UILapineUpgradeBox_IngredientInfoWnd::Paint() { this->DrawBitmap(32, 0, bitmap ? &bitmap->image : nullptr, false); } - UIButtonContext& controls = *this->m_controls; ItemDescriptions descriptions{g_itemDescriptions}; - DrawItemIcon(*this, controls.resources, descriptions, 4, 3, this->item, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 4, 3, this->item, 0); const std::string name = this->FitDisplayText(100, this->item.unknown_0044.c_str(), 0, 12, 0); this->DrawShadowedText(36, 9, name.c_str(), 0, 0, 0xE0E0E0, 0, 12, 0); @@ -148,7 +148,6 @@ void UILapineUpgradeBox_IngredientInfoWnd::Paint() { // OFFSET: 0x00603B60 // FUNCTION: fn_04200 void UILapineUpgradeBoxWnd::Paint() { - UIButtonContext& controls = *this->m_controls; CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\bg_lapineUpgrade.bmp"))); this->DrawBitmap(0, 0, &background->image, true); @@ -161,7 +160,7 @@ void UILapineUpgradeBoxWnd::Paint() { if (this->item.unknown_0000[1] != 0) { ItemDescriptions descriptions{g_itemDescriptions}; - DrawItemIcon(*this, controls.resources, descriptions, 101, 165, this->item, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 101, 165, this->item, 0); } if (timeGetTime() < this->noticeTick + this->noticeDuration) { @@ -466,7 +465,7 @@ void UILapineUpgradeBox_IngredientInfoWnd::Slot28(int x, int y) { int tipX = 0; int tipY = -20; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(this->tooltip.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->Show(this->tooltip.c_str(), tipX, tipY, -1, false, true); } } @@ -479,7 +478,7 @@ void UILapineUpgradeBoxWnd::Slot28(int x, int y) { int tipX = 101; int tipY = 145; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(this->item.unknown_0044.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->Show(this->item.unknown_0044.c_str(), tipX, tipY, -1, false, true); } } diff --git a/Source/UI/UILapineUpgradeBoxWnd.h b/Source/UI/UILapineUpgradeBoxWnd.h index 45661bb1..d7878204 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.h +++ b/Source/UI/UILapineUpgradeBoxWnd.h @@ -8,7 +8,6 @@ #include class UIBitmapButton; -struct UIButtonContext; class UILapineUpgradeBox_IngredientListWnd; class UILapineUpgradeBox_IngredientInfoWnd : public UIFrameWnd { @@ -32,14 +31,14 @@ public: /* 01CC */ int quantity; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; class UILapineUpgradeBoxWnd : public UIFrameWnd { friend class UILapineUpgradeBox_IngredientListWnd; public: - UILapineUpgradeBoxWnd(UIWindowContext& windows, UIButtonContext& controls); + UILapineUpgradeBoxWnd(UIWindowContext& windows); ~UILapineUpgradeBoxWnd() override; void Slot10(int x, int y, std::intptr_t value) override; void Slot15(int width, int height) override; @@ -71,7 +70,7 @@ public: /* 0214 */ unsigned char waiting; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIMacroBlackListCheckWnd.cpp b/Source/UI/UIMacroBlackListCheckWnd.cpp index 1d68e1d0..b776c0c3 100644 --- a/Source/UI/UIMacroBlackListCheckWnd.cpp +++ b/Source/UI/UIMacroBlackListCheckWnd.cpp @@ -42,10 +42,9 @@ void UIMacroBlackListCheckWnd::Slot15(int width, int height) { std::mt19937 engine(std::random_device{}()); std::shuffle(this->digits, this->digits + 10, engine); - UIButtonContext& controls = *this->m_controls; std::string directory; - this->okButton = new UIBitmapButton(*this->m_context, controls); + this->okButton = new UIBitmapButton(*this->m_context); this->okButton->SetBitmap("유저인터페이스\\btn_big_ok.bmp", 0, 0); this->okButton->SetBitmap("유저인터페이스\\btn_big_ok_a.bmp", 1, 0); this->okButton->SetBitmap("유저인터페이스\\btn_big_ok_b.bmp", 2, 0); @@ -71,7 +70,7 @@ void UIMacroBlackListCheckWnd::Slot15(int width, int height) { for (int i = 0; i < 10; ++i) { const int digit = this->digits[i]; UIBitmapButton*& button = this->digitButtons[i]; - button = new UIBitmapButton(*this->m_context, controls); + button = new UIBitmapButton(*this->m_context); button->SetBitmap((directory + names[digit][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((directory + names[digit][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((directory + names[digit][2] + ".bmp").c_str(), 2, 0); @@ -81,7 +80,7 @@ void UIMacroBlackListCheckWnd::Slot15(int width, int height) { this->AddChild(button); } - this->resetButton = new UIBitmapButton(*this->m_context, controls); + this->resetButton = new UIBitmapButton(*this->m_context); this->resetButton->SetBitmap((directory + names[10][0] + ".bmp").c_str(), 0, 0); this->resetButton->SetBitmap((directory + names[10][1] + ".bmp").c_str(), 1, 0); this->resetButton->SetBitmap((directory + names[10][2] + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/UIMacroBlackListCheckWnd.h b/Source/UI/UIMacroBlackListCheckWnd.h index 6a014609..54091095 100644 --- a/Source/UI/UIMacroBlackListCheckWnd.h +++ b/Source/UI/UIMacroBlackListCheckWnd.h @@ -6,7 +6,6 @@ #include class UIBitmapButton; -struct UIButtonContext; class UIMacroBlackListCheckWnd : public UIFrameWnd { public: @@ -38,7 +37,7 @@ public: /* 0158 */ std::uint32_t startTick; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 2dbafe80..2ad2610e 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -46,9 +46,9 @@ MacroReporterEntry::MacroReporterEntry(std::string name, int id, short unknown_0 // OFFSET: 0x007EEA00 // FUNCTION: fn_09832 -UIMacroReporterWnd::UIMacroReporterWnd(UIWindowContext& windows, UIButtonContext& controls) +UIMacroReporterWnd::UIMacroReporterWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), m_scrollBar(nullptr), m_scrollable(false), unknown_00C8(13), m_firstRow(0), m_visibleRows(10), unknown_00D4(nullptr), - m_reportButton(nullptr), m_mode(0), m_edit(nullptr), unknown_00F4(1), unknown_00F8(5), m_state(nullptr), unknown_010C(false), m_controls(&controls) { + m_reportButton(nullptr), m_mode(0), m_edit(nullptr), unknown_00F4(1), unknown_00F8(5), m_state(nullptr), unknown_010C(false) { this->m_tabs[0] = nullptr; this->m_tabs[1] = nullptr; this->m_tabs[2] = nullptr; @@ -60,8 +60,8 @@ UIMacroReporterWnd::UIMacroReporterWnd(UIWindowContext& windows, UIButtonContext // OFFSET: 0x007EEBC0 // FUNCTION: fn_09833 -UIMacroUserInfoWnd::UIMacroUserInfoWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIMacroUserInfoWnd::UIMacroUserInfoWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x007EF2C0 @@ -129,7 +129,7 @@ void UIMacroReporterWnd::sub_7EF430(int aid, std::string name) { this->AddChild(btn1); std::string truncated = this->sub_7EF680(0x8E, name.c_str(), 0, 13, 0); - auto* btn2 = new UITextButton(*this->m_context, *this->m_controls); + auto* btn2 = new UITextButton(*this->m_context); btn2->Configure("", 0, 0, 13, 0, 1); static_cast(btn2)->m_hoverColor = 0x2D2D2D; btn2->label = truncated; @@ -182,7 +182,7 @@ bool UIMacroUserInfoWnd::Slot08() { // OFFSET: 0x007F0EE0 // FUNCTION: fn_09847 void UIMacroUserInfoWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); } // OFFSET: 0x007F0EF0 @@ -445,14 +445,14 @@ void __stdcall SendMacroUserInfoPacket(std::uint16_t first, std::uint16_t second // OFFSET: 0x007F0490 // FUNCTION: fn_09846 void UIMacroReporterWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->m_scrollBar = new UIScrollBar(*this->m_context); this->m_scrollBar->Configure(186, 56, 1, 216); this->AddChild(this->m_scrollBar); - UICheckBox* check = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* check = new UICheckBox(*this->m_context); this->unknown_00D4 = check; check->SetSize(42, 20); check->SetBitmaps("유저인터페이스\\btn_q_active_a.bmp", "유저인터페이스\\btn_q_active.bmp"); @@ -460,7 +460,7 @@ void UIMacroReporterWnd::Slot15(int, int) { check->SetChecked(0); this->AddChild(check); - UIBitmapButton* report = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* report = new UIBitmapButton(*this->m_context); this->m_reportButton = report; report->SetBitmap("유저인터페이스\\btn_ok.bmp", 0, 0); report->SetBitmap("유저인터페이스\\btn_ok_a.bmp", 1, 0); @@ -476,7 +476,7 @@ void UIMacroReporterWnd::Slot15(int, int) { int index = 0; for (; index < 2; ++index) { - UIRadioBtn* tab = new UIRadioBtn(*this->m_context, *this->m_controls); + UIRadioBtn* tab = new UIRadioBtn(*this->m_context); this->m_tabs[index] = tab; tab->SetSize(50, 12); tab->Move(14 + index * 55, 31); @@ -490,7 +490,7 @@ void UIMacroReporterWnd::Slot15(int, int) { this->AddChild(tab); } for (; index < 4; ++index) { - UIRadioBtn* tab = new UIRadioBtn(*this->m_context, *this->m_controls); + UIRadioBtn* tab = new UIRadioBtn(*this->m_context); this->m_tabs[index] = tab; tab->SetSize(50, 12); tab->Move(70 + index * 30, 31); diff --git a/Source/UI/UIMacroUserInfoWnd.h b/Source/UI/UIMacroUserInfoWnd.h index 53434800..65f1eb18 100644 --- a/Source/UI/UIMacroUserInfoWnd.h +++ b/Source/UI/UIMacroUserInfoWnd.h @@ -9,11 +9,10 @@ class UIButton; class UIScrollBar; -struct UIButtonContext; class UIMacroUserInfoWnd : public UIFrameWnd { public: - UIMacroUserInfoWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMacroUserInfoWnd(UIWindowContext& windows); bool Slot08() override; void Slot15(int width, int height) override; void Paint() override; @@ -23,7 +22,7 @@ public: /* 00B4 */ std::string m_name; /* 00CC */ std::string m_message; - UIButtonContext* m_controls; + void* unknown_controls; }; struct MacroReporterEntry { @@ -47,7 +46,7 @@ struct MacroReporterState { class UIMacroReporterWnd : public UIFrameWnd { public: - UIMacroReporterWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMacroReporterWnd(UIWindowContext& windows); void Slot11() override; void Slot15(int width, int height) override; void Slot19() override; @@ -90,7 +89,7 @@ public: /* 024C */ bool m_namesValid; /* 024D */ bool m_targetValid; /* 0250 */ int m_nameCount; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIPreviewEquipWnd.cpp b/Source/UI/UIPreviewEquipWnd.cpp index fb5ca2a2..2dc119f3 100644 --- a/Source/UI/UIPreviewEquipWnd.cpp +++ b/Source/UI/UIPreviewEquipWnd.cpp @@ -20,8 +20,8 @@ // OFFSET: 0x007F2F90 // FUNCTION: fn_09879 -UIPreviewEquipWnd::UIPreviewEquipWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 1), saved(nullptr), m_render(nullptr), m_leftButton(nullptr), m_rightButton(nullptr), unknown_00C4(0), m_controls(&controls) { +UIPreviewEquipWnd::UIPreviewEquipWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 1), saved(nullptr), m_render(nullptr), m_leftButton(nullptr), m_rightButton(nullptr), unknown_00C4(0) { } // OFFSET: 0x007F3090 @@ -72,12 +72,11 @@ void UIPreviewEquipWnd::DrawCharacter() { // OFFSET: 0x007F38A0 // FUNCTION: fn_09882 void UIPreviewEquipWnd::Slot15(int width, int height) { - UIButtonContext& controls = *this->m_controls; - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); - UIStaticText* shadow = new UIStaticText(*this->m_context, controls); + UIStaticText* shadow = new UIStaticText(*this->m_context); shadow->SetSize( this->TextWidth(LookupMessage(0xB90), 0, 0, 12, 0, 0), this->TextHeight(LookupMessage(0xB90), 0, 0, 12, 0, 0) @@ -87,7 +86,7 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { shadow->Move(19, 4); this->AddChild(shadow); - UIStaticText* title = new UIStaticText(*this->m_context, controls); + UIStaticText* title = new UIStaticText(*this->m_context); title->SetSize( this->TextWidth(LookupMessage(0xB90), 0, 0, 12, 0, 0), this->TextHeight(LookupMessage(0xB90), 0, 0, 12, 0, 0) @@ -103,7 +102,7 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { this->m_render = new CCharacterRender(width, height); this->SyncFromPlayer(); - this->m_leftButton = new UIBitmapButton(*this->m_context, controls); + this->m_leftButton = new UIBitmapButton(*this->m_context); this->m_leftButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_l_out.bmp", 0, 0); this->m_leftButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_l_over.bmp", 1, 0); this->m_leftButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_l_press.bmp", 2, 0); @@ -112,7 +111,7 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { this->m_leftButton->SetId(0x180); this->AddChild(this->m_leftButton); - this->m_rightButton = new UIBitmapButton(*this->m_context, controls); + this->m_rightButton = new UIBitmapButton(*this->m_context); this->m_rightButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_r_out.bmp", 0, 0); this->m_rightButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_r_over.bmp", 1, 0); this->m_rightButton->SetBitmap("유저인터페이스\\equip_preview\\chr_arrow_rotate_r_press.bmp", 2, 0); @@ -121,7 +120,7 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { this->m_rightButton->SetId(0x181); this->AddChild(this->m_rightButton); - this->unknown_00C4 = new UIBasicButton(*this->m_context, controls); + this->unknown_00C4 = new UIBasicButton(*this->m_context); this->unknown_00C4->Configure(80, LookupMessage(0xB9F)); this->unknown_00C4->Move(static_cast((this->geometry.width - this->unknown_00C4->geometry.width) * 0.5), this->geometry.height - 30); this->unknown_00C4->SetId(0x16B); diff --git a/Source/UI/UIPreviewEquipWnd.h b/Source/UI/UIPreviewEquipWnd.h index fdc03382..06b6a06a 100644 --- a/Source/UI/UIPreviewEquipWnd.h +++ b/Source/UI/UIPreviewEquipWnd.h @@ -7,11 +7,10 @@ class CCharacterRender; class UIBasicButton; class UIBitmapButton; struct PreviewEquipWndInfo; -struct UIButtonContext; class UIPreviewEquipWnd : public UIFrameWnd { public: - UIPreviewEquipWnd(UIWindowContext& windows, UIButtonContext& controls); + UIPreviewEquipWnd(UIWindowContext& windows); ~UIPreviewEquipWnd() override; void Slot11() override; void Paint() override; @@ -29,7 +28,7 @@ public: /* 00C4 */ UIBasicButton* unknown_00C4; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index e61bf3a2..f9bc4bcd 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "UI/UIRefiningWnd.h" #include "Client/Application/ApplicationWindow.h" @@ -59,33 +61,33 @@ UIRefiningWnd::UIRefiningWnd(UIWindowContext& windows) // OFFSET: 0x007F4A70 // FUNCTION: fn_09891 -UIRefining_BtnAgain::UIRefining_BtnAgain(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls), cost(0) { +UIRefining_BtnAgain::UIRefining_BtnAgain(UIWindowContext& windows) : UIBitmapButton(windows), cost(0) { } // OFFSET: 0x007F4AD0 // FUNCTION: fn_09892 -UIRefining_BtnRefining::UIRefining_BtnRefining(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls), cost(0) { +UIRefining_BtnRefining::UIRefining_BtnRefining(UIWindowContext& windows) : UIBitmapButton(windows), cost(0) { } // OFFSET: 0x007F4B30 // FUNCTION: fn_09893 -UIRefining_BtnReturn::UIRefining_BtnReturn(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls), highlighted(1) { +UIRefining_BtnReturn::UIRefining_BtnReturn(UIWindowContext& windows) : UIBitmapButton(windows), highlighted(1) { } // OFFSET: 0x007F5E30 // FUNCTION: fn_09907 void UIRefiningWnd::Slot15(int width, int height) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); - UIBasicButton* basic = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* basic = new UIBasicButton(*this->m_context); basic->Configure(56, LookupMessage(218)); basic->Move(204, 322); basic->SetId(185); this->AddChild(basic); this->unknown_00C0 = basic; - this->refiningButton = new UIRefining_BtnRefining(*this->m_context, *this->m_controls); + this->refiningButton = new UIRefining_BtnRefining(*this->m_context); this->refiningButton->SetBitmap("유저인터페이스\\refining_renewal\\bt_refining_normal.bmp", 0, 0); this->refiningButton->SetBitmap("유저인터페이스\\refining_renewal\\bt_refining_normal.bmp", 1, 0); this->refiningButton->SetBitmap("유저인터페이스\\refining_renewal\\bt_refining_press.bmp", 2, 0); @@ -97,26 +99,26 @@ void UIRefiningWnd::Slot15(int width, int height) { this->refiningButton->Invalidate(); this->AddChild(this->refiningButton); - this->returnButton = new UIRefining_BtnReturn(*this->m_context, *this->m_controls); + this->returnButton = new UIRefining_BtnReturn(*this->m_context); this->returnButton->UpdateBitmaps(); this->returnButton->Move(20, 267); this->returnButton->SetId(519); this->returnButton->Enable(0); this->AddChild(this->returnButton); - this->againButton = new UIRefining_BtnAgain(*this->m_context, *this->m_controls); + this->againButton = new UIRefining_BtnAgain(*this->m_context); this->againButton->UpdateBitmaps(); this->againButton->Move(142, 267); this->againButton->SetId(520); this->againButton->Enable(0); this->AddChild(this->againButton); - this->notice = new UIRefining_Notice(*this->m_context, *this->m_controls); + this->notice = new UIRefining_Notice(*this->m_context); this->notice->SetSize(194, 22); this->notice->Move(6, 322); this->AddChild(this->notice); - UIBitmapButton* help = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* help = new UIBitmapButton(*this->m_context); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_normal.bmp", 0, 0); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_over.bmp", 1, 0); help->SetBitmap("유저인터페이스\\basic_interface\\btn_help_pressed.bmp", 2, 0); @@ -338,7 +340,6 @@ void UIRefiningWnd::ApplyResult() { // FUNCTION: fn_09909 void UIRefining_BtnAgain::Paint() { UIBitmapButton::Paint(); - auto& controls = *this->m_buttonContext; if (this->m_disabled == 1) { int width = this->TextWidth(LookupMessage(3241), 0, 0, 12, 1, 0); std::uint32_t color = this->success == 1 ? 0xE1C1F : (this->m_disabled == 1 ? 0x6F4333 : 0x3E1B12); @@ -370,7 +371,6 @@ void UIRefining_BtnAgain::Paint() { // FUNCTION: fn_09910 void UIRefining_BtnRefining::Paint() { UIBitmapButton::Paint(); - auto& controls = *this->m_buttonContext; int width = this->TextWidth(LookupMessage(2966), 0, 0, 13, 1, 0); std::uint32_t color = this->m_disabled == 1 ? 0x94644A : 0x3E1B12; this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), @@ -388,7 +388,6 @@ void UIRefining_BtnRefining::Paint() { // FUNCTION: fn_09911 void UIRefining_BtnReturn::Paint() { UIBitmapButton::Paint(); - auto& controls = *this->m_buttonContext; int width = this->TextWidth(LookupMessage(2973), 0, 0, 12, 1, 0); std::uint32_t color = this->highlighted == 1 ? 0xE1C1F : 0x3E1B12; this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), @@ -408,7 +407,6 @@ void UIRefining_Notice::Paint() { std::list lines; this->WrapFormattedText(this->text, &lines, this->geometry.width - 18, 0, 11, 0); - auto& controls = *this->m_controls; int offset = 0; for (const std::string& line : lines) { this->DrawTextAt(18, static_cast((this->geometry.height - lines.size() * 11) * 0.5 + offset), line.c_str(), 0, 0, 11, color, 0, 0 @@ -547,7 +545,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = 81; int tipY = 150; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(name, tipX, tipY - 20, -1, false, true); + static_cast(g_charViewMode)->Show(name, tipX, tipY - 20, -1, false, true); return; } @@ -560,7 +558,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = 161; int tipY = 150; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(name, tipX, tipY - 20, -1, false, true); + static_cast(g_charViewMode)->Show(name, tipX, tipY - 20, -1, false, true); return; } @@ -591,7 +589,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = slot * 49 + 11; int tipY = 35; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(name, tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->Show(name, tipX, tipY, -1, false, true); } } @@ -1074,7 +1072,6 @@ void UIRefiningWnd::Paint() { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(background.c_str()))); this->DrawBitmap(1, 17, bitmap ? &bitmap->image : nullptr, false); - UIButtonContext& controls = *this->m_controls; ItemDescriptions descriptions{g_itemDescriptions}; if (this->state == 1) { @@ -1097,11 +1094,11 @@ void UIRefiningWnd::Paint() { ITEM_INFO icon; icon.SetItemId(material->itemId); const int owned = LookupClientItem(g_session.m_inventoryItems, material->itemId, 0).quantity; - DrawItemIcon(*this, controls.resources, descriptions, x + 12, 69, icon, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, x + 12, 69, icon, 0); const std::string count = FormatOwnedString("%s%d^000000/1", owned != 0 ? "" : color, owned); this->DrawFormattedText(x, 107, count, 48, 6, 0, 12, 0, 0); if (index == this->selectedMaterial && (this->state == 1 || (this->state == 2 && this->frame == 0))) { - DrawItemIcon(*this, controls.resources, descriptions, 81, 150, icon, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 81, 150, icon, 0); } ++index; x += 49; @@ -1111,17 +1108,17 @@ void UIRefiningWnd::Paint() { ITEM_INFO icon; icon.SetItemId(this->catalystItemId); const int owned = LookupClientItem(g_session.m_inventoryItems, this->catalystItemId, 0).quantity; - DrawItemIcon(*this, controls.resources, descriptions, 218, 69, icon, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 218, 69, icon, 0); const std::string count = FormatOwnedString("%s%d^000000/%d", this->catalystCount <= owned ? "" : color, owned, this->catalystCount); this->DrawFormattedText(206, 107, count, 48, 6, 0, 12, 0, 0); if (this->catalystEnabled == 1 && (this->state == 1 || (this->state == 2 && this->frame < 13))) { - DrawItemIcon(*this, controls.resources, descriptions, 161, 150, icon, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 161, 150, icon, 0); } } } if (this->item.unknown_0000[1] != 0) { - DrawItemIcon(*this, controls.resources, descriptions, 120, 212, this->item, 0); + DrawItemIcon(*this, ResourceMgr::Instance(), descriptions, 120, 212, this->item, 0); if (this->item.unknown_0088 > 0) { bitmap = static_cast( ResourceMgr::Instance().Load(Resolve(FormatOwnedString("유저인터페이스\\grade_enchant\\grade_icon%d.bmp", this->item.unknown_0088).c_str())) diff --git a/Source/UI/UIRefiningWnd.h b/Source/UI/UIRefiningWnd.h index c6d7fdcd..01f7eed3 100644 --- a/Source/UI/UIRefiningWnd.h +++ b/Source/UI/UIRefiningWnd.h @@ -24,7 +24,7 @@ static_assert(sizeof(RefiningMaterial) == 9); class UIRefining_BtnAgain : public UIBitmapButton { public: - UIRefining_BtnAgain(UIWindowContext& windows, UIButtonContext& controls); + UIRefining_BtnAgain(UIWindowContext& windows); void Paint() override; void Enable(unsigned char value) override; void UpdateBitmaps(); @@ -36,7 +36,7 @@ public: class UIRefining_BtnRefining : public UIBitmapButton { public: - UIRefining_BtnRefining(UIWindowContext& windows, UIButtonContext& controls); + UIRefining_BtnRefining(UIWindowContext& windows); void Paint() override; void Enable(unsigned char value) override; @@ -45,7 +45,7 @@ public: class UIRefining_BtnReturn : public UIBitmapButton { public: - UIRefining_BtnReturn(UIWindowContext& windows, UIButtonContext& controls); + UIRefining_BtnReturn(UIWindowContext& windows); void Paint() override; void UpdateBitmaps(); @@ -55,8 +55,8 @@ public: class UIRefining_Notice : public UIStaticText { public: // INLINED - UIRefining_Notice(UIWindowContext& windows, UIButtonContext& controls) - : UIStaticText(windows, controls), savedHighlight(0), expireTick(0), autoShown(0), highlight(0) {} + UIRefining_Notice(UIWindowContext& windows) + : UIStaticText(windows), savedHighlight(0), expireTick(0), autoShown(0), highlight(0) {} void Slot19() override; void Paint() override; void SetNotice(const char* value, int duration, unsigned char highlight); @@ -111,7 +111,7 @@ public: /* 0208 */ ITEM_INFO nextItem; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/UIReputeWnd.cpp b/Source/UI/UIReputeWnd.cpp index 4aaa2a05..47dbeb2c 100644 --- a/Source/UI/UIReputeWnd.cpp +++ b/Source/UI/UIReputeWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "UI/UIReputeWnd.h" #include "Contents/MessageTable.h" #include "Contents/ReputeMgr.h" @@ -47,8 +48,8 @@ bool UIReputeWnd::Slot02() { // OFFSET: 0x0060F180 // FUNCTION: fn_04313 void UIReputeWnd::Slot15(int width, int height) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->m_groupCombo = new UIComboBoxDefWnd(*this->m_context, *this->m_comboContext); this->m_groupCombo->dropdownHeight = 160; @@ -72,7 +73,7 @@ void UIReputeWnd::Slot15(int width, int height) { this->m_searchEdit->flat = 0; this->AddChild(this->m_searchEdit); - UIBitmapButton* search = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* search = new UIBitmapButton(*this->m_context); search->SetBitmap("유저인터페이스\\Reputation\\btn_search.bmp", 0, 0); search->SetBitmap("유저인터페이스\\Reputation\\btn_search_over.bmp", 1, 0); search->SetBitmap("유저인터페이스\\Reputation\\btn_search_press.bmp", 2, 0); @@ -84,7 +85,7 @@ void UIReputeWnd::Slot15(int width, int height) { this->AddChild(search); this->m_message0 = 321; - this->m_prevButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_prevButton = new UIBitmapButton(*this->m_context); this->m_prevButton->SetBitmap("유저인터페이스\\Reputation\\arrow_prev.bmp", 0, 0); this->m_prevButton->SetBitmap("유저인터페이스\\Reputation\\arrow_prev.bmp", 1, 0); this->m_prevButton->SetBitmap("유저인터페이스\\Reputation\\arrow_prev.bmp", 2, 0); @@ -95,7 +96,7 @@ void UIReputeWnd::Slot15(int width, int height) { this->m_prevButton->SetId(316); this->AddChild(this->m_prevButton); - this->m_nextButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_nextButton = new UIBitmapButton(*this->m_context); this->m_nextButton->SetBitmap("유저인터페이스\\Reputation\\arrow_next.bmp", 0, 0); this->m_nextButton->SetBitmap("유저인터페이스\\Reputation\\arrow_next.bmp", 1, 0); this->m_nextButton->SetBitmap("유저인터페이스\\Reputation\\arrow_next.bmp", 2, 0); @@ -106,7 +107,7 @@ void UIReputeWnd::Slot15(int width, int height) { this->m_nextButton->SetId(317); this->AddChild(this->m_nextButton); - UIBasicButton* close = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* close = new UIBasicButton(*this->m_context); close->Configure(42, LookupMessage(3045)); close->Move(589, 425); close->SetId(201); @@ -126,7 +127,6 @@ void UIReputeWnd::Slot15(int width, int height) { // OFFSET: 0x0060F8F0 // FUNCTION: fn_04314 void UIReputeWnd::Paint() { - auto& controls = *this->m_controls; this->ClearSurface(0xFFFFFFFF); const int titleHeight = this->DrawTitleBar(false, LookupMessage(3827), 0); const int barHeight = this->DrawButtonBar(2, 0, 1); diff --git a/Source/UI/UIReputeWnd.h b/Source/UI/UIReputeWnd.h index 27098c5b..10831493 100644 --- a/Source/UI/UIReputeWnd.h +++ b/Source/UI/UIReputeWnd.h @@ -12,7 +12,6 @@ struct ReputeInfo; class UIBitmapButton; class UIComboBoxDefWnd; class UIEditCtrl; -struct UIButtonContext; struct UIComboBoxHeaderContext; struct UIEditContext; @@ -39,7 +38,7 @@ public: std::vector m_reputes; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; UIComboBoxHeaderContext* m_comboContext; }; diff --git a/Source/UI/UISlotBitmap.cpp b/Source/UI/UISlotBitmap.cpp index 20dd372a..cb3badc3 100644 --- a/Source/UI/UISlotBitmap.cpp +++ b/Source/UI/UISlotBitmap.cpp @@ -5,7 +5,7 @@ // FUNCTION: fn_10789 void UISlotBitmap::Slot15(int, int) { if (this->unknown_00B8 == 1) { - this->addButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->addButton = new UIBitmapButton(*this->m_context); this->addButton->SetBitmap("유저인터페이스\\select_character\\btn_add_out.bmp", 0, 0); this->addButton->SetBitmap("유저인터페이스\\select_character\\btn_add_over.bmp", 1, 0); this->addButton->SetBitmap("유저인터페이스\\select_character\\btn_add_press.bmp", 2, 0); @@ -64,7 +64,7 @@ int UISlotBitmap::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 // OFFSET: 0x008501D0 // FUNCTION: fn_10672 -UISlotBitmap::UISlotBitmap(UIWindowContext& windows, UIButtonContext& controls, int slot) : UIStaticBitmap(windows, controls) { +UISlotBitmap::UISlotBitmap(UIWindowContext& windows, int slot) : UIStaticBitmap(windows) { this->slot = slot; this->unknown_00B8 = 0; this->addButton = nullptr; @@ -72,7 +72,7 @@ UISlotBitmap::UISlotBitmap(UIWindowContext& windows, UIButtonContext& controls, // OFFSET: 0x00850240 // FUNCTION: fn_10673 -UISlotBitmap::UISlotBitmap(UIWindowContext& windows, UIButtonContext& controls, int slot, unsigned char flag) : UIStaticBitmap(windows, controls) { +UISlotBitmap::UISlotBitmap(UIWindowContext& windows, int slot, unsigned char flag) : UIStaticBitmap(windows) { this->slot = slot; this->unknown_00B8 = flag; this->addButton = nullptr; diff --git a/Source/UI/UISlotBitmap.h b/Source/UI/UISlotBitmap.h index e19b9c3d..52221cb6 100644 --- a/Source/UI/UISlotBitmap.h +++ b/Source/UI/UISlotBitmap.h @@ -7,8 +7,8 @@ class UIBitmapButton; class UISlotBitmap : public UIStaticBitmap { public: - UISlotBitmap(UIWindowContext& windows, UIButtonContext& controls, int slot); - UISlotBitmap(UIWindowContext& windows, UIButtonContext& controls, int slot, unsigned char flag); + UISlotBitmap(UIWindowContext& windows, int slot); + UISlotBitmap(UIWindowContext& windows, int slot, unsigned char flag); void Slot15(int width, int height) override; void Slot25(int x, int y) override; void Slot26(int x, int y) override; diff --git a/Source/UI/UIStaticBitmap.cpp b/Source/UI/UIStaticBitmap.cpp index 074ef447..28e1b1c7 100644 --- a/Source/UI/UIStaticBitmap.cpp +++ b/Source/UI/UIStaticBitmap.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -6,8 +8,8 @@ // OFFSET: 0x00850430 // FUNCTION: fn_10676 -UIStaticBitmap::UIStaticBitmap(UIWindowContext& windows, UIButtonContext& controls) - : UIWindow(windows, 0), tooltipX(0), tooltipY(-20), forwardHover(0), m_controls(&controls) { +UIStaticBitmap::UIStaticBitmap(UIWindowContext& windows) + : UIWindow(windows, 0), tooltipX(0), tooltipY(-20), forwardHover(0) { } // OFFSET: 0x00852F20 @@ -79,7 +81,7 @@ void UIStaticBitmap::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - this->m_controls->services.Tooltip(this->tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(this->tooltip.c_str(), screenX, screenY, -1, false, true); } } diff --git a/Source/UI/UIStaticBitmap.h b/Source/UI/UIStaticBitmap.h index f7dc04d6..3099f1d6 100644 --- a/Source/UI/UIStaticBitmap.h +++ b/Source/UI/UIStaticBitmap.h @@ -5,12 +5,11 @@ #include -struct UIButtonContext; class UIStaticBitmap : public UIWindow { public: UIStaticBitmap(); - UIStaticBitmap(UIWindowContext& windows, UIButtonContext& controls); + UIStaticBitmap(UIWindowContext& windows); ~UIStaticBitmap() override; void Paint() override; void Slot25(int x, int y) override; @@ -32,7 +31,7 @@ public: /* 00B4 */ int forwardHover; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/UIStaticItem.cpp b/Source/UI/UIStaticItem.cpp index cb86c41a..22d3e83a 100644 --- a/Source/UI/UIStaticItem.cpp +++ b/Source/UI/UIStaticItem.cpp @@ -2,8 +2,8 @@ // OFFSET: 0x0086E970 // FUNCTION: fn_11079 -UIStaticItem::UIStaticItem(UIWindowContext& windows, ItemDescriptions& descriptions, UIButtonContext& controls, WindowManagerWindows& windowList) - : UIWindow(windows, 0), m_item(), m_descriptions(&descriptions), m_controls(&controls), m_windows(&windowList) { +UIStaticItem::UIStaticItem(UIWindowContext& windows, ItemDescriptions& descriptions, WindowManagerWindows& windowList) + : UIWindow(windows, 0), m_item(), m_descriptions(&descriptions), m_windows(&windowList) { } // OFFSET: 0x00871A00 diff --git a/Source/UI/UIStaticItem.h b/Source/UI/UIStaticItem.h index ee3871b5..da267e14 100644 --- a/Source/UI/UIStaticItem.h +++ b/Source/UI/UIStaticItem.h @@ -5,12 +5,11 @@ #include "UI/Window/UIWindow.h" struct ItemDescriptions; -struct UIButtonContext; #include "UI/Window/WindowManagerWindows.h" class UIStaticItem : public UIWindow { public: - UIStaticItem(UIWindowContext& windows, ItemDescriptions& descriptions, UIButtonContext& controls, WindowManagerWindows& windowList); + UIStaticItem(UIWindowContext& windows, ItemDescriptions& descriptions, WindowManagerWindows& windowList); ~UIStaticItem() override; void Paint() override; void Slot28(int x, int y) override; @@ -19,7 +18,7 @@ public: protected: /* 0080 */ ITEM_INFO m_item; ItemDescriptions* m_descriptions; - UIButtonContext* m_controls; + void* unknown_controls; WindowManagerWindows* m_windows; }; diff --git a/Source/UI/Window/UIAccountLimitedToolWnd.cpp b/Source/UI/Window/UIAccountLimitedToolWnd.cpp index 12cefa0b..c79052cf 100644 --- a/Source/UI/Window/UIAccountLimitedToolWnd.cpp +++ b/Source/UI/Window/UIAccountLimitedToolWnd.cpp @@ -51,7 +51,7 @@ struct AccountLimitedRange { // OFFSET: 0x0094A450 // FUNCTION: fn_12890 void UIAccountLimitedToolWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); const int editPositions[15][2] = { {90, 25}, {90, 77}, {90, 99}, {125, 99}, {160, 99}, {268, 99}, {305, 99}, {90, 121}, @@ -100,7 +100,7 @@ void UIAccountLimitedToolWnd::Slot15(int, int) { this->AddChild(this->m_edits[i]); } - this->m_accountIdText = new UIStaticText(*this->m_context, *this->m_controls); + this->m_accountIdText = new UIStaticText(*this->m_context); this->m_accountIdText->SetSize(200, 17); this->m_accountIdText->Move(90, 47); this->m_accountIdText->background = 0xFF969696; @@ -117,7 +117,7 @@ void UIAccountLimitedToolWnd::Slot15(int, int) { {"btn_deleteItem", "btn_deleteItem_a", "btn_deleteItem_b", "btn_deleteItem_c"}, }; for (int i = 0; i < 3; ++i) { - this->m_buttons[i] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_buttons[i] = new UIBitmapButton(*this->m_context); this->m_buttons[i]->SetBitmap((prefix + buttonNames[i][0] + ".bmp").c_str(), 0, 0); this->m_buttons[i]->SetBitmap((prefix + buttonNames[i][1] + ".bmp").c_str(), 1, 0); this->m_buttons[i]->SetBitmap((prefix + buttonNames[i][2] + ".bmp").c_str(), 2, 0); @@ -142,7 +142,6 @@ void UIAccountLimitedToolWnd::Slot15(int, int) { // OFFSET: 0x0094CF50 // FUNCTION: fn_12901 void UIAccountLimitedToolWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(false, LookupMessage(3650), 0); this->DrawPanelBackground(17, 0, ""); this->DrawTextAt(5, 28, LookupMessage(3651), 0, 0, 12, 0, 0, 0); @@ -367,8 +366,8 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ // OFFSET: 0x00946800 // FUNCTION: fn_12846 -UIAccountLimitedToolWnd::UIAccountLimitedToolWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits, UITextViewerContext& texts) - : UIFrameWnd(windows, 0), m_accountIdText(nullptr), m_viewer(nullptr), m_controls(&controls), m_editContext(&edits), m_textContext(&texts) { +UIAccountLimitedToolWnd::UIAccountLimitedToolWnd(UIWindowContext& windows, UIEditContext& edits, UITextViewerContext& texts) + : UIFrameWnd(windows, 0), m_accountIdText(nullptr), m_viewer(nullptr), m_editContext(&edits), m_textContext(&texts) { SecureZeroMemory(this->m_edits, sizeof(this->m_edits)); SecureZeroMemory(this->m_buttons, sizeof(this->m_buttons)); } diff --git a/Source/UI/Window/UIAccountLimitedToolWnd.h b/Source/UI/Window/UIAccountLimitedToolWnd.h index e29fce04..68c53201 100644 --- a/Source/UI/Window/UIAccountLimitedToolWnd.h +++ b/Source/UI/Window/UIAccountLimitedToolWnd.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; struct UIEditContext; struct UITextViewerContext; class UIBitmapButton; @@ -15,7 +14,7 @@ class UITextViewer; class UIAccountLimitedToolWnd : public UIFrameWnd { public: - UIAccountLimitedToolWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& edits, UITextViewerContext& texts); + UIAccountLimitedToolWnd(UIWindowContext& windows, UIEditContext& edits, UITextViewerContext& texts); 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; @@ -27,7 +26,7 @@ public: /* 0104 */ std::string unknown_0104; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; UITextViewerContext* m_textContext; }; diff --git a/Source/UI/Window/UIBalloonOpenBtn.cpp b/Source/UI/Window/UIBalloonOpenBtn.cpp index 3f7a8905..7462ee0d 100644 --- a/Source/UI/Window/UIBalloonOpenBtn.cpp +++ b/Source/UI/Window/UIBalloonOpenBtn.cpp @@ -31,8 +31,8 @@ void UIBalloonOpenBtn::Slot19() { // OFFSET: 0x009468D0 // FUNCTION: fn_12847 -UIBalloonOpenBtn::UIBalloonOpenBtn(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_openTime(0), m_openDelay(4000), m_balloonId(0), m_balloon(nullptr), m_button(nullptr), m_controls(&controls) { +UIBalloonOpenBtn::UIBalloonOpenBtn(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_openTime(0), m_openDelay(4000), m_balloonId(0), m_balloon(nullptr), m_button(nullptr) { } // OFFSET: 0x00950200 diff --git a/Source/UI/Window/UIBalloonOpenBtn.h b/Source/UI/Window/UIBalloonOpenBtn.h index c17745c6..0766a958 100644 --- a/Source/UI/Window/UIBalloonOpenBtn.h +++ b/Source/UI/Window/UIBalloonOpenBtn.h @@ -7,11 +7,10 @@ class UIBitmapButton; class UITransBalloonText; -struct UIButtonContext; class UIBalloonOpenBtn : public UIFrameWnd { public: - UIBalloonOpenBtn(UIWindowContext& windows, UIButtonContext& controls); + UIBalloonOpenBtn(UIWindowContext& windows); void Paint() override; void Slot15(int width, int height) override; void Slot19() override; @@ -24,7 +23,7 @@ protected: /* 00C8 */ int m_balloonId; /* 00CC */ UITransBalloonText* m_balloon; /* 00D0 */ UIBitmapButton* m_button; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIBank_NewWnd.h b/Source/UI/Window/UIBank_NewWnd.h index fedccf3f..32f57d7e 100644 --- a/Source/UI/Window/UIBank_NewWnd.h +++ b/Source/UI/Window/UIBank_NewWnd.h @@ -4,12 +4,11 @@ #include "UI/Window/UIFrameWnd.h" class UIEditCtrl; -struct UIButtonContext; struct UIEditContext; class UIBank_NewWnd : public UIFrameWnd { public: - UIBank_NewWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext); + UIBank_NewWnd(UIWindowContext& windows, UIEditContext& editContext); bool Slot03() override; void Slot15(int width, int height) override; long long AdjustAmount(int amount); @@ -24,7 +23,7 @@ protected: /* 00B8 */ std::string m_status; /* 00D0 */ int unknown_00D0; /* 00D4 */ UIWindow* m_loading[4]; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index 5ae7fdd6..754d943b 100644 --- a/Source/UI/Window/UIBasicInfoWnd.cpp +++ b/Source/UI/Window/UIBasicInfoWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "UI/Window/UIBasicInfoWnd.h" #include "Client/Mode/CGameMode.h" @@ -213,7 +215,7 @@ void UIBasicInfoWnd::Slot28(int x, int y) { int screenX = 0; int screenY = top - 19; this->ToScreen(screenX, screenY); - this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); } // OFFSET: 0x009995A0 @@ -525,12 +527,12 @@ void UIBasicInfoWnd::DrawCollapsed() { // OFFSET: 0x009983C0 // FUNCTION: fn_13491 void UIBasicInfoWnd::Slot15(int width, int height) { - this->AddBaseButton(*this->m_controls); + this->AddBaseButton(); - UIBitmapButton* minimizeButton = this->AddMinimizeButton(*this->m_controls, "Alt+V, Ctrl+V", 0); + UIBitmapButton* minimizeButton = this->AddMinimizeButton("Alt+V, Ctrl+V", 0); minimizeButton->Move(this->geometry.width - 14, 3); - this->nameText = new UIStaticText(*this->m_context, *this->m_controls); + this->nameText = new UIStaticText(*this->m_context); this->nameText->SetSize(this->geometry.width - 20, 15); this->nameText->Move(9, 23); this->nameText->SetTextFitted(g_session.DecodePlayerName()); diff --git a/Source/UI/Window/UIBasicInfoWnd.h b/Source/UI/Window/UIBasicInfoWnd.h index 2caac608..3e3874aa 100644 --- a/Source/UI/Window/UIBasicInfoWnd.h +++ b/Source/UI/Window/UIBasicInfoWnd.h @@ -46,7 +46,7 @@ public: /* 0114 */ int extendedExpandedHeight; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIBattleMsgOptionWnd.cpp b/Source/UI/Window/UIBattleMsgOptionWnd.cpp index 638e2a15..f7d2336e 100644 --- a/Source/UI/Window/UIBattleMsgOptionWnd.cpp +++ b/Source/UI/Window/UIBattleMsgOptionWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIBattleMsgOptionWnd.h" #include "Client/Session.h" @@ -73,8 +74,8 @@ void UIBattleMsgOptionWnd::Slot15(int, int height) { this->m_scrollBar = new UIScrollBar(*this->m_context); this->m_scrollBar->Configure(this->geometry.width - 15, 14, 1, this->geometry.height - 38); this->AddChild(this->m_scrollBar); - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "ESC", 0); + this->AddBaseButton(); + this->AddCloseButton("ESC", 0); this->m_allCheckBox = new UICheckBox(); this->m_allCheckBox->SetSize(70, 12); this->m_allCheckBox->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", "all on"); @@ -184,7 +185,6 @@ void UIBattleMsgOptionWnd::UpdateScrollBar() { // OFFSET: 0x0092B9C0 // FUNCTION: fn_12659 void UIBattleMsgOptionWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(true, this->text.c_str(), 0); this->DrawPanelBackground(titleHeight, 0, ""); diff --git a/Source/UI/Window/UIBattleMsgOptionWnd.h b/Source/UI/Window/UIBattleMsgOptionWnd.h index 3e884fb0..0a67b340 100644 --- a/Source/UI/Window/UIBattleMsgOptionWnd.h +++ b/Source/UI/Window/UIBattleMsgOptionWnd.h @@ -8,7 +8,6 @@ class UICheckBox; class UIScrollBar; -struct UIButtonContext; class UIBattleMsgOptionWnd : public UIFrameWnd { public: @@ -38,7 +37,7 @@ public: /* 0114 */ UICheckBox* m_allCheckBox; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIChangeNameWnd.cpp b/Source/UI/Window/UIChangeNameWnd.cpp index 48ad1a48..4ea37f6b 100644 --- a/Source/UI/Window/UIChangeNameWnd.cpp +++ b/Source/UI/Window/UIChangeNameWnd.cpp @@ -87,8 +87,8 @@ void UIChangeNameWnd::Slot15(int, int) { // OFFSET: 0x00911190 // FUNCTION: fn_12511 -UIChangeNameWnd::UIChangeNameWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIChangeNameWnd::UIChangeNameWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } // OFFSET: 0x00934A10 diff --git a/Source/UI/Window/UIChangeNameWnd.h b/Source/UI/Window/UIChangeNameWnd.h index e3852954..8c0dd2ea 100644 --- a/Source/UI/Window/UIChangeNameWnd.h +++ b/Source/UI/Window/UIChangeNameWnd.h @@ -6,20 +6,19 @@ #include -struct UIButtonContext; class UIBitmapButton; class UIBitmapEditCtrl; class UIChangeNameWnd : public UIFrameWnd { public: - UIChangeNameWnd(UIWindowContext& windows, UIButtonContext& controls); + UIChangeNameWnd(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; int IsNameWithinLimit(std::string name, int limit); protected: - UIButtonContext* m_controls; + void* unknown_controls; public: /* 00B4 */ UIBitmapButton* m_okButton; diff --git a/Source/UI/Window/UIChatRoomWnd.h b/Source/UI/Window/UIChatRoomWnd.h index 52f53214..df62cb22 100644 --- a/Source/UI/Window/UIChatRoomWnd.h +++ b/Source/UI/Window/UIChatRoomWnd.h @@ -9,7 +9,6 @@ #include #include -struct UIButtonContext; struct UIEditContext; struct UIListBoxContext; class UIBitmapButton; @@ -21,7 +20,7 @@ class UIStaticText; class UIChatRoomWnd : public UIFrameWnd { public: - UIChatRoomWnd(UIWindowContext& windows, UIButtonContext& controls); + UIChatRoomWnd(UIWindowContext& windows); void Move(int x, int y) override; void Slot11() override; void Slot15(int width, int height) override; @@ -52,7 +51,7 @@ public: /* 0120 */ ChatRoomWndInfo* saved; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; UIListBoxContext* m_listContext; }; diff --git a/Source/UI/Window/UICntWnd.h b/Source/UI/Window/UICntWnd.h index 563e6d05..91d61bab 100644 --- a/Source/UI/Window/UICntWnd.h +++ b/Source/UI/Window/UICntWnd.h @@ -5,12 +5,11 @@ class UIEditCtrl; class UIStaticText; -struct UIButtonContext; struct UIEditContext; class UICntWnd : public UIFrameWnd { public: - UICntWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext); + UICntWnd(UIWindowContext& windows, UIEditContext& editContext); ~UICntWnd() override; void Slot15(int width, int height) override; @@ -21,7 +20,7 @@ protected: /* 00B4 */ int m_event; /* 00B8 */ UIEditCtrl* m_edit; /* 00BC */ UIStaticText* m_text; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UIDebuffRemoveWnd.cpp b/Source/UI/Window/UIDebuffRemoveWnd.cpp index 72c04647..0b22abe3 100644 --- a/Source/UI/Window/UIDebuffRemoveWnd.cpp +++ b/Source/UI/Window/UIDebuffRemoveWnd.cpp @@ -56,6 +56,6 @@ int UIDebuffRemoveWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // OFFSET: 0x00946970 // FUNCTION: fn_12848 -UIDebuffRemoveWnd::UIDebuffRemoveWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_button(nullptr), m_controls(&controls) { +UIDebuffRemoveWnd::UIDebuffRemoveWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_button(nullptr) { } diff --git a/Source/UI/Window/UIDebuffRemoveWnd.h b/Source/UI/Window/UIDebuffRemoveWnd.h index d956b539..cf81bf34 100644 --- a/Source/UI/Window/UIDebuffRemoveWnd.h +++ b/Source/UI/Window/UIDebuffRemoveWnd.h @@ -4,11 +4,10 @@ #include "UI/Window/UIFrameWnd.h" class UIBasicButton; -struct UIButtonContext; class UIDebuffRemoveWnd : public UIFrameWnd { public: - UIDebuffRemoveWnd(UIWindowContext& windows, UIButtonContext& controls); + UIDebuffRemoveWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Paint() override; void Slot25(int x, int y) override; @@ -18,7 +17,7 @@ public: protected: /* 00B4 */ UIBasicButton* m_button; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIEscOptionWnd.cpp b/Source/UI/Window/UIEscOptionWnd.cpp index a4b1141b..294e75de 100644 --- a/Source/UI/Window/UIEscOptionWnd.cpp +++ b/Source/UI/Window/UIEscOptionWnd.cpp @@ -17,7 +17,7 @@ void UIEscOptionWnd::Slot15(int, int) { const char* names[7] = {"esc_01", "esc_001", "esc_08", "esc_09", "esc_02", "esc_05", "esc_10"}; for (int i = 0; i < 7; ++i) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->m_buttons[i] = button; button->SetBitmap((prefix + names[i] + "a.bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i] + "b.bmp").c_str(), 1, 0); @@ -66,8 +66,8 @@ void UIEscOptionWnd::LayoutButtons() { // OFFSET: 0x00911250 // FUNCTION: fn_12512 -UIEscOptionWnd::UIEscOptionWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_titleHeight(17), m_controls(&controls) { +UIEscOptionWnd::UIEscOptionWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_titleHeight(17) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); int escMode; if (mode->unknown_0250 == 0) { diff --git a/Source/UI/Window/UIEscOptionWnd.h b/Source/UI/Window/UIEscOptionWnd.h index 706ecfb9..6b6d62c9 100644 --- a/Source/UI/Window/UIEscOptionWnd.h +++ b/Source/UI/Window/UIEscOptionWnd.h @@ -7,11 +7,10 @@ #include "UI/Window/UIFrameWnd.h" class UIButton; -struct UIButtonContext; class UIEscOptionWnd : public UIFrameWnd { public: - UIEscOptionWnd(UIWindowContext& windows, UIButtonContext& controls); + UIEscOptionWnd(UIWindowContext& windows); void Paint() override; void Slot15(int width, int height) override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; @@ -22,7 +21,7 @@ public: /* 00D4 */ int m_titleHeight; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 8e7d0d49..ec468b7c 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeTooltip.h" +#include "Client/Mode/CMode.h" #include "UI/Window/UIWindowMgr.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -231,8 +233,8 @@ int UIFrameWnd::Slot46() { // OFFSET: 0x008CEF10 // FUNCTION: fn_12074 -UIBitmapButton* UIFrameWnd::AddBaseButton(UIButtonContext& controls) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); +UIBitmapButton* UIFrameWnd::AddBaseButton() { + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\sys_base_off.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_base_on.bmp", 2, 0); @@ -245,12 +247,12 @@ UIBitmapButton* UIFrameWnd::AddBaseButton(UIButtonContext& controls) { // OFFSET: 0x008CEFD0 // FUNCTION: fn_12075 -UIBitmapButton* UIFrameWnd::AddBigCloseButton(UIButtonContext& controls, const char* tooltip, int width) { +UIBitmapButton* UIFrameWnd::AddBigCloseButton(const char* tooltip, int width) { if (width == 0) { width = this->geometry.width; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\big_sys_close_off.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\big_sys_close_on.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\big_sys_close_on.bmp", 2, 0); @@ -265,12 +267,12 @@ UIBitmapButton* UIFrameWnd::AddBigCloseButton(UIButtonContext& controls, const c // OFFSET: 0x008CF0C0 // FUNCTION: fn_12076 -UIBitmapButton* UIFrameWnd::AddCloseButton(UIButtonContext& controls, const char* tooltip, int width) { +UIBitmapButton* UIFrameWnd::AddCloseButton(const char* tooltip, int width) { if (width == 0) { width = this->geometry.width; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_off.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 2, 0); @@ -285,12 +287,12 @@ UIBitmapButton* UIFrameWnd::AddCloseButton(UIButtonContext& controls, const char // OFFSET: 0x008CF2A0 // FUNCTION: fn_12077 -UIBitmapButton* UIFrameWnd::AddMinimizeButton(UIButtonContext& controls, const char* tooltip, int width) { +UIBitmapButton* UIFrameWnd::AddMinimizeButton(const char* tooltip, int width) { if (width == 0) { width = this->geometry.width; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\sys_mini_off.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_mini_on.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\sys_mini_on.bmp", 2, 0); @@ -305,12 +307,12 @@ UIBitmapButton* UIFrameWnd::AddMinimizeButton(UIButtonContext& controls, const c // OFFSET: 0x008CF390 // FUNCTION: fn_12078 -UIBitmapButton* UIFrameWnd::AddBitmapButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip) { +UIBitmapButton* UIFrameWnd::AddBitmapButton(int id, int x, int y, const char* name, const char* tooltip) { if (!name) { return nullptr; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); std::string path = "유저인터페이스\\"; path += name; button->SetBitmap((path + "_out" + ".bmp").c_str(), 0, 0); @@ -327,12 +329,12 @@ UIBitmapButton* UIFrameWnd::AddBitmapButton(UIButtonContext& controls, int id, i // OFFSET: 0x008CF870 // FUNCTION: fn_12079 -UIBitmapButton* UIFrameWnd::AddNumberedButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip, bool prefix) { +UIBitmapButton* UIFrameWnd::AddNumberedButton(int id, int x, int y, const char* name, const char* tooltip, bool prefix) { if (!name) { return nullptr; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); std::string path; if (prefix) { path += "유저인터페이스\\"; @@ -352,11 +354,10 @@ UIBitmapButton* UIFrameWnd::AddNumberedButton(UIButtonContext& controls, int id, // OFFSET: 0x008CFE50 // FUNCTION: fn_12080 -UICheckBox* UIFrameWnd::AddStyledCheckBox( - UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, bool checked, const char* tooltip, int fontHeight, +UICheckBox* UIFrameWnd::AddStyledCheckBox(int id, int width, int height, const char* text, int x, int y, bool checked, const char* tooltip, int fontHeight, std::uint32_t color, const char* checkedImage, const char* uncheckedImage ) { - UICheckBox* checkBox = new UICheckBox(*this->m_context, controls); + UICheckBox* checkBox = new UICheckBox(*this->m_context); checkBox->SetSize(width, height); checkBox->SetImages( checkedImage ? checkedImage : "유저인터페이스\\checkbox_1.bmp", uncheckedImage ? uncheckedImage : "유저인터페이스\\checkbox_0.bmp", text @@ -374,8 +375,8 @@ UICheckBox* UIFrameWnd::AddStyledCheckBox( // OFFSET: 0x008CFF40 // FUNCTION: fn_12081 -UICheckBox* UIFrameWnd::AddCheckBox(UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, int checked, const char* tooltip) { - UICheckBox* checkBox = new UICheckBox(*this->m_context, controls); +UICheckBox* UIFrameWnd::AddCheckBox(int id, int width, int height, const char* text, int x, int y, int checked, const char* tooltip) { + UICheckBox* checkBox = new UICheckBox(*this->m_context); checkBox->SetSize(width, height); checkBox->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", text); checkBox->Move(x, y); @@ -440,7 +441,7 @@ void UIMonsterInfoWnd::Slot28(int x, int y) { } if (this->TextWidth(name.c_str(), 0, 0, 12, 0, 0) > 100) { - this->m_controls->services.Tooltip(name.c_str(), screenX + x, screenY + y, -1, false, true); + static_cast(g_charViewMode)->Show(name.c_str(), screenX + x, screenY + y, -1, false, true); } } @@ -467,7 +468,7 @@ int UIAllyGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a std::string text = "("; text += reinterpret_cast(b); text += ")"; - text += this->m_acceptance->text.buttons.services.MessageText(393); + text += LookupMessage(393); this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; @@ -615,14 +616,14 @@ UIAllyGuildAcceptWnd::UIAllyGuildAcceptWnd(UIWindowContext& windows, UIAcceptanc // OFFSET: 0x008A3510 // FUNCTION: fn_11654 -UIBank_NewWnd::UIBank_NewWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext) - : UIFrameWnd(windows, 0), m_amountEdit(nullptr), m_status(), m_controls(&controls), m_editContext(&editContext) { +UIBank_NewWnd::UIBank_NewWnd(UIWindowContext& windows, UIEditContext& editContext) + : UIFrameWnd(windows, 0), m_amountEdit(nullptr), m_status(), m_editContext(&editContext) { } // OFFSET: 0x008A35A0 // FUNCTION: fn_11655 -UIChatRoomWnd::UIChatRoomWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), title(), unknown_00CC(), unknown_010C(), unknown_0114(), saved(nullptr), m_controls(&controls) { +UIChatRoomWnd::UIChatRoomWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), title(), unknown_00CC(), unknown_010C(), unknown_0114(), saved(nullptr) { } // OFFSET: 0x008BB9E0 @@ -1091,8 +1092,8 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // OFFSET: 0x008A36A0 // FUNCTION: fn_11656 -UICntWnd::UICntWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&editContext) { +UICntWnd::UICntWnd(UIWindowContext& windows, UIEditContext& editContext) + : UIFrameWnd(windows, 0), m_editContext(&editContext) { } // OFFSET: 0x008A37F0 @@ -1102,8 +1103,8 @@ UIHomunInfoWnd::UIHomunInfoWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0 // OFFSET: 0x008A3860 // FUNCTION: fn_11659 -UILoginOTPWnd::UILoginOTPWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), unknown_00B4(0), unknown_00B8(0), timerText(nullptr), unknown_00C0(0), m_controls(&controls) { +UILoginOTPWnd::UILoginOTPWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), unknown_00B4(0), unknown_00B8(0), timerText(nullptr), unknown_00C0(0) { } // OFFSET: 0x008A38E0 diff --git a/Source/UI/Window/UIFrameWnd.h b/Source/UI/Window/UIFrameWnd.h index d3ed7e75..08c46717 100644 --- a/Source/UI/Window/UIFrameWnd.h +++ b/Source/UI/Window/UIFrameWnd.h @@ -7,7 +7,6 @@ #include "UI/Window/WindowManagerWindows.h" class UIBitmapButton; class UICheckBox; -struct UIButtonContext; class UIFrameWnd : public UIWindow { public: @@ -25,19 +24,16 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; std::vector Slot44() override; int Slot46() override; - UIBitmapButton* AddCloseButton(UIButtonContext& controls, const char* tooltip, int width); UIBitmapButton* AddCloseButton(const char* tooltip, int width); - UIBitmapButton* AddBaseButton(UIButtonContext& controls); UIBitmapButton* AddBaseButton(); - UIBitmapButton* AddBigCloseButton(UIButtonContext& controls, const char* tooltip, int width); - UIBitmapButton* AddMinimizeButton(UIButtonContext& controls, const char* tooltip, int width); - UIBitmapButton* AddBitmapButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip); - UIBitmapButton* AddNumberedButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip, bool prefix); - UICheckBox* AddStyledCheckBox( - UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, bool checked, const char* tooltip, int fontHeight, + UIBitmapButton* AddBigCloseButton(const char* tooltip, int width); + UIBitmapButton* AddMinimizeButton(const char* tooltip, int width); + UIBitmapButton* AddBitmapButton(int id, int x, int y, const char* name, const char* tooltip); + UIBitmapButton* AddNumberedButton(int id, int x, int y, const char* name, const char* tooltip, bool prefix); + UICheckBox* AddStyledCheckBox(int id, int width, int height, const char* text, int x, int y, bool checked, const char* tooltip, int fontHeight, std::uint32_t color, const char* checkedImage, const char* uncheckedImage ); - UICheckBox* AddCheckBox(UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, int checked, const char* tooltip); + UICheckBox* AddCheckBox(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 DrawSkinBox(const char* name, int x, int y, int width, int height, bool tiled); void FitLastTextLine(int width, unsigned lineCount, int family, int height, FrameTextLines& lines); diff --git a/Source/UI/Window/UIHomunInfoWnd.h b/Source/UI/Window/UIHomunInfoWnd.h index 2d611407..46cef196 100644 --- a/Source/UI/Window/UIHomunInfoWnd.h +++ b/Source/UI/Window/UIHomunInfoWnd.h @@ -13,7 +13,6 @@ class UIINT64BarGraph; class UINormalMB; class ForbiddenWords; struct WindowResponseRecorder; -struct UIButtonContext; struct UIEditContext; class UIHomunInfoWnd : public UIFrameWnd { @@ -35,7 +34,7 @@ public: /* 00D4 */ UICheckBox* unknown_00D4; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; WindowResponseRecorder* m_recorder; ForbiddenWords* m_forbiddenWords; diff --git a/Source/UI/Window/UIHotKeyWnd.cpp b/Source/UI/Window/UIHotKeyWnd.cpp index b5210786..fb142241 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -88,10 +88,9 @@ namespace { // OFFSET: 0x0091FFD0 // FUNCTION: fn_12639 void UIHotKeyWnd::Slot15(int, int) { - UIButtonContext& controls = *reinterpret_cast(nullptr); reinterpret_cast(g_session.unknown_7FB4)->DisableAll(); - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->m_balloon = new UITransBalloonText(*this->m_context, *reinterpret_cast(nullptr)); this->m_balloon->SetSize(this->geometry.width, 20); @@ -99,7 +98,7 @@ void UIHotKeyWnd::Slot15(int, int) { this->m_balloon->Show(0); g_windowMgr.AddRendered(this->m_balloon); - this->unknown_0100 = new UITabControl(*this->m_context, controls); + this->unknown_0100 = new UITabControl(*this->m_context); this->unknown_0100->Configure(1, this->unknown_00C4 - 3, 20, 1, 1, 0, 0, 0, 0, 0, 0, 0); this->unknown_0100->Move(this->unknown_00C8, this->unknown_00CC + this->unknown_00BC); this->AddChild(this->unknown_0100); diff --git a/Source/UI/Window/UIJobListWnd.cpp b/Source/UI/Window/UIJobListWnd.cpp index ddd67dd0..833e8a49 100644 --- a/Source/UI/Window/UIJobListWnd.cpp +++ b/Source/UI/Window/UIJobListWnd.cpp @@ -34,16 +34,16 @@ static_assert(sizeof(PartyBookingUpdatePacket) == 14); void UIJobListWnd::Slot15(int width, int height) { char title[9] = {}; std::sprintf(title, "Job List"); - this->m_title = new UIStaticText(*this->m_context, *this->m_controls); + this->m_title = new UIStaticText(*this->m_context); this->m_title->SetSize(this->geometry.width - 32, 15); this->m_title->SetTextFitted(title); this->m_title->Move(16, 2); this->m_title->shadow = 1; this->AddChild(this->m_title); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); const std::string path = "유저인터페이스\\"; - this->m_okButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_okButton = new UIBitmapButton(*this->m_context); this->m_okButton->SetBitmap((path + "btn_ok" + ".bmp").c_str(), 0, 0); this->m_okButton->SetBitmap((path + "btn_ok_a" + ".bmp").c_str(), 1, 0); this->m_okButton->SetBitmap((path + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -148,7 +148,7 @@ void UIJobListWnd::RefreshJobs() { int index = 0; for (auto it = g_partyBookingJobs.begin(); it != g_partyBookingJobs.end(); ++it, ++index) { - this->m_jobChecks[index] = new UICheckBox(*this->m_context, *this->m_controls); + this->m_jobChecks[index] = new UICheckBox(*this->m_context); this->m_jobChecks[index]->SetSize(120, 15); const int job = it->first; if (job == -1) { @@ -175,6 +175,6 @@ void UIJobListWnd::RefreshJobs() { // OFFSET: 0x00911410 // FUNCTION: fn_12514 -UIJobListWnd::UIJobListWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_title(nullptr), m_okButton(nullptr), unknown_00E8(0), m_controls(&controls) { +UIJobListWnd::UIJobListWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_title(nullptr), m_okButton(nullptr), unknown_00E8(0) { } diff --git a/Source/UI/Window/UIJobListWnd.h b/Source/UI/Window/UIJobListWnd.h index 2b7543c7..3696f1f7 100644 --- a/Source/UI/Window/UIJobListWnd.h +++ b/Source/UI/Window/UIJobListWnd.h @@ -8,14 +8,13 @@ class UIBitmapButton; class UICheckBox; class UIStaticText; -struct UIButtonContext; struct JobListWndInfo; extern std::map g_partyBookingJobs; class UIJobListWnd : public UIFrameWnd { public: - UIJobListWnd(UIWindowContext& windows, UIButtonContext& controls); + UIJobListWnd(UIWindowContext& windows); void Slot11() override; void Slot15(int width, int height) override; void Paint() override; @@ -29,7 +28,7 @@ protected: /* 00D4 */ unsigned char unknown_00D4[0x14]; /* 00E8 */ int unknown_00E8; /* 00EC */ JobListWndInfo* m_saved; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UILoginOTPWnd.h b/Source/UI/Window/UILoginOTPWnd.h index 028993f7..a1bfe247 100644 --- a/Source/UI/Window/UILoginOTPWnd.h +++ b/Source/UI/Window/UILoginOTPWnd.h @@ -3,14 +3,13 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct UIEditContext; class UIEditCtrl; class UIStaticText; class UILoginOTPWnd : public UIFrameWnd { public: - UILoginOTPWnd(UIWindowContext& windows, UIButtonContext& controls); + UILoginOTPWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Slot18() override; void Slot19() override; @@ -23,7 +22,7 @@ public: /* 00C0 */ int unknown_00C0; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UIMakeCharWnd.h b/Source/UI/Window/UIMakeCharWnd.h index 52a9a072..4547c3ee 100644 --- a/Source/UI/Window/UIMakeCharWnd.h +++ b/Source/UI/Window/UIMakeCharWnd.h @@ -8,7 +8,6 @@ class UIBitmapButton; class UIBitmapEditCtrl; class UIScrollBar; -struct UIButtonContext; class UIMakeCharWnd : public UIFrameWnd { public: @@ -33,7 +32,7 @@ public: /* 02D8 */ int unknown_02D8; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIMerInfoWnd.h b/Source/UI/Window/UIMerInfoWnd.h index cce7b72e..b48ae073 100644 --- a/Source/UI/Window/UIMerInfoWnd.h +++ b/Source/UI/Window/UIMerInfoWnd.h @@ -4,7 +4,6 @@ #include "UI/Window/UIFrameWnd.h" #include "Contents/UserData/NormalItemSlots.h" -struct UIButtonContext; class UIBitmapButton; class UIBarGraphPlayer; struct WindowResponseRecorder; @@ -25,7 +24,7 @@ public: /* 00C4 */ MerInfoWndInfo* saved; protected: - UIButtonContext* m_controls; + void* unknown_controls; WindowResponseRecorder* m_recorder; }; diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index a3234665..94005c12 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "Client/ReplayPacketRecorder.h" #include "Contents/Items/ItemDescription.h" #include "Resource/Bitmap/BitmapResource.h" @@ -265,8 +266,7 @@ UIMessageBox::~UIMessageBox() = default; // OFFSET: 0x008B8E60 // FUNCTION: fn_11768 void UIMessageBox::Paint() { - auto& controls = this->m_dialog->text.buttons; - const auto load = [&](const char* name) { return static_cast(controls.resources.Load((std::string(prefix) + name).c_str())); }; + const auto load = [&](const char* name) { return static_cast(ResourceMgr::Instance().Load((std::string(prefix) + name).c_str())); }; int leftWidth = 0; int rightWidth = 0; int titleHeight = 0; @@ -300,10 +300,10 @@ void UIMessageBox::Paint() { const auto* base = load("basic_interface\\sys_base_off.bmp"); this->DrawBitmap(3, 3, base ? &base->image : nullptr, true); - const auto border = Palette(controls.resources, 14, 6); + const auto border = Palette(ResourceMgr::Instance(), 14, 6); DrawRoundedBorder(*this, 0, 17, width, height - 17, border); this->FillRegion(0, 17, width, 5, border); - const auto background = Palette(controls.resources, 2, 2); + const auto background = Palette(ResourceMgr::Instance(), 2, 2); this->FillRegion(1, 17, width - 2, height - 19, background); this->FillRegion(2, height - 2, width - 4, 1, background); } @@ -417,25 +417,24 @@ void UIMakeCharWnd::Paint() { // OFFSET: 0x008B88F0 // FUNCTION: fn_11767 void UIMerInfoWnd::Paint() { - auto& controls = *this->m_controls; const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\homuninfo_bg.bmp"))); this->DrawBitmap(0, 0, &background->image, false); char title[50] = {}; const unsigned kind = g_session.m_mercenaryClass; const int titleId = kind - 6017 <= 9 ? 1181 : kind - 6037 <= 9 ? 1182 : kind - 6027 <= 9 ? 1183 : 1367; - std::sprintf(title, controls.services.MessageText(titleId)); + std::sprintf(title, LookupMessage(titleId)); this->DrawTextAt(5, 2, title, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(100, 24, controls.services.MessageText(407), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(100, 47, controls.services.MessageText(408), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(100, 111, controls.services.MessageText(1184), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(100, 135, controls.services.MessageText(1185), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(100, 159, controls.services.MessageText(1186), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(230, 133, controls.services.MessageText(1187), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 24, LookupMessage(407), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 47, LookupMessage(408), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 111, LookupMessage(1184), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 135, LookupMessage(1185), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 159, LookupMessage(1186), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(230, 133, LookupMessage(1187), 0, 0, 12, 0, 0, 0); char number[24] = {}; for (int i = 0; i < 8; ++i) { const int value = i == 7 ? (2000 - g_session.m_mercenaryStats[i]) / 10 : g_session.m_mercenaryStats[i]; const int bytes = std::sprintf(number, "%d", value); - DrawTextRight(*this, controls.fonts, controls.locale, 79, 24 + 18 * i, number, bytes, 1, 14, 0, 0); + DrawTextRight(*this, g_fontCache, this->m_context->locale, 79, 24 + 18 * i, number, bytes, 1, 14, 0, 0); } this->DrawTextAt(136, 24, g_session.m_mercenaryName, 0, 0, 12, 0x646464, 0, 0); this->DrawTextAt(135, 24, g_session.m_mercenaryName, 0, 0, 12, 0, 0, 0); @@ -448,7 +447,7 @@ void UIMerInfoWnd::Paint() { this->DrawTextAt(218, 70, text, bytes, 1, 14, 0, 0, 0); bytes = std::sprintf(text, "%d / %d", g_session.m_mercenarySp, g_session.m_mercenaryMaxSp); this->DrawTextAt(218, 85, text, bytes, 1, 14, 0, 0, 0); - std::strftime(text, 128, controls.services.MessageText(1260), _localtime32(&g_session.m_mercenaryExpiration)); + std::strftime(text, 128, LookupMessage(1260), _localtime32(&g_session.m_mercenaryExpiration)); this->DrawTextAt(155, 111, text, static_cast(std::strlen(text)), 0, 12, 255, 0, 0); bytes = std::sprintf(text, "%d", g_session.m_mercenaryLoyalty); this->DrawTextAt(170, 133, text, bytes, 1, 14, 0, 0, 0); @@ -462,15 +461,14 @@ void UIMerInfoWnd::Paint() { // OFFSET: 0x008A6E20 // FUNCTION: fn_11712 long long UIBank_NewWnd::TransactionAmount(unsigned char deposit) { - auto& services = this->m_controls->services; std::string text = this->m_amountEdit->Text(); this->m_amountEdit->SetText(""); const auto fail = [&](int notice, int status) { - g_windowMgr.SendNotice(1, reinterpret_cast(services.MessageText(notice)), 255, 0, 0, 0); - this->m_status = services.MessageText(status); + g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(notice)), 255, 0, 0, 0); + this->m_status = LookupMessage(status); return 0LL; }; - if (text == std::string(services.MessageText(2778))) { + if (text == std::string(LookupMessage(2778))) { const long long cash = g_session.m_zeny; const long long balance = g_session.m_bankBalance; const long long excess = cash + balance > 0x7FFFFFFF ? cash + balance - 0x7FFFFFFF : 0; @@ -545,18 +543,17 @@ bool UIBank_NewWnd::IsNumeric(std::string text) { // OFFSET: 0x008B7AD0 // FUNCTION: fn_11760 void UIBank_NewWnd::Paint() { - auto& controls = *this->m_controls; const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\bank\\bg_bank.bmp"))); - const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(2771), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(2771), 0); this->DrawBitmap(0, titleHeight, &background->image, false); char number[260] = {}; char text[260] = {}; - this->DrawTextAt(30, 29, controls.services.MessageText(2772), 0, 0, 12, 0, 0, 0); - const int x = this->TextWidth(controls.services.MessageText(2772), 0, 0, 12, 0, 0) + 43; + this->DrawTextAt(30, 29, LookupMessage(2772), 0, 0, 12, 0, 0, 0); + const int x = this->TextWidth(LookupMessage(2772), 0, 0, 12, 0, 0) + 43; FormatGroupedInteger(g_session.m_bankBalance, number, 260); std::sprintf(text, "%s z", number); this->DrawTextAt(x, 29, text, 0, 0, 11, 0, 0, 0); - this->DrawTextAt(30, 46, controls.services.MessageText(2773), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(30, 46, LookupMessage(2773), 0, 0, 12, 0, 0, 0); FormatGroupedInteger(g_session.m_zeny, number, 260); std::sprintf(text, "%s z", number); this->DrawTextAt(x, 46, text, 0, 0, 11, 0, 0, 0); @@ -570,7 +567,6 @@ void UIBank_NewWnd::Paint() { // OFFSET: 0x008B7CF0 // FUNCTION: fn_11761 void UIChatRoomWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); unsigned red, green, blue; @@ -640,8 +636,7 @@ void UIMessageBox::FormatCountdown() { // INLINED void UIMessageBox::AddButton(const char* name, int id, int x, int y) { - auto& controls = this->m_dialog->text.buttons; - auto* button = new UIBitmapButton(*this->m_context, controls); + auto* button = new UIBitmapButton(*this->m_context); const char* suffixes[] = {"", "_a", "_b"}; for (int state = 0; state < 3; ++state) { @@ -681,7 +676,7 @@ void UIMessageBox::Configure( int inset = 0; if (icon) { - auto* image = new UIStaticBitmap(*this->m_context, this->m_dialog->text.buttons); + auto* image = new UIStaticBitmap(*this->m_context); image->SetBitmap(icon); image->SetSize(image->geometry.width, image->geometry.height); image->Move(10, 22); @@ -691,7 +686,7 @@ void UIMessageBox::Configure( this->viewer = new UITextViewer(*this->m_context, this->m_dialog->text); this->viewer->Configure(inset + 10, 22, width - inset - 20, height - 55, 0); - this->viewer->backgroundColor = Palette(this->m_dialog->text.buttons.resources, 2, 2) | 0xFF000000u; + this->viewer->backgroundColor = Palette(ResourceMgr::Instance(), 2, 2) | 0xFF000000u; this->viewer->Invalidate(); this->AddChild(this->viewer); this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->messageText.data()), static_cast(static_cast(width) / 7.5), 0, 0); @@ -715,10 +710,9 @@ void UIMessageBox::Configure( case 5: { this->AddButton("btn_ok", 184, width - 46, height - 24); this->m_message0 = 184; - auto& controls = this->m_dialog->text.buttons; - auto* button = new UITextButton(*this->m_context, controls); - button->Configure(controls.services.MessageText(3445), 0x00F4934A, 0, 12, 0, 0); + auto* button = new UITextButton(*this->m_context); + button->Configure(LookupMessage(3445), 0x00F4934A, 0, 12, 0, 0); button->m_hoverColor = 0x00FF7864; button->Move(14, 70); button->SetId(426); @@ -779,8 +773,7 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return 0; case 98: if (a == 426) { - auto& controls = this->m_dialog->text.buttons; - ShellExecuteA(this->m_dialog->text.applicationWindow, "open", controls.services.MessageText(3445), nullptr, nullptr, SW_SHOWNORMAL); + ShellExecuteA(this->m_dialog->text.applicationWindow, "open", LookupMessage(3445), nullptr, nullptr, SW_SHOWNORMAL); } return 0; @@ -886,10 +879,10 @@ void UIHomunInfoWnd::Slot11() { // OFFSET: 0x008B0CA0 // FUNCTION: fn_11744 void UIMerInfoWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); { const std::string name("유저인터페이스\\btn_fired"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((name + ".bmp").c_str(), 0, 0); this->button->SetBitmap((name + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((name + "_b.bmp").c_str(), 2, 0); @@ -900,7 +893,7 @@ void UIMerInfoWnd::Slot15(int, int) { } { const std::string name("유저인터페이스\\btn_skill"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((name + ".bmp").c_str(), 0, 0); this->button->SetBitmap((name + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((name + "_b.bmp").c_str(), 2, 0); @@ -1025,7 +1018,6 @@ void UIBank_NewWnd::AnimateLoading() { // OFFSET: 0x008AE8A0 // FUNCTION: fn_11741 void UILoginOTPWnd::Slot15(int, int) { - auto& controls = *this->m_controls; const std::uint8_t prefixSource[] = {0x8F, 0xC8, 0x2D, 0x7F, 0xC9, 0xF9, 0xFA, 0xB4, 0x89, 0x83, 0x2D, 0x49, 0xB4, 0x8D, 0x63, 0x79}; thread_local EncryptedName prefixName(prefixSource); const std::string prefix(prefixName.Text()); @@ -1041,13 +1033,13 @@ void UILoginOTPWnd::Slot15(int, int) { InputFocus focus{g_windowMgr.hoverWindow}; focus.Set(this->unknown_00B4); - UIStaticText* label = new UIStaticText(*this->m_context, controls); + UIStaticText* label = new UIStaticText(*this->m_context); label->SetSize(80, 20); label->Move(141 - this->TextWidth(LookupMessage(3410), 0, 0, 12, 0, 0), 67); label->SetText(LookupMessage(3410), 0); this->AddChild(label); - this->timerText = new UIStaticText(*this->m_context, controls); + this->timerText = new UIStaticText(*this->m_context); this->timerText->SetSize(80, 20); this->timerText->Move(150, 66); this->timerText->SetText(LookupMessage(3410), 0); @@ -1055,19 +1047,19 @@ void UILoginOTPWnd::Slot15(int, int) { this->timerText->SetColor(205, 19, 41); this->AddChild(this->timerText); - label = new UIStaticText(*this->m_context, controls); + label = new UIStaticText(*this->m_context); label->SetSize(200, 40); label->SetText(LookupMessage(3385), 0); label->Move(static_cast(141.0f - this->TextWidth(LookupMessage(3385), 0, 0, 12, 0, 0) * 0.5f), 28); this->AddChild(label); - label = new UIStaticText(*this->m_context, controls); + label = new UIStaticText(*this->m_context); label->SetSize(200, 40); label->SetText(LookupMessage(3386), 0); label->Move(static_cast(141.0f - this->TextWidth(LookupMessage(3386), 0, 0, 12, 0, 0) * 0.5f), 42); this->AddChild(label); - label = new UIStaticText(*this->m_context, controls); + label = new UIStaticText(*this->m_context); label->SetSize(80, 20); label->Move(74 - this->TextWidth(LookupMessage(3255), 0, 0, 12, 0, 0), 98); label->SetText(LookupMessage(3255), 0); @@ -1075,7 +1067,7 @@ void UILoginOTPWnd::Slot15(int, int) { label->SetColor(64, 64, 64); this->AddChild(label); - UIBmpTextButton* button = new UIBmpTextButton(*this->m_context, controls); + UIBmpTextButton* button = new UIBmpTextButton(*this->m_context); const std::uint8_t normalSource[] = {0xDD, 0xAA, 0x53, 0xD3, 0xB1, 0xED, 0x92, 0x28, 0xDB, 0xE1, 0x53, 0xE5, 0xCC, 0x99, 0x0B, 0x89, 0x72, 0x62, 0xFA, 0x47, 0x2E, 0x4A, 0x39, 0x91, 0x78, 0x77, 0xF5, 0x48, 0x12, 0x46, 0x0B, 0x87, 0x69, 0x5A, 0xFC, 0x5D, 0x01, 0x7C, 0x39, 0x8A, 0x6F, 0x68, 0xF2, 0x45, 0x5F, 0x41, 0x3A, 0x95, 0x1D}; @@ -1109,7 +1101,6 @@ void UILoginOTPWnd::Slot15(int, int) { // OFFSET: 0x008B84B0 // FUNCTION: fn_11764 void UILoginOTPWnd::Paint() { - auto& controls = *this->m_controls; auto& resources = ResourceMgr::Instance(); const std::uint8_t source[] = {0x11, 0xF4, 0x57, 0x1F, 0xF9, 0x49, 0x2E, 0xE2, 0x17, 0xBF, 0x57, 0x29, 0x84, 0x3D, 0xB7, 0x43, 0xBE, 0x3C, 0xFE, 0x8B, 0x66, 0xEE, 0x85, 0x5B, 0xB4, 0x29, 0xF1, 0x84, 0x5A, 0xE2, 0xB7, 0x4D, @@ -1117,7 +1108,7 @@ void UILoginOTPWnd::Paint() { thread_local EncryptedName name(source); const auto* background = static_cast(resources.Load(Resolve(name.Text()))); this->DrawBitmap(0, 0, &background->image, false); - this->DrawTitleBar(true, controls.services.MessageText(3254), 280); + this->DrawTitleBar(true, LookupMessage(3254), 280); } // OFFSET: 0x008C3620 @@ -1285,7 +1276,6 @@ void UIReplayRECControlWnd::ApplyMode() { // OFFSET: 0x008B9790 // FUNCTION: fn_11771 void UINoticeWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { @@ -1446,7 +1436,6 @@ void UIPayConfirmWnd::Configure(const std::string& text, int itemId) { // OFFSET: 0x008B9940 // FUNCTION: fn_11772 void UIPayConfirmWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, this->m_title.c_str(), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1485,7 +1474,6 @@ void UIReplayRECControlWnd::Paint() { // OFFSET: 0x008BA010 // FUNCTION: fn_11776 void UISelectReplayDataWnd::Paint() { - auto& controls = *this->m_controls; this->DrawTitleBar(true, LookupMessage(2084), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1497,7 +1485,6 @@ void UISelectReplayDataWnd::Paint() { // OFFSET: 0x008BA0B0 // FUNCTION: fn_11777 void UISelectServerWnd::Paint() { - auto& controls = *this->m_controls; const char* title = LookupMessage(2082); if (g_modeMgr.GetLoginMode()->cursorType == 30) { @@ -1512,7 +1499,6 @@ void UISelectServerWnd::Paint() { // OFFSET: 0x008BA110 // FUNCTION: fn_11778 void UITalkboxTrapInputWnd::Paint() { - auto& controls = *this->m_controls; const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1659,9 +1645,9 @@ void UIChatRoomWnd::Slot15(int, int) { this->memberList->SetId(184); this->AddChild(this->memberList); - this->closeButton = this->AddCloseButton(*this->m_controls, "/q", 0); + this->closeButton = this->AddCloseButton("/q", 0); - this->titleText = new UIStaticText(*this->m_context, *this->m_controls); + this->titleText = new UIStaticText(*this->m_context); this->titleText->SetSize(this->geometry.width - 30, 15); this->titleText->Move(9, 2); this->titleText->SetTextFitted(""); @@ -1678,7 +1664,7 @@ void UINoticeWnd::Slot15(int, int) { int positions[3][2] = {{534, 376}, {244, 376}, {294, 376}}; for (int index = 0; index < 3; ++index) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -1848,7 +1834,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { int ids[6] = {420, 421, 422, 423, 424, 425}; for (int index = 0; index < 2; ++index) { - this->buttons[index] = new UIReplayButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIReplayButton(*this->m_context); this->buttons[index]->SetBitmap((prefix + names[index] + "a.bmp").c_str(), 0, 0); this->buttons[index]->SetBitmap((prefix + names[index] + "a.bmp").c_str(), 1, 0); this->buttons[index]->SetBitmap((prefix + names[index] + "b.bmp").c_str(), 2, 0); @@ -1860,7 +1846,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { } for (int index = 2; index < 6; ++index) { - this->buttons[index] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->buttons[index] = new UIBitmapButton(*this->m_context); this->buttons[index]->SetBitmap((prefix + names[index] + "a.bmp").c_str(), 0, 0); this->buttons[index]->SetBitmap((prefix + names[index] + "a.bmp").c_str(), 1, 0); this->buttons[index]->SetBitmap((prefix + names[index] + "b.bmp").c_str(), 2, 0); @@ -1872,7 +1858,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { } for (int index = 0; index < 5; ++index) { - UIStaticBitmap* tab = new UIStaticBitmap(*this->m_context, *this->m_controls); + UIStaticBitmap* tab = new UIStaticBitmap(*this->m_context); this->tabs[index] = tab; tab->SetBitmap((prefix + names[index + 6] + ".bmp").c_str()); tab->SetSize(tab->geometry.width, tab->geometry.height); @@ -1884,7 +1870,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { int textSizes[2][2] = {{50, 12}, {80, 12}}; const char* labels[2] = {"000:00:00", LookupMessage(0x7B3)}; for (int index = 0; index < 2; ++index) { - this->texts[index] = new UIStaticText(*this->m_context, *this->m_controls); + this->texts[index] = new UIStaticText(*this->m_context); this->texts[index]->SetSize(textSizes[index][0], textSizes[index][1]); this->texts[index]->SetText(labels[index], 0); this->texts[index]->Move(-100, -100); @@ -1897,7 +1883,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { "Basicinfo", "Equip", "Item", "Skill", "Guild", "Party", "Chatting", "Shortcut", "Status", "ALL", "User Defined File Name", "Repeated File Check", }; for (int index = 0; index < 10; ++index) { - UICheckBox* option = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* option = new UICheckBox(*this->m_context); this->options[index] = option; option->SetSize(70, 12); option->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", optionNames[index]); @@ -1907,7 +1893,7 @@ void UIReplayRECControlWnd::Slot15(int, int) { } for (int index = 0; index < 2; ++index) { - this->fileOptions[index] = new UICheckBox(*this->m_context, *this->m_controls); + this->fileOptions[index] = new UICheckBox(*this->m_context); this->fileOptions[index]->SetSize(150, 12); this->fileOptions[index]->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", optionNames[index + 10]); this->fileOptions[index]->Move(-100, -100); @@ -1960,7 +1946,7 @@ void UISelectReplayDataWnd::Slot15(int width, int height) { int positions[4][2] = {{189, height - 25}, {-100, -100}, {234, height - 25}, {100, height - 25}}; for (int index = 0; index < 4; ++index) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -1977,7 +1963,7 @@ void UISelectReplayDataWnd::Slot15(int width, int height) { UIStaticText** text = this->m_texts; for (int y = 35; y < 110; y += 15) { - *text = new UIStaticText(*this->m_context, *this->m_controls); + *text = new UIStaticText(*this->m_context); (*text)->SetSize(width - 12, 15); (*text)->SetText("", 0); (*text)->Move(12, y); @@ -2005,7 +1991,7 @@ void UITalkboxTrapInputWnd::Slot15(int, int) { int positions[2][2] = {{189, 96}, {234, 96}}; for (int index = 0; index < 2; ++index) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[index][2] + ".bmp").c_str(), 2, 0); @@ -2095,7 +2081,6 @@ void UIItemWnd::DrawNewItemMark(int x, int y) { // OFFSET: 0x008AAA10 // FUNCTION: fn_11724 void UIMonsterInfoWnd::DrawResistance(int x, int y, const char* label, int value, std::uint32_t border, std::uint32_t fill) { - auto& controls = *this->m_controls; char text[64]; wsprintfA(text, "%s:%d", label, value); unsigned red; @@ -2111,7 +2096,6 @@ void UIMonsterInfoWnd::DrawResistance(int x, int y, const char* label, int value // OFFSET: 0x008B8ED0 // FUNCTION: fn_11770 void UIMonsterInfoWnd::Paint() { - auto& controls = *this->m_controls; unsigned red; unsigned green; unsigned blue; @@ -2619,7 +2603,7 @@ int sub_8AB060() { UINoticeWnd::UINoticeWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { this->m_patchFile = "notice_patch.txt"; for (int i = 0; i < 19; ++i) { - this->m_texts[i] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_texts[i] = new UIStaticText(*this->m_context); } this->unknown_0108 = 20; this->unknown_010C = 0; @@ -2635,15 +2619,15 @@ UINoticeWnd::UINoticeWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { // OFFSET: 0x008AD190 // FUNCTION: fn_11737 void UIBank_NewWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "Exit", 0); - this->AddBitmapButton(*this->m_controls, 462, 209, 77, "bank\\btn_deposit", LookupMessage(2774)); - this->AddBitmapButton(*this->m_controls, 463, 209, 102, "bank\\btn_withdraw", LookupMessage(2775)); - this->AddBitmapButton(*this->m_controls, 279, 177, 89, "bank\\btn_upper", LookupMessage(2776)); - this->AddBitmapButton(*this->m_controls, 280, 177, 99, "bank\\btn_buttom", LookupMessage(2777)); - this->AddBitmapButton(*this->m_controls, 392, 189, 132, "bank\\btn_10mil", "+ 100,000"); - this->AddBitmapButton(*this->m_controls, 391, 141, 132, "bank\\btn_100mil", "+ 1,000,000"); - this->AddBitmapButton(*this->m_controls, 390, 93, 132, "bank\\btn_1000mil", "+ 10,000,000"); - this->AddBitmapButton(*this->m_controls, 389, 45, 132, "bank\\btn_max", LookupMessage(2778)); + this->AddCloseButton("Exit", 0); + this->AddBitmapButton(462, 209, 77, "bank\\btn_deposit", LookupMessage(2774)); + this->AddBitmapButton(463, 209, 102, "bank\\btn_withdraw", LookupMessage(2775)); + this->AddBitmapButton(279, 177, 89, "bank\\btn_upper", LookupMessage(2776)); + this->AddBitmapButton(280, 177, 99, "bank\\btn_buttom", LookupMessage(2777)); + this->AddBitmapButton(392, 189, 132, "bank\\btn_10mil", "+ 100,000"); + this->AddBitmapButton(391, 141, 132, "bank\\btn_100mil", "+ 1,000,000"); + this->AddBitmapButton(390, 93, 132, "bank\\btn_1000mil", "+ 10,000,000"); + this->AddBitmapButton(389, 45, 132, "bank\\btn_max", LookupMessage(2778)); this->m_amountEdit = new UIEditCtrl(*this->m_context, *this->m_editContext); this->m_amountEdit->SetSize(99, 17); @@ -2671,7 +2655,7 @@ void UICntWnd::Slot15(int, int) { focus.Set(this->m_edit); this->m_edit->SelectAll(); - this->m_text = new UIStaticText(*this->m_context, *this->m_controls); + this->m_text = new UIStaticText(*this->m_context); this->m_text->SetSize(this->geometry.width - 30, 15); this->m_text->Move(15, 6); this->AddChild(this->m_text); @@ -2679,7 +2663,7 @@ void UICntWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); const int width = this->geometry.width; const int height = this->geometry.height; - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -3015,7 +2999,6 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // OFFSET: 0x008B99A0 // FUNCTION: fn_11773 void UIPetInfoWnd::Paint() { - auto& controls = *this->m_controls; unsigned red; unsigned green; unsigned blue; @@ -3145,7 +3128,7 @@ void UIPetInfoWnd::UpdateFriendlyGauge() { // FUNCTION: fn_11745 void UIMonsterInfoWnd::Slot15(int, int) { const std::string prefix("유저인터페이스\\"); - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "btn_ok" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "btn_ok_a" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -3166,8 +3149,8 @@ void UIMonsterInfoWnd::Slot15(int, int) { // OFFSET: 0x008A4300 // FUNCTION: fn_11667 -UIPetInfoWnd::UIPetInfoWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), friendlyGauge(nullptr), m_controls(&controls) { +UIPetInfoWnd::UIPetInfoWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), friendlyGauge(nullptr) { this->friendlyText.clear(); this->unknown_00E4 = 0; this->unknown_00E8 = 0; @@ -3180,7 +3163,7 @@ UIPetInfoWnd::UIPetInfoWnd(UIWindowContext& windows, UIButtonContext& controls) // OFFSET: 0x008A43E0 // FUNCTION: fn_11668 -UIReplayButton::UIReplayButton(UIWindowContext& windows, UIButtonContext& controls) : UIBitmapButton(windows, controls) { +UIReplayButton::UIReplayButton(UIWindowContext& windows) : UIBitmapButton(windows) { } // OFFSET: 0x008A4440 @@ -3212,16 +3195,16 @@ UISelectReplayDataWnd::UISelectReplayDataWnd(UIWindowContext& windows) : UIFrame // OFFSET: 0x008A4640 // FUNCTION: fn_11672 -UISelectServerWnd::UISelectServerWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UISelectServerWnd::UISelectServerWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { this->m_serverList = nullptr; this->m_okButton = nullptr; } // OFFSET: 0x008A46E0 // FUNCTION: fn_11673 -UITalkboxTrapInputWnd::UITalkboxTrapInputWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext) - : UIFrameWnd(windows, 0), m_controls(&controls), m_editContext(&editContext) { +UITalkboxTrapInputWnd::UITalkboxTrapInputWnd(UIWindowContext& windows, UIEditContext& editContext) + : UIFrameWnd(windows, 0), m_editContext(&editContext) { } // OFFSET: 0x008A4E00 @@ -3402,7 +3385,7 @@ int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // OFFSET: 0x008ADC80 // FUNCTION: fn_11740 void UIHomunInfoWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); this->nameEdit = new UIEditCtrl2(*this->m_context, *this->m_editContext); this->nameEdit->SetSize(80, 16); char* const name = reinterpret_cast(&g_session.unknown_5570[0x0C]); @@ -3416,7 +3399,7 @@ void UIHomunInfoWnd::Slot15(int, int) { this->AddChild(this->nameEdit); { const std::string bitmap("유저인터페이스\\btn_del"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((bitmap + ".bmp").c_str(), 0, 0); this->button->SetBitmap((bitmap + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((bitmap + "_b.bmp").c_str(), 2, 0); @@ -3427,7 +3410,7 @@ void UIHomunInfoWnd::Slot15(int, int) { } { const std::string bitmap("유저인터페이스\\btn_skill"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((bitmap + ".bmp").c_str(), 0, 0); this->button->SetBitmap((bitmap + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((bitmap + "_b.bmp").c_str(), 2, 0); @@ -3438,7 +3421,7 @@ void UIHomunInfoWnd::Slot15(int, int) { } { const std::string bitmap("유저인터페이스\\btn_feed"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((bitmap + ".bmp").c_str(), 0, 0); this->button->SetBitmap((bitmap + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((bitmap + "_b.bmp").c_str(), 2, 0); @@ -3450,7 +3433,7 @@ void UIHomunInfoWnd::Slot15(int, int) { } { const std::string bitmap("유저인터페이스\\btn_rewrite"); - this->button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->button = new UIBitmapButton(*this->m_context); this->button->SetBitmap((bitmap + ".bmp").c_str(), 0, 0); this->button->SetBitmap((bitmap + "_a.bmp").c_str(), 1, 0); this->button->SetBitmap((bitmap + "_b.bmp").c_str(), 2, 0); @@ -3488,7 +3471,7 @@ void UIHomunInfoWnd::Slot15(int, int) { this->AddChild(this->intimacyBar); this->m_message0 = 201; - this->unknown_00D4 = new UICheckBox(*this->m_context, *this->m_controls); + this->unknown_00D4 = new UICheckBox(*this->m_context); this->unknown_00D4->SetSize(12, 12); this->unknown_00D4->Move(210, 142); this->unknown_00D4->SetBitmaps("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp"); @@ -3499,7 +3482,6 @@ void UIHomunInfoWnd::Slot15(int, int) { // OFFSET: 0x008B7DB0 // FUNCTION: fn_11763 void UIHomunInfoWnd::Paint() { - auto& controls = *this->m_controls; const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\homuninfo_bg.bmp"))); this->DrawBitmap(0, 0, &background->image, false); DrawFilledRoundedBorder(*this, 0, this->geometry.height - 40, this->geometry.width, 40, 0xFFFFFF); @@ -3670,8 +3652,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // OFFSET: 0x008B2820 // FUNCTION: fn_11747 void UIPetInfoWnd::Slot15(int, int) { - auto& controls = *this->m_controls; - this->AddCloseButton(controls, "", 0); + this->AddCloseButton("", 0); this->nameEdit = new UIEditCtrl2(*this->m_context, *this->m_editContext); this->nameEdit->SetSize(80, 16); if (std::strcmp(g_session.unknown_1018, "") == 0) { @@ -3684,7 +3665,7 @@ void UIPetInfoWnd::Slot15(int, int) { this->AddChild(this->nameEdit); { const std::string prefix("유저인터페이스\\"); - this->unknown_00BC = new UIBitmapButton(*this->m_context, controls); + this->unknown_00BC = new UIBitmapButton(*this->m_context); this->unknown_00BC->SetBitmap((prefix + "btn_rewrite" + ".bmp").c_str(), 0, 0); this->unknown_00BC->SetBitmap((prefix + "btn_rewrite_a" + ".bmp").c_str(), 1, 0); this->unknown_00BC->SetBitmap((prefix + "btn_rewrite_b" + ".bmp").c_str(), 2, 0); @@ -3695,14 +3676,14 @@ void UIPetInfoWnd::Slot15(int, int) { } const char tooltip[] = "Pet Command"; - this->unknown_00C0 = new UINoneVisibleButton(*this->m_context, controls); + this->unknown_00C0 = new UINoneVisibleButton(*this->m_context); this->unknown_00C0->SetSize(120, 18); this->unknown_00C0->Move(150, 44); this->unknown_00C0->SetId(268); this->AddChild(this->unknown_00C0); { const std::string prefix("유저인터페이스\\basic_interface\\"); - UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + "txtbox_btn_a" + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + "txtbox_btn_b" + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + "txtbox_btn_c" + ".bmp").c_str(), 2, 0); @@ -3724,7 +3705,7 @@ void UIPetInfoWnd::Slot15(int, int) { const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); this->unknown_00E4 = g_petEvolutionMgr->IsAutoFeeding(petEgg); if (this->unknown_00E4 == true) { - this->unknown_00E8 = new UICheckBox(*this->m_context, controls); + this->unknown_00E8 = new UICheckBox(*this->m_context); this->unknown_00E8->SetSize(12, 12); this->unknown_00E8->Move(this->TextWidth(LookupMessage(2577), 0, 0, 12, 0, 0) + 110, 159); this->unknown_00E8->SetBitmaps("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp"); @@ -3923,7 +3904,7 @@ void UISelectServerWnd::Slot15(int width, int height) { continue; } - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + names[i][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + names[i][2] + ".bmp").c_str(), 2, 0); @@ -3948,7 +3929,7 @@ void UIReplayControlWnd::Slot15(int, int) { const char* const names[6] = {"replay_stop_", "replay_end_", "replay_speedadd_", "replay_speedmin_", "replay_start_", "replay_pause_"}; for (int i = 0; i < 4; ++i) { - this->m_buttons[i] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_buttons[i] = new UIBitmapButton(*this->m_context); UIBitmapButton* button = static_cast(this->m_buttons[i]); button->SetBitmap((prefix + names[i] + "a.bmp").c_str(), 0, 0); button->SetBitmap((prefix + names[i] + "a.bmp").c_str(), 1, 0); @@ -3959,7 +3940,7 @@ void UIReplayControlWnd::Slot15(int, int) { this->AddChild(button); } - this->m_playButton = new UIReplayButton(*this->m_context, *this->m_controls); + this->m_playButton = new UIReplayButton(*this->m_context); this->m_playButton->SetBitmap((prefix + names[4] + "a.bmp").c_str(), 0, 0); this->m_playButton->SetBitmap((prefix + names[4] + "a.bmp").c_str(), 1, 0); this->m_playButton->SetBitmap((prefix + names[4] + "b.bmp").c_str(), 2, 0); @@ -3968,7 +3949,7 @@ void UIReplayControlWnd::Slot15(int, int) { this->m_playButton->SetId(ids[4]); this->AddChild(this->m_playButton); - this->m_pauseButton = new UIReplayButton(*this->m_context, *this->m_controls); + this->m_pauseButton = new UIReplayButton(*this->m_context); this->m_pauseButton->SetBitmap((prefix + names[5] + "a.bmp").c_str(), 0, 0); this->m_pauseButton->SetBitmap((prefix + names[5] + "a.bmp").c_str(), 1, 0); this->m_pauseButton->SetBitmap((prefix + names[5] + "b.bmp").c_str(), 2, 0); @@ -3995,7 +3976,7 @@ void UIReplayControlWnd::Slot15(int, int) { const int textPositions[4][2] = {{8, 26}, {8, 40}, {-100, -100}, {8, 54}}; for (int i = 0; i < 4; ++i) { - this->m_texts[i] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_texts[i] = new UIStaticText(*this->m_context); this->m_texts[i]->SetSize(188, 14); this->m_texts[i]->SetText("", 0); this->m_texts[i]->Move(textPositions[i][0], textPositions[i][1]); diff --git a/Source/UI/Window/UIMessageBox.h b/Source/UI/Window/UIMessageBox.h index 826dd7b8..2b4e3e69 100644 --- a/Source/UI/Window/UIMessageBox.h +++ b/Source/UI/Window/UIMessageBox.h @@ -7,7 +7,6 @@ class UITextViewer; struct UITextViewerContext; -struct UIButtonContext; class UIWindowMgr; struct WindowResponseRecorder; diff --git a/Source/UI/Window/UIMileageWnd.cpp b/Source/UI/Window/UIMileageWnd.cpp index 843e5c4e..c90a9735 100644 --- a/Source/UI/Window/UIMileageWnd.cpp +++ b/Source/UI/Window/UIMileageWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeTooltip.h" #include "UI/Window/UIMileageWnd.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -88,7 +90,7 @@ void UIMileageWnd::Slot28(int x, int y) { int tipX = 10; int tipY = -20; this->ToScreen(tipX, tipY); - this->m_controls->services.Tooltip(this->m_tooltip.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), tipX, tipY, -1, false, true); } // OFFSET: 0x0094F040 @@ -159,7 +161,7 @@ int UIMileageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i // OFFSET: 0x00946B50 // FUNCTION: fn_12850 -UIMileageWnd::UIMileageWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_startTime(0), m_point(0), m_remaining(0), m_bonus(1), m_controls(&controls) { +UIMileageWnd::UIMileageWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_startTime(0), m_point(0), m_remaining(0), m_bonus(1) { this->m_tooltip.clear(); } diff --git a/Source/UI/Window/UIMileageWnd.h b/Source/UI/Window/UIMileageWnd.h index c0e70f06..e7d164e8 100644 --- a/Source/UI/Window/UIMileageWnd.h +++ b/Source/UI/Window/UIMileageWnd.h @@ -6,11 +6,10 @@ #include #include -struct UIButtonContext; class UIMileageWnd : public UIFrameWnd { public: - UIMileageWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMileageWnd(UIWindowContext& windows); void Paint() override; void Slot19() override; void Slot25(int x, int y) override; @@ -26,7 +25,7 @@ protected: /* 00BC */ int m_remaining; /* 00C0 */ int m_bonus; /* 00C4 */ std::string m_tooltip; - UIButtonContext* m_controls; + void* unknown_controls; }; extern int g_mileageWndActive; diff --git a/Source/UI/Window/UIMonsterDisplayWnd.h b/Source/UI/Window/UIMonsterDisplayWnd.h index defc5461..b920d312 100644 --- a/Source/UI/Window/UIMonsterDisplayWnd.h +++ b/Source/UI/Window/UIMonsterDisplayWnd.h @@ -5,11 +5,10 @@ #include -struct UIButtonContext; class UIMonsterDisplayWnd : public UIFrameWnd { public: - UIMonsterDisplayWnd(UIWindowContext& windows, UIButtonContext& controls); + UIMonsterDisplayWnd(UIWindowContext& windows); /* 00B4 */ std::string m_name; /* 00CC */ std::string unknown_00CC; /* 00E4 */ unsigned char unknown_00E4; @@ -20,7 +19,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIMonsterInfoWnd.h b/Source/UI/Window/UIMonsterInfoWnd.h index c4ba49f7..01807a22 100644 --- a/Source/UI/Window/UIMonsterInfoWnd.h +++ b/Source/UI/Window/UIMonsterInfoWnd.h @@ -6,7 +6,6 @@ #include #include -struct UIButtonContext; struct MonsterInfo { /* 0000 */ short unknown_0000; @@ -37,7 +36,7 @@ public: /* 00D8 */ std::string name; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; extern std::uint32_t g_monsterInfoActorId; diff --git a/Source/UI/Window/UINavigationHelpWnd.cpp b/Source/UI/Window/UINavigationHelpWnd.cpp index d8f2041d..d3362493 100644 --- a/Source/UI/Window/UINavigationHelpWnd.cpp +++ b/Source/UI/Window/UINavigationHelpWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "UI/Window/UINavigationHelpWnd.h" #include "Contents/MessageTable.h" @@ -46,7 +47,7 @@ void UINavigationHelpWnd::Slot15(int width, int height) { this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3217)), 0x30, 0, 0); this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3218)), 0x30, 0, 0); - this->AddCloseButton(*this->m_controls, LookupMessage(2202), 0); + this->AddCloseButton(LookupMessage(2202), 0); } // OFFSET: 0x0092CEC0 @@ -67,6 +68,6 @@ int UINavigationHelpWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::i // OFFSET: 0x009115B0 // FUNCTION: fn_12517 -UINavigationHelpWnd::UINavigationHelpWnd(UIWindowContext& windows, UIButtonContext& controls, UITextViewerContext& text) - : UIFrameWnd(windows, 0), m_controls(&controls), m_text(&text), m_viewer(nullptr), unknown_00B8(0) { +UINavigationHelpWnd::UINavigationHelpWnd(UIWindowContext& windows, UITextViewerContext& text) + : UIFrameWnd(windows, 0), m_text(&text), m_viewer(nullptr), unknown_00B8(0) { } diff --git a/Source/UI/Window/UINavigationHelpWnd.h b/Source/UI/Window/UINavigationHelpWnd.h index 086f1b4a..83553f89 100644 --- a/Source/UI/Window/UINavigationHelpWnd.h +++ b/Source/UI/Window/UINavigationHelpWnd.h @@ -4,18 +4,17 @@ #include "UI/Window/UIFrameWnd.h" class UITextViewer; -struct UIButtonContext; struct UITextViewerContext; class UINavigationHelpWnd : public UIFrameWnd { public: - UINavigationHelpWnd(UIWindowContext& windows, UIButtonContext& controls, UITextViewerContext& text); + UINavigationHelpWnd(UIWindowContext& windows, UITextViewerContext& text); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; UITextViewerContext* m_text; /* 00B4 */ UITextViewer* m_viewer; /* 00B8 */ int unknown_00B8; diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index 374730a5..07ba1c94 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -127,7 +127,7 @@ void UINavigationWnd::Slot15(int width, int height) { const int ids[6] = {321, 184, 189, 190, 284, 191}; for (int index = 0; index < 6; ++index) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); this->m_buttons[index] = button; button->SetBitmap((path + names[index] + "_A.bmp").c_str(), 0, 0); button->SetBitmap((path + names[index] + "_B.bmp").c_str(), 1, 0); @@ -139,10 +139,10 @@ void UINavigationWnd::Slot15(int width, int height) { this->AddChild(this->m_buttons[index]); } - this->m_closeButton = this->AddCloseButton(*this->m_controls, LookupMessage(0x89A), 0); - this->m_minimizeButton = this->AddMinimizeButton(*this->m_controls, "", 0); + this->m_closeButton = this->AddCloseButton(LookupMessage(0x89A), 0); + this->m_minimizeButton = this->AddMinimizeButton("", 0); - this->unknown_0120 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0120 = new UIBitmapButton(*this->m_context); this->unknown_0120->SetBitmap((path + "NaviHelp_off.bmp").c_str(), 0, 0); this->unknown_0120->SetBitmap((path + "NaviHelp_on.bmp").c_str(), 1, 0); this->unknown_0120->SetBitmap((path + "NaviHelp_on.bmp").c_str(), 2, 0); @@ -186,7 +186,7 @@ void UINavigationWnd::Slot15(int width, int height) { this->m_titleBar->Invalidate(); } - UICheckBox* box = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* box = new UICheckBox(*this->m_context); this->unknown_0118 = box; box->SetSize(this->TextWidth(LookupMessage(0x8A3), 10, 0, 12, 0, 0), 12); path = base; @@ -196,7 +196,7 @@ void UINavigationWnd::Slot15(int width, int height) { this->unknown_0118->SetTooltip(LookupMessage(0x8A4)); this->AddChild(this->unknown_0118); - box = new UICheckBox(*this->m_context, *this->m_controls); + box = new UICheckBox(*this->m_context); this->unknown_0114 = box; box->SetSize(this->TextWidth(LookupMessage(0x8A5), 10, 0, 12, 0, 0), 12); path = base; @@ -206,7 +206,7 @@ void UINavigationWnd::Slot15(int width, int height) { this->unknown_0114->SetTooltip(LookupMessage(0x8A6)); this->AddChild(this->unknown_0114); - box = new UICheckBox(*this->m_context, *this->m_controls); + box = new UICheckBox(*this->m_context); this->unknown_011C = box; box->SetSize(this->TextWidth(LookupMessage(0x8A7), 10, 0, 12, 0, 0), 12); path = base; diff --git a/Source/UI/Window/UINavigationWnd.h b/Source/UI/Window/UINavigationWnd.h index 14476e16..21e79151 100644 --- a/Source/UI/Window/UINavigationWnd.h +++ b/Source/UI/Window/UINavigationWnd.h @@ -17,7 +17,6 @@ class UIComboBoxDefWnd; class UIEditCtrl; class UIListBoxNavi; class UIResizer; -struct UIButtonContext; struct UIComboBoxHeaderContext; struct UIEditContext; struct UIListBoxContext; @@ -93,7 +92,7 @@ protected: /* 0128 */ UIResizer* unknown_0128; /* 012C */ std::vector m_history; - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; UIComboBoxHeaderContext* m_comboContext; UIEditContext* m_editContext; diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index 95e32820..b4ab0087 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowDialogs.h" +#include "UI/Window/UIWindowMgr.h" #include "UI/Window/UINewMakeCharWnd.h" #include "Client/Mode/CMode.h" @@ -297,7 +299,7 @@ int UIHairStyleButton::SendMsg(UIWindow* sender, int message, std::intptr_t argu // OFFSET: 0x007DA290 // FUNCTION: fn_09613 void UIHairStyleButton::Slot15(int width, int height) { - this->m_preview = new (std::nothrow) UIHairBitmap(*this->m_context, *this->m_buttonContext); + this->m_preview = new (std::nothrow) UIHairBitmap(*this->m_context); this->m_preview->SetSize(36, 37); this->AddChild(this->m_preview); this->SendMsg(nullptr, 40, 0, 0, 0, 0); @@ -340,7 +342,7 @@ void UINewMakeCharWnd::sub_7DBFD0() { // OFFSET: 0x007DA340 // FUNCTION: fn_09614 void UINewMakeCharWnd::Slot15(int width, int height) { - UIBitmapButton* closeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* closeButton = new UIBitmapButton(*this->m_context); closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_normal.bmp", 0, 0); closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_over.bmp", 1, 0); closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_press.bmp", 2, 0); @@ -349,7 +351,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { closeButton->SetId(0xB9); this->AddChild(closeButton); - UIBmpTextButton* makeButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* makeButton = new UIBmpTextButton(*this->m_context); makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_normal.bmp", 0, 0); makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_over.bmp", 1, 0); makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_press.bmp", 2, 0); @@ -362,7 +364,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { makeButton->SetId(0xB8); this->AddChild(makeButton); - UIBmpTextButton* cancelButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* cancelButton = new UIBmpTextButton(*this->m_context); cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_normal.bmp", 0, 0); cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_over.bmp", 1, 0); cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_press.bmp", 2, 0); @@ -408,7 +410,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { this->m_raceViews[1] = doram; this->AddChild(doram); - this->m_genderButtons[1] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_genderButtons[1] = new UIBitmapButton(*this->m_context); this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_off.bmp", 0, 0); this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_over.bmp", 1, 0); this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_press.bmp", 2, 0); @@ -417,7 +419,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { this->m_genderButtons[1]->SetId(0x20D); this->AddChild(this->m_genderButtons[1]); - this->m_genderButtons[0] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_genderButtons[0] = new UIBitmapButton(*this->m_context); this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_off.bmp", 0, 0); this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_over.bmp", 1, 0); this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_press.bmp", 2, 0); @@ -432,7 +434,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_on.bmp", 0, 0); } - UIBitmapButton* leftTurn = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* leftTurn = new UIBitmapButton(*this->m_context); leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_normal.bmp", 0, 0); leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_over.bmp", 1, 0); leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_press.bmp", 2, 0); @@ -443,7 +445,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { leftTurn->SetTooltip(LookupMessage(0x87E)); this->AddChild(leftTurn); - UIBitmapButton* rightTurn = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* rightTurn = new UIBitmapButton(*this->m_context); rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_normal.bmp", 0, 0); rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_over.bmp", 1, 0); rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_press.bmp", 2, 0); @@ -454,7 +456,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { rightTurn->SetTooltip(LookupMessage(0x87F)); this->AddChild(rightTurn); - UIStaticText* hairStyleTitle = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* hairStyleTitle = new UIStaticText(*this->m_context); hairStyleTitle->SetSize(100, 0xF); hairStyleTitle->SetText(LookupMessage(0xD12), 0); hairStyleTitle->SetColor(0x40, 0x40, 0x40); @@ -463,7 +465,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { this->AddChild(hairStyleTitle); for (int index = 0; index < 24; ++index) { - this->m_hairStyleButtons[index] = new UIHairStyleButton(*this->m_context, *this->m_controls, index, this->m_sex); + this->m_hairStyleButtons[index] = new UIHairStyleButton(*this->m_context, index, this->m_sex); this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_normal.bmp", 0, 0); this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_over.bmp", 1, 0); this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_select.bmp", 2, 0); @@ -476,7 +478,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { } } - UIStaticText* hairColorTitle = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* hairColorTitle = new UIStaticText(*this->m_context); hairColorTitle->SetSize(100, 0xF); hairColorTitle->SetText(LookupMessage(0xD13), 0); hairColorTitle->SetColor(0x40, 0x40, 0x40); @@ -487,7 +489,7 @@ void UINewMakeCharWnd::Slot15(int width, int height) { char name[128]; memset(name, 0, sizeof(name)); for (int index = 0; index < 9; ++index) { - UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context); memset(name, 0, 0x40); sprintf(name, "유저인터페이스\\make_character_ver2\\color%02d_off.bmp", index + 1); button->SetBitmap(name, 0); diff --git a/Source/UI/Window/UINewMakeCharWnd.h b/Source/UI/Window/UINewMakeCharWnd.h index 1811af50..2d20ef0f 100644 --- a/Source/UI/Window/UINewMakeCharWnd.h +++ b/Source/UI/Window/UINewMakeCharWnd.h @@ -36,8 +36,8 @@ public: class UIHairStyleButton : public UIBitmapButton { public: // INLINED - UIHairStyleButton(UIWindowContext& windows, UIButtonContext& controls, int style, int sex) - : UIBitmapButton(windows, controls), m_style(style), m_sex(sex), m_race(0), m_preview(nullptr), m_selected(false) { + UIHairStyleButton(UIWindowContext& windows, int style, int sex) + : UIBitmapButton(windows), m_style(style), m_sex(sex), m_race(0), m_preview(nullptr), m_selected(false) { } UIHairStyleButton(int style, int sex); void Slot15(int width, int height) override; @@ -134,7 +134,7 @@ public: /* 0360 */ unsigned long m_startTime; /* 0364 */ int unknown_0364; /* 0368 */ int unknown_0368; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index 6d715a01..67a7b9cf 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -1,3 +1,5 @@ +#include "Contents/MessageTable.h" +#include "Client/Mode/CMode.h" #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Buttons/UIBitmapButton.h" #include "UI/Buttons/UIBmpTextButton.h" @@ -191,7 +193,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { for (int index = 0; index < this->m_slotsPerPage; ++index) { const int slot = this->m_page * this->m_slotsPerPage + index; - UISlotBmpButton* button = new UISlotBmpButton(*this->m_context, *this->m_controls, index, true); + UISlotBmpButton* button = new UISlotBmpButton(*this->m_context, index, true); button->SetBitmap("유저인터페이스\\select_character_ver3\\img_slot2_normal.bmp", 0, 0); button->SetBitmap("유저인터페이스\\select_character_ver3\\img_slot2_over.bmp", 1, 0); button->SetBitmap("유저인터페이스\\select_character_ver3\\img_slot2_press.bmp", 2, 0); @@ -220,7 +222,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { closeButton->SetId(0xB9); this->AddChild(closeButton); - this->m_textButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + this->m_textButton = new UIBmpTextButton(*this->m_context); this->m_textButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_normal.bmp", 0, 0); this->m_textButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_over.bmp", 1, 0); this->m_textButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_press.bmp", 2, 0); @@ -234,7 +236,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { this->m_textButton->Enable(0); this->AddChild(this->m_textButton); - UIBmpTextButton* startButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* startButton = new UIBmpTextButton(*this->m_context); this->m_windowC0 = startButton; startButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_normal.bmp", 0, 0); startButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_over.bmp", 1, 0); @@ -254,7 +256,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { startButton->Invalidate(); } - UIBmpTextButton* cancelDeleteButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* cancelDeleteButton = new UIBmpTextButton(*this->m_context); this->m_windowC4 = cancelDeleteButton; cancelDeleteButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_normal.bmp", 0, 0); cancelDeleteButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_over.bmp", 1, 0); @@ -269,7 +271,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { cancelDeleteButton->Enable(0); this->AddChild(cancelDeleteButton); - UIBmpTextButton* gameStartButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* gameStartButton = new UIBmpTextButton(*this->m_context); this->m_windowFC = gameStartButton; gameStartButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_gameStart_off.bmp", 0, 0); gameStartButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_gameStart_over.bmp", 1, 0); @@ -285,7 +287,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { gameStartButton->AddTextStyle(3, 0x12, 0x7F74DC, 1, 0, -1000, 0x39); this->AddChild(gameStartButton); - UIBmpTextButton* deleteButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + UIBmpTextButton* deleteButton = new UIBmpTextButton(*this->m_context); this->m_window100 = deleteButton; deleteButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_normal.bmp", 0, 0); deleteButton->SetBitmap("유저인터페이스\\select_character_ver3\\bt_info_over.bmp", 1, 0); diff --git a/Source/UI/Window/UINewSelectCharWnd.h b/Source/UI/Window/UINewSelectCharWnd.h index 21a6415a..0a826fa0 100644 --- a/Source/UI/Window/UINewSelectCharWnd.h +++ b/Source/UI/Window/UINewSelectCharWnd.h @@ -11,7 +11,6 @@ class UIBitmapButton; class UIBmpTextButton; class UIStaticText; class CUIControl; -struct UIButtonContext; extern void* g_charViewMode; extern char g_selectedSlotIndex; @@ -88,7 +87,7 @@ protected: /* 0134 */ int m_maxCharacters; /* 0138 */ int m_unknown138; /* 013C */ bool m_unknown13C; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index 0d67c0de..11095eb7 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -284,7 +284,6 @@ void UINewSkillListWnd::sub_9AE930() { // OFFSET: 0x009AF300 // FUNCTION: fn_13802 void UINewSkillListWnd::sub_9AF300() { - auto& controls = *this->m_controls; LuaScript& script = *g_session.m_hotkeyScript; int drawn = 0; int index = 0; @@ -785,14 +784,14 @@ bool UINewSkillListWnd::IsSkillArea(int x, int y) { // OFFSET: 0x009B1050 // FUNCTION: fn_13814 void UINewSkillListWnd::Slot15(int width, int height) { - this->m_tabs = new UITabControl(*this->m_context, *this->m_controls); + this->m_tabs = new UITabControl(*this->m_context); this->m_tabs->Configure(0, 17, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->m_tabs->Move(0, 6); this->AddChild(this->m_tabs); - this->m_btnHelp = this->AddBaseButton(*this->m_controls); - this->m_btnMinimize = this->AddMinimizeButton(*this->m_controls, "", 0); - this->m_btnClose = this->AddCloseButton(*this->m_controls, "Alt+S", 0); + this->m_btnHelp = this->AddBaseButton(); + this->m_btnMinimize = this->AddMinimizeButton("", 0); + this->m_btnClose = this->AddCloseButton("Alt+S", 0); this->m_btnHelp->Move(22, 5); this->m_btnMinimize->Move(this->geometry.width - 30, 5); @@ -805,7 +804,7 @@ void UINewSkillListWnd::Slot15(int width, int height) { this->AddChild(this->m_scrollBar); for (int i = 0; i < 10; ++i) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\skill_up_a.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\skill_up_b.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\skill_up_c.bmp", 2, 0); @@ -817,7 +816,7 @@ void UINewSkillListWnd::Slot15(int width, int height) { } for (int i = 0; i < 42; ++i) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\arw_left.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\arw_left.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\arw_left.bmp", 2, 0); @@ -829,7 +828,7 @@ void UINewSkillListWnd::Slot15(int width, int height) { } for (int i = 0; i < 42; ++i) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\arw_right.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\arw_right.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\arw_right.bmp", 2, 0); @@ -842,7 +841,7 @@ void UINewSkillListWnd::Slot15(int width, int height) { const char* baseDir = "유저인터페이스\\"; const char* applyNames[3] = {"btn_apply", "btn_apply_a", "btn_apply_b"}; - this->m_btnApply = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_btnApply = new UIBitmapButton(*this->m_context); for (int state = 0; state < 3; ++state) { std::string path = std::string(baseDir) + applyNames[state] + ".bmp"; this->m_btnApply->SetBitmap(Resolve(path.c_str()), state, 0); @@ -855,7 +854,7 @@ void UINewSkillListWnd::Slot15(int width, int height) { this->AddChild(this->m_btnApply); const char* resetNames[3] = {"btn_reset", "btn_reset_a", "btn_reset_b"}; - this->m_btnCancel = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_btnCancel = new UIBitmapButton(*this->m_context); for (int state = 0; state < 3; ++state) { std::string path = std::string(baseDir) + resetNames[state] + ".bmp"; this->m_btnCancel->SetBitmap(Resolve(path.c_str()), state, 0); @@ -885,7 +884,6 @@ void UINewSkillListWnd::Slot15(int width, int height) { // OFFSET: 0x009B2160 // FUNCTION: fn_13815 void UINewSkillListWnd::Paint() { - auto& controls = *this->m_controls; const int left = this->m_tabs->geometry.width; this->ClearSurface(0xFFFF00FF); this->FillRegion(left, this->m_topMargin, this->geometry.width - left, this->geometry.height - this->m_bottomMargin - this->m_topMargin, 0xFFFFFF); @@ -1604,7 +1602,6 @@ static int SkillValueOf(const std::list& values, int id) { // OFFSET: 0x009AF960 // FUNCTION: fn_13803 void UINewSkillListWnd::sub_9AF960() { - auto& controls = *this->m_controls; LuaScript& script = *g_session.m_hotkeyScript; CBitmapRes* emptySlot = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\no_skill.bmp"))); diff --git a/Source/UI/Window/UINewSkillListWnd.h b/Source/UI/Window/UINewSkillListWnd.h index 6230dae7..8cd8d309 100644 --- a/Source/UI/Window/UINewSkillListWnd.h +++ b/Source/UI/Window/UINewSkillListWnd.h @@ -12,7 +12,6 @@ #include struct SkillListWndInfo; -struct UIButtonContext; class UIBitmapButton; class UIResizer; class UIScrollBar; @@ -91,7 +90,7 @@ public: /* 02AC */ int m_detailId; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UINormalMB.cpp b/Source/UI/Window/UINormalMB.cpp index cf3969ba..84be7d42 100644 --- a/Source/UI/Window/UINormalMB.cpp +++ b/Source/UI/Window/UINormalMB.cpp @@ -19,7 +19,6 @@ UINormalMB::UINormalMB(UIWindowContext& windows) : UIFrameWnd(windows, 0), m_own // OFFSET: 0x0094D840 // FUNCTION: fn_12906 void UINormalMB::Paint() { - UIButtonContext& controls = this->m_textContext->buttons; this->DrawTitleBar(true, this->m_title.c_str(), 0); this->DrawPanelBackground(17, 0, ""); } @@ -61,7 +60,7 @@ int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int // INLINED __forceinline void UINormalMB::AddButton(const char* normal, const char* hover, const char* pressed, int x, int y, int id) { - auto* button = new UIBitmapButton(*this->m_context, this->m_textContext->buttons); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap(normal, 0, 0); button->SetBitmap(hover, 1, 0); button->SetBitmap(pressed, 2, 0); @@ -86,7 +85,7 @@ void UINormalMB::Create(UIWindow* owner, const char* text, int type, bool defaul int inset = 0; if (icon) { - auto* image = new UIStaticBitmap(*this->m_context, this->m_textContext->buttons); + auto* image = new UIStaticBitmap(*this->m_context); image->SetBitmap(icon); image->SetSize(image->geometry.width, image->geometry.height); image->Move(10, 22); diff --git a/Source/UI/Window/UINoteWnd.cpp b/Source/UI/Window/UINoteWnd.cpp index 36bfb6c4..3cf93b6e 100644 --- a/Source/UI/Window/UINoteWnd.cpp +++ b/Source/UI/Window/UINoteWnd.cpp @@ -9,7 +9,7 @@ // OFFSET: 0x0094C2D0 // FUNCTION: fn_12895 void UINoteWnd::Slot15(int width, int height) { - UIBasicButton* button = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* button = new UIBasicButton(*this->m_context); button->Configure(60, LookupMessage(0xBE5)); button->Move(width - 68, height - 26); button->SetId(201); @@ -65,8 +65,8 @@ void UINoteWnd_Scroll::Slot35(int delta) { // OFFSET: 0x00946D00 // FUNCTION: fn_12852 -UINoteWnd::UINoteWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_scroll(nullptr), m_controls(&controls) { +UINoteWnd::UINoteWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0), m_scroll(nullptr) { } // OFFSET: 0x00950840 diff --git a/Source/UI/Window/UINoteWnd.h b/Source/UI/Window/UINoteWnd.h index 80721520..11d4b2df 100644 --- a/Source/UI/Window/UINoteWnd.h +++ b/Source/UI/Window/UINoteWnd.h @@ -4,7 +4,6 @@ #include "UI/UIScrollWnd.h" #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIStaticText_LF; class UINoteWnd_Scroll : public UIScrollWnd { @@ -23,14 +22,14 @@ public: class UINoteWnd : public UIFrameWnd { public: - UINoteWnd(UIWindowContext& windows, UIButtonContext& controls); + UINoteWnd(UIWindowContext& windows); 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; protected: /* 00B4 */ UINoteWnd_Scroll* m_scroll; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UINoticeWnd.h b/Source/UI/Window/UINoticeWnd.h index 5a775350..05715194 100644 --- a/Source/UI/Window/UINoticeWnd.h +++ b/Source/UI/Window/UINoticeWnd.h @@ -28,7 +28,7 @@ public: /* 0170 */ UIWindow* m_scrollBar; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIOpenMailBoxWnd.cpp b/Source/UI/Window/UIOpenMailBoxWnd.cpp index b0f1092e..3ee0d9a6 100644 --- a/Source/UI/Window/UIOpenMailBoxWnd.cpp +++ b/Source/UI/Window/UIOpenMailBoxWnd.cpp @@ -12,7 +12,7 @@ void UIOpenMailBoxWnd::Slot53() { // OFFSET: 0x0094C410 // FUNCTION: fn_12896 void UIOpenMailBoxWnd::Slot15(int width, int height) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\icon_noti_gotmail.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\icon_noti_gotmail.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\icon_noti_gotmail.bmp", 2, 0); @@ -66,6 +66,6 @@ int UIOpenMailBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // OFFSET: 0x00946DE0 // FUNCTION: fn_12853 -UIOpenMailBoxWnd::UIOpenMailBoxWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIOpenMailBoxWnd::UIOpenMailBoxWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } diff --git a/Source/UI/Window/UIOpenMailBoxWnd.h b/Source/UI/Window/UIOpenMailBoxWnd.h index 9d46db68..f993ab33 100644 --- a/Source/UI/Window/UIOpenMailBoxWnd.h +++ b/Source/UI/Window/UIOpenMailBoxWnd.h @@ -3,18 +3,17 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIOpenMailBoxWnd : public UIFrameWnd { public: - UIOpenMailBoxWnd(UIWindowContext& windows, UIButtonContext& controls); + UIOpenMailBoxWnd(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; virtual void Slot53(); protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIOpenRoulletteWnd.cpp b/Source/UI/Window/UIOpenRoulletteWnd.cpp index 8e0cb922..fdd829fc 100644 --- a/Source/UI/Window/UIOpenRoulletteWnd.cpp +++ b/Source/UI/Window/UIOpenRoulletteWnd.cpp @@ -23,7 +23,7 @@ void UIOpenRoulletteWnd::Slot19() { // OFFSET: 0x0094C4E0 // FUNCTION: fn_12897 void UIOpenRoulletteWnd::Slot15(int width, int height) { - auto* button = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* button = new UIBitmapButton(*this->m_context); button->SetBitmap("유저인터페이스\\basic_interface\\roullette\\RoulletteIcon.bmp", 0, 0); button->SetBitmap("유저인터페이스\\basic_interface\\roullette\\RoulletteIcon.bmp", 1, 0); button->SetBitmap("유저인터페이스\\basic_interface\\roullette\\RoulletteIcon.bmp", 2, 0); @@ -56,6 +56,6 @@ int UIOpenRoulletteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, // OFFSET: 0x00946E40 // FUNCTION: fn_12854 -UIOpenRoulletteWnd::UIOpenRoulletteWnd(UIWindowContext& windows, UIButtonContext& controls) - : UIFrameWnd(windows, 0), m_controls(&controls) { +UIOpenRoulletteWnd::UIOpenRoulletteWnd(UIWindowContext& windows) + : UIFrameWnd(windows, 0) { } diff --git a/Source/UI/Window/UIOpenRoulletteWnd.h b/Source/UI/Window/UIOpenRoulletteWnd.h index 37b4ffdc..2f0940c1 100644 --- a/Source/UI/Window/UIOpenRoulletteWnd.h +++ b/Source/UI/Window/UIOpenRoulletteWnd.h @@ -3,18 +3,17 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIOpenRoulletteWnd : public UIFrameWnd { public: - UIOpenRoulletteWnd(UIWindowContext& windows, UIButtonContext& controls); + UIOpenRoulletteWnd(UIWindowContext& windows); void Slot19() override; 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIPartyBookingHelpWnd.cpp b/Source/UI/Window/UIPartyBookingHelpWnd.cpp index f9ef4baf..369bd8d1 100644 --- a/Source/UI/Window/UIPartyBookingHelpWnd.cpp +++ b/Source/UI/Window/UIPartyBookingHelpWnd.cpp @@ -13,9 +13,8 @@ // OFFSET: 0x00924810 // FUNCTION: fn_12645 void UIPartyBookingHelpWnd::Slot15(int width, int height) { - auto& controls = *this->m_controls; - this->AddBaseButton(controls); - this->AddCloseButton(controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->m_viewer = new UITextViewer(*this->m_context, *this->m_text); this->m_viewer->Configure(10, 25, width - 20, height - 35, 1); @@ -54,6 +53,6 @@ int UIPartyBookingHelpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x00911860 // FUNCTION: fn_12519 -UIPartyBookingHelpWnd::UIPartyBookingHelpWnd(UIWindowContext& windows, UIButtonContext& controls, UITextViewerContext& text) - : UIFrameWnd(windows, 0), m_controls(&controls), m_text(&text) { +UIPartyBookingHelpWnd::UIPartyBookingHelpWnd(UIWindowContext& windows, UITextViewerContext& text) + : UIFrameWnd(windows, 0), m_text(&text) { } diff --git a/Source/UI/Window/UIPartyBookingHelpWnd.h b/Source/UI/Window/UIPartyBookingHelpWnd.h index 0c6bc21e..1bcb2393 100644 --- a/Source/UI/Window/UIPartyBookingHelpWnd.h +++ b/Source/UI/Window/UIPartyBookingHelpWnd.h @@ -4,18 +4,17 @@ #include "UI/Window/UIFrameWnd.h" class UITextViewer; -struct UIButtonContext; struct UITextViewerContext; class UIPartyBookingHelpWnd : public UIFrameWnd { public: - UIPartyBookingHelpWnd(UIWindowContext& windows, UIButtonContext& controls, UITextViewerContext& text); + UIPartyBookingHelpWnd(UIWindowContext& windows, UITextViewerContext& text); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; UITextViewerContext* m_text; /* 00B4 */ UITextViewer* m_viewer; }; diff --git a/Source/UI/Window/UIPayConfirmWnd.h b/Source/UI/Window/UIPayConfirmWnd.h index 890e2cce..255df078 100644 --- a/Source/UI/Window/UIPayConfirmWnd.h +++ b/Source/UI/Window/UIPayConfirmWnd.h @@ -26,7 +26,7 @@ public: /* 0120 */ const BitmapImage* m_image; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIPetEvolutionWnd.cpp b/Source/UI/Window/UIPetEvolutionWnd.cpp index dd78cfab..cdeff620 100644 --- a/Source/UI/Window/UIPetEvolutionWnd.cpp +++ b/Source/UI/Window/UIPetEvolutionWnd.cpp @@ -35,9 +35,9 @@ UIPetEvolutionWnd::~UIPetEvolutionWnd() { // OFFSET: 0x009AB170 // FUNCTION: fn_13763 void UIPetEvolutionWnd::Slot15(int width, int height) { - this->AddCloseButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); - UIBitmapButton* okButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* okButton = new UIBitmapButton(*this->m_context); okButton->SetBitmap("유저인터페이스\\btn_big_ok.bmp", 0, 0); okButton->SetBitmap("유저인터페이스\\btn_big_ok_a.bmp", 1, 0); okButton->SetBitmap("유저인터페이스\\btn_big_ok_b.bmp", 2, 0); @@ -46,7 +46,7 @@ void UIPetEvolutionWnd::Slot15(int width, int height) { okButton->SetId(184); this->AddChild(okButton); - UIBitmapButton* cancelButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* cancelButton = new UIBitmapButton(*this->m_context); cancelButton->SetBitmap("유저인터페이스\\btn_big_cancel.bmp", 0, 0); cancelButton->SetBitmap("유저인터페이스\\btn_big_cancel_a.bmp", 1, 0); cancelButton->SetBitmap("유저인터페이스\\btn_big_cancel_b.bmp", 2, 0); @@ -199,7 +199,7 @@ int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu void UIPetEvolutionWnd::RebuildButtons() { const char* name = g_session.GetPetString(g_session.GetPetJobByEggItem(this->m_petEggId)); if (name) { - UITextButton* button = new UITextButton(*this->m_context, *this->m_controls); + UITextButton* button = new UITextButton(*this->m_context); button->Configure(name, 0xFF6464, 0, 12, 1, 1); button->m_hoverColor = 0x9B9B9B; button->ResizeToTextClipped(button->geometry.width - 10, button->geometry.height); @@ -212,7 +212,7 @@ void UIPetEvolutionWnd::RebuildButtons() { name = g_session.GetPetString(g_session.GetPetJobByEggItem(this->m_evolvedEggId)); if (name) { - UITextButton* button = new UITextButton(*this->m_context, *this->m_controls); + UITextButton* button = new UITextButton(*this->m_context); button->Configure(name, 0xFF6464, 0, 12, 1, 1); button->m_hoverColor = 0x9B9B9B; button->ResizeToTextClipped(button->geometry.width - 10, button->geometry.height); @@ -232,7 +232,7 @@ void UIPetEvolutionWnd::RebuildButtons() { std::memset(text, 0, sizeof(text)); int capacity = sizeof(text); item.sub_6D5810(text, capacity, 0); - UITextButton* button = new UITextButton(*this->m_context, *this->m_controls); + UITextButton* button = new UITextButton(*this->m_context); button->Configure(text, 0xFF6464, 0, 12, 1, 1); button->m_hoverColor = 0x9B9B9B; button->ResizeToTextClipped(button->geometry.width, button->geometry.height); diff --git a/Source/UI/Window/UIPetEvolutionWnd.h b/Source/UI/Window/UIPetEvolutionWnd.h index 80a098a5..6eaf51fb 100644 --- a/Source/UI/Window/UIPetEvolutionWnd.h +++ b/Source/UI/Window/UIPetEvolutionWnd.h @@ -7,7 +7,6 @@ #include class UITextButton; -struct UIButtonContext; class UIPetEvolutionWnd : public UIFrameWnd { public: @@ -24,7 +23,7 @@ public: /* 00C8 */ std::vector> m_materials; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIPetInfoWnd.h b/Source/UI/Window/UIPetInfoWnd.h index 19dc6729..da9ccae1 100644 --- a/Source/UI/Window/UIPetInfoWnd.h +++ b/Source/UI/Window/UIPetInfoWnd.h @@ -13,13 +13,12 @@ class UINormalMB; class ForbiddenWords; class UINoneVisibleButton; class UIPetInfoBarGraph; -struct UIButtonContext; struct UIEditContext; struct WindowResponseRecorder; class UIPetInfoWnd : public UIFrameWnd { public: - UIPetInfoWnd(UIWindowContext& windows, UIButtonContext& controls); + UIPetInfoWnd(UIWindowContext& windows); ~UIPetInfoWnd() override; void Slot11() override; @@ -39,7 +38,7 @@ public: /* 00E8 */ UICheckBox* unknown_00E8; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; WindowResponseRecorder* m_recorder; ForbiddenWords* m_forbiddenWords; diff --git a/Source/UI/Window/UIRebirthWnd.cpp b/Source/UI/Window/UIRebirthWnd.cpp index eaae6819..4c042ed1 100644 --- a/Source/UI/Window/UIRebirthWnd.cpp +++ b/Source/UI/Window/UIRebirthWnd.cpp @@ -23,7 +23,7 @@ void UIRebirthWnd::Slot15(int width, int height) { const RECT positions[5] = {{29, 22}, {29, 45}, {29, 68}, {29, 91}, {29, 119}}; for (int index = 0; index < 5; ++index) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((path + names[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((path + names[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((path + names[index][2] + ".bmp").c_str(), 2, 0); @@ -71,5 +71,5 @@ int UIRebirthWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 // OFFSET: 0x00911950 // FUNCTION: fn_12521 -UIRebirthWnd::UIRebirthWnd(UIWindowContext& windows, UIButtonContext& controls) : UIFrameWnd(windows, 0), m_controls(&controls) { +UIRebirthWnd::UIRebirthWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { } diff --git a/Source/UI/Window/UIRebirthWnd.h b/Source/UI/Window/UIRebirthWnd.h index 2141adfc..8ddacb2e 100644 --- a/Source/UI/Window/UIRebirthWnd.h +++ b/Source/UI/Window/UIRebirthWnd.h @@ -3,17 +3,16 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; class UIRebirthWnd : public UIFrameWnd { public: - UIRebirthWnd(UIWindowContext& windows, UIButtonContext& controls); + UIRebirthWnd(UIWindowContext& windows); 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; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIReplayControlWnd.h b/Source/UI/Window/UIReplayControlWnd.h index f59ba1f0..762fe121 100644 --- a/Source/UI/Window/UIReplayControlWnd.h +++ b/Source/UI/Window/UIReplayControlWnd.h @@ -6,7 +6,6 @@ class UIBarGraph4; class UIStaticText; -struct UIButtonContext; class UIReplayControlWnd : public UIFrameWnd { public: @@ -27,7 +26,7 @@ public: /* 00D4 */ UIStaticText* m_texts[4]; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIReplayRECControlWnd.h b/Source/UI/Window/UIReplayRECControlWnd.h index 51178304..12bbd0f2 100644 --- a/Source/UI/Window/UIReplayRECControlWnd.h +++ b/Source/UI/Window/UIReplayRECControlWnd.h @@ -68,7 +68,7 @@ public: protected: InputFocus* m_focus; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index ebfbb65c..847520e6 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -1,3 +1,4 @@ +#include "Render/Text/FontCache.h" #include "UI/Window/UIRodexContentsWnd.h" #include "Client/Input/InputCharset.h" @@ -58,9 +59,9 @@ void UIRodexContentsWnd::SetContentsText(const char* text) { // OFFSET: 0x00801CE0 // FUNCTION: fn_10015 -UIRodexContentsWnd::UIRodexContentsWnd(UIWindowContext& windows, UIButtonContext& controls) +UIRodexContentsWnd::UIRodexContentsWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), m_contents(nullptr), m_zeny(0), m_itemButton(nullptr), m_zenyButton(nullptr), unknown_0104(nullptr), - unknown_0108(nullptr), m_controls(&controls) { + unknown_0108(nullptr) { this->m_items.clear(); this->m_itemIndex = 0; this->unknown_010C = false; @@ -102,8 +103,8 @@ void UIRodexContentsWnd::DisableZenyButton() { // OFFSET: 0x008020B0 // FUNCTION: fn_10020 void UIRodexContentsWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); RodexMailStore* store = g_rodexMailStore; std::map* mails = nullptr; @@ -126,7 +127,7 @@ void UIRodexContentsWnd::Slot15(int, int) { mail->second.unknown_0001); if (store->unknown_0010 == 0 && (mail->second.unknown_0001 & 8) == 0 && mail->second.unknown_0194 == 0) { - UIBasicButton* report = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* report = new UIBasicButton(*this->m_context); report->Configure(70, LookupMessage(3548)); report->Move(224, 29); report->SetId(310); @@ -137,7 +138,7 @@ void UIRodexContentsWnd::Slot15(int, int) { } } - this->unknown_0104 = new UIBasicButton(*this->m_context, *this->m_controls); + this->unknown_0104 = new UIBasicButton(*this->m_context); this->unknown_0104->Configure(50, LookupMessage(3542)); this->unknown_0104->Move(6, 376); this->unknown_0104->SetId(211); @@ -147,7 +148,6 @@ void UIRodexContentsWnd::Slot15(int, int) { // OFFSET: 0x008023F0 // FUNCTION: fn_10021 void UIRodexContentsWnd::Paint() { - auto& controls = *this->m_controls; this->ClearSurface(0xFF00FF); const auto* background = static_cast( @@ -185,7 +185,7 @@ void UIRodexContentsWnd::Paint() { ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\shadow_item_on.bmp")) ); this->DrawBitmap(x - 4, 319, &slot->image, true); - DrawItemWithQuantity(*this, controls.resources, descriptions, controls.fonts, controls.locale, x, 309, *item, 0, 0); + DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, g_fontCache, this->m_context->locale, x, 309, *item, 0, 0); if (item->unknown_0088 > 0) { ResourceMgr& resources = ResourceMgr::Instance(); const std::string name = FormatOwnedString("유저인터페이스\\grade_enchant\\grade_icon%d.bmp", item->unknown_0088); @@ -384,7 +384,7 @@ void UIRodexContentsWnd::SetMailContents(std::string title, std::string sender, this->AddChild(this->m_contents); if (hasItem) { - this->m_itemButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_itemButton = new UIBitmapButton(*this->m_context); this->m_itemButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_out.bmp", 0, 0); this->m_itemButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_over.bmp", 1, 0); this->m_itemButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_press.bmp", 2, 0); @@ -396,7 +396,7 @@ void UIRodexContentsWnd::SetMailContents(std::string title, std::string sender, if (zeny > 0) { this->m_zeny = zeny; - this->m_zenyButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_zenyButton = new UIBitmapButton(*this->m_context); this->m_zenyButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_out.bmp", 0, 0); this->m_zenyButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_over.bmp", 1, 0); this->m_zenyButton->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_receive_press.bmp", 2, 0); @@ -407,7 +407,7 @@ void UIRodexContentsWnd::SetMailContents(std::string title, std::string sender, } if (g_rodexMailStore->unknown_0010 == 0 && (flags & 8) == 0) { - this->unknown_0108 = new UIBasicButton(*this->m_context, *this->m_controls); + this->unknown_0108 = new UIBasicButton(*this->m_context); this->unknown_0108->Configure(70, LookupMessage(3543)); this->unknown_0108->Move(224, 376); this->unknown_0108->SetId(305); diff --git a/Source/UI/Window/UIRodexContentsWnd.h b/Source/UI/Window/UIRodexContentsWnd.h index e49359b2..bfe53f69 100644 --- a/Source/UI/Window/UIRodexContentsWnd.h +++ b/Source/UI/Window/UIRodexContentsWnd.h @@ -8,14 +8,13 @@ #include #include -struct UIButtonContext; class UIRodexEditCtrl3; class UIBitmapButton; class UIBasicButton; class UIRodexContentsWnd : public UIFrameWnd { public: - UIRodexContentsWnd(UIWindowContext& windows, UIButtonContext& controls); + UIRodexContentsWnd(UIWindowContext& windows); void Paint() override; void Slot15(int width, int height) override; @@ -45,7 +44,7 @@ public: /* 010C */ bool unknown_010C; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIRoulletteWnd.cpp b/Source/UI/Window/UIRoulletteWnd.cpp index 24628cd2..4790d276 100644 --- a/Source/UI/Window/UIRoulletteWnd.cpp +++ b/Source/UI/Window/UIRoulletteWnd.cpp @@ -105,9 +105,9 @@ ITEM_INFO UIRoulletteWnd::ItemAt(int x, int y) { // OFFSET: 0x0080BD10 // FUNCTION: fn_10086 void UIRoulletteWnd::Slot15(int, int) { - this->AddCloseButton(*reinterpret_cast(nullptr), "", 0); + this->AddCloseButton("", 0); - auto* startButton = new UIBitmapButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* startButton = new UIBitmapButton(*reinterpret_cast(nullptr)); this->m_startButton = startButton; startButton->SetBitmap("유저인터페이스\\basic_interface\\roullette\\StartRoullette_a.bmp", 0, 0); startButton->SetBitmap("유저인터페이스\\basic_interface\\roullette\\StartRoullette_a.bmp", 1, 0); @@ -118,7 +118,7 @@ void UIRoulletteWnd::Slot15(int, int) { this->AddChild(startButton); if (g_effectDetailLevel == 2) { - auto* startSprite = new UISpriteButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* startSprite = new UISpriteButton(*reinterpret_cast(nullptr)); this->m_startSprite = startSprite; startSprite->SetSprite("roullette\\Start.spr"); startSprite->SetActName("roullette\\Start.act"); @@ -129,7 +129,7 @@ void UIRoulletteWnd::Slot15(int, int) { startSprite->unknown_00C4 = 1; this->AddChild(startSprite); - auto* prizeSprite = new UISpriteButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* prizeSprite = new UISpriteButton(*reinterpret_cast(nullptr)); this->m_prizeSprite = prizeSprite; prizeSprite->SetSprite("roullette\\GetWinPrize.spr"); prizeSprite->SetActName("roullette\\GetWinPrize.act"); @@ -140,7 +140,7 @@ void UIRoulletteWnd::Slot15(int, int) { prizeSprite->unknown_00C4 = 1; this->AddChild(prizeSprite); - auto* stageArrow = new UISpriteButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* stageArrow = new UISpriteButton(*reinterpret_cast(nullptr)); this->m_stageArrow = stageArrow; stageArrow->SetSprite("roullette\\stageArrow.spr"); stageArrow->SetActName("roullette\\stageArrow.act"); @@ -152,7 +152,7 @@ void UIRoulletteWnd::Slot15(int, int) { this->AddChild(stageArrow); } - auto* prizeButton = new UIBitmapButton(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* prizeButton = new UIBitmapButton(*reinterpret_cast(nullptr)); this->m_prizeButton = prizeButton; prizeButton->SetBitmap("유저인터페이스\\basic_interface\\roullette\\GetWinPrize_a.bmp", 0, 0); prizeButton->SetBitmap("유저인터페이스\\basic_interface\\roullette\\GetWinPrize_a.bmp", 1, 0); @@ -162,21 +162,21 @@ void UIRoulletteWnd::Slot15(int, int) { prizeButton->SetId(410); this->AddChild(prizeButton); - auto* goldText = new UIStaticText(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* goldText = new UIStaticText(*reinterpret_cast(nullptr)); this->m_goldText = goldText; goldText->SetSize(25, 12); goldText->Move(575, 134); goldText->SetColor(0, 0, 0); this->AddChild(goldText); - auto* silverText = new UIStaticText(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* silverText = new UIStaticText(*reinterpret_cast(nullptr)); this->m_silverText = silverText; silverText->SetSize(25, 12); silverText->Move(575, 218); silverText->SetColor(0, 0, 0); this->AddChild(silverText); - auto* bronzeText = new UIStaticText(*reinterpret_cast(nullptr), *reinterpret_cast(nullptr)); + auto* bronzeText = new UIStaticText(*reinterpret_cast(nullptr)); this->m_bronzeText = bronzeText; bronzeText->SetSize(25, 12); bronzeText->Move(575, 302); diff --git a/Source/UI/Window/UISecondCostumeWnd.cpp b/Source/UI/Window/UISecondCostumeWnd.cpp index b5a6bbe2..ba0cb6fa 100644 --- a/Source/UI/Window/UISecondCostumeWnd.cpp +++ b/Source/UI/Window/UISecondCostumeWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIWindowMgr.h" #include "UI/Window/UISecondCostumeWnd.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -157,7 +158,7 @@ void UISecondCostumeWnd::SelectSavedEntries() { // FUNCTION: fn_12898 void UISecondCostumeWnd::Slot15(int width, int height) { this->LoadLists(); - this->AddCloseButton(*this->m_controls, "Close", 0); + this->AddCloseButton("Close", 0); this->m_list = new UIListBoxNavi(*this->m_context, *this->m_listContext); this->m_list->SetSize(width - 212, 160); @@ -186,7 +187,7 @@ void UISecondCostumeWnd::Slot15(int width, int height) { this->m_typeCombo->AddOption(LookupMessage(2766), 0); this->m_typeCombo->Select(this->m_tab); - auto* previous = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* previous = new UIBitmapButton(*this->m_context); previous->SetBitmap("유저인터페이스\\scroll1left.bmp", 0, 0); previous->SetBitmap("유저인터페이스\\scroll1left.bmp", 1, 0); previous->SetBitmap("유저인터페이스\\scroll1left.bmp", 2, 0); @@ -195,7 +196,7 @@ void UISecondCostumeWnd::Slot15(int width, int height) { previous->SetId(227); this->AddChild(previous); - auto* next = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* next = new UIBitmapButton(*this->m_context); next->SetBitmap("유저인터페이스\\scroll1right.bmp", 0, 0); next->SetBitmap("유저인터페이스\\scroll1right.bmp", 1, 0); next->SetBitmap("유저인터페이스\\scroll1right.bmp", 2, 0); @@ -287,9 +288,9 @@ bool UISecondCostumeWnd::Slot03() { // OFFSET: 0x00946FB0 // FUNCTION: fn_12857 UISecondCostumeWnd::UISecondCostumeWnd( - UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists, UIComboBoxHeaderContext& combos + UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos ) - : UIFrameWnd(windows, 0), m_controls(&controls), m_listContext(&lists), m_comboContext(&combos) { + : UIFrameWnd(windows, 0), m_listContext(&lists), 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 177e7e08..b6b2e311 100644 --- a/Source/UI/Window/UISecondCostumeWnd.h +++ b/Source/UI/Window/UISecondCostumeWnd.h @@ -10,7 +10,6 @@ class UIComboBoxDefWnd; class UIListBox; -struct UIButtonContext; struct UIComboBoxHeaderContext; struct UIListBoxContext; @@ -21,7 +20,7 @@ struct SecondCostumeEntry { class UISecondCostumeWnd : public UIFrameWnd { public: - UISecondCostumeWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists, UIComboBoxHeaderContext& combos); + UISecondCostumeWnd(UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos); bool Slot03() override; void Slot15(int width, int height) override; void Paint() override; @@ -40,7 +39,7 @@ protected: /* 00D0 */ std::vector m_entries[4]; /* 0100 */ std::uint32_t unknown_0100; /* 0104 */ int m_page; - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; UIComboBoxHeaderContext* m_comboContext; /* 0108 */ std::string unknown_0108[7]; diff --git a/Source/UI/Window/UISeekPartyListWnd.cpp b/Source/UI/Window/UISeekPartyListWnd.cpp index 32d19185..1c27747e 100644 --- a/Source/UI/Window/UISeekPartyListWnd.cpp +++ b/Source/UI/Window/UISeekPartyListWnd.cpp @@ -46,7 +46,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { { std::string title(LookupMessage(0x699)); - this->m_title = new UIStaticText(*this->m_context, *this->m_controls); + this->m_title = new UIStaticText(*this->m_context); this->m_title->SetSize(this->geometry.width - 0x20, 0xF); this->m_title->SetTextFitted(title.c_str()); this->m_title->Move(0x10, 2); @@ -54,11 +54,11 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->AddChild(this->m_title); } - this->AddCloseButton(*this->m_controls, "", 0); - this->AddMinimizeButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); + this->AddMinimizeButton("", 0); label = "LEVEL"; - this->m_levelLabel = new UIStaticText(*this->m_context, *this->m_controls); + this->m_levelLabel = new UIStaticText(*this->m_context); this->m_levelLabel->SetSize(this->geometry.width - 10, 0x1E); this->m_levelLabel->SetText(label.c_str(), 1); this->m_levelLabel->Move(10, 0x17); @@ -75,7 +75,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->AddChild(this->m_searchEdit); label = "MAP"; - this->m_mapLabel = new UIStaticText(*this->m_context, *this->m_controls); + this->m_mapLabel = new UIStaticText(*this->m_context); this->m_mapLabel->SetSize(this->geometry.width - 10, 0x1E); this->m_mapLabel->SetText(label.c_str(), 1); this->m_mapLabel->Move(10, 0x2D); @@ -83,7 +83,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->AddChild(this->m_mapLabel); label = "JOB"; - this->m_jobLabel = new UIStaticText(*this->m_context, *this->m_controls); + this->m_jobLabel = new UIStaticText(*this->m_context); this->m_jobLabel->SetSize(this->geometry.width - 10, 0x1E); this->m_jobLabel->SetText(label.c_str(), 1); this->m_jobLabel->Move(10, 0x46); @@ -91,31 +91,31 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->AddChild(this->m_jobLabel); label = LookupMessage(0x72A); - this->m_footerText = new UIStaticText(*this->m_context, *this->m_controls); + this->m_footerText = new UIStaticText(*this->m_context); this->m_footerText->SetSize(this->geometry.width - 10, 0x1E); this->m_footerText->SetText(label.c_str(), 0); this->m_footerText->Move(100, this->geometry.height - 0x14); this->AddChild(this->m_footerText); - this->m_filterLabel0 = new UIStaticText(*this->m_context, *this->m_controls); + this->m_filterLabel0 = new UIStaticText(*this->m_context); this->m_filterLabel0->SetSize(0x32, 0x14); this->m_filterLabel0->SetText(LookupMessage(0x6A1), 0); this->m_filterLabel0->Move(0x21, 0x68); this->AddChild(this->m_filterLabel0); - this->m_filterLabel1 = new UIStaticText(*this->m_context, *this->m_controls); + this->m_filterLabel1 = new UIStaticText(*this->m_context); this->m_filterLabel1->SetSize(0x32, 0x14); this->m_filterLabel1->SetText(LookupMessage(0x197), 0); this->m_filterLabel1->Move(0x6A, 0x68); this->AddChild(this->m_filterLabel1); - this->m_filterLabel2 = new UIStaticText(*this->m_context, *this->m_controls); + this->m_filterLabel2 = new UIStaticText(*this->m_context); this->m_filterLabel2->SetSize(0x32, 0x14); this->m_filterLabel2->SetText(LookupMessage(0x198), 0); this->m_filterLabel2->Move(0xDC, 0x68); this->AddChild(this->m_filterLabel2); - this->m_filterLabel3 = new UIStaticText(*this->m_context, *this->m_controls); + this->m_filterLabel3 = new UIStaticText(*this->m_context); this->m_filterLabel3->SetSize(0x32, 0x14); this->m_filterLabel3->SetText(LookupMessage(0x6A2), 0); this->m_filterLabel3->Move(0x16D, 0x68); @@ -173,7 +173,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->m_mapCombo->blue = 0xE8; this->AddChild(this->m_mapCombo); - this->m_alarmCheck = new UICheckBox(*this->m_context, *this->m_controls); + this->m_alarmCheck = new UICheckBox(*this->m_context); this->m_alarmCheck->SetSize(0x3C, 0x14); this->m_alarmCheck->SetSize(100, 0xC); this->m_alarmCheck->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(0x69E)); @@ -183,7 +183,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\"; - this->m_okButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_okButton = new UIBitmapButton(*this->m_context); this->m_okButton->SetBitmap((path + "btn_ok" + ".bmp").c_str(), 0, 0); this->m_okButton->SetBitmap((path + "btn_ok_a" + ".bmp").c_str(), 1, 0); this->m_okButton->SetBitmap((path + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -195,7 +195,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\"; - this->m_findButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_findButton = new UIBitmapButton(*this->m_context); this->m_findButton->SetBitmap((path + "btn_find" + ".bmp").c_str(), 0, 0); this->m_findButton->SetBitmap((path + "btn_find_a" + ".bmp").c_str(), 1, 0); this->m_findButton->SetBitmap((path + "btn_find_b" + ".bmp").c_str(), 2, 0); @@ -207,7 +207,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\basic_interface\\"; - this->m_chatButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_chatButton = new UIBitmapButton(*this->m_context); this->m_chatButton->SetBitmap((path + "direct_chat" + ".bmp").c_str(), 0, 0); this->m_chatButton->SetBitmap((path + "direct_chat" + ".bmp").c_str(), 1, 0); this->m_chatButton->SetBitmap((path + "direct_chat" + ".bmp").c_str(), 2, 0); @@ -217,7 +217,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { this->AddChild(this->m_chatButton); } - this->m_refreshButton = new UITextButton(*this->m_context, *this->m_controls); + this->m_refreshButton = new UITextButton(*this->m_context); this->m_refreshButton->Configure(LookupMessage(0x6E3), 0, 0, 0xC, 0, 0); this->m_refreshButton->m_hoverColor = 0xEFB700; this->m_refreshButton->SetTooltip(LookupMessage(0x6E4)); @@ -227,7 +227,7 @@ void UISeekPartyListWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\battle_field\\btn_help"; - this->m_tabButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_tabButton = new UIBitmapButton(*this->m_context); this->m_tabButton->SetBitmap((path + ".bmp").c_str(), 0, 0); this->m_tabButton->SetBitmap((path + "_a.bmp").c_str(), 1, 0); this->m_tabButton->SetBitmap((path + "_b.bmp").c_str(), 2, 0); diff --git a/Source/UI/Window/UISeekPartyListWnd.h b/Source/UI/Window/UISeekPartyListWnd.h index 2df3df5f..607fdfab 100644 --- a/Source/UI/Window/UISeekPartyListWnd.h +++ b/Source/UI/Window/UISeekPartyListWnd.h @@ -17,7 +17,6 @@ class UIScrollBar; class UIStaticText; class UITextButton; struct SeekPartyListWndInfo; -struct UIButtonContext; struct UIComboBoxHeaderContext; struct UIEditContext; @@ -92,7 +91,7 @@ protected: /* 01CA */ unsigned char unknown_01CA[6]; /* 01D0 */ SeekPartyListWndInfo* m_saved; UIStaticText* m_footerText; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; UIComboBoxHeaderContext* m_comboContext; }; diff --git a/Source/UI/Window/UISeekPartyMBWnd.cpp b/Source/UI/Window/UISeekPartyMBWnd.cpp index fe18606c..c06181af 100644 --- a/Source/UI/Window/UISeekPartyMBWnd.cpp +++ b/Source/UI/Window/UISeekPartyMBWnd.cpp @@ -160,7 +160,7 @@ void UISeekPartyMBWnd::CreateJobChecks() { int starts[8] = {1, 5, 11, 24, 30, 37, 43, 56}; for (int i = 0; i < counts[0]; ++i) { - UICheckBox* check = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* check = new UICheckBox(*this->m_context); check->SetSize(110, 12); const int job = i + 1; check->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(0x6AF + job)); @@ -178,7 +178,7 @@ void UISeekPartyMBWnd::CreateJobChecks() { for (int category = 1; category < 8; ++category) { for (int i = 0; i < counts[category]; ++i) { - UICheckBox* check = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* check = new UICheckBox(*this->m_context); check->SetSize(110, 12); check->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(0x65D + message)); if (i < 8) { @@ -253,10 +253,9 @@ void UISeekPartyMBWnd::ShowJobCategory(int category) { // OFFSET: 0x00911EE0 // FUNCTION: fn_12524 -UISeekPartyMBWnd::UISeekPartyMBWnd(UIWindowContext& windows, UIButtonContext& controls) +UISeekPartyMBWnd::UISeekPartyMBWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0), unknown_00BC(nullptr), unknown_00C0(nullptr), m_levelEdit(nullptr), m_typeCombo(nullptr), m_subTypeCombo(nullptr), m_jobCategoryCombo(nullptr), - m_jobChecks(), m_subTypes(), unknown_0154(nullptr), unknown_0158(nullptr), m_jobCategory(-1), m_subType(0), m_restoreHeight(0), m_minimized(0), - m_controls(&controls), m_titleText(nullptr), m_levelText(nullptr) { + m_jobChecks(), m_subTypes(), unknown_0154(nullptr), unknown_0158(nullptr), m_jobCategory(-1), m_subType(0), m_restoreHeight(0), m_minimized(0), m_titleText(nullptr), m_levelText(nullptr) { } // OFFSET: 0x009146D0 @@ -270,19 +269,19 @@ void UISeekPartyMBWnd::Slot15(int width, int height) { std::memset(title, 0, sizeof(title)); std::sprintf(title, LookupMessage(0x698)); - this->m_titleText = new UIStaticText(*this->m_context, *this->m_controls); + this->m_titleText = new UIStaticText(*this->m_context); this->m_titleText->SetSize(this->geometry.width - 0x20, 0xF); this->m_titleText->SetTextFitted(title); this->m_titleText->Move(0x10, 2); this->m_titleText->shadow = 1; this->AddChild(this->m_titleText); - this->AddCloseButton(*this->m_controls, "", 0); - this->AddMinimizeButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); + this->AddMinimizeButton("", 0); std::string label; label = "LEVEL"; - this->m_levelText = new UIStaticText(*this->m_context, *this->m_controls); + this->m_levelText = new UIStaticText(*this->m_context); this->m_levelText->SetSize(this->geometry.width - 10, 0x1E); this->m_levelText->SetText(label.c_str(), 1); this->m_levelText->Move(10, 0x17); @@ -290,7 +289,7 @@ void UISeekPartyMBWnd::Slot15(int width, int height) { this->AddChild(this->m_levelText); label = "MAP"; - this->unknown_00BC = new UIStaticText(*this->m_context, *this->m_controls); + this->unknown_00BC = new UIStaticText(*this->m_context); this->unknown_00BC->SetSize(this->geometry.width - 10, 0x1E); this->unknown_00BC->SetText(label.c_str(), 1); this->unknown_00BC->Move(10, 0x2D); @@ -298,7 +297,7 @@ void UISeekPartyMBWnd::Slot15(int width, int height) { this->AddChild(this->unknown_00BC); label = "JOB"; - this->unknown_00C0 = new UIStaticText(*this->m_context, *this->m_controls); + this->unknown_00C0 = new UIStaticText(*this->m_context); this->unknown_00C0->SetSize(this->geometry.width - 10, 0x1E); this->unknown_00C0->SetText(label.c_str(), 1); this->unknown_00C0->Move(10, 0x46); @@ -307,7 +306,7 @@ void UISeekPartyMBWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\"; - this->unknown_0158 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0158 = new UIBitmapButton(*this->m_context); this->unknown_0158->SetBitmap((path + "btn_ok" + ".bmp").c_str(), 0, 0); this->unknown_0158->SetBitmap((path + "btn_ok_a" + ".bmp").c_str(), 1, 0); this->unknown_0158->SetBitmap((path + "btn_ok_b" + ".bmp").c_str(), 2, 0); @@ -319,7 +318,7 @@ void UISeekPartyMBWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\"; - this->unknown_0154 = new UIBitmapButton(*this->m_context, *this->m_controls); + this->unknown_0154 = new UIBitmapButton(*this->m_context); this->unknown_0154->SetBitmap((path + "btn_cancel" + ".bmp").c_str(), 0, 0); this->unknown_0154->SetBitmap((path + "btn_cancel_a" + ".bmp").c_str(), 1, 0); this->unknown_0154->SetBitmap((path + "btn_cancel_b" + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/Window/UISeekPartyMBWnd.h b/Source/UI/Window/UISeekPartyMBWnd.h index 17cc06cb..def91c7f 100644 --- a/Source/UI/Window/UISeekPartyMBWnd.h +++ b/Source/UI/Window/UISeekPartyMBWnd.h @@ -9,7 +9,6 @@ #include #include -struct UIButtonContext; struct UIComboBoxHeaderContext; struct UIEditContext; struct SeekPartyMBWndInfo; @@ -27,7 +26,7 @@ struct SeekPartyRegistration { class UISeekPartyMBWnd : public UIFrameWnd { public: - UISeekPartyMBWnd(UIWindowContext& windows, UIButtonContext& controls); + UISeekPartyMBWnd(UIWindowContext& windows); ~UISeekPartyMBWnd() override; void Slot11() override; void Slot15(int width, int height) override; @@ -58,7 +57,7 @@ protected: /* 0169 */ SeekPartyRegistration m_registration; /* 0179 */ unsigned char unknown_0179[3]; /* 017C */ SeekPartyMBWndInfo* m_saved; - UIButtonContext* m_controls; + void* unknown_controls; UIStaticText* m_titleText; UIStaticText* m_levelText; UIEditContext* m_editContext; diff --git a/Source/UI/Window/UISeekPartyWnd.cpp b/Source/UI/Window/UISeekPartyWnd.cpp index e5b3b141..1c3a2816 100644 --- a/Source/UI/Window/UISeekPartyWnd.cpp +++ b/Source/UI/Window/UISeekPartyWnd.cpp @@ -40,18 +40,18 @@ void UISeekPartyWnd::Slot15(int, int) { const int maximum = g_partyBookingLevelLimit + 0xF <= g_partyBookingLevelMax ? g_partyBookingLevelLimit + 0xF : g_partyBookingLevelMax; std::sprintf(text, "%s - %d~%d", LookupMessage(0x6DA), g_partyBookingLevelLimit, maximum); - this->m_label = new UIStaticText(*this->m_context, *this->m_controls); + this->m_label = new UIStaticText(*this->m_context); this->m_label->SetSize(this->geometry.width - 0x20, 0xF); this->m_label->SetTextFitted(text); this->m_label->Move(0x10, 2); this->m_label->shadow = 1; this->AddChild(this->m_label); - this->AddCloseButton(*this->m_controls, "", 0); - this->AddMinimizeButton(*this->m_controls, "", 0); + this->AddCloseButton("", 0); + this->AddMinimizeButton("", 0); const std::string path = "유저인터페이스\\"; - this->m_cancelButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_cancelButton = new UIBitmapButton(*this->m_context); this->m_cancelButton->SetBitmap((path + "btn_cancel" + ".bmp").c_str(), 0, 0); this->m_cancelButton->SetBitmap((path + "btn_cancel_a" + ".bmp").c_str(), 1, 0); this->m_cancelButton->SetBitmap((path + "btn_cancel_b" + ".bmp").c_str(), 2, 0); @@ -60,7 +60,7 @@ void UISeekPartyWnd::Slot15(int, int) { this->m_cancelButton->SetId(0xC9); this->AddChild(this->m_cancelButton); - this->m_rewriteButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_rewriteButton = new UIBitmapButton(*this->m_context); this->m_rewriteButton->SetBitmap((path + "btn_rewrite" + ".bmp").c_str(), 0, 0); this->m_rewriteButton->SetBitmap((path + "btn_rewrite_a" + ".bmp").c_str(), 1, 0); this->m_rewriteButton->SetBitmap((path + "btn_rewrite_b" + ".bmp").c_str(), 2, 0); diff --git a/Source/UI/Window/UISeekPartyWnd.h b/Source/UI/Window/UISeekPartyWnd.h index b33a7ab1..a6777e9e 100644 --- a/Source/UI/Window/UISeekPartyWnd.h +++ b/Source/UI/Window/UISeekPartyWnd.h @@ -7,7 +7,6 @@ class UIBitmapButton; class UIStaticText; -struct UIButtonContext; struct SeekPartyWndInfo; extern int g_partyBookingLevelLimit; @@ -39,7 +38,7 @@ protected: /* 01E4 */ unsigned char m_minimized; /* 01E5 */ unsigned char unknown_01E5[3]; /* 01E8 */ SeekPartyWndInfo* m_saved; - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UISelectReplayDataWnd.h b/Source/UI/Window/UISelectReplayDataWnd.h index e1675f82..45d8f188 100644 --- a/Source/UI/Window/UISelectReplayDataWnd.h +++ b/Source/UI/Window/UISelectReplayDataWnd.h @@ -23,7 +23,7 @@ public: /* 00BC */ UIStaticText* m_texts[5]; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; }; diff --git a/Source/UI/Window/UISelectServerWnd.h b/Source/UI/Window/UISelectServerWnd.h index 33ac9cd2..275ca74e 100644 --- a/Source/UI/Window/UISelectServerWnd.h +++ b/Source/UI/Window/UISelectServerWnd.h @@ -8,7 +8,7 @@ class UIListBox; class UISelectServerWnd : public UIFrameWnd { public: - UISelectServerWnd(UIWindowContext& windows, UIButtonContext& controls); + UISelectServerWnd(UIWindowContext& windows); void Slot15(int width, int height) override; void Slot18() override; @@ -22,7 +22,7 @@ public: /* 00D8 */ int m_event; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UISerachStoreInfoWnd.cpp b/Source/UI/Window/UISerachStoreInfoWnd.cpp index d01de979..fd0f2253 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.cpp +++ b/Source/UI/Window/UISerachStoreInfoWnd.cpp @@ -87,7 +87,7 @@ ITEM_INFO UISerachStoreInfoWnd::ItemAt(int x, int y) { void UISerachStoreInfoWnd::Slot15(int width, int height) { UIRadioBtn** radio = this->m_radios; for (int x = 10; x < 90; x += 40) { - *radio = new UIRadioBtn(*this->m_context, *this->m_controls); + *radio = new UIRadioBtn(*this->m_context); (*radio)->SetSize(this->geometry.width / 2, 12); (*radio)->Move(x, 40); this->AddChild(*radio); @@ -144,7 +144,7 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { this->m_edits[3]->Invalidate(); this->AddChild(this->m_edits[3]); - UICheckBox* check = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* check = new UICheckBox(*this->m_context); check->SetSize(0xA0, 0xC); check->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(0x6FC)); check->Move(100, 0x3C); @@ -153,7 +153,7 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { { std::string path = "유저인터페이스\\"; - this->m_findButton = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_findButton = new UIBitmapButton(*this->m_context); this->m_findButton->SetBitmap((path + "btn_find" + ".bmp").c_str(), 0, 0); this->m_findButton->SetBitmap((path + "btn_find_a" + ".bmp").c_str(), 1, 0); this->m_findButton->SetBitmap((path + "btn_find_b" + ".bmp").c_str(), 2, 0); @@ -163,7 +163,7 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { this->AddChild(this->m_findButton); } - this->m_prevButton = new UITextButton(*this->m_context, *this->m_controls); + this->m_prevButton = new UITextButton(*this->m_context); this->m_prevButton->Configure(LookupMessage(0x41D), 0x8E8E8E, 0, 0xC, 0, 0); this->m_prevButton->m_hoverColor = 0xEFB700; this->m_prevButton->Move( @@ -173,7 +173,7 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { this->m_prevButton->SetId(0x13C); this->AddChild(this->m_prevButton); - this->m_nextButton = new UITextButton(*this->m_context, *this->m_controls); + this->m_nextButton = new UITextButton(*this->m_context); this->m_nextButton->Configure(LookupMessage(0x41E), 0x8E8E8E, 0, 0xC, 0, 0); this->m_nextButton->m_hoverColor = 0xEFB700; this->m_nextButton->Move(this->geometry.width / 2 + 0x14, this->geometry.height - 0x15); @@ -181,8 +181,8 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { this->m_nextButton->SetId(0x13D); this->AddChild(this->m_nextButton); - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); this->SendMsg(this, 0x3C, 0, 0, 0, 0); InputFocus{g_windowMgr.hoverWindow}.Set(this->m_edits[1]); this->m_message0 = 0x16D; diff --git a/Source/UI/Window/UISerachStoreInfoWnd.h b/Source/UI/Window/UISerachStoreInfoWnd.h index 94595df6..81bffba9 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.h +++ b/Source/UI/Window/UISerachStoreInfoWnd.h @@ -9,7 +9,6 @@ class UIBitmapButton; class UIEditCtrl; class UIRadioBtn; class UITextButton; -struct UIButtonContext; struct UIEditContext; class UISerachStoreInfoWnd : public UIFrameWnd { @@ -38,7 +37,7 @@ protected: /* 00ED */ unsigned char unknown_00ED; /* 00F0 */ std::string unknown_00F0; - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index 6c43f3fc..f23e1c2b 100644 --- a/Source/UI/Window/UIShowWarpWnd.cpp +++ b/Source/UI/Window/UIShowWarpWnd.cpp @@ -32,7 +32,7 @@ void UIShowWarpWnd::Slot15(int width, int height) { this->AddChild(list); const std::string prefix = "유저인터페이스\\"; - auto* close = new UIBitmapButton(*this->m_context, *this->m_controls); + auto* close = new UIBitmapButton(*this->m_context); close->SetBitmap((prefix + "btn_close" + ".bmp").c_str(), 0, 0); close->SetBitmap((prefix + "btn_close_a" + ".bmp").c_str(), 1, 0); close->SetBitmap((prefix + "btn_close_b" + ".bmp").c_str(), 2, 0); @@ -83,6 +83,6 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x009470C0 // FUNCTION: fn_12858 -UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists, WindowResponseRecorder& recorder) - : UIFrameWnd(windows, 0), m_controls(&controls), m_listContext(&lists), m_recorder(&recorder) { +UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, WindowResponseRecorder& recorder) + : UIFrameWnd(windows, 0), m_listContext(&lists), m_recorder(&recorder) { } diff --git a/Source/UI/Window/UIShowWarpWnd.h b/Source/UI/Window/UIShowWarpWnd.h index 26a75dcf..f2c62c3a 100644 --- a/Source/UI/Window/UIShowWarpWnd.h +++ b/Source/UI/Window/UIShowWarpWnd.h @@ -3,14 +3,13 @@ #include "UI/Window/UIFrameWnd.h" -struct UIButtonContext; struct WindowResponseRecorder; struct UIListBoxContext; class UIListBox; class UIShowWarpWnd : public UIFrameWnd { public: - UIShowWarpWnd(UIWindowContext& windows, UIButtonContext& controls, UIListBoxContext& lists, WindowResponseRecorder& recorder); + UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, 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: /* 00B4 */ UIListBox* m_list; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIListBoxContext* m_listContext; WindowResponseRecorder* m_recorder; }; diff --git a/Source/UI/Window/UITalkboxTrapInputWnd.h b/Source/UI/Window/UITalkboxTrapInputWnd.h index 0120a6f7..34a8d72a 100644 --- a/Source/UI/Window/UITalkboxTrapInputWnd.h +++ b/Source/UI/Window/UITalkboxTrapInputWnd.h @@ -20,7 +20,7 @@ struct TalkboxTrapRequest { class UITalkboxTrapInputWnd : public UIFrameWnd { public: - UITalkboxTrapInputWnd(UIWindowContext& windows, UIButtonContext& controls, UIEditContext& editContext); + UITalkboxTrapInputWnd(UIWindowContext& windows, UIEditContext& editContext); void Slot15(int width, int height) override; void Paint() override; @@ -30,7 +30,7 @@ public: /* 00C4 */ UIEditCtrl* edit; protected: - UIButtonContext* m_controls; + void* unknown_controls; UIEditContext* m_editContext; }; diff --git a/Source/UI/Window/UITransMenuWnd.cpp b/Source/UI/Window/UITransMenuWnd.cpp index d6542638..65ce1f72 100644 --- a/Source/UI/Window/UITransMenuWnd.cpp +++ b/Source/UI/Window/UITransMenuWnd.cpp @@ -19,7 +19,6 @@ void UITransMenuWnd::Paint() { this->FillRegion(0, (i - 1) * half + cellHeight * i + this->m_margin, this->geometry.width, cellHeight + half, 0xC8C8C8); } - auto& controls = *this->m_controls; const int margin = this->m_margin; this->DrawTextAt(margin, (margin / 2 + cellHeight) * i + margin, this->m_items[i].text, 0, 0, this->m_lineHeight, color, 0, 0); } @@ -105,7 +104,7 @@ int UITransMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // OFFSET: 0x009471E0 // FUNCTION: fn_12859 -UITransMenuWnd::UITransMenuWnd(UIWindowContext& windows, UIButtonContext& controls) : UIFrameWnd(windows, 0), m_controls(&controls) { +UITransMenuWnd::UITransMenuWnd(UIWindowContext& windows) : UIFrameWnd(windows, 0) { this->m_margin = 5; this->m_lineHeight = 12; this->m_selected = -1; diff --git a/Source/UI/Window/UITransMenuWnd.h b/Source/UI/Window/UITransMenuWnd.h index 78523c2d..283a68c0 100644 --- a/Source/UI/Window/UITransMenuWnd.h +++ b/Source/UI/Window/UITransMenuWnd.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; struct TransMenuItem { /* 0000 */ char text[24]; @@ -15,7 +14,7 @@ struct TransMenuItem { class UITransMenuWnd : public UIFrameWnd { public: - UITransMenuWnd(UIWindowContext& windows, UIButtonContext& controls); + UITransMenuWnd(UIWindowContext& windows); void Resize(int width, int height) override; void Move(int x, int y) override; bool Slot07(void* output) override; @@ -38,7 +37,7 @@ protected: /* 00DC */ int m_lineHeight; /* 00E0 */ int m_margin; /* 00E4 */ int m_selected; - UIButtonContext* m_controls; + void* unknown_controls; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Window/UIVideoWnd.cpp b/Source/UI/Window/UIVideoWnd.cpp index c32c8050..64772f45 100644 --- a/Source/UI/Window/UIVideoWnd.cpp +++ b/Source/UI/Window/UIVideoWnd.cpp @@ -35,7 +35,7 @@ UIVideoWnd::~UIVideoWnd() { // OFFSET: 0x00AB4060 // FUNCTION: fn_17436 -UIVideoSkipButton::UIVideoSkipButton(UIWindowContext& windowContext, UIButtonContext& buttonContext) : UIButton(windowContext, buttonContext) { +UIVideoSkipButton::UIVideoSkipButton(UIWindowContext& windowContext) : UIButton(windowContext) { } // OFFSET: 0x00AB4380 @@ -47,7 +47,7 @@ bool UIVideoWnd::Slot02() { // OFFSET: 0x00AB4390 // FUNCTION: fn_17441 void UIVideoWnd::Slot15(int width, int height) { - UIVideoSkipButton* button = new UIVideoSkipButton(*this->m_context, this->m_videoContext->buttons); + UIVideoSkipButton* button = new UIVideoSkipButton(*this->m_context); button->SetSize(127, 43); button->Move(width - button->geometry.width - 33, height - button->geometry.height - 110); button->SetId(521); @@ -59,7 +59,6 @@ void UIVideoWnd::Slot15(int width, int height) { void UIVideoSkipButton::Paint() { this->ClearSurface(0xFF000000); std::string text = "SKIP>"; - UIButtonContext& controls = *this->m_buttonContext; const int textWidth = this->TextWidth(text.c_str(), 0, 0, 30, 1, 0); const int textHeight = this->TextHeight(text.c_str(), 0, 0, 30, 1, 0); const std::uint32_t color = this->geometry.unknown_0030 == 1 ? 0x4EC7FF : 0xFFFFFF; diff --git a/Source/UI/Window/UIVideoWnd.h b/Source/UI/Window/UIVideoWnd.h index e0250f01..61815cc8 100644 --- a/Source/UI/Window/UIVideoWnd.h +++ b/Source/UI/Window/UIVideoWnd.h @@ -14,12 +14,11 @@ struct WindowDialogs; struct UIVideoWndContext { WindowManagerWindows& windows; WindowDialogs& dialogs; - UIButtonContext& buttons; }; class UIVideoSkipButton : public UIButton { public: - UIVideoSkipButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); + UIVideoSkipButton(UIWindowContext& windowContext); void Paint() override; }; diff --git a/Source/UI/Window/UIViewCameraInfoWnd.cpp b/Source/UI/Window/UIViewCameraInfoWnd.cpp index 2ae8b802..bfd1fd49 100644 --- a/Source/UI/Window/UIViewCameraInfoWnd.cpp +++ b/Source/UI/Window/UIViewCameraInfoWnd.cpp @@ -34,7 +34,6 @@ void UIViewCameraInfoWnd::Paint() { return; } - auto& controls = *this->m_controls; this->DrawTextAt(10, 10, FormatOwnedString("range : %4.3f", mode->camera->camera.distance).c_str(), 0, 0, 12, 0xFF, 1, 0); this->DrawTextAt(10, 25, diff --git a/Source/UI/Window/UIViewCameraInfoWnd.h b/Source/UI/Window/UIViewCameraInfoWnd.h index 08ed9c47..65a7a8cd 100644 --- a/Source/UI/Window/UIViewCameraInfoWnd.h +++ b/Source/UI/Window/UIViewCameraInfoWnd.h @@ -5,7 +5,6 @@ #include -struct UIButtonContext; class UIViewCameraInfoWnd : public UIFrameWnd { public: @@ -16,7 +15,7 @@ public: int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; protected: - UIButtonContext* m_controls; + void* unknown_controls; }; #endif diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 1c69a95e..02f515b0 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -2338,7 +2338,7 @@ void UIListBox_NaviSearch::Paint() { // OFFSET: 0x005C4EA0 // FUNCTION: fn_03581 void UINavigationV4Wnd::Slot15(int, int) { - UIBitmapButton* closeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* closeButton = new UIBitmapButton(*this->m_context); this->unknown_00B8 = closeButton; closeButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_close_normal.bmp", 0, 0); closeButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_close_over.bmp", 1, 0); @@ -2348,7 +2348,7 @@ void UINavigationV4Wnd::Slot15(int, int) { closeButton->SetTooltip(LookupMessage(0x0BE5)); this->AddChild(closeButton); - UIBitmapButton* maximizeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* maximizeButton = new UIBitmapButton(*this->m_context); this->unknown_00C4 = maximizeButton; maximizeButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_maximize_normal.bmp", 0, 0); maximizeButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_maximize_over.bmp", 1, 0); @@ -2358,7 +2358,7 @@ void UINavigationV4Wnd::Slot15(int, int) { maximizeButton->SetTooltip(LookupMessage(0x089B)); this->AddChild(maximizeButton); - UICheckBox* minimizeCheck = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* minimizeCheck = new UICheckBox(*this->m_context); this->unknown_00D4 = minimizeCheck; minimizeCheck->SetSize(110, 12); minimizeCheck->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", "Minimize"); @@ -2366,7 +2366,7 @@ void UINavigationV4Wnd::Slot15(int, int) { minimizeCheck->SetTooltip(LookupMessage(0x089C)); this->AddChild(minimizeCheck); - UIBitmapButton* roadIconButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* roadIconButton = new UIBitmapButton(*this->m_context); this->unknown_00C8 = roadIconButton; this->SetRoadIcon(g_navigationRoadIcon); roadIconButton->SetSize(roadIconButton->geometry.width, roadIconButton->geometry.height); @@ -2374,7 +2374,7 @@ void UINavigationV4Wnd::Slot15(int, int) { roadIconButton->SetTooltip(LookupMessage(0x0C8B)); this->AddChild(roadIconButton); - UIBitmapButton* roadListButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* roadListButton = new UIBitmapButton(*this->m_context); this->unknown_00D8 = roadListButton; roadListButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_roadlistwnd_normal.bmp", 0, 0); roadListButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_roadlistwnd_over.bmp", 1, 0); @@ -2402,7 +2402,7 @@ void UINavigationV4Wnd::Slot15(int, int) { searchList->SetId(441); this->AddChild(searchList); - UICheckBox* filterCheck = new UICheckBox(*this->m_context, *this->m_controls); + UICheckBox* filterCheck = new UICheckBox(*this->m_context); this->unknown_00F4 = filterCheck; filterCheck->SetSize(110, 12); filterCheck->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", "service"); @@ -2411,7 +2411,7 @@ void UINavigationV4Wnd::Slot15(int, int) { filterCheck->SetTooltip(LookupMessage(0x0C8C)); this->AddChild(filterCheck); - UIBitmapButton* shareButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* shareButton = new UIBitmapButton(*this->m_context); this->unknown_00F8 = shareButton; shareButton->SetBitmap("유저인터페이스\\private_airplane\\btn_share_normal.bmp", 0, 0); shareButton->SetBitmap("유저인터페이스\\private_airplane\\btn_share_over.bmp", 1, 0); @@ -2421,7 +2421,7 @@ void UINavigationV4Wnd::Slot15(int, int) { shareButton->SetTooltip(LookupMessage(0x0C86)); this->AddChild(shareButton); - UIBitmapButton* findButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* findButton = new UIBitmapButton(*this->m_context); this->unknown_00FC = findButton; findButton->SetBitmap("유저인터페이스\\private_airplane\\btn_find_normal.bmp", 0, 0); findButton->SetBitmap("유저인터페이스\\private_airplane\\btn_find_over.bmp", 1, 0); @@ -2431,7 +2431,7 @@ void UINavigationV4Wnd::Slot15(int, int) { findButton->SetTooltip(LookupMessage(0x0895)); this->AddChild(findButton); - UIBitmapButton* moveButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* moveButton = new UIBitmapButton(*this->m_context); this->unknown_0100 = moveButton; moveButton->SetBitmap("유저인터페이스\\private_airplane\\btn_move_normal.bmp", 0, 0); moveButton->SetBitmap("유저인터페이스\\private_airplane\\btn_move_over.bmp", 1, 0); @@ -2440,17 +2440,17 @@ void UINavigationV4Wnd::Slot15(int, int) { moveButton->SetId(499); this->AddChild(moveButton); - UIStaticText* label = new UIStaticText(*this->m_context, *this->m_controls); + UIStaticText* label = new UIStaticText(*this->m_context); this->unknown_00E8 = label; label->SetSize(100, 20); this->AddChild(label); label->SetText(LookupMessage(0x0C87), 0); label->SetColor(0, 0, 0); - this->unknown_00B4 = this->AddCloseButton(*this->m_controls, LookupMessage(0x0BE5), 0); - this->unknown_00BC = this->AddMinimizeButton(*this->m_controls, LookupMessage(0x089C), 0); + this->unknown_00B4 = this->AddCloseButton(LookupMessage(0x0BE5), 0); + this->unknown_00BC = this->AddMinimizeButton(LookupMessage(0x089C), 0); - UIBitmapButton* helpButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* helpButton = new UIBitmapButton(*this->m_context); this->unknown_00C0 = helpButton; helpButton->SetBitmap("유저인터페이스\\navigation_interface\\NaviHelp_off.bmp", 0, 0); helpButton->SetBitmap("유저인터페이스\\navigation_interface\\NaviHelp_on.bmp", 1, 0); @@ -2460,7 +2460,7 @@ void UINavigationV4Wnd::Slot15(int, int) { helpButton->SetTooltip(LookupMessage(0x089D)); this->AddChild(helpButton); - UIBitmapButton* dataButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* dataButton = new UIBitmapButton(*this->m_context); this->unknown_00CC = dataButton; dataButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_Navidata_Open_normal.bmp", 0, 0); dataButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_Navidata_Open_over.bmp", 1, 0); @@ -2478,7 +2478,7 @@ void UINavigationV4Wnd::Slot15(int, int) { searchEdit->SetId(516); this->AddChild(searchEdit); - UIBitmapButton* searchButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* searchButton = new UIBitmapButton(*this->m_context); this->unknown_00E4 = searchButton; searchButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_searchbar_normal.bmp", 3, 0); searchButton->SetBitmap("유저인터페이스\\navigation_interface3\\btn_searchbar_normal.bmp", 0, 0); @@ -2489,7 +2489,7 @@ void UINavigationV4Wnd::Slot15(int, int) { searchButton->SetTooltip(LookupMessage(0x0894)); this->AddChild(searchButton); - UIBitmapButton* backButton = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* backButton = new UIBitmapButton(*this->m_context); this->unknown_00D0 = backButton; backButton->SetBitmap("유저인터페이스\\navigation_interface3\\bt_back.bmp", 3, 0); backButton->SetBitmap("유저인터페이스\\navigation_interface3\\bt_back.bmp", 0, 0); @@ -2522,9 +2522,9 @@ void UINavigationV4Wnd::Slot15(int, int) { // OFFSET: 0x005C5D40 // FUNCTION: fn_03582 void UINavigationroadiconWnd::Slot15(int, int) { - this->AddCloseButton(*this->m_controls, LookupMessage(3045), 0); + this->AddCloseButton(LookupMessage(3045), 0); - this->icon = new UIStaticBitmap(*this->m_context, *this->m_controls); + this->icon = new UIStaticBitmap(*this->m_context); this->icon->SetBitmap("유저인터페이스\\navigation_interface3\\img_roadIocn_bg_select.bmp"); this->icon->SetSize(this->icon->geometry.width, this->icon->geometry.height); @@ -3020,7 +3020,7 @@ int UINavigationroadiconWnd::SendMsg(UIWindow*, int message, std::intptr_t a, st // OFFSET: 0x005C4D70 // FUNCTION: fn_03580 void UINavigationRuideWnd::Slot15(int width, int) { - this->AddCloseButton(*this->m_controls, LookupMessage(3045), 0); + this->AddCloseButton(LookupMessage(3045), 0); this->routeList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext); this->routeList->SetSize(width - 4, 293); this->routeList->backgroundRed = 255; @@ -3674,8 +3674,8 @@ void UINavigationV4Wnd::SetRoadIcon(int slot) { // OFFSET: 0x005C5E50 // FUNCTION: fn_03583 void UIPrivateAirplaneWnd::Slot15(int, int) { - this->AddBaseButton(*this->m_controls); - this->AddCloseButton(*this->m_controls, "", 0); + this->AddBaseButton(); + this->AddCloseButton("", 0); const int count = static_cast(g_privateAirplaneItems->m_needItems.size()); for (int index = 0, y = 26; index < count; ++index, y += 26) { @@ -3692,7 +3692,7 @@ void UIPrivateAirplaneWnd::Slot15(int, int) { continue; } - UIBasicButton* button = new UIBasicButton(*this->m_context, *this->m_controls); + UIBasicButton* button = new UIBasicButton(*this->m_context); const std::string text = FormatOwnedString(LookupMessage(0xd01), name); button->Configure(0xc0, text.c_str()); button->Move(8, y); diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index 32a23bda..190e7caf 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -258,6 +258,16 @@ private: UIWindow& operator=(const UIWindow&) = delete; }; +// INLINED +__forceinline void RecordEditTextsNoArg(UIWindow* window) { + union { + int (UIWindow::*method)(WindowReplayRecorder&); + void (__thiscall* call)(UIWindow*); + } convert; + convert.method = &UIWindow::RecordEditTexts; + convert.call(window); +} + extern std::uint32_t g_windowUid; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index d8e5cdef..fbfbb80c 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowPolicy.h" #include "Render/Renderer.h" #include "UI/Chat/UISubChatHisWnd.h" #include "Client/Browser/WebBrowser.h" @@ -1957,15 +1958,6 @@ void UIWindowMgr::sub_A8C4B0(int id) { sub_DFF150(&g_session); } -__forceinline void RecordEditTextsNoArg(UIWindow* window) { - union { - int (UIWindow::*method)(WindowReplayRecorder&); - void (__thiscall* call)(UIWindow*); - } convert; - convert.method = &UIWindow::RecordEditTexts; - convert.call(window); -} - // OFFSET: 0x00A8CA20 // FUNCTION: fn_17139 bool UIWindowMgr::sub_A8CA20() { @@ -3954,7 +3946,7 @@ void UIWindowMgr::ShowWaitDBSaveWindow() { } WindowDialogs& dialogs = *reinterpret_cast(this); - UIWaitDBSaveWndContext waitContext{*reinterpret_cast(this), dialogs.dialog.text.buttons}; + UIWaitDBSaveWndContext waitContext{*reinterpret_cast(this)}; this->window_4F2AC = new UIWaitDBSaveWnd(dialogs.windows, waitContext); this->window_4F2AC->SetSize(g_renderer->viewport.width, g_renderer->viewport.height); this->window_4F2AC->Move(0, 0); diff --git a/Source/UI/Window/UIZeroChatWnd.cpp b/Source/UI/Window/UIZeroChatWnd.cpp index a9e119b4..6d159d1f 100644 --- a/Source/UI/Window/UIZeroChatWnd.cpp +++ b/Source/UI/Window/UIZeroChatWnd.cpp @@ -12,7 +12,7 @@ // OFFSET: 0x0094B410 // FUNCTION: fn_12891 void UIBalloonOpenBtn::Slot15(int width, int height) { - this->m_button = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_button = new UIBitmapButton(*this->m_context); this->m_button->SetBitmap("유저인터페이스\\basic_interface\\combo_btn_a.bmp", 0, 0); this->m_button->SetBitmap("유저인터페이스\\basic_interface\\combo_btn_b.bmp", 1, 0); this->m_button->SetBitmap("유저인터페이스\\basic_interface\\combo_btn_c.bmp", 2, 0); @@ -25,7 +25,7 @@ void UIBalloonOpenBtn::Slot15(int width, int height) { // OFFSET: 0x0094B500 // FUNCTION: fn_12892 void UIDebuffRemoveWnd::Slot15(int width, int height) { - this->m_button = new UIBasicButton(*this->m_context, *this->m_controls); + this->m_button = new UIBasicButton(*this->m_context); this->m_button->Configure(0x96, LookupMessage(0x10E6)); this->m_button->Move(0xF, 0x16); this->m_button->SetId(0xB8); @@ -45,25 +45,25 @@ void UIGuild_Storage_Log::Slot15(int width, int height) { int y = 60; for (int row = 0; row < 10; ++row) { - this->m_dateTexts[row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_dateTexts[row] = new UIStaticText(*this->m_context); this->m_dateTexts[row]->SetSize(100, 15); this->m_dateTexts[row]->SetTextFitted(""); this->m_dateTexts[row]->Move(50, y); this->AddChild(this->m_dateTexts[row]); - this->m_nameTexts[row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_nameTexts[row] = new UIStaticText(*this->m_context); this->m_nameTexts[row]->SetSize(20, 15); this->m_nameTexts[row]->SetTextFitted(""); this->m_nameTexts[row]->Move(150, y); this->AddChild(this->m_nameTexts[row]); - this->m_itemTexts[row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_itemTexts[row] = new UIStaticText(*this->m_context); this->m_itemTexts[row]->SetSize(80, 15); this->m_itemTexts[row]->SetTextFitted(""); this->m_itemTexts[row]->Move(190, y); this->AddChild(this->m_itemTexts[row]); - this->m_countTexts[row] = new UIStaticText(*this->m_context, *this->m_controls); + this->m_countTexts[row] = new UIStaticText(*this->m_context); this->m_countTexts[row]->SetSize(130, 15); this->m_countTexts[row]->SetTextFitted(""); this->m_countTexts[row]->Move(280, y); @@ -74,7 +74,7 @@ void UIGuild_Storage_Log::Slot15(int width, int height) { const std::string prefix = "유저인터페이스\\basic_interface\\"; for (int index = 0; index < 3; ++index) { - UIBitmapButton* button = new UIBitmapButton(*this->m_context, *this->m_controls); + UIBitmapButton* button = new UIBitmapButton(*this->m_context); button->SetBitmap((prefix + bitmaps[index][0] + ".bmp").c_str(), 0, 0); button->SetBitmap((prefix + bitmaps[index][1] + ".bmp").c_str(), 1, 0); button->SetBitmap((prefix + bitmaps[index][2] + ".bmp").c_str(), 2, 0); @@ -84,7 +84,7 @@ void UIGuild_Storage_Log::Slot15(int width, int height) { this->AddChild(button); } - this->unknown_0158 = new UITabControl(*this->m_context, *this->m_controls); + this->unknown_0158 = new UITabControl(*this->m_context); this->unknown_0158->Configure(1, 20, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0158->Move(0, 17); this->AddChild(this->unknown_0158); diff --git a/Source/UI/Window/WindowMgrState.cpp b/Source/UI/Window/WindowMgrState.cpp index f6277cbf..ba508477 100644 --- a/Source/UI/Window/WindowMgrState.cpp +++ b/Source/UI/Window/WindowMgrState.cpp @@ -1168,7 +1168,7 @@ int WindowDialogs::RunEmailAddress() { } auto* window = new UIEmailAddressWnd( - this->windows, *reinterpret_cast(nullptr), *reinterpret_cast(nullptr) + this->windows, *reinterpret_cast(nullptr) ); window->SetSize(280, 48); window->Move((g_renderer->viewport.width - 640) / 2 + 185, (g_renderer->viewport.height - 480) / 2 + 180);