Maintenance: [forced, user-approved] Remove fabricated UIListBoxContext and NavigationDestination (family B; follow-up to #10188). Ev

Batch #10189 by ragnarok-clanker: forced by an admin (15 lower score(s), 71 changed function(s)); checked with 118 compiled unit(s), including every includer of Source/UI/Buttons/UINaviLinkButton.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIChooseWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/EntryQueue/UIEntryQueueWnd.h, Source/UI/Guild/UIAgitWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Items/UIItemRepairWnd.h, Source/UI/Items/UIMakeTargetListWnd.h, Source/UI/Items/UIWeaponRefineWnd.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBox.h, Source/UI/Lists/UIComboBoxEx.h, Source/UI/Lists/UIListBox.h, Source/UI/Lists/UIListBoxEx.h, Source/UI/Lists/UIListBoxNavi.h, Source/UI/Lists/UIListBoxNaviSearch.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UIPackageBoxNameList.h, Source/UI/Lists/UIReplayListBox.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/Text/TextMarkup.h, Source/UI/Text/UITextViewer.h, Source/UI/UIRoundBoxTooltipWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISelectReplayDataWnd.h, Source/UI/Window/UIShowWarpWnd.h.
This commit is contained in:
ragnarok-clanker 2026-11-02 20:18:32 +00:00
commit e844522fe1
65 changed files with 152 additions and 227 deletions

View file

@ -407,13 +407,13 @@ UICaptchaPreviewWnd::UICaptchaPreviewWnd(UIWindowContext& windows)
// OFFSET: 0x0086C7B0
// FUNCTION: fn_11030
UIChatHisBox2::UIChatHisBox2(UIWindowContext& windows, UIListBoxContext& list)
: UIChatHisBox(windows, list), backgroundRed(255), backgroundGreen(255), backgroundBlue(255) {
UIChatHisBox2::UIChatHisBox2(UIWindowContext& windows)
: UIChatHisBox(windows), backgroundRed(255), backgroundGreen(255), backgroundBlue(255) {
}
// OFFSET: 0x0086C830
// FUNCTION: fn_11031
UIChatHisBox3::UIChatHisBox3(UIWindowContext& windows, UIListBoxContext& list) : UIChatHisBox2(windows, list), unknown_0130(1), unknown_0134(12) {
UIChatHisBox3::UIChatHisBox3(UIWindowContext& windows) : UIChatHisBox2(windows), unknown_0130(1), unknown_0134(12) {
}
// OFFSET: 0x00999FF0

View file

@ -3779,7 +3779,7 @@ void CGameMode::ShowSpecialPopup(int popupId) {
switch (popup->m_messageId) {
case 0:
for (const std::string& description : popup->m_descriptions) {
text = RemoveTextColors(description.c_str(), static_cast<unsigned short>(g_textCodePage));
text = RemoveTextColors(description.c_str());
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(text.c_str()), popup->m_color, 0, 0, 0);
}
break;
@ -3790,7 +3790,7 @@ void CGameMode::ShowSpecialPopup(int popupId) {
[[fallthrough]];
case 2:
for (const std::string& description : popup->m_descriptions) {
text = RemoveTextColors(description.c_str(), static_cast<unsigned short>(g_textCodePage));
text = RemoveTextColors(description.c_str());
g_windowMgr.SendNotice(1, reinterpret_cast<std::intptr_t>(text.c_str()), popup->m_color, 0, 0, 0);
}
if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(358)) {

View file

@ -298,8 +298,8 @@ void UIChooseSellBuyWnd::CreateViewer(int width, int height) {
// OFFSET: 0x008C7420
// FUNCTION: fn_11931
UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext)
: UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices(), m_listContext(&listContext) {
UIChooseWarpWnd::UIChooseWarpWnd(UIWindowContext& windows)
: UIFrameWnd(windows, 0), m_list(nullptr), unknown_00B8(0), m_choices() {
this->m_choices.reserve(6);
}
@ -324,7 +324,7 @@ void UIChooseWarpWnd::Slot15(int width, int height) {
title->SetFont(0, 12, 0, 0);
this->AddChild(title);
this->m_list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIListBox(*this->m_context);
int listWidth = width - 24;
int listHeight = height - 55;
if (listWidth < 20) {
@ -362,7 +362,7 @@ void UIChooseWarpWnd::Slot15(int width, int height) {
// OFFSET: 0x008DE0E0
// FUNCTION: fn_12164
void UIChooseWnd::Slot15(int width, int height) {
this->m_list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIListBox(*this->m_context);
int listHeight = height - 55;
if (listHeight < 30) {
listHeight = 30;

View file

@ -1,10 +1,10 @@
#include "Contents/NavigationManager.h"
#include "UI/Text/NavigationLink.h"
#include "UI/Buttons/UINaviLinkButton.h"
// OFFSET: 0x0086DF60
// FUNCTION: fn_11062
UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation)
: UITextButton(windows), m_navigation(&navigation) {
UINaviLinkButton::UINaviLinkButton(UIWindowContext& windows) : UITextButton(windows) {
}
// OFFSET: 0x00873A90
@ -30,6 +30,6 @@ void UINaviLinkButton::Slot25(int, int) {
}
if (!map.empty()) {
this->m_navigation->Navigate(map, x, y);
g_navigationManager.SetDestinationMap(map, x, y);
}
}

View file

@ -3,17 +3,9 @@
#include "UI/Buttons/UITextButton.h"
class NavigationDestination {
public:
virtual void Navigate(std::string map, int x, int y) = 0;
protected:
~NavigationDestination() = default;
};
class UINaviLinkButton : public UITextButton {
public:
UINaviLinkButton(UIWindowContext& windows, NavigationDestination& navigation);
UINaviLinkButton(UIWindowContext& windows);
~UINaviLinkButton() override;
void Slot25(int x, int y) override;
std::string Link();
@ -21,8 +13,7 @@ public:
/* 0110 */ int column;
/* 0114 */ int line;
private:
NavigationDestination* m_navigation;
void* unknown_0118;
};
#if defined(_WIN32) && !defined(_WIN64)

View file

@ -1915,7 +1915,6 @@ void UIListBoxNavi::Paint() {
const int limit = this->geometry.height / this->lineHeight - this->bottomMargin + first;
const int end = static_cast<int>(std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(limit)));
std::uint32_t color = 0;
auto& owner = *this->m_listContext;
for (int index = first, row = 0; index < end; ++index, ++row) {
if (this->lineColors[index] == 1) {
@ -3199,7 +3198,6 @@ void UIListBox2::Paint() {
end = count;
}
auto& owner = *this->m_listContext;
for (int row = 0; row + first < static_cast<int>(end); ++row) {
const int index = row + first;
if (index == this->selected) {
@ -3437,7 +3435,7 @@ UITVTextButton::UITVTextButton() : UIButton() {
// OFFSET: 0x0086DE10
// FUNCTION: fn_11060
UIMemberListBox::UIMemberListBox(UIWindowContext& windows, UIListBoxContext& list) : UIChatHisBox2(windows, list) {
UIMemberListBox::UIMemberListBox(UIWindowContext& windows) : UIChatHisBox2(windows) {
this->backgroundRed = 255;
this->backgroundGreen = 255;
this->backgroundBlue = 255;
@ -3454,8 +3452,8 @@ void UIChatHisBox2::Paint() {
end = static_cast<unsigned int>(this->lines.size());
}
FontCache& fonts = this->m_listContext->fonts;
const TextLocale& locale = this->m_listContext->locale;
FontCache& fonts = g_fontCache;
const TextLocale& locale = this->m_context->locale;
for (int row = 0; top + row < static_cast<int>(end); ++row) {
const int index = top + row;
int x;
@ -3489,8 +3487,8 @@ void UIChatHisBox3::Paint() {
end = static_cast<unsigned int>(this->lines.size());
}
FontCache& fonts = this->m_listContext->fonts;
const TextLocale& locale = this->m_listContext->locale;
FontCache& fonts = g_fontCache;
const TextLocale& locale = this->m_context->locale;
for (int row = 0; top + row < static_cast<int>(end); ++row) {
const int index = top + row;
this->DrawTextAt(2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, this->unknown_0134, this->unknown_00E4[index], 0, 0);

View file

@ -164,7 +164,7 @@ void UISubChatHisWnd::Slot15(int width, int height) {
this->AddChild(button);
}
this->m_chatBox = new UIChatHisBox(*this->m_context, *this->m_listContext);
this->m_chatBox = new UIChatHisBox(*this->m_context);
this->m_chatBox->Configure(0, 0, this->geometry.width - 8, this->geometry.height - this->unknown_00F0 - this->m_inputHeight - 4, 0);
this->m_chatBox->Move(5, this->m_inputHeight + 4);
this->AddChild(this->m_chatBox);
@ -208,8 +208,8 @@ void UISubChatHisWnd::Slot15(int width, int height) {
// OFFSET: 0x00912340
// FUNCTION: fn_12529
UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list)
: UIFrameWnd(windows, 0), m_editContext(&edit), m_listContext(&list) {
UISubChatHisWnd::UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit)
: UIFrameWnd(windows, 0), m_editContext(&edit) {
this->m_saved = nullptr;
this->m_resizer = nullptr;
this->m_chatBox = nullptr;

View file

@ -12,7 +12,6 @@ class UIResizer;
class UIWindowMgr;
struct SubChatHisWndInfo;
struct UIEditContext;
struct UIListBoxContext;
struct SubChatHistoryState {
/* 0000 */ int unknown_0000;
@ -29,7 +28,7 @@ class UISubChatHisWnd : public UIFrameWnd {
public:
UISubChatHisWnd();
UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit, UIListBoxContext& list);
UISubChatHisWnd(UIWindowContext& windows, UIEditContext& edit);
void Resize(int width, int height) override;
void Move(int x, int y) override;
void Slot11() override;
@ -63,7 +62,7 @@ private:
/* 012C */ UIEditCtrl* m_edit;
void* unknown_controls;
UIEditContext* m_editContext;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
#if defined(_WIN32) && !defined(_WIN64)

View file

@ -6,12 +6,11 @@
#include <string>
#include <vector>
struct UIListBoxContext;
class UIListBox;
class UIChooseWarpWnd : public UIFrameWnd {
public:
UIChooseWarpWnd(UIWindowContext& windows, UIListBoxContext& listContext);
UIChooseWarpWnd(UIWindowContext& windows);
void Slot15(int width, int height) override;
void Paint() override;
std::vector<unsigned char> Slot44() override;
@ -23,7 +22,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
#endif

View file

@ -8,8 +8,8 @@ UIChooseWnd::~UIChooseWnd() {
// OFFSET: 0x008C74C0
// FUNCTION: fn_11932
UIChooseWnd::UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists)
: UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr), m_listContext(&lists) {
UIChooseWnd::UIChooseWnd(UIWindowContext& windows)
: UIFrameWnd(windows, 0), m_list(nullptr), m_okButton(nullptr), m_cancelButton(nullptr) {
this->unknown_00B4 = -1;
this->m_placement = nullptr;
}

View file

@ -6,13 +6,12 @@
#include <vector>
struct ChooseWndInfo;
struct UIListBoxContext;
class UIBitmapButton;
class UIListBox;
class UIChooseWnd : public UIFrameWnd {
public:
UIChooseWnd(UIWindowContext& windows, UIListBoxContext& lists);
UIChooseWnd(UIWindowContext& windows);
~UIChooseWnd() override;
void Slot11() override;
void Slot15(int width, int height) override;
@ -30,7 +29,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
class UIChoose3Wnd : public UIChooseWnd {

View file

@ -13,7 +13,6 @@ struct CLanguageBase;
using InputCharset = CLanguageBase;
struct BitmapImage;
#include "UI/Window/WindowManagerWindows.h"
class NavigationDestination;
class UINaviLinkButton;
class UIItemTagButton;
struct ITEM_INFO;
@ -24,7 +23,6 @@ struct UIEditContext {
unsigned char& password;
const InputCharset& charset;
WindowManagerWindows& windows;
NavigationDestination& navigation;
const BitmapImage& colorChip;
const int& candidateCursor;
UIWindow* const& candidateWindow;

View file

@ -254,7 +254,7 @@ void UIEditCtrl::InsertLink(const char* value) {
this->anchor = this->cursor = static_cast<int>(this->text.size());
g_serverLanguage->Select(this->cursor, this->cursor);
auto* button = new UINaviLinkButton(*this->m_context, this->m_edit->navigation);
auto* button = new UINaviLinkButton(*this->m_context);
button->Configure(display.c_str(), 0x009E68F0, 0, 12, 0, 0);
button->SetId(438);

View file

@ -64,7 +64,7 @@ int UIEntryQueueHelpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a,
// OFFSET: 0x00BA42E0
// FUNCTION: fn_19684
UIEntryQueueListBox::UIEntryQueueListBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIEntryQueueListBox::UIEntryQueueListBox(UIWindowContext& windows) : UIListBox(windows) {
}
// OFFSET: 0x00BA43F0
@ -332,9 +332,8 @@ void UIEntryQueueStandByWnd::SetInfo(const char* queueName, int waiting, int ran
// OFFSET: 0x00BA6000
// FUNCTION: fn_19704
UIEntryQueueWnd::UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue, UIListBoxContext& list)
: UIFrameWnd(windows, 0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_entryQueue(&entryQueue),
m_listContext(&list), m_applyButtons(), m_helpButton(nullptr) {
UIEntryQueueWnd::UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue)
: UIFrameWnd(windows, 0), unknown_00BC(), m_labels(), m_values(), m_list(nullptr), saved(nullptr), m_entryQueue(&entryQueue), m_applyButtons(), m_helpButton(nullptr) {
}
// OFFSET: 0x00BA6110
@ -353,7 +352,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) {
this->AddBaseButton();
this->AddCloseButton("", 0);
this->m_list = new UIEntryQueueListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIEntryQueueListBox(*this->m_context);
this->m_list->SetSize(130, 270);
this->m_list->Move(10, 40);
this->m_list->backgroundRed = 240;

View file

@ -41,7 +41,7 @@ public:
class UIEntryQueueListBox : public UIListBox {
public:
UIEntryQueueListBox(UIWindowContext& windows, UIListBoxContext& list);
UIEntryQueueListBox(UIWindowContext& windows);
~UIEntryQueueListBox() override;
void Slot31(int x, int y) override;
virtual void AddEntry(const char* name, int value);
@ -102,7 +102,7 @@ public:
class UIEntryQueueWnd : public UIFrameWnd {
public:
UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue, UIListBoxContext& list);
UIEntryQueueWnd(UIWindowContext& windows, UIEntryQueueContext& entryQueue);
~UIEntryQueueWnd() override;
void Slot11() override;
void Slot15(int width, int height) override;
@ -120,7 +120,7 @@ public:
protected:
UIEntryQueueContext* m_entryQueue;
UIListBoxContext* m_listContext;
void* unknown_listContext;
UIBitmapButton* m_applyButtons[3];
UIBitmapButton* m_helpButton;
};

View file

@ -98,7 +98,6 @@ void UIListBoxAgitMenu::Paint() {
this->DrawBitmap(this->geometry.width - rightDown->image.width, this->geometry.height - rightDown->image.height, &rightDown->image, false);
SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue);
auto& owner = *this->m_listContext;
for (int index = 0; index < 2; ++index) {
if (index == this->selected) {
this->FillRegion(3, this->lineHeight * index + 1, this->geometry.width - 6, this->lineHeight - 2, RGB(red, green, blue));

View file

@ -34,7 +34,7 @@ public:
class UIListBoxAgitMenu : public UIListBox {
public:
UIListBoxAgitMenu(UIWindowContext& windows, UIListBoxContext& list);
UIListBoxAgitMenu(UIWindowContext& windows);
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
void Slot25(int x, int y) override;

View file

@ -1027,14 +1027,14 @@ void UIGuildInfoManageWnd::Slot15(int, int) {
this->AddChild(this->m_disbandButton);
}
this->m_agitList = new UIListBoxAgit(*this->m_context, *this->m_listContext);
this->m_agitList = new UIListBoxAgit(*this->m_context);
this->m_agitList->SetSize(95, 158);
this->m_agitList->Move(this->TextWidth(LookupMessage(333), 0, 0, 12, 0, 0) + 19, 129);
this->m_agitList->lineHeight = 13;
this->m_agitList->SetId(558);
this->AddChild(this->m_agitList);
this->m_agitMenu = new UIListBoxAgitMenu(*this->m_context, *this->m_listContext);
this->m_agitMenu = new UIListBoxAgitMenu(*this->m_context);
this->m_agitMenu->SetSize(120, 35);
this->m_agitMenu->SetId(559);
this->m_agitMenu->Show(0);
@ -2257,7 +2257,7 @@ UIGuildTotalInfoWnd::UIGuildTotalInfoWnd(UIWindowContext& windows)
// OFFSET: 0x00954120
// FUNCTION: fn_13006
UIListBoxAgitMenu::UIListBoxAgitMenu(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIListBoxAgitMenu::UIListBoxAgitMenu(UIWindowContext& windows) : UIListBox(windows) {
}
// OFFSET: 0x0095BF90

View file

@ -41,7 +41,6 @@ class UIListBoxAgit;
class UIListBoxAgitMenu;
class UIScrollBar;
class UIStaticText;
struct UIListBoxContext;
struct GuildWndInfo;
class ForbiddenWords;
@ -130,7 +129,7 @@ protected:
/* 00FC */ int m_hostileRow;
/* 0100 */ UIListBoxAgit* m_agitList;
/* 0104 */ UIListBoxAgitMenu* m_agitMenu;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
class UIGuildMemberManageWnd : public UIGuildWnd {

View file

@ -54,7 +54,7 @@ void UIMakeTargetResultWnd::Paint() {
// OFFSET: 0x009A0B00
// FUNCTION: fn_13604
void UIItemRepairWnd::Slot15(int width, int height) {
this->m_list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIListBox(*this->m_context);
this->m_list->Configure(12, 22, width - 24, height - 55, 0);
this->m_list->backgroundRed = 240;
this->m_list->backgroundGreen = 240;
@ -84,7 +84,7 @@ void UIItemRepairWnd::Slot15(int width, int height) {
// OFFSET: 0x009A1590
// FUNCTION: fn_13605
void UIMakeTargetListWnd::Slot15(int width, int height) {
this->m_list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIListBox(*this->m_context);
this->m_list->Configure(12, 22, width - 24, height - 55, 0);
this->m_list->backgroundRed = 240;
this->m_list->backgroundGreen = 240;
@ -153,7 +153,7 @@ void UIMakeTargetResultWnd::Slot15(int width, int height) {
// OFFSET: 0x009A2DD0
// FUNCTION: fn_13608
void UIWeaponRefineWnd::Slot15(int width, int height) {
this->m_list = new UIListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIListBox(*this->m_context);
this->m_list->Configure(12, 22, width - 24, height - 55, 0);
this->m_list->backgroundRed = 240;
this->m_list->backgroundGreen = 240;
@ -309,7 +309,7 @@ int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t
// OFFSET: 0x0099F780
// FUNCTION: fn_13587
UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext,
UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows,
WindowResponseRecorder& recorder)
: UIFrameWnd(windows, 0), itemIds(), indices(), entries() {
}
@ -317,7 +317,7 @@ UIItemRepairWnd::UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& lis
// OFFSET: 0x0099F850
// FUNCTION: fn_13588
UIMakeTargetListWnd::UIMakeTargetListWnd(
UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder
UIWindowContext& windows, WindowResponseRecorder& recorder
)
: UIFrameWnd(windows, 0), itemIds() {
}
@ -341,7 +341,7 @@ UIMakeTargetResultWnd::UIMakeTargetResultWnd(UIWindowContext& windows)
// OFFSET: 0x0099F9C0
// FUNCTION: fn_13591
UIWeaponRefineWnd::UIWeaponRefineWnd(
UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder
UIWindowContext& windows, WindowResponseRecorder& recorder
)
: UIFrameWnd(windows, 0), itemIds(), indices() {
}

View file

@ -8,7 +8,6 @@
#include <vector>
struct WindowResponseRecorder;
struct UIListBoxContext;
class UIListBox;
#pragma pack(push, 1)
@ -23,7 +22,7 @@ static_assert(sizeof(UIItemRepairEntry) == 0x18);
class UIItemRepairWnd : public UIFrameWnd {
public:
UIItemRepairWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder);
UIItemRepairWnd(UIWindowContext& windows, WindowResponseRecorder& recorder);
~UIItemRepairWnd() override;
void Slot15(int width, int height) override;
void Paint() override;
@ -32,7 +31,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
public:
/* 00B4 */ UIListBox* m_list;

View file

@ -6,12 +6,11 @@
#include <vector>
struct WindowResponseRecorder;
struct UIListBoxContext;
class UIListBox;
class UIMakeTargetListWnd : public UIFrameWnd {
public:
UIMakeTargetListWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder);
UIMakeTargetListWnd(UIWindowContext& windows, WindowResponseRecorder& recorder);
std::vector<unsigned char> BuildReplayRecords();
void Slot15(int width, int height) override;
void Paint() override;
@ -21,7 +20,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
public:
/* 00B8 */ std::vector<int> itemIds;

View file

@ -6,12 +6,11 @@
#include <vector>
struct WindowResponseRecorder;
struct UIListBoxContext;
class UIListBox;
class UIWeaponRefineWnd : public UIFrameWnd {
public:
UIWeaponRefineWnd(UIWindowContext& windows, UIListBoxContext& listContext, WindowResponseRecorder& recorder);
UIWeaponRefineWnd(UIWindowContext& windows, WindowResponseRecorder& recorder);
std::vector<unsigned char> BuildReplayRecords();
void Slot15(int width, int height) override;
void Paint() override;
@ -21,7 +20,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
public:
/* 00B8 */ std::vector<int> itemIds;

View file

@ -1,3 +1,4 @@
#include "Render/Text/FontCache.h"
#include "Client/Input/InputCharset.h"
#include "Contents/Configuration/ServiceConfiguration.h"
#include "Contents/Items/ItemDescription.h"
@ -26,7 +27,7 @@ std::string UIChatHisBox::ResolvePlayerTags(const char* name) {
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
const unsigned short codePage = static_cast<unsigned short>(g_textCodePage);
const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->m_maximumId, codePage};
ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width};
ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width};
for (std::vector<UIItemTagButton*>& row : this->ItemTags()) {
const int count = static_cast<int>(row.size());
@ -93,7 +94,7 @@ void UIChatHisBox::sub_89C080() {
// OFFSET: 0x0086C8D0
// FUNCTION: fn_11032
UIChatHisBox::UIChatHisBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIChatHisBox::UIChatHisBox(UIWindowContext& windows) : UIListBox(windows) {
new (&this->ItemTags()) std::list<std::vector<UIItemTagButton*>>();
this->maxLines = 240;
this->lineHeight = 14;

View file

@ -12,7 +12,7 @@ class UINaviLinkButton;
class UIChatHisBox : public UIListBox {
public:
UIChatHisBox(UIWindowContext& windows, UIListBoxContext& list);
UIChatHisBox(UIWindowContext& windows);
~UIChatHisBox() override;
bool Slot08() override;
void Resize(int width, int height) override;

View file

@ -297,5 +297,5 @@ int UIListBoxID::sub_8991B0(UIWindow* sender, int message, std::intptr_t argumen
// OFFSET: 0x0086CB40
// FUNCTION: fn_11033
UIComboBox::UIComboBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), targetId(10041) {
UIComboBox::UIComboBox(UIWindowContext& windows) : UIListBox(windows), targetId(10041) {
}

View file

@ -8,7 +8,7 @@
class UIComboBox : public UIListBox {
public:
UIComboBox();
UIComboBox(UIWindowContext& windows, UIListBoxContext& list);
UIComboBox(UIWindowContext& windows);
void Resize(int width, int height) override;
void Slot15(int width, int height) override;
void Paint() override;

View file

@ -1,3 +1,4 @@
#include "UI/Window/UIWindowMgr.h"
#include "Render/DeviceContext/DeviceContext.h"
#include "Resource/Bitmap/BitmapResource.h"
#include "Resource/ResourceMgr.h"
@ -25,7 +26,7 @@ namespace {
// OFFSET: 0x0086CD40
// FUNCTION: fn_11037
UIComboBoxEx::UIComboBoxEx(UIWindowContext& windows, UIComboBoxContext& combo) : UIListBoxEx(windows, combo.list), targetId(10041), m_combo(&combo) {
UIComboBoxEx::UIComboBoxEx(UIWindowContext& windows, UIComboBoxContext& combo) : UIListBoxEx(windows), targetId(10041), m_combo(&combo) {
}
// OFFSET: 0x00872C00
@ -86,7 +87,7 @@ void UIComboBoxEx::Slot27(int x, int y) {
// FUNCTION: fn_11435
void UIComboBoxEx::Slot31(int x, int y) {
this->selected = this->LineAt(x, y);
auto& windows = this->m_listContext->windows;
auto& windows = g_windowMgr;
if (UIWindow* target = windows.LookupWindow(this->targetId)) {
target->SendMsg(nullptr, 39, this->selected, 0, 0, 0);
@ -143,12 +144,12 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i
switch (message) {
case 0:
if (UIWindow* target = this->m_listContext->windows.LookupWindow(this->targetId)) {
if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) {
target->SendMsg(nullptr, 39, this->selected, 0, 0, 0);
}
if (this->m_combo->popup) {
this->m_listContext->windows.CloseWindow(26);
g_windowMgr.CloseWindow(26);
}
return 0;
@ -213,7 +214,6 @@ void UIComboBoxEx::DrawRows(bool centered) {
const unsigned end = std::min(
static_cast<unsigned>(this->lines.size()), static_cast<unsigned>((this->topLine + (this->geometry.height / this->lineHeight - this->bottomMargin)))
);
auto& owner = *this->m_listContext;
for (int index = this->topLine; index < static_cast<int>(end); index = (index + 1)) {
auto& row = this->lines[index];
@ -231,7 +231,7 @@ void UIComboBoxEx::DrawRows(bool centered) {
// OFFSET: 0x0088A360
// FUNCTION: fn_11354
void UIComboBoxEx::Paint() {
auto& resources = this->m_listContext->resources;
auto& resources = ResourceMgr::Instance();
this->geometry.surface->Fill(nullptr, Palette(resources, 6, 6));
this->FillRegion(1, 1, (this->geometry.width - 2), (this->geometry.height - 2), Palette(resources, 2, 2));
constexpr char prefix[] = "유저인터페이스\\basic_interface\\";
@ -276,7 +276,6 @@ UIComboBoxEx2::~UIComboBoxEx2() = default;
// OFFSET: 0x00885EE0
// FUNCTION: fn_11320
void UIComboBoxEx2::Slot15(int width, int height) {
auto& list = *this->m_listContext;
auto* vertical = new UIScrollBar_Navi(*this->m_context);
this->verticalBar = vertical;
vertical->vertical = 1;

View file

@ -4,7 +4,6 @@
#include "UI/Lists/UIListBoxEx.h"
struct UIComboBoxContext {
UIListBoxContext& list;
UIWindow* const& popup;
};

View file

@ -1,3 +1,4 @@
#include "UI/Window/UIWindowMgr.h"
#include "Render/DeviceContext/DeviceContext.h"
#include "Render/Text/TextContext.h"
#include "Resource/Bitmap/BitmapResource.h"
@ -28,7 +29,7 @@ namespace {}
UIListBox::UIListBox()
: UIWindow(*reinterpret_cast<UIWindowContext*>(nullptr), 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0),
horizontalOffset(0), contentWidth(0), verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16),
textColor(0), textInset(3), m_listContext(nullptr) {
textColor(0), textInset(3) {
const SkinPaletteCell cell = {3, 2};
this->selectionColor = SkinPaletteColor(ResourceMgr::Instance(), cell, g_skinInfo.Selected());
this->selectable = 1;
@ -38,18 +39,17 @@ UIListBox::UIListBox()
// OFFSET: 0x0086E750
// FUNCTION: fn_11076
UIServerListBox::UIServerListBox() : UIListBox() {
this->m_listContext = nullptr;
*reinterpret_cast<int*>(reinterpret_cast<char*>(this) + 0xD8) = 0;
this->unknown_00DC = 0;
this->unknown_00E0 = 0;
}
UIListBox::UIListBox(UIWindowContext& windows, UIListBoxContext& list)
UIListBox::UIListBox(UIWindowContext& windows)
: UIWindow(windows, 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0), horizontalOffset(0), contentWidth(0),
verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectable(1), textColor(0),
centerVertically(0), textInset(3), m_listContext(&list) {
centerVertically(0), textInset(3) {
constexpr char path[] = "유저인터페이스\\colorchip.bmp";
const auto* chip = static_cast<CBitmapRes*>(list.resources.Load(path));
const auto* chip = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(path));
this->selectionColor = 0;
if (chip) {
@ -231,7 +231,6 @@ void UIChatHisBox::AddText(const char* text, int color, const char* style) {
// FUNCTION: fn_11201
void UIListBox::AddLine(const char* text) {
this->lines.emplace_back(text);
auto& owner = *this->m_listContext;
const int width = this->TextWidth(text, 0, 0, 12, 0, 0);
this->contentWidth = std::max(this->contentWidth, width);
this->Refresh();
@ -330,7 +329,6 @@ void UIListBox::Paint() {
const int limit = ((this->geometry.height / this->lineHeight - this->bottomMargin) + first);
const int end = static_cast<int>(std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(limit)));
std::uint32_t color = this->textColor;
auto& owner = *this->m_listContext;
for (int index = first; index < end; ++index) {
const int row = (index - first);
@ -465,7 +463,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s
}
case 98:
if (argument3 > 0) {
if (UIWindow* window = this->m_listContext->windows.LookupWindow(12)) {
if (UIWindow* window = g_windowMgr.LookupWindow(12)) {
window->SendMsg(nullptr, 24, argument3, 0, 0, 0);
}
}
@ -560,5 +558,5 @@ void UIListBoxID::AddLine(const char* text, int id) {
// OFFSET: 0x0086D8C0
// FUNCTION: fn_11054
UIListBox2::UIListBox2(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), fontFamily(0), fontHeight(12), bold(0), italic(0) {
UIListBox2::UIListBox2(UIWindowContext& windows) : UIListBox(windows), fontFamily(0), fontHeight(12), bold(0), italic(0) {
}

View file

@ -10,22 +10,11 @@ struct FrameFocus;
class ResourceMgr;
class UIScrollBar;
#include "UI/Window/WindowManagerWindows.h"
class NavigationDestination;
struct UIListBoxContext {
FrameFocus& capture;
ResourceMgr& resources;
FontCache& fonts;
const TextLocale& locale;
const unsigned short& codePage;
WindowManagerWindows& windows;
NavigationDestination& navigation;
};
class UIListBox : public UIWindow {
public:
__declspec(noinline) UIListBox();
__declspec(noinline) UIListBox(UIWindowContext& windows, UIListBoxContext& list);
__declspec(noinline) UIListBox(UIWindowContext& windows);
~UIListBox() override;
void Resize(int width, int height) override;
void Slot15(int width, int height) override;
@ -68,7 +57,7 @@ public:
/* 00D0 */ int textInset;
protected:
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
class UIServerListBox : public UIListBox {
@ -81,7 +70,7 @@ public:
class UIListBox2 : public UIListBox {
public:
UIListBox2(UIWindowContext& windows, UIListBoxContext& list);
UIListBox2(UIWindowContext& windows);
void Paint() override;
/* 00D4 */ int fontFamily;

View file

@ -10,12 +10,11 @@
// OFFSET: 0x0086DA90
// FUNCTION: fn_11056
UIListBoxEx::UIListBoxEx(UIWindowContext& windows, UIListBoxContext& list)
UIListBoxEx::UIListBoxEx(UIWindowContext& windows)
: UIWindow(windows, 0), backgroundRed(255), backgroundGreen(255), backgroundBlue(255), selected(0), topLine(0), horizontalOffset(0), contentWidth(0),
verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectionColor(0),
m_listContext(&list) {
verticalOverflow(0), bottomMargin(0), verticalBar(nullptr), horizontalBar(nullptr), transparent(0), lineHeight(16), selectionColor(0) {
constexpr char path[] = "유저인터페이스\\colorchip.bmp";
const auto* chip = static_cast<CBitmapRes*>(list.resources.Load(path));
const auto* chip = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(path));
if (chip) {
const auto& image = chip->image;
@ -41,7 +40,6 @@ void UIListBoxEx::Configure(int x, int y, int width, int height, unsigned char v
// OFFSET: 0x00886990
// FUNCTION: fn_11327
void UIListBoxEx::Slot15(int width, int height) {
auto& owner = *this->m_listContext;
auto* vertical = new UIScrollBar(*this->m_context);
this->verticalBar = vertical;
const int thickness = vertical->thickness;
@ -78,7 +76,6 @@ void UIListBoxEx::Resize(int width, int height) {
// FUNCTION: fn_11202
void UIListBoxEx::AddLine(const char* text, std::uint32_t color) {
this->lines.emplace(static_cast<int>(this->lines.size()), ExtendedListLine{text, color});
auto& owner = *this->m_listContext;
const int width = this->TextWidth(text, 0, 0, 12, 0, 0);
this->contentWidth = std::max(this->contentWidth, width);
this->Refresh();
@ -167,7 +164,6 @@ void UIListBoxEx::Paint() {
const unsigned end = std::min(
static_cast<unsigned>(this->lines.size()), static_cast<unsigned>((this->topLine + (this->geometry.height / this->lineHeight - this->bottomMargin)))
);
auto& owner = *this->m_listContext;
for (int index = this->topLine; index < static_cast<int>(end); index = (index + 1)) {
const int y = (this->lineHeight * (index - this->topLine));

View file

@ -6,7 +6,6 @@
#include <map>
#include <string>
struct UIListBoxContext;
class UIScrollBar;
struct ExtendedListLine {
@ -16,7 +15,7 @@ struct ExtendedListLine {
class UIListBoxEx : public UIWindow {
public:
UIListBoxEx(UIWindowContext& windows, UIListBoxContext& list);
UIListBoxEx(UIWindowContext& windows);
~UIListBoxEx() override;
void Resize(int width, int height) override;
void Slot15(int width, int height) override;
@ -49,7 +48,7 @@ public:
/* 00BC */ std::uint32_t selectionColor;
protected:
UIListBoxContext* m_listContext;
void* unknown_listContext;
int LineAt(int x, int y) const;
};

View file

@ -2,7 +2,7 @@
// OFFSET: 0x0086DD10
// FUNCTION: fn_11058
UIListBoxNavi::UIListBoxNavi(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), lineColors(), lineOffset(-1) {
UIListBoxNavi::UIListBoxNavi(UIWindowContext& windows) : UIListBox(windows), lineColors(), lineOffset(-1) {
this->defaultLineColor = 0xD2D2D2;
}

View file

@ -8,7 +8,7 @@
class UIListBoxNavi : public UIListBox {
public:
UIListBoxNavi(UIWindowContext& windows, UIListBoxContext& list);
UIListBoxNavi(UIWindowContext& windows);
void Paint() override;
void Slot25(int x, int y) override;
void Clear() override;

View file

@ -7,7 +7,7 @@
class UIListBox_NaviSearch : public UIListBox {
public:
UIListBox_NaviSearch(UIWindowContext& windows, UIListBoxContext& list);
UIListBox_NaviSearch(UIWindowContext& windows);
void Resize(int width, int height) override;
void Slot15(int width, int height) override;

View file

@ -7,7 +7,7 @@
class UIChatHisBox2 : public UIChatHisBox {
public:
UIChatHisBox2();
UIChatHisBox2(UIWindowContext& windows, UIListBoxContext& list);
UIChatHisBox2(UIWindowContext& windows);
bool Slot08() override;
void Paint() override;
void Slot15(int width, int height) override;
@ -21,7 +21,7 @@ public:
class UIChatHisBox3 : public UIChatHisBox2 {
public:
UIChatHisBox3(UIWindowContext& windows, UIListBoxContext& list);
UIChatHisBox3(UIWindowContext& windows);
void Paint() override;
void Slot15(int width, int height) override;
void Resize(int width, int height) override;
@ -33,7 +33,7 @@ public:
class UIMemberListBox : public UIChatHisBox2 {
public:
UIMemberListBox(UIWindowContext& windows, UIListBoxContext& list);
UIMemberListBox(UIWindowContext& windows);
void Paint() override;
void Slot25(int x, int y) override;
void Slot28(int x, int y) override;

View file

@ -2,5 +2,5 @@
// OFFSET: 0x0086E0C0
// FUNCTION: fn_11064
UIPackageBoxNameList::UIPackageBoxNameList(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIPackageBoxNameList::UIPackageBoxNameList(UIWindowContext& windows) : UIListBox(windows) {
}

View file

@ -5,7 +5,7 @@
class UIPackageBoxNameList : public UIListBox {
public:
UIPackageBoxNameList(UIWindowContext& windows, UIListBoxContext& list);
UIPackageBoxNameList(UIWindowContext& windows);
void Slot25(int x, int y) override;
};

View file

@ -6,7 +6,7 @@
class UIReplayListBox : public UIListBox {
public:
// INLINED
UIReplayListBox(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIReplayListBox(UIWindowContext& windows) : UIListBox(windows) {
}
void Slot25(int x, int y) override;

View file

@ -1,3 +1,4 @@
#include "Network/TextEncoding.h"
#include "Render/Text/FontCache.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Mode/ModeCursor.h"
@ -1358,8 +1359,8 @@ void UIChatHisBox::Paint() {
end = static_cast<unsigned int>(this->lines.size());
}
FontCache& fonts = this->m_listContext->fonts;
const TextLocale& locale = this->m_listContext->locale;
FontCache& fonts = g_fontCache;
const TextLocale& locale = this->m_context->locale;
for (int row = 0; top + row < static_cast<int>(end); ++row) {
const int index = top + row;
int x;
@ -1824,8 +1825,8 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou
const bool languagePrefix = false;
const WORD language = g_serverLanguage->language;
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, this->m_listContext->codePage};
ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width};
const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, static_cast<unsigned short>(g_textCodePage)};
ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width};
for (;;) {
std::string encoded;
@ -1963,7 +1964,7 @@ std::string UIChatHisBox::RenderNavigationLinks(const char* text, std::string& s
tail = line.substr(position + label.size());
}
UINaviLinkButton* button = new (std::nothrow) UINaviLinkButton(*this->m_context, this->m_listContext->navigation);
UINaviLinkButton* button = new (std::nothrow) UINaviLinkButton(*this->m_context);
if (button) {
button->link = link;
button->Configure(label.c_str(), 0x82F2E1, 0, 12, 0, 0);
@ -2077,8 +2078,8 @@ void UIChatHisBox::sub_89DC30(const char* text, int& color, int& mode) {
bool languagePrefix = false;
WORD language = g_serverLanguage->language;
ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language};
const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, this->m_listContext->codePage};
ItemLinkDisplay display{*this->geometry.surface, this->m_listContext->fonts, this->m_listContext->locale, naming, titles, this->geometry.width};
const TipBoxTitles titles{g_itemTagOwner->m_entries, g_itemTagOwner->m_missing, g_itemTagOwner->unknown_0118, static_cast<unsigned short>(g_textCodePage)};
ItemLinkDisplay display{*this->geometry.surface, g_fontCache, this->m_context->locale, naming, titles, this->geometry.width};
const std::string converted = display.Convert(text);
this->sub_8932D0(&mode, &wrapped, converted);
this->RewrapLinkLines(wrapped, mode);

View file

@ -65,7 +65,6 @@ void UITagListBox::Paint() {
const int end =
static_cast<int>(std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(limit)));
std::uint32_t color = 0;
auto& owner = *this->m_listContext;
for (int index = 0; index < first; ++index) {
const std::string& line = this->lines[index];
@ -368,7 +367,6 @@ int UITagListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1
void UITagListBox::sub_9B9EA0(std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
char* text = reinterpret_cast<char*>(argument1);
const int width = static_cast<int>(argument2);
auto& owner = *this->m_listContext;
std::vector<std::string> lines;
if (width == 138) {

View file

@ -2,8 +2,8 @@
// OFFSET: 0x005C2860
// FUNCTION: fn_03536
UINavigationRuideWnd::UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists)
: UIFrameWnd(windows, 0), m_listContext(&lists) {
UINavigationRuideWnd::UINavigationRuideWnd(UIWindowContext& windows)
: UIFrameWnd(windows, 0) {
}
// OFFSET: 0x005C28C0

View file

@ -10,7 +10,6 @@ class CBitmapRes;
class CNavi_Object;
class CTexture;
class UIListBox_NaviSearch;
struct UIListBoxContext;
class UIStaticText;
struct NavigationWindowInfo {
@ -75,7 +74,7 @@ public:
/* 0118 */ int unknown_0118;
/* 011C */ int unknown_011C;
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
class UIStaticBitmap;
@ -96,7 +95,7 @@ protected:
class UINavigationRuideWnd : public UIFrameWnd {
public:
UINavigationRuideWnd(UIWindowContext& windows, UIListBoxContext& lists);
UINavigationRuideWnd(UIWindowContext& windows);
void Slot15(int width, int height) override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
@ -109,7 +108,7 @@ public:
/* 00B4 */ UIListBox_NaviSearch* routeList;
protected:
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
extern int g_navigationTab;

View file

@ -804,7 +804,7 @@ int CCreateLineInfo::LayoutLink(int x, std::string text, int type, LineTextStyle
if (std::get<0>(info)) {
std::string display = std::get<1>(info);
if (this->m_parent) {
display = RemoveTextColors(display.c_str(), 0);
display = RemoveTextColors(display.c_str());
}
const std::vector<std::string> parts = SplitString(std::get<2>(info), ",");

View file

@ -1,3 +1,4 @@
#include "UI/Text/ColoredText.h"
#include "UI/Text/TextMarkup.h"
#include <windows.h>
@ -10,19 +11,6 @@ namespace {
}
// INLINED
bool Color(const char* text, const char* end) {
if (*text != '^' || end - text < 6) {
return false;
}
for (int index = 1; index <= 6; ++index) {
if (!Hex(static_cast<unsigned char>(text[index]))) {
return false;
}
}
return true;
}
}
// GLOBAL: gl_24593
@ -102,18 +90,13 @@ std::string ExpandTextEscapes(std::string text) {
// OFFSET: 0x00A7EDC0
// FUNCTION: fn_16961
std::string RemoveTextColors(const char* text, unsigned short codePage) {
std::string RemoveTextColors(const char* text) {
const char* end = text + std::char_traits<char>::length(text);
const char* current = text;
std::string result;
while (current < end) {
const char* next = current;
while (next < end && !Color(next, end)) {
next = CharNextExA(codePage, next, 0);
}
const char* next = SegmentEnd(current, end);
result.append(current, next);
if (next >= end) {

View file

@ -15,7 +15,7 @@ struct TextLink {
bool HasTextLinks(const std::string& text);
std::string ExpandTextEscapes(std::string text);
std::string RemoveTextColors(const char* text, unsigned short codePage);
std::string RemoveTextColors(const char* text);
std::string DisplayTextTag(std::string text, const std::string& begin, const std::string& end);
std::string DisplayItemTextTag(const std::string& text);
std::string DisplayNavigationTextTag(const std::string& text);

View file

@ -470,7 +470,6 @@ void UIAchTV::Paint() {
const int rows = this->lineHeight - this->bottomMargin == 0 ? this->geometry.height : this->geometry.height / this->lineHeight - this->bottomMargin;
const unsigned end = std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(rows + this->topLine));
UIListBoxContext& owner = *this->m_listContext;
int row = 0;
for (int index = this->topLine; index < static_cast<int>(end); ++index, ++row) {

View file

@ -38,7 +38,7 @@ namespace {
}
// INLINED
void ScanColors(const std::string& line, unsigned short codePage, std::uint32_t& color) {
void ScanColors(const std::string& line, std::uint32_t& color) {
const char* current = line.c_str();
const char* end = current + line.size();
@ -55,7 +55,7 @@ namespace {
((Digit(current[6]) + 16 * Digit(current[5])) << 16);
current += 7;
} else {
current = CharNextExA(codePage, current, 0);
current = CharNextExA(static_cast<WORD>(g_textCodePage), current, 0);
}
}
}
@ -64,10 +64,10 @@ namespace {
// OFFSET: 0x0086F0A0
// FUNCTION: fn_11086
UITextViewer::UITextViewer(UIWindowContext& windows, UITextViewerContext& text)
: UIListBox(windows, text.list), splitTipLinks(0), outline(0), bold(0), m_text(&text) {
: UIListBox(windows), splitTipLinks(0), outline(0), bold(0), m_text(&text) {
this->lineHeight = 18;
constexpr char path[] = "유저인터페이스\\colorchip.bmp";
const auto* chip = static_cast<CBitmapRes*>(text.list.resources.Load(path));
const auto* chip = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(path));
const auto& image = chip->image;
const std::uint32_t pixel = image.width > 18 && image.height > 2 ? image.pixels[18 + 2 * image.width] : 0x00FF0000u;
this->backgroundColor = 0xFF000000u | ((pixel & 255) << 16) | (pixel & 0xFF00) | ((pixel >> 16) & 255);
@ -229,11 +229,10 @@ void UITextViewer::Paint() {
const int limit = (this->geometry.height / divisor + this->topLine);
const int end = static_cast<int>(std::min(static_cast<unsigned>(this->lines.size()), static_cast<unsigned>(limit)));
auto& owner = this->m_text->list;
std::uint32_t color = 0;
for (int index = 0; index < this->topLine; ++index) {
ScanColors(this->lines[index], owner.codePage, color);
ScanColors(this->lines[index], color);
}
for (int index = this->topLine; index < end; ++index) {

View file

@ -22,7 +22,6 @@ protected:
};
struct UITextViewerContext {
UIListBoxContext& list;
ItemNaming& items;
const TipBoxTitles& tips;
TextViewerActions& actions;

View file

@ -1,3 +1,4 @@
#include "Client/Input/InputCharset.h"
#include "Contents/Items/ItemNaming.h"
#include "Render/Text/TextContext.h"
#include "UI/Text/ItemLinkDisplay.h"
@ -38,10 +39,9 @@ std::pair<int, int> UITextViewer::LinkPosition(unsigned position, unsigned added
unsigned accumulated = 0;
const auto count = static_cast<unsigned>(this->lines.size());
const unsigned first = count - addedLines;
auto& owner = this->m_text->list;
for (unsigned index = first; index < count; ++index) {
const std::string plain = RemoveTextColors(this->lines[index].c_str(), owner.codePage);
const std::string plain = RemoveTextColors(this->lines[index].c_str());
accumulated += static_cast<unsigned>(plain.size());
if (accumulated > position) {
@ -57,8 +57,7 @@ std::pair<int, int> UITextViewer::LinkPosition(unsigned position, unsigned added
// OFFSET: 0x008760D0
// FUNCTION: fn_11205
bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) {
auto& owner = this->m_text->list;
std::string parsed = RemoveTextColors(text.c_str(), owner.codePage);
std::string parsed = RemoveTextColors(text.c_str());
parsed = DisplayTextTag(std::move(parsed), "<URL>", "</URL>");
parsed = DisplayTextTag(std::move(parsed), "<NAVI>", "</NAVI>");
@ -101,8 +100,7 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) {
// OFFSET: 0x00876700
// FUNCTION: fn_11206
bool UITextViewer::AddNaviLinks(std::string text, unsigned addedLines) {
auto& owner = this->m_text->list;
std::string parsed = RemoveTextColors(text.c_str(), owner.codePage);
std::string parsed = RemoveTextColors(text.c_str());
parsed = DisplayTextTag(std::move(parsed), "<URL>", "</URL>");
parsed = DisplayTextTag(std::move(parsed), "<ITEM>", "</ITEM>");
@ -202,8 +200,7 @@ void UIListBoxNavi::ResetLineColors() {
// OFFSET: 0x00877020
// FUNCTION: fn_11209
bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) {
auto& owner = this->m_text->list;
std::string parsed = RemoveTextColors(text.c_str(), owner.codePage);
std::string parsed = RemoveTextColors(text.c_str());
parsed = DisplayTextTag(std::move(parsed), "<URL>", "</URL>");
parsed = DisplayTextTag(std::move(parsed), "<NAVI>", "</NAVI>");
@ -246,8 +243,7 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) {
// OFFSET: 0x00877B00
// FUNCTION: fn_11211
void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) {
auto& owner = this->m_text->list;
std::string parsed = RemoveTextColors(text.c_str(), owner.codePage);
std::string parsed = RemoveTextColors(text.c_str());
parsed = DisplayTextTag(std::move(parsed), "<URL>", "</URL>");
parsed = DisplayTextTag(std::move(parsed), "<NAVI>", "</NAVI>");
parsed = DisplayTextTag(std::move(parsed), "<ITEM>", "</ITEM>");
@ -280,7 +276,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) {
const char* breakAt = begin;
while (current < end) {
current = CharNextExA(owner.codePage, current, 0);
current = g_serverLanguage->NextChar(current, static_cast<int>(end - current));
while (*current == ' ') {
breakAt = ++current;
@ -346,8 +342,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) {
// OFFSET: 0x00878750
// FUNCTION: fn_11212
bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) {
auto& owner = this->m_text->list;
std::string parsed = RemoveTextColors(text.c_str(), owner.codePage);
std::string parsed = RemoveTextColors(text.c_str());
parsed = DisplayTextTag(std::move(parsed), "<NAVI>", "</NAVI>");
parsed = DisplayTextTag(std::move(parsed), "<ITEM>", "</ITEM>");

View file

@ -1,3 +1,4 @@
#include "UI/Window/UIWindowMgr.h"
#include "Contents/Items/ItemInfo.h"
#include "UI/Lists/UIScrollBar.h"
#include "UI/Buttons/UITextButton.h"
@ -87,7 +88,7 @@ void UITextViewer::Activate(UITextButton* button, int id) {
item.unknown_0070 = 0;
item.itemId = arguments.at(0);
if (UIWindow* window = this->m_text->list.windows.LookupWindow(12)) {
if (UIWindow* window = g_windowMgr.LookupWindow(12)) {
window->SendMsg(nullptr, 24, reinterpret_cast<std::intptr_t>(&item), 0, 0, 0);
}
@ -95,7 +96,7 @@ void UITextViewer::Activate(UITextButton* button, int id) {
}
case 517:
if (!arguments.empty()) {
if (UIWindow* window = this->m_text->list.windows.EnsureWindow(315)) {
if (UIWindow* window = g_windowMgr.EnsureWindow(315)) {
this->m_text->actions.OpenTip(*window, number(0));
}
}
@ -111,7 +112,6 @@ void UITextViewer::Activate(UITextButton* button, int id) {
// INLINED
void UITextViewer::AppendText(char* text, int width, bool carriageReturns, bool pixels) {
auto& owner = this->m_text->list;
std::vector<std::string> wrapped;
if (width == 138) {

View file

@ -20,7 +20,7 @@
#include <vector>
// INLINED
UIColoringTextViewer::UIColoringTextViewer(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list), color(0), lineLimit(0) {
UIColoringTextViewer::UIColoringTextViewer(UIWindowContext& windows) : UIListBox(windows), color(0), lineLimit(0) {
}
// OFFSET: 0x0099A1F0
@ -30,7 +30,7 @@ void UIRoundBoxTooltipWnd::Slot15(int width, int height) {
return;
}
this->viewer = new UIColoringTextViewer(*this->m_context, *this->m_listContext);
this->viewer = new UIColoringTextViewer(*this->m_context);
this->viewer->Configure(4, 4, width - 6, height - 6, 0);
unsigned red;
@ -68,7 +68,6 @@ void UIColoringTextViewer::Paint() {
end = this->lineLimit;
}
auto& owner = *this->m_listContext;
for (int index = first; index < end; ++index) {
const auto& line = this->lines[index];
DrawColoredText(*this, 3, this->lineHeight * (index - first) + 4, line.c_str(), static_cast<unsigned>(line.size()), this->color, 0, 12, false);

View file

@ -7,7 +7,7 @@
class UIColoringTextViewer : public UIListBox {
public:
UIColoringTextViewer();
UIColoringTextViewer(UIWindowContext& windows, UIListBoxContext& list);
UIColoringTextViewer(UIWindowContext& windows);
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
@ -26,7 +26,7 @@ public:
/* 00B4 */ UIColoringTextViewer* viewer;
protected:
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
#endif

View file

@ -10,7 +10,6 @@
#include <vector>
struct UIEditContext;
struct UIListBoxContext;
class UIBitmapButton;
class UIChatEditCtrl;
class UIChatHisBox;
@ -53,7 +52,7 @@ public:
protected:
void* unknown_controls;
UIEditContext* m_editContext;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
#endif

View file

@ -1632,14 +1632,14 @@ void UIChatRoomWnd::Slot15(int, int) {
focus.Set(this->edit);
this->edit->SetId(494);
UIChatHisBox2* history = new UIChatHisBox2(*this->m_context, *this->m_listContext);
UIChatHisBox2* history = new UIChatHisBox2(*this->m_context);
this->history = history;
history->Configure(0, 0, this->geometry.width - this->geometry.width * 56 / 280 - 3, this->geometry.height - 38, 0);
this->history->Move(1, 17);
this->history->SetId(184);
this->AddChild(this->history);
this->memberList = new UIMemberListBox(*this->m_context, *this->m_listContext);
this->memberList = new UIMemberListBox(*this->m_context);
this->memberList->Configure(0, 0, this->geometry.width * 56 / 280, this->geometry.height - 38, 0);
this->memberList->Move(this->geometry.width - this->geometry.width * 56 / 280 - 1, 17);
this->memberList->SetId(184);
@ -1927,7 +1927,7 @@ void UIReplayRECControlWnd::Slot15(int, int) {
// OFFSET: 0x008B5A50
// FUNCTION: fn_11750
void UISelectReplayDataWnd::Slot15(int width, int height) {
this->m_list = new UIReplayListBox(*this->m_context, *this->m_listContext);
this->m_list = new UIReplayListBox(*this->m_context);
this->m_list->Configure(6, 127, width - 12, height - 170, 0);
this->m_list->backgroundRed = 240;
this->m_list->backgroundGreen = 240;

View file

@ -88,7 +88,7 @@ std::vector<NaviRouteLine> g_navigationLabels;
// OFFSET: 0x00921A70
// FUNCTION: fn_12643
void UINavigationWnd::Slot15(int width, int height) {
this->m_routePanel = new UIListBoxNavi(*this->m_context, *this->m_listContext);
this->m_routePanel = new UIListBoxNavi(*this->m_context);
this->m_routePanel->SetSize(215, 96);
this->m_routePanel->backgroundRed = 210;
this->m_routePanel->backgroundGreen = 210;
@ -97,7 +97,7 @@ void UINavigationWnd::Slot15(int width, int height) {
this->m_routePanel->Move(-1000, -1000);
this->AddChild(this->m_routePanel);
this->m_searchPanel = new UIListBoxNavi(*this->m_context, *this->m_listContext);
this->m_searchPanel = new UIListBoxNavi(*this->m_context);
this->m_searchPanel->SetSize(215, 96);
this->m_searchPanel->backgroundRed = 210;
this->m_searchPanel->backgroundGreen = 210;

View file

@ -19,7 +19,6 @@ class UIListBoxNavi;
class UIResizer;
struct UIComboBoxHeaderContext;
struct UIEditContext;
struct UIListBoxContext;
struct WindowDialogs;
struct WindowResponseRecorder;
@ -93,7 +92,7 @@ protected:
/* 012C */ std::vector<std::string> m_history;
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
UIComboBoxHeaderContext* m_comboContext;
UIEditContext* m_editContext;
WindowResponseRecorder* m_recorder;

View file

@ -160,7 +160,7 @@ void UISecondCostumeWnd::Slot15(int width, int height) {
this->LoadLists();
this->AddCloseButton("Close", 0);
this->m_list = new UIListBoxNavi(*this->m_context, *this->m_listContext);
this->m_list = new UIListBoxNavi(*this->m_context);
this->m_list->SetSize(width - 212, 160);
this->m_list->backgroundRed = 210;
this->m_list->backgroundGreen = 210;
@ -288,9 +288,9 @@ bool UISecondCostumeWnd::Slot03() {
// OFFSET: 0x00946FB0
// FUNCTION: fn_12857
UISecondCostumeWnd::UISecondCostumeWnd(
UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos
UIWindowContext& windows, UIComboBoxHeaderContext& combos
)
: UIFrameWnd(windows, 0), m_listContext(&lists), m_comboContext(&combos) {
: UIFrameWnd(windows, 0), m_comboContext(&combos) {
this->m_typeCombo = nullptr;
this->m_list = nullptr;
this->m_tab = 0;

View file

@ -11,7 +11,6 @@
class UIComboBoxDefWnd;
class UIListBox;
struct UIComboBoxHeaderContext;
struct UIListBoxContext;
struct SecondCostumeEntry {
/* 0000 */ std::string name;
@ -20,7 +19,7 @@ struct SecondCostumeEntry {
class UISecondCostumeWnd : public UIFrameWnd {
public:
UISecondCostumeWnd(UIWindowContext& windows, UIListBoxContext& lists, UIComboBoxHeaderContext& combos);
UISecondCostumeWnd(UIWindowContext& windows, UIComboBoxHeaderContext& combos);
bool Slot03() override;
void Slot15(int width, int height) override;
void Paint() override;
@ -40,7 +39,7 @@ protected:
/* 0100 */ std::uint32_t unknown_0100;
/* 0104 */ int m_page;
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
UIComboBoxHeaderContext* m_comboContext;
/* 0108 */ std::string unknown_0108[7];
/* 01B0 */ std::string unknown_01B0[7];

View file

@ -6,7 +6,6 @@
class UIBitmapButton;
class UIReplayListBox;
class UIStaticText;
struct UIListBoxContext;
class UISelectReplayDataWnd : public UIFrameWnd {
public:
@ -24,7 +23,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
};
#endif

View file

@ -12,7 +12,7 @@
// OFFSET: 0x0094CA20
// FUNCTION: fn_12899
void UIShowWarpWnd::Slot15(int width, int height) {
auto* list = new UIListBox(*this->m_context, *this->m_listContext);
auto* list = new UIListBox(*this->m_context);
this->m_list = list;
width -= 0x18;
height -= 0x32;
@ -83,6 +83,6 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument
// OFFSET: 0x009470C0
// FUNCTION: fn_12858
UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, WindowResponseRecorder& recorder)
: UIFrameWnd(windows, 0), m_listContext(&lists), m_recorder(&recorder) {
UIShowWarpWnd::UIShowWarpWnd(UIWindowContext& windows, WindowResponseRecorder& recorder)
: UIFrameWnd(windows, 0), m_recorder(&recorder) {
}

View file

@ -4,12 +4,11 @@
#include "UI/Window/UIFrameWnd.h"
struct WindowResponseRecorder;
struct UIListBoxContext;
class UIListBox;
class UIShowWarpWnd : public UIFrameWnd {
public:
UIShowWarpWnd(UIWindowContext& windows, UIListBoxContext& lists, WindowResponseRecorder& recorder);
UIShowWarpWnd(UIWindowContext& windows, WindowResponseRecorder& recorder);
void Slot15(int width, int height) override;
void Paint() override;
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
@ -18,7 +17,7 @@ public:
protected:
void* unknown_controls;
UIListBoxContext* m_listContext;
void* unknown_listContext;
WindowResponseRecorder* m_recorder;
};

View file

@ -1959,7 +1959,7 @@ bool UIWindow::FitSprite(const ActionFrame* frame, const CSprRes* sprite, int wi
// OFFSET: 0x005C27E0
// FUNCTION: fn_03535
UIListBox_NaviSearch::UIListBox_NaviSearch(UIWindowContext& windows, UIListBoxContext& list) : UIListBox(windows, list) {
UIListBox_NaviSearch::UIListBox_NaviSearch(UIWindowContext& windows) : UIListBox(windows) {
}
// OFFSET: 0x005C3340
@ -2382,7 +2382,7 @@ void UINavigationV4Wnd::Slot15(int, int) {
roadListButton->SetTooltip(LookupMessage(0x0C85));
this->AddChild(roadListButton);
UIListBox_NaviSearch* roadList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext);
UIListBox_NaviSearch* roadList = new UIListBox_NaviSearch(*this->m_context);
this->unknown_00EC = roadList;
roadList->SetSize(138, 244);
roadList->backgroundRed = 255;
@ -2391,7 +2391,7 @@ void UINavigationV4Wnd::Slot15(int, int) {
roadList->SetId(336);
this->AddChild(roadList);
UIListBox_NaviSearch* searchList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext);
UIListBox_NaviSearch* searchList = new UIListBox_NaviSearch(*this->m_context);
this->unknown_00F0 = searchList;
searchList->SetSize(132, 80);
searchList->backgroundRed = 240;
@ -3019,7 +3019,7 @@ int UINavigationroadiconWnd::SendMsg(UIWindow*, int message, std::intptr_t a, st
// FUNCTION: fn_03580
void UINavigationRuideWnd::Slot15(int width, int) {
this->AddCloseButton(LookupMessage(3045), 0);
this->routeList = new UIListBox_NaviSearch(*this->m_context, *this->m_listContext);
this->routeList = new UIListBox_NaviSearch(*this->m_context);
this->routeList->SetSize(width - 4, 293);
this->routeList->backgroundRed = 255;
this->routeList->backgroundGreen = 255;

View file

@ -16,7 +16,6 @@
struct LayoutWindowContexts {
UIWindowContext& windows;
UIEntryQueueContext& entryQueue;
UIListBoxContext& listBox;
QuickSlotPainting& quickSlots;
};
@ -48,7 +47,7 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) {
this->unknown_0404 = window;
break;
case 0x9D:
window = new UIEntryQueueWnd(contexts.windows, contexts.entryQueue, contexts.listBox);
window = new UIEntryQueueWnd(contexts.windows, contexts.entryQueue);
break;
case 0x9F:
window = new UIQuickSlotWnd(contexts.windows, contexts.quickSlots);