From 0029665586bf81caf2deea164844ed6b8f3aa16e Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Mon, 2 Nov 2026 16:03:53 +0000 Subject: [PATCH] Maintenance: Stage 0 resubmit (identical to #10090; that and #10084 failed only on Source/Client/Session.cpp with an empty log, consi Batch #10096 by ragnarok-clanker: forced by an admin (72 lower score(s), 364 changed function(s)); checked with 394 compiled unit(s), including every includer of Source/UI/Window/UIWindow.h. --- Source/Contents/CashEmotionMgr.cpp | 2 +- Source/Contents/Messenger/MessengerMember.cpp | 36 ++-- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 196 +++++++++--------- Source/UI/Buttons/UIBasicButton.cpp | 10 +- Source/UI/Buttons/UIBmpTextButton.cpp | 4 +- Source/UI/Buttons/UIButton.cpp | 2 +- Source/UI/Buttons/UICheckBox.cpp | 6 +- Source/UI/Buttons/UIColorButton.cpp | 13 +- Source/UI/Buttons/UIRadioBtn.cpp | 7 +- Source/UI/Buttons/UITextButton.cpp | 114 +++++----- Source/UI/CashShop/UICashShopWnd.cpp | 22 +- Source/UI/Chat/UISubChatHisWnd.cpp | 4 +- Source/UI/Clan/UIClanWnd.cpp | 24 +-- Source/UI/Dialogs/UIEditctrlWnd.cpp | 4 +- Source/UI/Edit/UICandidateWnd.cpp | 26 +-- Source/UI/Edit/UIEditBoxEx.cpp | 40 ++-- Source/UI/Edit/UIEditCtrl.cpp | 192 ++++++++--------- Source/UI/Edit/UIEditCtrl3.cpp | 4 +- Source/UI/Edit/UIEditLinks.cpp | 2 +- Source/UI/Edit/UIEditVariants.cpp | 22 +- Source/UI/Emotion/UIEmotionWnd.cpp | 2 +- Source/UI/EntryQueue/UIEntryQueueWnd.cpp | 12 +- Source/UI/Guild/UIAgitWnd.cpp | 4 +- Source/UI/Guild/UIGuildHelperWnd.cpp | 10 +- Source/UI/Guild/UIGuildWnd.cpp | 73 +++---- Source/UI/Guild/UIGuild_Storage_Log.cpp | 16 +- Source/UI/Item/UIMerchantItemLogWnd.cpp | 8 +- Source/UI/Item/UIParaItemShopWnd.cpp | 8 +- Source/UI/Items/MergeItemWnd.cpp | 2 +- Source/UI/Items/UIIllustWnd.cpp | 4 +- Source/UI/Items/UIItemRepairWnd.cpp | 4 +- Source/UI/Items/UIMakeTargetListWnd.cpp | 2 +- Source/UI/Items/UIMakeTargetProcessWnd.cpp | 4 +- Source/UI/Items/UIWeaponRefineWnd.cpp | 2 +- Source/UI/Lists/UIChatHisBox.cpp | 6 +- Source/UI/Lists/UIComboBoxDefWnd.cpp | 14 +- Source/UI/Lists/UIComboBoxEx.cpp | 4 +- Source/UI/Lists/UIListBox.cpp | 6 +- Source/UI/Lists/UIListBoxEx.cpp | 2 +- Source/UI/Lists/UIScrollBar.cpp | 67 +++--- Source/UI/Lists/UITagListBox.cpp | 4 +- Source/UI/Party/UIAdvenPartyBoardWnd.cpp | 12 +- Source/UI/Party/UIApplyForPartyWnd.cpp | 8 +- Source/UI/Party/UIMiniPartyWnd.cpp | 3 +- Source/UI/Party/UIPartyInfoWnd.cpp | 2 +- Source/UI/Party/UIRegisterPartyWnd.cpp | 8 +- Source/UI/Party/UIRequestJoinPartyWnd.cpp | 8 +- Source/UI/Quest/UIQuestDisplay.cpp | 4 +- Source/UI/Quest/UIRenewQuestWnd.cpp | 14 +- Source/UI/Rodex/UIRodexComposeWnd.cpp | 14 +- Source/UI/Rodex/UIRodexInboxWnd.cpp | 18 +- Source/UI/RuneSystem/UIRuneSystemWnd.cpp | 114 +++++----- Source/UI/Shop/ItemDrawing.cpp | 24 +-- Source/UI/Shortcuts/ShortcutCooldowns.cpp | 60 +++--- Source/UI/Shortcuts/ShortcutPainting.cpp | 2 +- Source/UI/Shortcuts/UIShortCutWnd.cpp | 12 +- Source/UI/StylingShop/UIStylingShopWnd.cpp | 18 +- Source/UI/Text/NavigationLink.cpp | 10 +- Source/UI/Text/UIAchWnd.cpp | 50 +++-- Source/UI/Text/UIBalloonText.cpp | 10 +- Source/UI/Text/UICharInfoBalloonText.cpp | 2 +- Source/UI/Text/UIStaticText.cpp | 57 +++-- Source/UI/Text/UITextViewerLinks.cpp | 14 +- Source/UI/Text/UITransBalloonText.cpp | 6 +- Source/UI/UIBarGraph.cpp | 3 +- Source/UI/UIBartermarketWnd.cpp | 8 +- Source/UI/UIBroadcastBalloon.cpp | 4 +- Source/UI/UICaptchaRegisterWnd.cpp | 2 +- Source/UI/UIChangeMaterialWnd.cpp | 14 +- Source/UI/UIHotkeyGuideWnd.cpp | 12 +- Source/UI/UIItemReformWnd.cpp | 15 +- Source/UI/UILapineScrollBar.cpp | 4 +- Source/UI/UILapineUpgradeBoxWnd.cpp | 4 +- Source/UI/UIMacroBlackListCheckWnd.cpp | 2 +- Source/UI/UIMacroUserInfoWnd.cpp | 14 +- Source/UI/UIPreviewEquipWnd.cpp | 8 +- Source/UI/UIRefiningWnd.cpp | 58 +++--- Source/UI/UIReputeWnd.cpp | 11 +- Source/UI/UIRoundBoxTooltipWnd.cpp | 4 +- Source/UI/Window/UIAccountLimitedToolWnd.cpp | 40 ++-- Source/UI/Window/UIBasicInfoWnd.cpp | 84 ++++---- Source/UI/Window/UIBattleMsgOptionWnd.cpp | 4 +- Source/UI/Window/UIControl.cpp | 63 +++--- Source/UI/Window/UIDebuffRemoveWnd.cpp | 2 +- Source/UI/Window/UIEscOptionWnd.cpp | 2 +- Source/UI/Window/UIFrameWnd.cpp | 2 +- Source/UI/Window/UIHotKeyWnd.cpp | 14 +- Source/UI/Window/UIJobListWnd.cpp | 2 +- Source/UI/Window/UIMessageBox.cpp | 178 ++++++++-------- Source/UI/Window/UIMileageWnd.cpp | 4 +- Source/UI/Window/UINavigationHelpWnd.cpp | 2 +- Source/UI/Window/UINavigationWnd.cpp | 14 +- Source/UI/Window/UINewMakeCharWnd.cpp | 2 +- Source/UI/Window/UINewSelectCharWnd.cpp | 20 +- Source/UI/Window/UINewSkillListWnd.cpp | 39 ++-- Source/UI/Window/UINormalMB.cpp | 2 +- Source/UI/Window/UIPartyBookingHelpWnd.cpp | 2 +- Source/UI/Window/UIPetEvolutionWnd.cpp | 9 +- Source/UI/Window/UIRoMapWnd.cpp | 26 +-- Source/UI/Window/UIRodexContentsWnd.cpp | 8 +- Source/UI/Window/UIRoulletteWnd.cpp | 2 +- Source/UI/Window/UISelCharForUServerWnd.cpp | 2 +- Source/UI/Window/UISerachStoreInfoWnd.cpp | 2 +- Source/UI/Window/UITransMenuWnd.cpp | 2 +- Source/UI/Window/UIVideoWnd.cpp | 7 +- Source/UI/Window/UIViewCameraInfoWnd.cpp | 6 +- Source/UI/Window/UIWindow.cpp | 60 +++--- Source/UI/Window/UIWindow.h | 20 +- Source/UI/WindowOverlay.cpp | 2 +- Source/UI/WindowTitlebar.cpp | 12 +- 110 files changed, 1065 insertions(+), 1186 deletions(-) diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index f852b854..0fe8f663 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -2283,7 +2283,7 @@ void UICashEmotionListWnd::Slot15(int width, int height) { void UICashEmotionListWnd::Paint() { this->ClearSurface(0xFFFF00FF); const int width = this->geometry.width - 30; - const int top = this->DrawTitleBarAt(this->m_controls->fonts, this->m_controls->locale, 29, width, false, LookupMessage(542)); + const int top = this->DrawTitleBarAt(29, width, false, LookupMessage(542)); this->DrawPanelBackgroundAt(29, top, width, nullptr); DrawRectangleBorder(*this, 60, 22, 161, 18, 0xB5B5B5); this->FillRegion(29, 46, width, 1, 0xCECECE); diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index 729cb0fd..e8eceb0e 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -524,7 +524,7 @@ void UIFriendOptionWnd::Slot15(int, int) { auto& controls = this->m_options->buttons; const char* label = controls.services.MessageText(361); - int width = std::min(this->TextWidth(controls.fonts, controls.locale, label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); + 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->SetSize(width, 12); this->option0Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(361)); @@ -533,7 +533,7 @@ void UIFriendOptionWnd::Slot15(int, int) { this->AddChild(this->option0Box); label = controls.services.MessageText(359); - width = std::min(this->TextWidth(controls.fonts, controls.locale, label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); + 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->SetSize(width, 12); this->option2Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(359)); @@ -542,7 +542,7 @@ void UIFriendOptionWnd::Slot15(int, int) { this->AddChild(this->option2Box); label = controls.services.MessageText(362); - width = std::min(this->TextWidth(controls.fonts, controls.locale, label, 0, 0, 12, 0, 0) + 12, this->geometry.width - 15); + 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->SetSize(width, 12); this->option1Box->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", controls.services.MessageText(362)); @@ -558,7 +558,7 @@ void UIFriendOptionWnd::Slot15(int, int) { void UIFriendOptionWnd::Paint() { auto& controls = this->m_options->buttons; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(355), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(355), 0); this->DrawPanelBackground(titleHeight, 0, ""); const int barHeight = this->DrawButtonBar(0, 0, 1); this->FillRegion(0, this->geometry.height - barHeight, this->geometry.width, 1, 0xC0C0C0); @@ -839,7 +839,7 @@ void UIMessengerGroupWnd::Slot15(int, int) { this->mode = 1; const char* tabLabels[2] = {LookupMessage(0x66), LookupMessage(0x67)}; - int tabWidths[2] = {48, this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0x67), 0, 0, 12, 0, 0) + 13}; + 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); @@ -946,7 +946,7 @@ void UIMessengerGroupWnd::Slot15(int, int) { // OFFSET: 0x0073B9D0 // FUNCTION: fn_07707 void UIMessengerGroupWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned 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)); @@ -1036,14 +1036,12 @@ void UIMessengerGroupWnd::Paint() { } else { levelColor = 0x493A37; } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, x + 28, this->iconPositions[this->iconIndex].y + top + 3, level, + this->DrawTextAt(x + 28, this->iconPositions[this->iconIndex].y + top + 3, level, static_cast(strlen(level)), 0, 12, levelColor, 1, 0 ); const int textY = this->iconPositions[this->iconIndex].y + top + 3; - const int levelWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, level, static_cast(strlen(level)), 0, 12, 1, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, levelWidth + x + 33, textY, clipped.c_str(), static_cast(clipped.size()), 0, 12, color, + const int levelWidth = this->TextWidth(level, static_cast(strlen(level)), 0, 12, 1, 0); + this->DrawTextAt(levelWidth + x + 33, textY, clipped.c_str(), static_cast(clipped.size()), 0, 12, color, 1, 0 ); @@ -1052,8 +1050,7 @@ void UIMessengerGroupWnd::Paint() { if (gauge->geometry.x != -100) { char hpText[128]; sprintf(hpText, "%d/%d", gauge->current, gauge->maximum); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->gauges[index]->geometry.x + 66, this->gauges[index]->geometry.y - 2, hpText, + this->DrawTextAt(this->gauges[index]->geometry.x + 66, this->gauges[index]->geometry.y - 2, hpText, static_cast(strlen(hpText)), 0, 10, 0, 0, 0 ); } @@ -1078,15 +1075,13 @@ void UIMessengerGroupWnd::Paint() { memset(path, 0, sizeof(path)); sprintf(path, "%sbg_partymember.bmp", prefix.c_str()); const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve(path))); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->geometry.width - 96, this->geometry.height - 16, LookupMessage(3231), 0, 0, 12, 0, 0, 0 + this->DrawTextAt(this->geometry.width - 96, this->geometry.height - 16, LookupMessage(3231), 0, 0, 12, 0, 0, 0 ); this->DrawBitmap(this->geometry.width - 58, this->geometry.height - 18, &background->image, true); memset(path, 0, sizeof(path)); sprintf(path, "%d/%d", ClientMessenger{g_session.m_partyMembers, g_session.m_friends}.PartyCount(), 12); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->geometry.width - 51, this->geometry.height - 16, path, + this->DrawTextAt(this->geometry.width - 51, this->geometry.height - 16, path, static_cast(strlen(path)), 0, 12, 0xFFFFFF, 0, 0 ); } else { @@ -1115,13 +1110,12 @@ void UIMessengerGroupWnd::Paint() { unsigned selectRed, selectGreen, selectBlue; SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, selectRed, selectGreen, selectBlue); this->FillRegion( - x + 17, top + 4, this->TextWidth(this->m_context->fonts, this->m_context->locale, nameText, 0, 0, 12, 0, 0) + 3, 16, + x + 17, top + 4, this->TextWidth(nameText, 0, 0, 12, 0, 0) + 3, 16, RGB(selectRed, selectGreen, selectBlue) ); } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, x + 19, top + 6, nameText, static_cast(strlen(nameText)), 0, 12, color, 0, 0 + this->DrawTextAt(x + 19, top + 6, nameText, static_cast(strlen(nameText)), 0, 12, color, 0, 0 ); if (it->offline == 0) { @@ -1294,7 +1288,7 @@ void UIMessengerGroupWnd::Slot28(int x, int y) { if (fitted.find(text, 0, std::strlen(text)) == std::string::npos) { char level[64]; std::sprintf(level, "Lv.%d", member.level); - int tipX = this->TextWidth(this->m_context->fonts, this->m_context->locale, level, std::strlen(level), 0, 12, 1, 0) + + int tipX = this->TextWidth(level, std::strlen(level), 0, 12, 1, 0) + this->iconPositions[this->iconIndex].x + 33; int tipY = this->selected / this->columns * this->rowHeight + 22; this->ToScreen(tipX, tipY); diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 5e7d07d5..8f1b62f8 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -500,7 +500,7 @@ void UIDisconnectedServerMsgWnd::Paint() { void UIEmailAddressWnd::Paint() { auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 15, 6, controls.services.MessageText(g_serviceType == 0 ? 1815 : 299), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 6, controls.services.MessageText(g_serviceType == 0 ? 1815 : 299), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008ED240 @@ -515,11 +515,11 @@ void UIEquipWnd::Paint() { if (this->m_viewOther == 1) { char title[100]; std::sprintf(title, LookupMessage(1361), reinterpret_cast(&g_session.unknown_5974[0x2C])); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 17, 4, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 16, 3, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, title, 0, 0, 12, 0, 0, 0); } else { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 17, 4, LookupMessage(104), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 16, 3, LookupMessage(104), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, LookupMessage(104), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, LookupMessage(104), 0, 0, 12, 0, 0, 0); } if (this->geometry.height == 17) { @@ -604,11 +604,11 @@ void UIEquipWnd::Paint() { // FUNCTION: fn_12223 void UIGraffiStrboxWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(controls.fonts, controls.locale, 17, 23, controls.services.MessageText(436), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 22, controls.services.MessageText(436), 0, 0, 12, 0, 0, 0); + 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); } // OFFSET: 0x008EE9D0 @@ -629,20 +629,20 @@ void UIItemParamChangeDisplayWnd::Paint() { this->DrawBorder(0, 0, 0, 0); std::sprintf(text, controls.services.MessageText(269)); - this->DrawTextAt(controls.fonts, controls.locale, 20, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(20, 10, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%d", this->m_before); - this->DrawTextAt(controls.fonts, controls.locale, 70, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(70, 10, text, 0, 0, 12, 0, 0, 0); drawArrow(90, this->m_before, this->m_after); std::sprintf(text, "%d", this->m_after); - this->DrawTextAt(controls.fonts, controls.locale, 110, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(110, 10, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, controls.services.MessageText(270)); - this->DrawTextAt(controls.fonts, controls.locale, 152, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(152, 10, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%d", this->m_beforeSecond); - this->DrawTextAt(controls.fonts, controls.locale, 202, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(202, 10, text, 0, 0, 12, 0, 0, 0); drawArrow(222, this->m_beforeSecond, this->m_afterSecond); std::sprintf(text, "%d", this->m_afterSecond); - this->DrawTextAt(controls.fonts, controls.locale, 242, 10, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(242, 10, text, 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008EECD0 @@ -687,7 +687,7 @@ void UIMenuWnd::Paint() { if (index == this->m_selected) { this->FillRegion(3, this->m_itemHeight / 2 * row + 1, this->geometry.width - 6, this->m_itemHeight - 2, RGB(red, green, blue)); } - this->DrawTextAt(controls.fonts, controls.locale, 3, this->m_itemHeight * row / 2 + 1, item.c_str(), 0, 0, 12, this->m_colors[index], 0, 0); + this->DrawTextAt(3, this->m_itemHeight * row / 2 + 1, item.c_str(), 0, 0, 12, this->m_colors[index], 0, 0); } } @@ -700,8 +700,8 @@ void UIMinimapZoomWnd::Paint() { int row = 0; static_cast(g_modeMgr.GetGameMode())->PlayerCell(&column, &row); const std::string text = FormatOwnedString(" %d %d", column, row); - this->DrawTextAt(controls.fonts, controls.locale, 19, 128, text.c_str(), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 20, 128, text.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(19, 128, text.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(20, 128, text.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); } // OFFSET: 0x008E3340 @@ -832,7 +832,7 @@ void UIMinimapZoomWnd::AddTownButton(int index, TownInfo town) { // FUNCTION: fn_12232 void UIMonsterDisplayWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned 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)); @@ -932,7 +932,7 @@ void UINotifyQuestWnd::Paint() { void UINpcEditDialogWnd::Paint() { auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 15, 6, g_serviceType == 12 ? "Insira o Numero" : "Input number ", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 6, g_serviceType == 12 ? "Insira o Numero" : "Input number ", 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008EF850 @@ -1077,28 +1077,28 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_12239 void UIPartyInvitationToWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, controls.services.MessageText(2056), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(2056), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(controls.fonts, controls.locale, 10, 22, controls.services.MessageText(2058), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, controls.services.MessageText(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(controls.fonts, controls.locale, true, controls.services.MessageText(this->m_mode == 50 ? 2054 : 291), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(this->m_mode == 50 ? 2054 : 291), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); if (this->m_mode == 70) { - this->DrawTextAt(controls.fonts, controls.locale, 10, 22, controls.services.MessageText(292), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, controls.services.MessageText(292), 0, 0, 12, 0, 0, 0); } else if (this->m_mode == 50) { - this->DrawTextAt(controls.fonts, controls.locale, 10, 22, controls.services.MessageText(2057), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 22, controls.services.MessageText(2057), 0, 0, 12, 0, 0, 0); } - this->DrawTextAt(controls.fonts, controls.locale, 10, this->m_mode + 82, controls.services.MessageText(738), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 10, this->m_mode + 17, controls.services.MessageText(293), 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); } // OFFSET: 0x008EFAF0 @@ -1262,7 +1262,7 @@ void UIProhibitListWnd::Paint() { auto& controls = *this->m_controls; char text[256]; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, controls.services.MessageText(714), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(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); @@ -1279,9 +1279,9 @@ void UIProhibitListWnd::Paint() { if (y == 0) { std::sprintf(text, "AID : %d CharacterName : %s", entry.aid, entry.name); - this->DrawTextAt(controls.fonts, controls.locale, 10, 25, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 25, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "ServerName : %s", g_session.m_prohibitionLog[index].ownerName); - this->DrawTextAt(controls.fonts, controls.locale, 10, 41, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 41, text, 0, 0, 12, 0, 0, 0); } const ProhibitionLogEntry& record = g_session.m_prohibitionLog[index]; @@ -1291,7 +1291,7 @@ void UIProhibitListWnd::Paint() { text, "ProhibitTime : %d분 LogTime : %d년 %d월 %d일 %d시 %d분 %d초", record.minutes, date >> 16 & 0xFFFF, date >> 8 & 0xFF, date & 0xFF, time >> 16 & 0xFF, time >> 8 & 0xFF, time & 0xFF ); - this->DrawTextAt(controls.fonts, controls.locale, 10, y + 65, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, y + 65, text, 0, 0, 12, 0, 0, 0); y += 18; } } @@ -1320,7 +1320,7 @@ void UISayDialogWnd::Paint() { // FUNCTION: fn_12249 void UISelectCartWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, controls.services.MessageText(659), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(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); @@ -1348,7 +1348,7 @@ void UISkillDescribeWnd::Paint() { void UISkillNameChangeWnd::Paint() { auto& controls = *this->m_controls; this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 15, 6, this->m_name.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 6, this->m_name.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x00905320 @@ -1443,7 +1443,7 @@ UISpellListWnd::~UISpellListWnd() { void UISpellListWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, controls.services.MessageText(697), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(697), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1468,7 +1468,7 @@ void UISpellListWnd::Paint() { char path[256]; g_session.ItemBitmapPath(skill.IdName(*g_session.m_hotkeyScript), path); this->DrawBitmap(8, y, &static_cast(ResourceMgr::Instance().Load(Resolve(path)))->image, true); - this->DrawTextAt(controls.fonts, controls.locale, 40, y + 4, name, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(40, y + 4, name, 0, 0, 12, 0, 0, 0); ++row; if (row == this->m_rows * this->m_columns) { @@ -1487,7 +1487,7 @@ void CSession::ItemBitmapPath(const char* name, char* output) { // FUNCTION: fn_12255 void UITipOfTheDayWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, controls.services.MessageText(174), 0); + this->DrawTitleBar(true, controls.services.MessageText(174), 0); if (this->geometry.height == 17) { return; @@ -1548,7 +1548,7 @@ void UIWhisperWnd::Paint() { DrawRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height, 0xC0C0C0); this->FillRegion(1, this->geometry.height - 20, this->geometry.width - 2, 1, 0xC0C0C0); - this->DrawTextAt(controls.fonts, controls.locale, 10, 3, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(10, 3, title, 0, 0, 12, 0xFFFFFF, 0, 0); } // OFFSET: 0x008F2DE0 @@ -1566,7 +1566,7 @@ void UIItemIdentifyWnd::Slot26(int x, int y) { // OFFSET: 0x008F0750 // FUNCTION: fn_12253 void UIStatusWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(105), 0); + this->DrawTitleBar(true, LookupMessage(105), 0); if (this->geometry.height == this->m_titleHeight || this->geometry.unknown_0030 != 0) { return; } @@ -1587,19 +1587,19 @@ void UIStatusWnd::Paint() { const int* entry = stats[0]; for (int y = 23; y < 119; y += 16, entry += 2) { const int value = entry[0]; - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 36, y, FormatOwnedString("%d", value).c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(36, y, FormatOwnedString("%d", value).c_str(), 0, 1, 14, 0, 0, 0); const int bonus = entry[1]; if (bonus > 0) { if (value < 100) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 49, y, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(49, y, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); } else { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 54, y + 2, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); + this->DrawTextAt(54, y + 2, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); } } else if (bonus < 0) { if (value < 100) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 49, y, FormatOwnedString("%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(49, y, FormatOwnedString("%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); } else { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 54, y + 2, FormatOwnedString("%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); + this->DrawTextAt(54, y + 2, FormatOwnedString("%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); } } } @@ -1637,14 +1637,14 @@ void UIStatusWnd::Paint() { int index = 0; for (int y = 144; y < 240; y += 16, point += 1, ++index) { const int value = g_session.GetTraitStat(types[index]); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 36, y, FormatOwnedString("%d", value).c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(36, y, FormatOwnedString("%d", value).c_str(), 0, 1, 14, 0, 0, 0); this->DrawRightAlignedText(101, y, FormatOwnedString("%lld", *point).c_str(), 0, 1, 14, 0, 0); const int bonus = bonuses[index]; if (bonus > 0) { if (value < 100) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 49, y, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(49, y, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 14, 0, 0, 0); } else { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 54, y + 2, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); + this->DrawTextAt(54, y + 2, FormatOwnedString("+%d", bonus).c_str(), 0, 1, 12, 0, 0, 0); } } } @@ -2174,7 +2174,7 @@ int UIMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp int width = 20; const int count = static_cast(this->m_items.end() - this->m_items.begin()); for (int index = 0; index < count; ++index) { - const int textWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, this->m_items[index].c_str(), 0, 0, 12, 0, 0); + const int textWidth = this->TextWidth(this->m_items[index].c_str(), 0, 0, 12, 0, 0); if (width < textWidth) { width = textWidth; } @@ -3781,8 +3781,8 @@ void UIItemCollectionWnd::Slot15(int width, int height) { this->m_moveInfo->Configure(LookupMessage(2796), 0, 0, 12, 0, 1); this->m_moveInfo->SetId(487); UIItemMoveInfo* moveInfo = this->m_moveInfo; - int textHeight = this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(2796), 0, 0, 12, 0, 0); - moveInfo->ResizeToTextClipped(this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(2796), 0, 0, 12, 0, 0) + 1, textHeight); + int textHeight = this->TextHeight(LookupMessage(2796), 0, 0, 12, 0, 0); + moveInfo->ResizeToTextClipped(this->TextWidth(LookupMessage(2796), 0, 0, 12, 0, 0) + 1, textHeight); this->AddChild(this->m_moveInfo); } @@ -4086,7 +4086,7 @@ void UIProhibitListWnd::Slot15(int, int) { // OFFSET: 0x008EE7F0 // FUNCTION: fn_12226 void UIItemIdentifyWnd::Paint() { - const int titleHeight = this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, false, this->m_title.c_str(), 0); + const int titleHeight = this->DrawTitleBar(false, this->m_title.c_str(), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -4165,7 +4165,7 @@ void UInCashWnd::DrawItems() { const int width = this->DrawFittedItemName(x, -30, &*it, 0, 0, 12, 0); this->DrawWrappedItemName(x - width / 2 + 90, y + 4, width, &*it, 0, 0, 12); int length = std::sprintf(text, LookupMessage(1854)); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x + 112, y + 64, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 112, y + 64, text, length, 0, 12, 0, 0, 0); length = std::sprintf(text, " %s C", FormatGroupedInteger(static_cast(it->unknown_0014[0]), number, 64)); this->DrawRightAlignedText(x + 152, y + 84, text, length, 0, 12, 0, 0); @@ -4195,11 +4195,11 @@ void UInCashWnd::DrawItems() { const int width = this->DrawFittedItemName(453, -30, &*it, 0, 0, 12, 0); this->DrawWrappedItemName(535 - width / 2, y + 4, width, &*it, 0, 0, 12); int length = std::sprintf(text, LookupMessage(1854)); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 565, y + 24, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(565, y + 24, text, length, 0, 12, 0, 0, 0); length = std::sprintf(text, " %s C", FormatGroupedInteger(static_cast(it->unknown_0014[0]), number, 64)); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 550, y + 42, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(550, y + 42, text, length, 0, 12, 0, 0, 0); length = std::sprintf(text, LookupMessage(1855)); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 565, y + 66, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(565, y + 66, text, length, 0, 12, 0, 0, 0); length = std::sprintf(text, " %d %s", it->quantity, LookupMessage(1856)); this->DrawRightAlignedText(590, y + 84, text, length, 0, 12, 0, 0); @@ -4247,7 +4247,7 @@ void UIFrameWnd::FitLastTextLine(int width, unsigned lineCount, int family, int int total = 0; for (auto it = last.begin(); it != last.end(); ++it) { - int segment = this->TextWidth(this->m_context->fonts, this->m_context->locale, it->second.c_str(), it->second.size(), 0, 12, 0, 0); + int segment = this->TextWidth(it->second.c_str(), it->second.size(), 0, 12, 0, 0); total += segment; if (total >= width) { it->second = this->FitDisplayText(width - total + segment, it->second.c_str(), family, height, 0); @@ -4265,7 +4265,7 @@ void UIFrameWnd::DrawTextLines(int x, int y, int family, int lineHeight, const F int left = x; for (auto it = line->begin(); it != line->end(); ++it) { this->DrawShadowedText(left, y, it->second.c_str(), it->second.size(), it->first, 0xE0E0E0, family, 12, 0); - left += this->TextWidth(this->m_context->fonts, this->m_context->locale, it->second.c_str(), it->second.size(), 0, 12, 0, 0); + left += this->TextWidth(it->second.c_str(), it->second.size(), 0, 12, 0, 0); } y += lineHeight; } @@ -4322,13 +4322,13 @@ int UIWindow::DrawItemNameSegments( ) { auto it = breaks.begin(); int offset = 0; - if (this->TextWidth(this->m_context->fonts, this->m_context->locale, text, 0, 0, 12, 0, 0) < width) { + if (this->TextWidth(text, 0, 0, 12, 0, 0) < width) { for (; it != breaks.end(); ++it) { const char* end = *it; int bytes = static_cast(end - text); if (bytes) { this->DrawShadowedText(offset + x, y, text, bytes, text == highlight ? highlightColor : color, 0xE0E0E0, 0, 12, 0); - offset += this->TextWidth(this->m_context->fonts, this->m_context->locale, text, bytes, 0, 12, 0, 0); + offset += this->TextWidth(text, bytes, 0, 12, 0, 0); text = end; } } @@ -4349,8 +4349,8 @@ int UIWindow::DrawItemNameSegments( } int bytes = static_cast(next - cursor); - int nextWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, next, static_cast(std::strlen(next)), 0, 12, 0, 0); - int reach = this->TextWidth(this->m_context->fonts, this->m_context->locale, cursor, bytes, 0, 12, 0, 0) + offset; + int nextWidth = this->TextWidth(next, static_cast(std::strlen(next)), 0, 12, 0, 0); + int reach = this->TextWidth(cursor, bytes, 0, 12, 0, 0) + offset; if (line == 2 && reach >= width - 15 && reach + nextWidth > width) { if (segment == highlight) { this->DrawShadowedText(bytes + offset + x, y, "...", 3, highlightColor, 0xE0E0E0, 0, 12, 0); @@ -4361,7 +4361,7 @@ int UIWindow::DrawItemNameSegments( } this->DrawShadowedText(x + offset, y, cursor, bytes, segment == highlight ? highlightColor : color, 0xE0E0E0, 0, 12, 0); - offset += this->TextWidth(this->m_context->fonts, this->m_context->locale, cursor, bytes, 0, 12, 0, 0); + offset += this->TextWidth(cursor, bytes, 0, 12, 0, 0); if (offset > width) { offset = 0; y += lineHeight + 1; @@ -5156,7 +5156,7 @@ int UILoadingWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: // OFFSET: 0x008CED00 // FUNCTION: fn_12071 int UIItemTagCtrl::MeasureText(const std::string& text, const unsigned& bytes) { - return this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), bytes, 0, 12, 0, 0); + return this->TextWidth(text.c_str(), bytes, 0, 12, 0, 0); } // OFFSET: 0x008E8390 @@ -5291,8 +5291,8 @@ void UIChatRoomMakeWnd::Paint() { this->DrawBitmap(0, 0, titleBar ? &titleBar->image : nullptr, false); auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\chatwin0_bg.bmp"))); this->DrawBitmap(0, 17, background ? &background->image : nullptr, false); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 9, 4, this->m_title.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 8, 3, this->m_title.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(9, 4, this->m_title.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(8, 3, this->m_title.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008F64B0 @@ -5497,7 +5497,7 @@ public: // FUNCTION: fn_12210 void UIAutoMessageWnd::Paint() { this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 15, 6, LookupMessage(0x3B0), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 6, LookupMessage(0x3B0), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008FFC40 @@ -6791,7 +6791,7 @@ int UINotifyItemObtainWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->m_message = text; } - int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, this->m_message.c_str(), 0, 0, 12, 0, 0) + 54; + int width = this->TextWidth(this->m_message.c_str(), 0, 0, 12, 0, 0) + 54; width += width % 28 != 0 ? 28 : 0; if (width < 34) { width = 34; @@ -7405,7 +7405,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "0"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7426,7 +7426,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "1"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7447,7 +7447,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "2"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7468,7 +7468,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "3"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7489,7 +7489,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "4"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7510,7 +7510,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "5"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7531,7 +7531,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "6"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7552,7 +7552,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "7"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7573,7 +7573,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "8"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7594,7 +7594,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::strcat(this->unknown_00E2, "9"); break; } - this->DrawTextAt(g_fontCache, locale, this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_00F0 + 112, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; @@ -7629,12 +7629,12 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ // OFFSET: 0x008ECE60 // FUNCTION: fn_12211 void UIBookWnd::Paint() { - const int titleHeight = this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); char* title = new char[110]; std::sprintf(title, "%s ( %d / %d )", this->m_bookName, this->m_page, this->m_pageCount); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, this->geometry.width / 2 - 72, 2, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->geometry.width / 2 - 72, 2, title, 0, 0, 12, 0, 0, 0); this->FillRegion(1, titleHeight, this->geometry.width - 2, this->geometry.height - 18, RGB(this->m_red, this->m_green, this->m_blue)); this->m_viewer->backgroundColor = 0xFF000000u | RGB(this->m_red, this->m_green, this->m_blue); @@ -7645,7 +7645,7 @@ void UIBookWnd::Paint() { // FUNCTION: fn_12212 void UICardItemIllustWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + 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); } @@ -8034,7 +8034,7 @@ int UICardItemIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, // OFFSET: 0x008EFFF0 // FUNCTION: fn_12248 void UISecondPasswordInputWnd::Paint() { - const int titleHeight = this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(1899), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(1899), 0); this->DrawPanelBackground(titleHeight, 540, "유저인터페이스\\basic_interface\\2ndpassword_bg.bmp"); this->DrawButtonBar(2, 0, 1); @@ -8077,13 +8077,13 @@ void UISecondPasswordInputWnd::Paint() { } for (std::size_t index = 0, x = 416; index < std::strlen(this->unknown_00D0); ++index, x += 5) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, static_cast(x), this->unknown_00FC, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(static_cast(x), this->unknown_00FC, "*", 0, 0, 12, 0, 0, 0); } for (std::size_t index = 0, x = 416; index < std::strlen(this->unknown_00D9); ++index, x += 5) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, static_cast(x), this->unknown_0100, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(static_cast(x), this->unknown_0100, "*", 0, 0, 12, 0, 0, 0); } for (std::size_t index = 0, x = 416; index < std::strlen(this->unknown_00E2); ++index, x += 5) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, static_cast(x), this->unknown_0104, "*", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(static_cast(x), this->unknown_0104, "*", 0, 0, 12, 0, 0, 0); } } @@ -8109,11 +8109,11 @@ void UInCashWnd::Paint() { length = std::sprintf(text, LookupMessage(1858), FormatGroupedInteger(this->m_pointBalance, number, sizeof(number))); this->DrawShadowedText(74, this->geometry.height - 17, text, length, 0, 0xFFFFFF, 0, 12, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 260, this->geometry.height - 36, LookupMessage(1306), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 427, this->geometry.height - 36, "C", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(260, this->geometry.height - 36, LookupMessage(1306), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(427, this->geometry.height - 36, "C", 0, 0, 12, 0, 0, 0); length = std::sprintf(text, "Total : %s", FormatGroupedInteger(this->m_totalPrice, number, sizeof(number))); this->DrawShadowedText(260, this->geometry.height - 17, text, length, 0, 0xFFFFFF, 0, 12, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 427, this->geometry.height - 17, "C", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(427, this->geometry.height - 17, "C", 0, 0, 12, 0, 0, 0); this->DrawItems(); } @@ -8214,7 +8214,7 @@ void UIItemCollectionWnd::Paint() { this->DrawCenteredText(0, bottom + offset, line->c_str(), this->geometry.width, 0, 12, 0xFF, 0); break; } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 12, bottom + offset, line->c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(12, bottom + offset, line->c_str(), 0, 0, 12, 0, 0, 0); ++line; if (line == card->second.end()) { break; @@ -9011,7 +9011,7 @@ int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std // FUNCTION: fn_12256 void UITipboxWnd::Paint() { this->ClearSurface(0xFFFF00FF); - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(0xCA6), 0); + this->DrawTitleBar(true, LookupMessage(0xCA6), 0); const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\tipbox\\TipboxBG.bmp"))); this->DrawBitmap(0, 17, background ? &background->image : nullptr, false); @@ -9106,7 +9106,7 @@ void UITipOfTheDayWnd::Slot15(int width, int height) { this->m_showTipsAtStartup = g_window315Enabled; UICheckBox* checkBox = new UICheckBox(*this->m_context, *this->m_controls); - checkBox->SetSize(this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(176), 0, 0, 12, 0, 0) + 12, 12); + 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); checkBox->SetChecked(this->m_showTipsAtStartup); @@ -9129,7 +9129,7 @@ void UITipOfTheDayWnd::Slot15(int width, int height) { // OFFSET: 0x008F1430 // FUNCTION: fn_12254 void UIStorePasswordInputWnd::Paint() { - const int titleHeight = this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(1017), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(1017), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -9572,7 +9572,7 @@ int UIFrameWnd::BuildItemName( // OFFSET: 0x008D9420 // FUNCTION: fn_12133 bool UIItemCollectionWnd::WrapText(std::string text, int width, std::list& lines) { - if (this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), 0, 0, 12, 0, 0) <= width) { + if (this->TextWidth(text.c_str(), 0, 0, 12, 0, 0) <= width) { lines.push_back(text); return false; } @@ -9586,14 +9586,14 @@ bool UIItemCollectionWnd::WrapText(std::string text, int width, std::listTextWidth(this->m_context->fonts, this->m_context->locale, candidate.c_str(), 0, 0, 12, 0, 0) > width) { + if (this->TextWidth(candidate.c_str(), 0, 0, 12, 0, 0) > width) { lines.emplace_back(start, cursor); start = cursor; } cursor += 2; } else { const std::string candidate(start, cursor + 1); - if (this->TextWidth(this->m_context->fonts, this->m_context->locale, candidate.c_str(), 0, 0, 12, 0, 0) > width) { + if (this->TextWidth(candidate.c_str(), 0, 0, 12, 0, 0) > width) { lines.emplace_back(start, cursor); start = cursor; } @@ -9979,7 +9979,7 @@ void UIFrameWnd::DrawItemNameText( do { next = CharNextExA(static_cast(g_textCodePage), next, 0); length = static_cast(next - lineStart); - measured = this->TextWidth(this->m_context->fonts, this->m_context->locale, begin, length, 0, 12, 0, 0); + measured = this->TextWidth(begin, length, 0, 12, 0, 0); if (measured + lineWidth > width) { line->push_back(std::make_pair(segment->first, segment->second.substr(offset, length))); ++line; @@ -9999,7 +9999,7 @@ void UIFrameWnd::DrawItemNameText( } } - if (this->TextWidth(this->m_context->fonts, this->m_context->locale, text, std::strlen(text), position->family, position->height, 0, 0) > width * 2) { + if (this->TextWidth(text, std::strlen(text), position->family, position->height, 0, 0) > width * 2) { this->FitLastTextLine(width, 2, position->family, position->height, lines); } @@ -10087,8 +10087,8 @@ void UIExchangeWnd::Paint() { char title[128]; std::sprintf(title, "%s : ", LookupMessage(0xCE)); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 13, 4, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 12, 3, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(13, 4, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(12, 3, title, 0, 0, 12, 0, 0, 0); char partner[128]; if (this->unknown_0108 < 1) { std::sprintf(partner, "%s", this->unknown_00F0.c_str()); @@ -10098,8 +10098,8 @@ void UIExchangeWnd::Paint() { const std::string identifier = ShortcutFilename(this->unknown_0108); std::sprintf(partner, "%s Lv%d (%s)", this->unknown_00F0.c_str(), this->unknown_010C, identifier.c_str()); } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 63, 4, partner, 0, 0, 12, 0xB4B4B4, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 62, 3, partner, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(63, 4, partner, 0, 0, 12, 0xB4B4B4, 0, 0); + this->DrawTextAt(62, 3, partner, 0, 0, 12, 0, 0, 0); const std::string prefix = "유저인터페이스\\btn_"; const char* buttons[2] = {"ok", "exchange"}; diff --git a/Source/UI/Buttons/UIBasicButton.cpp b/Source/UI/Buttons/UIBasicButton.cpp index d5400f6c..6ab205d3 100644 --- a/Source/UI/Buttons/UIBasicButton.cpp +++ b/Source/UI/Buttons/UIBasicButton.cpp @@ -31,7 +31,7 @@ bool UIBasicButton::Configure(int width, const char* value) { this->Resize(width, this->geometry.height); this->text = value; - if (width < this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, value, 0, 0, 12, 0, 0)) { + if (width < this->TextWidth(value, 0, 0, 12, 0, 0)) { return false; } @@ -60,7 +60,7 @@ void UIBasicButton::Paint() { } drawBitmap("_right.bmp", (this->geometry.width - 6)); - const int width = this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->text.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->text.c_str(), 0, 0, 12, 0, 0); int height; { @@ -73,11 +73,9 @@ void UIBasicButton::Paint() { const int y = (this->geometry.height - height) / 2; const bool pressed = state == 2 || state == 3; const unsigned shadow = state == 0 ? 0xD7D7D7u : state == 1 ? 0xC7A796u : state == 2 ? 0xFFFFFFu : 0xE2E2E2u; - this->DrawTextAt( - this->m_buttonContext->fonts, this->m_buttonContext->locale, (x + (pressed ? 0 : 1)), (y + (pressed ? 0 : 1)), this->text.c_str(), 0, 0, 12, shadow, 0, 0 + this->DrawTextAt((x + (pressed ? 0 : 1)), (y + (pressed ? 0 : 1)), this->text.c_str(), 0, 0, 12, shadow, 0, 0 ); - this->DrawTextAt( - this->m_buttonContext->fonts, this->m_buttonContext->locale, (x + (pressed ? 1 : 0)), (y + (pressed ? 1 : 0)), this->text.c_str(), 0, 0, 12, + this->DrawTextAt((x + (pressed ? 1 : 0)), (y + (pressed ? 1 : 0)), this->text.c_str(), 0, 0, 12, state == 3 ? 0x6F6F6Fu : 0, 0, 0 ); } diff --git a/Source/UI/Buttons/UIBmpTextButton.cpp b/Source/UI/Buttons/UIBmpTextButton.cpp index 16628548..93885958 100644 --- a/Source/UI/Buttons/UIBmpTextButton.cpp +++ b/Source/UI/Buttons/UIBmpTextButton.cpp @@ -44,7 +44,7 @@ void UIBmpTextButton::Paint() { if (!this->text.empty()) { const auto draw = [&](int x, int y, int height, unsigned color, unsigned char bold) { - this->DrawTextAt(this->m_buttonContext->fonts, this->m_buttonContext->locale, x, y, this->text.c_str(), 0, 0, height, color, bold, 0); + this->DrawTextAt(x, y, this->text.c_str(), 0, 0, height, color, bold, 0); }; if (style) { @@ -58,7 +58,7 @@ void UIBmpTextButton::Paint() { const int pressedOffset = disabled || state == 2 ? 1 : 0; draw((style->x + pressedOffset), (style->y + pressedOffset), style->height, style->color, style->bold); } else { - const int width = this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->text.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->text.c_str(), 0, 0, 12, 0, 0); int height; { diff --git a/Source/UI/Buttons/UIButton.cpp b/Source/UI/Buttons/UIButton.cpp index 37690782..d4ef8743 100644 --- a/Source/UI/Buttons/UIButton.cpp +++ b/Source/UI/Buttons/UIButton.cpp @@ -48,7 +48,7 @@ void UIButton::Paint() { } this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); - this->DrawTextAt(this->m_buttonContext->fonts, this->m_buttonContext->locale, 0, 0, this->label.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(0, 0, this->label.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0085EB20 diff --git a/Source/UI/Buttons/UICheckBox.cpp b/Source/UI/Buttons/UICheckBox.cpp index 1e98f9d0..88626060 100644 --- a/Source/UI/Buttons/UICheckBox.cpp +++ b/Source/UI/Buttons/UICheckBox.cpp @@ -46,7 +46,7 @@ void UICheckBox::Paint() { } if (!this->m_text.empty()) { - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, (width + 3), 0, this->m_text.c_str(), 0, 0, this->m_fontHeight, this->m_color, 0, 0); + this->DrawTextAt((width + 3), 0, this->m_text.c_str(), 0, 0, this->m_fontHeight, this->m_color, 0, 0); } } @@ -138,7 +138,7 @@ void UICheckBox::SetImages(const char* checked, const char* unchecked, const cha this->m_text = text ? text : ""; if (!this->m_text.empty()) { - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->m_text.c_str(), 0, 0, 12, 0, 0); + 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())); @@ -180,7 +180,7 @@ void UICheckBox::FitToText() { return; } - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->m_text.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->m_text.c_str(), 0, 0, 12, 0, 0); CBitmapRes* bitmap = nullptr; switch (this->geometry.unknown_0030) { case 0: diff --git a/Source/UI/Buttons/UIColorButton.cpp b/Source/UI/Buttons/UIColorButton.cpp index 470c37a7..c71075c7 100644 --- a/Source/UI/Buttons/UIColorButton.cpp +++ b/Source/UI/Buttons/UIColorButton.cpp @@ -6,7 +6,7 @@ // FUNCTION: fn_10804 void UIColorButton::Paint() { UIButtonContext& controls = *this->m_buttonContext; - const int textWidth = this->TextWidth(controls.fonts, controls.locale, this->label.c_str(), 0, 0, 12, 0, 0); + 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); this->ClearSurface(static_cast(red) | (static_cast(green) << 8) | (static_cast(blue) << 16)); @@ -22,12 +22,10 @@ void UIColorButton::Paint() { case 2: color = static_cast(this->activeRed) | (static_cast(this->activeGreen) << 8) | (static_cast(this->activeBlue) << 16); this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, color); - this->DrawTextAt( - controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 2, (this->geometry.height - 12) / 2 + 2, this->label.c_str(), 0, 0, 12, + this->DrawTextAt((this->geometry.width - textWidth) / 2 + 2, (this->geometry.height - 12) / 2 + 2, this->label.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0 ); - this->DrawTextAt( - controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0, + this->DrawTextAt((this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0, 0, 0 ); return; @@ -36,9 +34,8 @@ void UIColorButton::Paint() { } this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, color); - this->DrawTextAt( - controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0xFFFFFF, + this->DrawTextAt((this->geometry.width - textWidth) / 2 + 1, (this->geometry.height - 12) / 2 + 1, this->label.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0 ); - this->DrawTextAt(controls.fonts, controls.locale, (this->geometry.width - textWidth) / 2, (this->geometry.height - 12) / 2, this->label.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt((this->geometry.width - textWidth) / 2, (this->geometry.height - 12) / 2, this->label.c_str(), 0, 0, 12, 0, 0, 0); } diff --git a/Source/UI/Buttons/UIRadioBtn.cpp b/Source/UI/Buttons/UIRadioBtn.cpp index 6d72a4cb..607ed524 100644 --- a/Source/UI/Buttons/UIRadioBtn.cpp +++ b/Source/UI/Buttons/UIRadioBtn.cpp @@ -26,10 +26,9 @@ void UIRadioBtn::Paint() { this->DrawBitmap(0, static_cast((this->geometry.height - bitmap->image.height) * 0.5f), &bitmap->image, true); } - const int textHeight = this->TextHeight(controls.fonts, controls.locale, this->text.c_str(), 0, 0, this->fontHeight, 0, 0); + const int textHeight = this->TextHeight(this->text.c_str(), 0, 0, this->fontHeight, 0, 0); const std::uint32_t color = this->enabled == 1 ? this->textColor : 0xB5B5B5; - this->DrawTextAt( - controls.fonts, controls.locale, bitmap->image.width + 3, static_cast((this->geometry.height - textHeight) * 0.5f), this->text.c_str(), 0, 0, + this->DrawTextAt(bitmap->image.width + 3, static_cast((this->geometry.height - textHeight) * 0.5f), this->text.c_str(), 0, 0, this->fontHeight, color, 0, 0 ); return; @@ -46,7 +45,7 @@ void UIRadioBtn::Paint() { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(name))); this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); const std::uint32_t color = this->enabled != 0 ? this->textColor : 0xB5B5B5; - this->DrawTextAt(controls.fonts, controls.locale, 13, 0, this->text.c_str(), 0, 0, this->fontHeight, color, 0, 0); + this->DrawTextAt(13, 0, this->text.c_str(), 0, 0, this->fontHeight, color, 0, 0); } // OFFSET: 0x0085ECB0 diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 71b1241f..a21943a0 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -326,13 +326,13 @@ void UIBmpRadioBtn::AddText(int id, int height, std::uint32_t color, bool bold, if (x == -1000) { const int textWidth = - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->m_label.c_str(), static_cast(this->m_label.size()), 0, height, bold, 0); + this->TextWidth(this->m_label.c_str(), static_cast(this->m_label.size()), 0, height, bold, 0); text.x = static_cast((this->geometry.width - textWidth) * 0.5); } if (y == -1000) { const int textHeight = - this->TextHeight(this->m_controls->fonts, this->m_controls->locale, this->m_label.c_str(), static_cast(this->m_label.size()), 0, height, bold, 0); + this->TextHeight(this->m_label.c_str(), static_cast(this->m_label.size()), 0, height, bold, 0); text.y = static_cast((this->geometry.height - textHeight) * 0.5); } @@ -615,7 +615,7 @@ void UIMemberListBox::Slot28(int, int y) { } const char* text = this->lines[line].c_str(); - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); if (width <= this->geometry.width - this->verticalOverflow * 15) { return; } @@ -745,9 +745,9 @@ void UITabControl::RecalculateWidths() { int width; if (this->layout == 0 || this->layout == 2) { - width = this->VerticalTextHeight(this->m_controls->fonts, this->m_controls->locale, this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0); + width = this->VerticalTextHeight(this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0); } else { - width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0); + width = this->TextWidth(this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0); } widest = std::max(width + this->tabPadding, widest); @@ -791,7 +791,7 @@ void UITVTextButton::ResizeToText() { this->unknown_00DC = this->label; const int width = - this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->label.c_str(), 0, this->m_fontFamily, this->m_fontHeight, this->m_outlined, 0); + this->TextWidth(this->label.c_str(), 0, this->m_fontFamily, this->m_fontHeight, this->m_outlined, 0); const int border = this->m_border ? 2 : 0; UIWindow::Resize(width + 2 + border, this->m_fontHeight + 2 + border); } @@ -804,7 +804,7 @@ void UITextButton::ResizeToText() { } this->m_text = this->label; - const int width = this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->label.c_str(), 0, this->m_family, this->m_height, this->m_outline, 0); + const int width = this->TextWidth(this->label.c_str(), 0, this->m_family, this->m_height, this->m_outline, 0); UIWindow::Resize(width + 2, this->m_height + 2); } @@ -1540,7 +1540,7 @@ void UITVTextButton::Paint() { if (this->m_outlined != 0) { DrawOutlinedText(*this, inset + 1, 2, this->unknown_00DC.c_str(), 0, color, this->m_outlineColor, this->m_fontFamily, this->m_fontHeight, 1, 0); } else { - this->DrawTextAt(this->m_buttonContext->fonts, this->m_buttonContext->locale, inset + 1, 2, this->unknown_00DC.c_str(), 0, this->m_fontFamily, this->m_fontHeight, color, 0, 0); + this->DrawTextAt(inset + 1, 2, this->unknown_00DC.c_str(), 0, this->m_fontFamily, this->m_fontHeight, color, 0, 0); } } @@ -1867,7 +1867,7 @@ void UIItemMoveInfo::Paint() { 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(controls.fonts, controls.locale, 1, 1, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); + this->DrawTextAt(1, 1, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); } if (this->m_underline != 0) { @@ -1888,7 +1888,7 @@ void UIItemTagButton::Paint() { 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(controls.fonts, controls.locale, 1, this->textY, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); + this->DrawTextAt(1, this->textY, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); } if (this->m_underline != 0) { @@ -2258,8 +2258,7 @@ void UIMemberListBox::Paint() { this->FillRegion(0, row * this->lineHeight + 1, this->geometry.width, this->lineHeight, 0xC8C832); } - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0 + this->DrawTextAt(2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0 ); } } @@ -2297,12 +2296,12 @@ void UIBasicSkillCtrl::Paint() { std::sprintf(text, "%d", skill.level); FontCache& fonts = this->m_controls->fonts; const TextLocale& locale = this->m_controls->locale; - const int x = this->geometry.width - this->TextWidth(fonts, locale, text, 0, 0, 11, 0, 0); - this->DrawTextAt(fonts, locale, x, 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x - 2, 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x - 1, 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x - 1, 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x - 1, 15, text, 0, 0, 11, 0, 0, 0); + 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); + this->DrawTextAt(x - 1, 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x - 1, 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x - 1, 15, text, 0, 0, 11, 0, 0, 0); } } } @@ -2338,17 +2337,17 @@ void UIBmpRadioBtn::Paint() { for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { if (it->id == 3) { if (it->unknown_0018 == true) { - this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xE2E2E2, 0, 0); + this->DrawTextAt(it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xE2E2E2, 0, 0); } - this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + this->DrawTextAt(it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); return; } } - const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0xE2E2E2, 0, 0); - this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0x6F6F6F, 0, 0); + const int x = static_cast((this->geometry.width - this->TextWidth(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(x, y, this->m_label.c_str(), 0, 0, 12, 0xE2E2E2, 0, 0); + this->DrawTextAt(x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0x6F6F6F, 0, 0); return; } @@ -2356,17 +2355,17 @@ void UIBmpRadioBtn::Paint() { for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { if (it->id == 2) { if (it->unknown_0018 == true) { - this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xFFFFFF, it->bold, 0); + this->DrawTextAt(it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xFFFFFF, it->bold, 0); } - this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + this->DrawTextAt(it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); return; } } - const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); + const int x = static_cast((this->geometry.width - this->TextWidth(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(x, y, this->m_label.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); return; } @@ -2374,34 +2373,34 @@ void UIBmpRadioBtn::Paint() { for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { if (it->id == 1) { if (it->unknown_0018 == true) { - this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xC7A796, it->bold, 0); + this->DrawTextAt(it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xC7A796, it->bold, 0); } - this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + this->DrawTextAt(it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); return; } } - const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xC7A796, 0, 0); - this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); + const int x = static_cast((this->geometry.width - this->TextWidth(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xC7A796, 0, 0); + this->DrawTextAt(x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); return; } for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { if (it->id == 0) { if (it->unknown_0018 == true) { - this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xD7D7D7, it->bold, 0); + this->DrawTextAt(it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xD7D7D7, it->bold, 0); } - this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + this->DrawTextAt(it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); return; } } - const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); - this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xD7D7D7, 0, 0); - this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); + const int x = static_cast((this->geometry.width - this->TextWidth(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xD7D7D7, 0, 0); + this->DrawTextAt(x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008894A0 @@ -2439,8 +2438,7 @@ void UIComboBox::Paint() { this->FillRegion(3, row * this->lineHeight + 1, this->geometry.width - 6, this->lineHeight - 2, RGB(red, green, blue)); } - this->DrawTextAt( - this->m_listContext->fonts, this->m_listContext->locale, 3 - this->horizontalOffset, this->lineHeight * row + 2, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0 + this->DrawTextAt(3 - this->horizontalOffset, this->lineHeight * row + 2, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0 ); } @@ -2582,7 +2580,7 @@ void UIComboBoxV2Wnd::Paint() { } const std::string selected = this->SelectedText(); - this->DrawTextAt(context.fonts, context.locale, 2, 3, selected.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(2, 3, selected.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x00880CC0 @@ -2750,8 +2748,8 @@ void UINewComboBoxCtrl::Paint() { void UIShowAndEditTimeCtrl::Paint() { UIWindowContext& context = *this->m_context; this->ClearSurface(0xFFFF00FF); - this->DrawTextAt(context.fonts, context.locale, 22, 3, "m", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(context.fonts, context.locale, 60, 3, "s", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(22, 3, "m", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(60, 3, "s", 0, 0, 12, 0, 0, 0); } #include "UI/Buttons/UINaviLinkButton.h" @@ -3133,8 +3131,7 @@ void UIComboBoxID::Paint() { this->FillRegion(3, (index - first) * this->lineHeight + 1, this->geometry.width - 6, this->lineHeight - 2, RGB(red, green, blue)); } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, 3 - this->horizontalOffset, (index - first) * this->lineHeight + 2, this->lines[index].text.c_str(), 0, 0, 12, + this->DrawTextAt(3 - this->horizontalOffset, (index - first) * this->lineHeight + 2, this->lines[index].text.c_str(), 0, 0, 12, 0, 0, 0 ); } @@ -3171,8 +3168,7 @@ void UIItemStoreComboBox::Paint() { } for (int index = first; index < static_cast(end); ++index) { - this->DrawTextAt( - this->m_listContext->fonts, this->m_listContext->locale, 3 - this->horizontalOffset, (index - first) * this->lineHeight + 2, this->lines[index].text.c_str(), 0, + this->DrawTextAt(3 - this->horizontalOffset, (index - first) * this->lineHeight + 2, this->lines[index].text.c_str(), 0, 0, 12, this->lines[index].color, 0, 0 ); } @@ -3212,7 +3208,7 @@ void UIListBox2::Paint() { int y = this->lineHeight * row; if (this->centerVertically == 1) { const int lineHeight = this->lineHeight; - const int height = this->TextHeight(owner.fonts, owner.locale, this->lines[index].c_str(), 0, 0, 12, 0, 0); + const int height = this->TextHeight(this->lines[index].c_str(), 0, 0, 12, 0, 0); y = static_cast(static_cast(lineHeight - height) * 0.5f + static_cast(row * lineHeight)); } @@ -3462,12 +3458,12 @@ void UIChatHisBox2::Paint() { const int index = top + row; int x; if (g_serviceType == 19 && g_tipOfTheDayEnglish) { - const int width = this->TextWidth(fonts, locale, this->lines[index].c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->lines[index].c_str(), 0, 0, 12, 0, 0); x = this->geometry.width - width - 19; } else { x = 2; } - this->DrawTextAt(fonts, locale, x, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0); + this->DrawTextAt(x, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0); this->PlaceNaviLinks(index); this->PlaceItemTags(index); } @@ -3495,7 +3491,7 @@ void UIChatHisBox3::Paint() { const TextLocale& locale = this->m_listContext->locale; for (int row = 0; top + row < static_cast(end); ++row) { const int index = top + row; - this->DrawTextAt(fonts, locale, 2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, this->unknown_0134, this->unknown_00E4[index], 0, 0); + this->DrawTextAt(2, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, this->unknown_0134, this->unknown_00E4[index], 0, 0); this->PlaceNaviLinks(index); this->PlaceItemTags(index); } @@ -3638,10 +3634,10 @@ void UISlotBmpButton::Paint() { const TIMESTAMP_STRUCT date = expiry.ToSqlTimestamp(); const std::string period = FormatOwnedString(LookupMessage(0xc20), date.month, date.day); const std::string time = FormatOwnedString(LookupMessage(0xd15), date.hour, date.minute, date.second); - const int periodWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, period.c_str(), 0, 0, 0xb, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x4f - periodWidth / 2, 0x28, period.c_str(), 0, 0, 0xb, color, 0, 0); - const int timeWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, time.c_str(), 0, 0, 0xb, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x4f - timeWidth / 2, 0x34, time.c_str(), 0, 0, 0xb, color, 0, 0); + const int periodWidth = this->TextWidth(period.c_str(), 0, 0, 0xb, 0, 0); + this->DrawTextAt(0x4f - periodWidth / 2, 0x28, period.c_str(), 0, 0, 0xb, color, 0, 0); + const int timeWidth = this->TextWidth(time.c_str(), 0, 0, 0xb, 0, 0); + this->DrawTextAt(0x4f - timeWidth / 2, 0x34, time.c_str(), 0, 0, 0xb, color, 0, 0); } } } diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index cb83bec6..8056b413 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -473,7 +473,7 @@ void UICashShopWnd::Paint() { ); } - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, false, LookupMessage(0xCD8), 0); + this->DrawTitleBar(false, LookupMessage(0xCD8), 0); if (this->m_pageCount == 0) { this->sub_A84400(0xF7, 0x1EE, std::string("0 / 0"), 0x2B, 0, 6, 0, 0xC, 0x6B2921, 0); } else { @@ -484,11 +484,11 @@ void UICashShopWnd::Paint() { this->DrawCenteredText(0x21A, 0x1B, LookupMessage(0xCD9), 0xB9, 0, 0xE, 0, 1); this->DrawCenteredText(0x219, 0x1A, LookupMessage(0xCD9), 0xB9, 0, 0xE, 0xFFFFFF, 1); this->DrawRightAlignedText(0x273, 0x33, IntToString(this->unknown_00E8, 0).c_str(), 0, 0, 0xC, 0xFFFFFF, 1); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x226, 0x1B2, LookupMessage(0xCE7), 0, 0, 0xC, 0, 0, 0); + this->DrawTextAt(0x226, 0x1B2, LookupMessage(0xCE7), 0, 0, 0xC, 0, 0, 0); this->DrawRightAlignedText(0x2C4, 0x1B2, FormatOwnedString("%d C", this->unknown_00EC).c_str(), 0, 0, 0xC, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x226, 0x1C2, LookupMessage(0xCE8), 0, 0, 0xC, 0, 0, 0); + this->DrawTextAt(0x226, 0x1C2, LookupMessage(0xCE8), 0, 0, 0xC, 0, 0, 0); this->DrawRightAlignedText(0x2C4, 0x1C2, "C", 0, 0, 0xC, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x226, 0x1D2, LookupMessage(0xCE9), 0, 0, 0xC, 0, 0, 0); + this->DrawTextAt(0x226, 0x1D2, LookupMessage(0xCE9), 0, 0, 0xC, 0, 0, 0); this->DrawRightAlignedText(0x2C4, 0x1D2, FormatOwnedString("%d C", 0).c_str(), 0, 0, 0xC, 0, 0); } else { { @@ -545,7 +545,7 @@ void UICashShopWnd_CartItem::Paint() { ); std::string name = this->FitDisplayText(0x70, this->m_item.unknown_0044.c_str(), 0, 0xB, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x30, 0xC, name.c_str(), 0, 0, 0xB, 0x902418, 0, 0); + this->DrawTextAt(0x30, 0xC, name.c_str(), 0, 0, 0xB, 0x902418, 0, 0); CBitmapRes* icon = static_cast( ResourceMgr::Instance().Load(Resolve(FormatOwnedString("유저인터페이스\\collection\\%s.bmp", ItemResourcePath(this->m_item)).c_str())) @@ -588,7 +588,7 @@ void UICashShopWnd_Item::Paint() { } if (this->m_item.unknown_0014[0] == 0) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x53, 0x4C, LookupMessage(0xF4E), 0, 0, 0xB, 0xFF, 0, 0); + this->DrawTextAt(0x53, 0x4C, LookupMessage(0xF4E), 0, 0, 0xB, 0xFF, 0, 0); } else { std::string count; if (static_cast(this->m_item.unknown_0078[3]) < 0) { @@ -596,7 +596,7 @@ void UICashShopWnd_Item::Paint() { } else { count = FormatOwnedString("%d/%d", this->m_item.unknown_0078[3], this->m_item.quantity); } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x53, 0x4C, LookupMessage(0xE4A), 0, 0, 0xB, 0x6E4B41, 0, 0); + this->DrawTextAt(0x53, 0x4C, LookupMessage(0xE4A), 0, 0, 0xB, 0x6E4B41, 0, 0); this->DrawCenteredOutlinedText(0x53, 0x5B, count.c_str(), 0x51, 0, 0xFFFFFF, 0xD29374, 0, 0x10, 1); } @@ -615,10 +615,10 @@ void UICashShopWnd_Item::Paint() { const char* text = startText.c_str(); const int center = this->geometry.width / 2; - const int startWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, text, 0, 0, 0xC, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, static_cast(center - startWidth * 0.5), 0xA0, text, 0, 0, 0xB, 0, 0, 0); - const int endWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, endText.c_str(), 0, 0, 0xC, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x9E - endWidth, 0xAD, endText.c_str(), 0, 0, 0xB, 0, 0, 0); + const int startWidth = this->TextWidth(text, 0, 0, 0xC, 0, 0); + this->DrawTextAt(static_cast(center - startWidth * 0.5), 0xA0, text, 0, 0, 0xB, 0, 0, 0); + const int endWidth = this->TextWidth(endText.c_str(), 0, 0, 0xC, 0, 0); + this->DrawTextAt(0x9E - endWidth, 0xAD, endText.c_str(), 0, 0, 0xB, 0, 0, 0); } else { this->DrawBitmap( 0, 0, reinterpret_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\cashshop\\img_shop_itemBg.bmp"))), false diff --git a/Source/UI/Chat/UISubChatHisWnd.cpp b/Source/UI/Chat/UISubChatHisWnd.cpp index ffe5f174..6f7258a3 100644 --- a/Source/UI/Chat/UISubChatHisWnd.cpp +++ b/Source/UI/Chat/UISubChatHisWnd.cpp @@ -94,7 +94,7 @@ void UISubChatHisWnd::Paint() { this->ClearSurface(0xFFFF00FF); std::uint32_t color = 0xFFFFFF; const TextLocale locale = {}; - this->DrawTextAt(g_fontCache, locale, 5, 4, this->m_name.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 4, this->m_name.c_str(), 0, 0, 12, 0, 0, 0); DrawColoredText(*this, static_cast(g_textCodePage), 4, 3, this->m_name.c_str(), 0, color, 0, 12, false); this->FillRegion(2, 0, this->m_inputWidth - 5, 1, color); this->FillRegion(1, 1, 1, 1, color); @@ -191,7 +191,7 @@ void UISubChatHisWnd::Slot15(int width, int height) { const auto found = g_session.m_subChatWnds.find(this->m_index); if (found != g_session.m_subChatWnds.end()) { this->m_name = found->second.name; - this->m_inputWidth = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->m_name.c_str(), 0, 0, 12, 0, 0) + 10; + this->m_inputWidth = this->TextWidth(this->m_name.c_str(), 0, 0, 12, 0, 0) + 10; std::memcpy(this->m_options, found->second.options, sizeof(this->m_options)); if (this->m_inputWidth < 25) { this->m_inputWidth = 25; diff --git a/Source/UI/Clan/UIClanWnd.cpp b/Source/UI/Clan/UIClanWnd.cpp index 68e38e4e..564cffb6 100644 --- a/Source/UI/Clan/UIClanWnd.cpp +++ b/Source/UI/Clan/UIClanWnd.cpp @@ -55,18 +55,18 @@ void UIClanInfoManageWnd::Paint() { char text[1024]; std::memset(text, 0, sizeof(text)); std::sprintf(text, "%s : %s", LookupMessage(2357), g_clanInfo->m_clanName.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 49, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 49, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %d", LookupMessage(2356), g_clanInfo->unknown_0034); - this->DrawTextAt(controls.fonts, controls.locale, 8, 65, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 65, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %s", LookupMessage(2362), g_clanInfo->m_masterName.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 81, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 81, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : ", LookupMessage(2363)); - this->DrawTextAt(controls.fonts, controls.locale, 8, 97, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 97, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s", "유저인터페이스\\basic_interface\\grp_online.bmp"); CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(text))); this->DrawBitmap(128, 95, bitmap ? &bitmap->image : nullptr, true); std::sprintf(text, " %d", g_clanInfo->m_connectedMembers); - this->DrawTextAt(controls.fonts, controls.locale, 138, 97, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(138, 97, text, 0, 0, 12, 0, 0, 0); { std::string map = g_clanInfo->m_mapName; @@ -75,7 +75,7 @@ void UIClanInfoManageWnd::Paint() { } map = g_mapInfoMgr->GetDisplayName(std::string(map.c_str())); std::sprintf(text, "%s : %s", LookupMessage(2364), map.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 113, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 113, text, 0, 0, 12, 0, 0, 0); } if (g_clanInfo->m_clanId != 0) { @@ -93,7 +93,7 @@ void UIClanInfoManageWnd::Paint() { } std::sprintf(text, "%s", LookupMessage(2358)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 65, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 65, text, 0, 0, 12, 0, 0, 0); unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); this->FillRegion(279, 64, 26, 26, RGB(red, green, blue)); @@ -101,9 +101,9 @@ void UIClanInfoManageWnd::Paint() { this->DrawBitmap(280, 65, this->m_emblem ? &this->m_emblem->image : nullptr, true); } std::sprintf(text, "%s", LookupMessage(2359)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 139, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 139, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s", LookupMessage(2360)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 213, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 213, text, 0, 0, 12, 0, 0, 0); SkinPaletteChannels(ResourceMgr::Instance(), 14, 6, red, green, blue); this->FillRegion(200, 155, 168, 48, RGB(red, green, blue)); @@ -118,7 +118,7 @@ void UIClanInfoManageWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); this->FillRegion(204, y, 80, 16, RGB(red, green, blue)); } - this->DrawTextAt(controls.fonts, controls.locale, 204, y, relation.second.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(204, y, relation.second.c_str(), 0, 0, 12, 0, 0, 0); ++row; y += 16; } @@ -137,7 +137,7 @@ void UIClanInfoManageWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); this->FillRegion(204, y, 80, 16, RGB(red, green, blue)); } - this->DrawTextAt(controls.fonts, controls.locale, 204, y, relation.second.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(204, y, relation.second.c_str(), 0, 0, 12, 0, 0, 0); ++row; y += 16; } @@ -153,7 +153,7 @@ void UIClanWnd::Paint() { 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(controls.fonts, controls.locale, false, "", 0); + 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)); SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); diff --git a/Source/UI/Dialogs/UIEditctrlWnd.cpp b/Source/UI/Dialogs/UIEditctrlWnd.cpp index 7dc40761..c75d073e 100644 --- a/Source/UI/Dialogs/UIEditctrlWnd.cpp +++ b/Source/UI/Dialogs/UIEditctrlWnd.cpp @@ -218,7 +218,7 @@ void UIMiniMapWnd::Slot15(int width, int height) { void UIEditctrlWnd::Paint() { UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFFFFFFFF); - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2755), 0); + this->DrawTitleBar(true, LookupMessage(2755), 0); } // OFFSET: 0x0099C820 @@ -329,7 +329,7 @@ void UIMiniMapWnd::Paint() { 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(controls.fonts, controls.locale, true, title.c_str(), 0), 0, ""); + this->DrawPanelBackground(this->DrawTitleBar(true, title.c_str(), 0), 0, ""); this->DrawButtonBar(1, 0, 1); this->FillRegion(2, 19, 512, 512, 0xFFAAAAAA); diff --git a/Source/UI/Edit/UICandidateWnd.cpp b/Source/UI/Edit/UICandidateWnd.cpp index dcff7951..a67e83b2 100644 --- a/Source/UI/Edit/UICandidateWnd.cpp +++ b/Source/UI/Edit/UICandidateWnd.cpp @@ -49,8 +49,8 @@ void UICandidateWnd::Paint() { for (int i = 0; i < this->m_count;) { ++i; StringFormat(text, sizeof(text), static_cast(-1), "%d %s", i, this->m_candidates[i - 1].c_str()); - this->DrawTextAt(controls.fonts, controls.locale, x, 12, text, 0, 0, 12, 0, 0, 0); - x += 8 + this->TextWidth(controls.fonts, controls.locale, text, static_cast(std::strlen(text)), 0, 12, 0, 0); + this->DrawTextAt(x, 12, text, 0, 0, 12, 0, 0, 0); + x += 8 + this->TextWidth(text, static_cast(std::strlen(text)), 0, 12, 0, 0); } break; } @@ -63,14 +63,14 @@ void UICandidateWnd::Paint() { if (this->m_selection == i) { unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); - this->FillRegion(8, y - 2, this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0) + 4, 16, RGB(red, green, blue)); + this->FillRegion(8, y - 2, this->TextWidth(text, 0, 0, 12, 0, 0) + 4, 16, RGB(red, green, blue)); } - this->DrawTextAt(controls.fonts, controls.locale, 10, y, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, y, text, 0, 0, 12, 0, 0, 0); y += 20; i = number; } std::sprintf(text, "%d / %d", this->m_page + 1, this->m_lastPage + 1); - this->DrawTextAt(controls.fonts, controls.locale, 110 - this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0), 192, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(110 - this->TextWidth(text, 0, 0, 12, 0, 0), 192, text, 0, 0, 12, 0, 0, 0); return; } case 3: @@ -81,11 +81,11 @@ void UICandidateWnd::Paint() { int number = i + 1; StringFormat(text, sizeof(text), static_cast(-1), "%d %s", number, this->m_candidates[i].c_str()); if (i == this->m_selection) { - this->DrawTextAt(controls.fonts, controls.locale, x, 12, text, static_cast(std::strlen(text)), 0, 12, 0xFF, 0, 0); + this->DrawTextAt(x, 12, text, static_cast(std::strlen(text)), 0, 12, 0xFF, 0, 0); } else { - this->DrawTextAt(controls.fonts, controls.locale, x, 12, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x, 12, text, 0, 0, 12, 0, 0, 0); } - x += this->TextWidth(controls.fonts, controls.locale, text, static_cast(std::strlen(text)), 0, 12, 0, 0) + 8; + x += this->TextWidth(text, static_cast(std::strlen(text)), 0, 12, 0, 0) + 8; i = number; } break; @@ -102,7 +102,7 @@ void UICandidateWnd::Paint() { // FUNCTION: fn_13204 void UICompositionWnd::Paint() { this->DrawBorder(0, 0, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 10, 12, this->m_text.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 12, this->m_text.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0096DB60 @@ -127,7 +127,7 @@ void UIKeyStrokeWnd::Paint() { auto table = *reinterpret_cast(g_serverLanguage); const char* source = table[1](g_serverLanguage) + index * 2; char text[3] = {source[0], source[1], 0}; - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 2 + index * 14, 2, text, 2, 0, 12, 0, 0, 0); + this->DrawTextAt(2 + index * 14, 2, text, 2, 0, 12, 0, 0, 0); } } @@ -154,13 +154,13 @@ int UICandidateWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen ++i; StringFormat(text, sizeof(text), static_cast(-1), "%d %s", i, this->m_candidates[i - 1].c_str()); if (g_language == 2) { - int textWidth = this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0) + 8; + int textWidth = this->TextWidth(text, 0, 0, 12, 0, 0) + 8; if (textWidth < width) { textWidth = width; } width = textWidth; } else { - width += 8 + this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); + width += 8 + this->TextWidth(text, 0, 0, 12, 0, 0); } } int height; @@ -183,7 +183,7 @@ int UICompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum const char* text = reinterpret_cast(argument1); if (text != nullptr) { this->m_text = text; - int padded = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, 0, 12, 0, 0) + 20; + int padded = this->TextWidth(text, 0, 0, 12, 0, 0) + 20; int width = padded / 28 * 28; width += padded != width ? 28 : 0; if (width < 34) { diff --git a/Source/UI/Edit/UIEditBoxEx.cpp b/Source/UI/Edit/UIEditBoxEx.cpp index efeace89..bc878c0f 100644 --- a/Source/UI/Edit/UIEditBoxEx.cpp +++ b/Source/UI/Edit/UIEditBoxEx.cpp @@ -65,7 +65,7 @@ int CUIEditCtrlEx::LeadingBytesFitting(const std::string& text, int width) { const char* start = current; current = CharNextExA(static_cast(g_textCodePage), current, 0); const int count = static_cast(current - start); - const int extent = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, start, count, 0, 12, 0, 0); + const int extent = this->TextWidth(start, count, 0, 12, 0, 0); if (width <= total + extent) { if (std::abs(total + extent - width) < std::abs(total - width)) { @@ -88,7 +88,7 @@ int CUIEditCtrlEx::TrailingOffsetFitting(const std::string& text, int width) { return static_cast(text.size()); } - this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, text.c_str(), 0, 0, 12, 0, 0); + this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); int bytes = 0; int total = 0; @@ -99,7 +99,7 @@ int CUIEditCtrlEx::TrailingOffsetFitting(const std::string& text, int width) { const char* next = current; current = CharPrevExA(static_cast(g_textCodePage), begin, current, 0); const int count = static_cast(next - current); - const int extent = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current, count, 0, 12, 0, 0); + const int extent = this->TextWidth(current, count, 0, 12, 0, 0); if (width <= total + extent) { if (std::abs(total + extent - width) < std::abs(total - width)) { @@ -309,14 +309,14 @@ void CUIEditCtrlEx::Synchronize() { this->column += candidateCursor; int cursorX = 0; if (this->column > 0) { - cursorX = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, this->lines[this->line].text.c_str(), this->column, 0, 12, 0, 0); + cursorX = this->TextWidth(this->lines[this->line].text.c_str(), this->column, 0, 12, 0, 0); } int end = std::max(anchor, cursor) + candidateCursor + static_cast(prefix.size()); int readingOffset = end - currentOffset; int readingX = 0; if (readingOffset > 0) { - readingX = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, this->lines[this->line].text.c_str(), readingOffset, 0, 12, 0, 0); + readingX = this->TextWidth(this->lines[this->line].text.c_str(), readingOffset, 0, 12, 0, 0); } int delta = std::max(cursorX - readingX, 2); this->MoveCandidateWindow(cursorX + 2 + delta); @@ -484,13 +484,13 @@ int CUIEditCtrlEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: const std::string& current = this->lines[this->line].text; int offset; if (this->alignment == 2) { - const int width = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(current.c_str(), 0, 0, 12, 0, 0); const int columnWidth = - this->column > 0 ? this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), this->column, 0, 12, 0, 0) : 0; + this->column > 0 ? this->TextWidth(current.c_str(), this->column, 0, 12, 0, 0) : 0; offset = this->TrailingOffsetFitting(previous.text, width - columnWidth); } else { const int columnWidth = - this->column > 0 ? this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), this->column, 0, 12, 0, 0) : 0; + this->column > 0 ? this->TextWidth(current.c_str(), this->column, 0, 12, 0, 0) : 0; offset = this->LeadingBytesFitting(previous.text, columnWidth); } @@ -512,13 +512,13 @@ int CUIEditCtrlEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: const std::string& current = this->lines[this->line].text; int offset; if (this->alignment == 2) { - const int width = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(current.c_str(), 0, 0, 12, 0, 0); const int columnWidth = - this->column > 0 ? this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), this->column, 0, 12, 0, 0) : 0; + this->column > 0 ? this->TextWidth(current.c_str(), this->column, 0, 12, 0, 0) : 0; offset = this->TrailingOffsetFitting(next.text, width - columnWidth); } else { const int columnWidth = - this->column > 0 ? this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, current.c_str(), this->column, 0, 12, 0, 0) : 0; + this->column > 0 ? this->TextWidth(current.c_str(), this->column, 0, 12, 0, 0) : 0; offset = this->LeadingBytesFitting(next.text, columnWidth); } @@ -695,7 +695,7 @@ void CUIEditCtrlEx::PaintTextLines() { if (this->lines.empty()) { int x = this->unknown_01B4; if (this->alignment == 2) { - const int caretWidth = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, "|", 0, 0, 12, 0, 0); + const int caretWidth = this->TextWidth("|", 0, 0, 12, 0, 0); x = width - this->unknown_01B4 - caretWidth; } else if (this->alignment == 6) { x = width / 2; @@ -719,7 +719,7 @@ void CUIEditCtrlEx::PaintTextLines() { for (int lineIndex = this->scrollPosition; lineIndex < endLine; ++lineIndex) { EditLine& line = this->lines[lineIndex]; const char* text = line.text.c_str(); - const int textWidth = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, text, 0, 0, 12, 0, 0); + const int textWidth = this->TextWidth(text, 0, 0, 12, 0, 0); int x = this->unknown_01B4; if (this->alignment == 2) { @@ -733,15 +733,13 @@ void CUIEditCtrlEx::PaintTextLines() { if (g_windowMgr.GetHoverWindow() == this && line.selectionEnd > line.selectionBegin) { int selectionBeginWidth = 0; if (line.selectionBegin >= 1) { - selectionBeginWidth = this->TextWidth( - this->m_edit->buttons.fonts, this->m_edit->buttons.locale, text, static_cast(line.selectionBegin), 0, 12, 0, 0 + selectionBeginWidth = this->TextWidth(text, static_cast(line.selectionBegin), 0, 12, 0, 0 ); } int selectionEndWidth = 0; if (line.selectionEnd >= 1) { - selectionEndWidth = this->TextWidth( - this->m_edit->buttons.fonts, this->m_edit->buttons.locale, text, static_cast(line.selectionEnd), 0, 12, 0, 0 + selectionEndWidth = this->TextWidth(text, static_cast(line.selectionEnd), 0, 12, 0, 0 ); } @@ -751,8 +749,7 @@ void CUIEditCtrlEx::PaintTextLines() { this->PlaceLinks(line.text, y, lineIndex, this->scrollPosition, endLine); if (this->unknown_0190 == 0) { - this->DrawTextAt( - this->m_edit->buttons.fonts, this->m_edit->buttons.locale, x, this->verticalPadding + y, text, 0, 0, 12, this->textColor, 0, 0 + this->DrawTextAt(x, this->verticalPadding + y, text, 0, 0, 12, this->textColor, 0, 0 ); } else { this->DrawEmboldenedText(x, this->verticalPadding + y, text, this->textColor, this->secondColor, 0, 0, 12); @@ -764,8 +761,7 @@ void CUIEditCtrlEx::PaintTextLines() { if (g_windowMgr.GetHoverWindow() == this && lineIndex == this->line) { int caretOffset = 0; if (this->column >= 1) { - caretOffset = this->TextWidth( - this->m_edit->buttons.fonts, this->m_edit->buttons.locale, text, static_cast(this->column), 0, 12, 0, 0 + caretOffset = this->TextWidth(text, static_cast(this->column), 0, 12, 0, 0 ); } this->DrawCaret(x - 2 + caretOffset, y); @@ -800,6 +796,6 @@ CUIEditCtrlEx::CUIEditCtrlEx(UIWindowContext& windows, UIEditContext& edit) : UI void CUIEditCtrlEx::DrawCaret(int x, int y) { const int elapsed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now() - this->caretStart).count()); if (((elapsed / 500) & 1) == 0 && IsInputSuggestionAllowed()) { - this->DrawTextAt(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, x, y, "|", 0, 0, 12, this->textColor, 0, 0); + this->DrawTextAt(x, y, "|", 0, 0, 12, this->textColor, 0, 0); } } diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index a85cfba7..e3eeed1e 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -752,7 +752,7 @@ void UIEditCtrl3::DrawBlinkingCaret(const std::uint32_t& color) { return; } - this->DrawTextAt(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, 1, 0, "|", 0, 0, 12, color, 0, 0); + this->DrawTextAt(1, 0, "|", 0, 0, 12, color, 0, 0); } // OFFSET: 0x00854130 @@ -968,12 +968,12 @@ void UIBmpTextButton2::DrawLabels() { int shadowY = 0; if (x == -1000) { - const int width = this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, label.text.c_str(), label.text.size(), 0, label.height, label.bold, 0); + const int width = this->TextWidth(label.text.c_str(), label.text.size(), 0, label.height, label.bold, 0); x = static_cast((this->geometry.width - width) * 0.5); } if (y == -1000) { - const int height = this->TextHeight(this->m_buttonContext->fonts, this->m_buttonContext->locale, label.text.c_str(), label.text.size(), 0, label.height, label.bold, 0); + const int height = this->TextHeight(label.text.c_str(), label.text.size(), 0, label.height, label.bold, 0); y = static_cast((this->geometry.height - height) * 0.5); } @@ -1007,10 +1007,10 @@ void UIBmpTextButton2::DrawLabels() { } if (label.shadow == 1) { - this->DrawTextAt(this->m_buttonContext->fonts, this->m_buttonContext->locale, shadowX, shadowY, label.text.c_str(), 0, 0, label.height, shadowColor, label.bold, 0); + this->DrawTextAt(shadowX, shadowY, label.text.c_str(), 0, 0, label.height, shadowColor, label.bold, 0); } - this->DrawTextAt(this->m_buttonContext->fonts, this->m_buttonContext->locale, x, y, label.text.c_str(), 0, 0, label.height, color, label.bold, 0); + this->DrawTextAt(x, y, label.text.c_str(), 0, 0, label.height, color, label.bold, 0); } } @@ -1122,16 +1122,16 @@ void UIEditCtrl_Custom::Synchronize() { int before = 0; if (this->firstVisible != 0) { - before = this->TextWidth(fonts, locale, this->text.c_str(), this->firstVisible, 0, 12, this->unknown_011C, 0); + before = this->TextWidth(this->text.c_str(), this->firstVisible, 0, 12, this->unknown_011C, 0); } - const int position = this->TextWidth(fonts, locale, this->text.c_str(), this->cursor, 0, 12, this->unknown_011C, 0); + const int position = this->TextWidth(this->text.c_str(), this->cursor, 0, 12, this->unknown_011C, 0); if (position + 3 - before > available) { const char* end = this->text.c_str() + this->text.size(); const char* next = CharNextExA(static_cast(g_textCodePage), this->text.c_str(), 0); - while (this->TextWidth(fonts, locale, next, 0, 0, 12, this->unknown_011C, 0) + 3 > available && next < end) { + while (this->TextWidth(next, 0, 0, 12, this->unknown_011C, 0) + 3 > available && next < end) { next = CharNextExA(static_cast(g_textCodePage), next, 0); } @@ -1140,7 +1140,7 @@ void UIEditCtrl_Custom::Synchronize() { this->firstVisible = std::min(this->cursor - tail, scrolled); } } else if (this->cursor < previousCursor) { - if (this->TextWidth(fonts, locale, this->text.c_str(), this->cursor, 0, 12, this->unknown_011C, 0) + 3 < available && this->firstVisible > this->cursor) { + if (this->TextWidth(this->text.c_str(), this->cursor, 0, 12, this->unknown_011C, 0) + 3 < available && this->firstVisible > this->cursor) { this->firstVisible += this->cursor - previousCursor; } @@ -1590,7 +1590,7 @@ void UIItemDropCntWnd::Paint() { // FUNCTION: fn_13328 void UIItemBaseWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -1681,24 +1681,20 @@ void UIMerchantItemMyShopWnd::Paint() { if (this->unknown_0100 == 1) { if (remaining <= 60000) { - this->DrawTextAt( - controls.fonts, controls.locale, 12, this->geometry.height - 42, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, + this->DrawTextAt(12, this->geometry.height - 42, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 11, 0xFF, 1, 0 ); } else { - this->DrawTextAt( - controls.fonts, controls.locale, 12, this->geometry.height - 42, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, + this->DrawTextAt(12, this->geometry.height - 42, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 11, 0, 1, 0 ); } } else if (remaining <= 60000) { - this->DrawTextAt( - controls.fonts, controls.locale, 20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, + this->DrawTextAt(20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 12, 0xFF, 1, 0 ); } else { - this->DrawTextAt( - controls.fonts, controls.locale, 20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, + this->DrawTextAt(20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 12, 0, 1, 0 ); } @@ -1756,7 +1752,7 @@ void UIMerchantItemPurchaseMSGWnd::Slot15(int, int) { // FUNCTION: fn_13340 void UIMerchantItemPurchaseMSGWnd::Paint() { this->ClearSurface(0xFFFFFFFF); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + this->DrawTitleBar(false, "", 0); this->DrawButtonBar(2, 0, 1); } @@ -1770,24 +1766,20 @@ void UIMerchantItemWnd::Paint() { this->DrawBitmap(10, this->geometry.height - 22, &count->image, true); const std::uint32_t countColor = g_session.cartCount >= g_session.cartMaxCount ? 0xFF : 0x232323; - this->DrawTextAt( - controls.fonts, controls.locale, 23, this->geometry.height - 19, FormatOwnedString("%d", g_session.cartCount).c_str(), 0, 0, 11, countColor, 0, 0 + this->DrawTextAt(23, this->geometry.height - 19, FormatOwnedString("%d", g_session.cartCount).c_str(), 0, 0, 11, countColor, 0, 0 ); - const int countWidth = this->TextWidth(controls.fonts, controls.locale, FormatOwnedString("%d", g_session.cartCount).c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, countWidth + 24, this->geometry.height - 19, FormatOwnedString("/%d", g_session.cartMaxCount).c_str(), 0, 0, 11, 0, 0, 0 + const int countWidth = this->TextWidth(FormatOwnedString("%d", g_session.cartCount).c_str(), 0, 0, 11, 0, 0); + this->DrawTextAt(countWidth + 24, this->geometry.height - 19, FormatOwnedString("/%d", g_session.cartMaxCount).c_str(), 0, 0, 11, 0, 0, 0 ); const auto* weight = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\inventory\\icon_weight.bmp"))); this->DrawBitmap(75, this->geometry.height - 20, &weight->image, true); const std::uint32_t weightColor = g_session.cartWeight >= g_session.cartMaxWeight ? 0xFF : 0x232323; - this->DrawTextAt( - controls.fonts, controls.locale, 90, this->geometry.height - 19, FormatOwnedString("%d", g_session.cartWeight).c_str(), 0, 0, 11, weightColor, 0, 0 + this->DrawTextAt(90, this->geometry.height - 19, FormatOwnedString("%d", g_session.cartWeight).c_str(), 0, 0, 11, weightColor, 0, 0 ); - const int weightWidth = this->TextWidth(controls.fonts, controls.locale, FormatOwnedString("%d", g_session.cartWeight).c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, weightWidth + 91, this->geometry.height - 19, FormatOwnedString("/%d", g_session.cartMaxWeight).c_str(), 0, 0, 11, 0, 0, 0 + const int weightWidth = this->TextWidth(FormatOwnedString("%d", g_session.cartWeight).c_str(), 0, 0, 11, 0, 0); + this->DrawTextAt(weightWidth + 91, this->geometry.height - 19, FormatOwnedString("/%d", g_session.cartMaxWeight).c_str(), 0, 0, 11, 0, 0, 0 ); } @@ -1855,16 +1847,16 @@ void UISkillListWnd::Paint() { this->FillRegion(72, 17, slotColumns * 32 - 32, slotRows * 32, RGB(red, green, fillBlue)); if (this->skillTab == 0) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 17, 4, LookupMessage(0x3A9), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 16, 3, LookupMessage(0x3A9), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, LookupMessage(0x3A9), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, LookupMessage(0x3A9), 0, 0, 12, 0, 0, 0); std::sprintf(text, LookupMessage(0x11C), *reinterpret_cast(g_session.unknown_1664)); } else if (this->skillTab == 1) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 17, 4, LookupMessage(0x4EE), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 16, 3, LookupMessage(0x4EE), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, LookupMessage(0x4EE), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, LookupMessage(0x4EE), 0, 0, 12, 0, 0, 0); } if (this->skillTab != 1) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 16, this->geometry.height - 20, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(16, this->geometry.height - 20, text, 0, 0, 12, 0, 0, 0); } int drawn = 0; @@ -1902,7 +1894,7 @@ void UISkillListWnd::Paint() { int levelX; if (CSkillInfo::UsesLevel(*g_session.m_hotkeyScript, static_cast(it->id))) { std::sprintf(text, g_serviceType != 12 ? "Lv :" : "Nv :"); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x + 124, top + 34, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 124, top + 34, text, 0, 0, 12, 0, 0, 0); if (this->skillTab == 0) { skillLevel = g_session.HomunSkillLevel(static_cast(it->id)); } else if (this->skillTab == 1) { @@ -1912,7 +1904,7 @@ void UISkillListWnd::Paint() { skillLevel = it->level; } std::sprintf(text, "%2d", skillLevel); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x + 149, top + 34, text, 0, 0, 12, skillLevel != it->level ? 0xFF : 0, 0, 0); + this->DrawTextAt(x + 149, top + 34, text, 0, 0, 12, skillLevel != it->level ? 0xFF : 0, 0, 0); format = "/ %2d"; levelX = 168; } else { @@ -1920,7 +1912,7 @@ void UISkillListWnd::Paint() { levelX = 113; } std::sprintf(text, format, it->level); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, levelX + x, top + 34, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(levelX + x, top + 34, text, 0, 0, 12, 0, 0, 0); if (it->unknown_000C == 0) { std::sprintf(text, LookupMessage(0x11E)); @@ -1944,13 +1936,13 @@ void UISkillListWnd::Paint() { std::sprintf(text, "Sp : %d", sp); } } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x + 212, top + 34, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 212, top + 34, text, 0, 0, 12, 0, 0, 0); shade = 0; } x += 112; std::string name = this->FitDisplayText(this->geometry.width - x - 20, it->DisplayName(*g_session.m_hotkeyScript), 0, 12, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, top + 22, name.c_str(), 0, 0, 12, RGB(shade, shade, shade), 0, 0); + this->DrawTextAt(x, top + 22, name.c_str(), 0, 0, 12, RGB(shade, shade, shade), 0, 0); if (++drawn == this->visibleRows * this->columns) { break; } @@ -3513,7 +3505,7 @@ std::string UIEditCtrl3::PlaceLineLinks(const char* line, std::string& text, con if (button) { buttons.push_back(button); button->line = *lineIndex; - button->column = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, result.c_str(), 0, 0, 12, 0, 0) - this->textY; + button->column = this->TextWidth(result.c_str(), 0, 0, 12, 0, 0) - this->textY; result += button->label; } } @@ -3539,11 +3531,11 @@ std::string UIEditCtrl3::PlaceLineLinks(const char* line, std::string& text, con button->SetTooltip(item.DisplayName(0).c_str()); button->m_hoverColor = 0x82F2E1; button->SetId(0x1D0); - button->ResizeToTextClipped(this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, name.c_str(), 0, 0, 12, 0, 0) + 1, button->geometry.height); + button->ResizeToTextClipped(this->TextWidth(name.c_str(), 0, 0, 12, 0, 0) + 1, button->geometry.height); this->AddChild(button); buttons.push_back(button); button->line = *lineIndex; - button->column = this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, result.c_str(), 0, 0, 12, 0, 0) - this->textY; + button->column = this->TextWidth(result.c_str(), 0, 0, 12, 0, 0) - this->textY; result += name; position += static_cast(link.size() + g_itemLinkClose.size() + g_itemLinkOpen.size()); } @@ -7142,7 +7134,7 @@ void UIChatEditCtrl::InsertItemLink(const ITEM_INFO& item) { // FUNCTION: fn_13335 void UIItemStoreFindWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned red, green, blue; SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); @@ -7195,14 +7187,14 @@ void UIItemStoreFindWnd::Paint() { } } - this->DrawTextAt(controls.fonts, controls.locale, 16, this->geometry.height - 20, this->unknown_0124.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(16, this->geometry.height - 20, this->unknown_0124.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x00980610 // FUNCTION: fn_13336 void UIItemStoreSubWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned red, green, blue; SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); @@ -7255,14 +7247,14 @@ void UIItemStoreSubWnd::Paint() { } } - this->DrawTextAt(controls.fonts, controls.locale, 16, this->geometry.height - 20, this->unknown_0120.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(16, this->geometry.height - 20, this->unknown_0120.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0097E7A0 // FUNCTION: fn_13330 void UIItemPurchaseWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -7378,8 +7370,8 @@ void UIItemPurchaseWnd::Paint() { } if (this->unknown_00FC != 0) { - this->DrawTextAt(controls.fonts, controls.locale, 12, this->geometry.height - 48, LookupMessage(1306), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 179, this->geometry.height - 48, LookupMessage(1307), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(12, this->geometry.height - 48, LookupMessage(1306), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(179, this->geometry.height - 48, LookupMessage(1307), 0, 0, 12, 0, 0, 0); this->FillRegion(109, this->geometry.height - 51, 66, 18, 0x8E8E8E); } } @@ -7390,7 +7382,7 @@ void UIItemSellWnd::Paint() { UIButtonContext& controls = *this->m_controls; char price[64]; char text[64]; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -7492,7 +7484,7 @@ void UIItemSellWnd::Paint() { // FUNCTION: fn_13334 void UIItemShopWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -7625,12 +7617,12 @@ void UIItemShopWnd::Paint() { const int aid = *reinterpret_cast(&g_session.unknown_5913[0x1D]); const char* name = this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0); int length = sprintf(text, LookupMessage(message), name, aid); - this->DrawTextAt(controls.fonts, controls.locale, 12, this->geometry.height - 21, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(12, this->geometry.height - 21, text, length, 0, 12, 0, 0, 0); const int gid = *reinterpret_cast(&g_session.unknown_5913[0x21]); name = this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0); length = sprintf(text, LookupMessage(1305), name, gid); - this->DrawTextAt(controls.fonts, controls.locale, 12, this->geometry.height - this->unknown_0104 - 21, text, length, 0, 12, 0, 0, 0); + this->DrawTextAt(12, this->geometry.height - this->unknown_0104 - 21, text, length, 0, 12, 0, 0, 0); } } @@ -7638,7 +7630,7 @@ void UIItemShopWnd::Paint() { // FUNCTION: fn_13337 void UIItemStoreWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -7727,16 +7719,16 @@ void UIItemStoreWnd::Paint() { const auto* icon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\inventory\\icon_num.bmp"))); this->DrawBitmap(6, this->geometry.height - 21, &icon->image, true); const std::uint32_t color = this->unknown_0188 >= this->unknown_018C ? 0xFF : 0x232323; - this->DrawTextAt(controls.fonts, controls.locale, 22, this->geometry.height - 19, FormatOwnedString("%d", this->unknown_0188).c_str(), 0, 0, 11, color, 0, 0); - const int width = this->TextWidth(controls.fonts, controls.locale, FormatOwnedString("%d", this->unknown_0188).c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, width + 23, this->geometry.height - 19, FormatOwnedString("/%d", this->unknown_018C).c_str(), 0, 0, 11, 0, 0, 0); + this->DrawTextAt(22, this->geometry.height - 19, FormatOwnedString("%d", this->unknown_0188).c_str(), 0, 0, 11, color, 0, 0); + const int width = this->TextWidth(FormatOwnedString("%d", this->unknown_0188).c_str(), 0, 0, 11, 0, 0); + this->DrawTextAt(width + 23, this->geometry.height - 19, FormatOwnedString("/%d", this->unknown_018C).c_str(), 0, 0, 11, 0, 0, 0); } // OFFSET: 0x009819C0 // FUNCTION: fn_13341 void UIMerchantItemPurchaseWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -7822,7 +7814,7 @@ void UIMerchantItemPurchaseWnd::Paint() { void UIMerchantShopMakeWnd::Paint() { UIButtonContext& controls = *this->m_controls; this->ClearSurface(0xFF); - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); unsigned red, green, blue; SkinPaletteChannels(controls.resources, 2, 2, red, green, blue); @@ -7868,8 +7860,8 @@ void UIMerchantShopMakeWnd::Paint() { } for (int i = 0, y = 72; i < count; ++i, y += 42) { - this->DrawTextAt(controls.fonts, controls.locale, this->geometry.width - 155, y - 15, LookupMessage(1721), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, this->geometry.width - 176, y - 15, LookupMessage(588), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->geometry.width - 155, y - 15, LookupMessage(1721), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->geometry.width - 176, y - 15, LookupMessage(588), 0, 0, 12, 0, 0, 0); DrawItemSlotBackground(*this, 3, y - 18); if (i >= this->unknown_012C) { continue; @@ -7887,28 +7879,27 @@ void UIMerchantShopMakeWnd::Paint() { } const int x = this->geometry.width - 155; - this->DrawTextAt(controls.fonts, controls.locale, x, y, LookupMessage(3222), 0, 0, 12, 0, 0, 0); - const int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(3222), 0, 0, 12, 0, 0); + this->DrawTextAt(x, y, LookupMessage(3222), 0, 0, 12, 0, 0, 0); + const int width = this->TextWidth(LookupMessage(3222), 0, 0, 12, 0, 0); const double rate = PriceCommission(price) * 0.01; price += static_cast(price * rate); FormatGroupedInteger(price, text, 24); const PriceColors colors = PriceColor(price); if (colors.secondary == 0xFFFFFFFF) { - this->DrawTextAt(controls.fonts, controls.locale, width + x, y, text, 0, 0, 12, colors.primary, 0, 0); + this->DrawTextAt(width + x, y, text, 0, 0, 12, colors.primary, 0, 0); } else { this->DrawEmboldenedText(width + x, y, text, colors.primary, colors.secondary, 0, 0, 12); } } - this->DrawTextAt(controls.fonts, controls.locale, 17, 4, LookupMessage(1720), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 3, LookupMessage(1720), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 2, 25, LookupMessage(282), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, LookupMessage(1720), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, LookupMessage(1720), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(2, 25, LookupMessage(282), 0, 0, 12, 0, 0, 0); - const int labelWidth = this->TextWidth(controls.fonts, controls.locale, LookupMessage(1723), 0, 0, 12, 0, 0) + 10; + const int labelWidth = this->TextWidth(LookupMessage(1723), 0, 0, 12, 0, 0) + 10; this->unknown_0128->Move(labelWidth, this->geometry.height - barHeight + 5); - this->DrawTextAt(controls.fonts, controls.locale, 5, this->geometry.height - barHeight + 5, LookupMessage(1723), 0, 0, 12, 0, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, this->unknown_0128->geometry.width + this->unknown_0128->geometry.x + 5, this->geometry.height - barHeight + 5, + this->DrawTextAt(5, this->geometry.height - barHeight + 5, LookupMessage(1723), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->unknown_0128->geometry.width + this->unknown_0128->geometry.x + 5, this->geometry.height - barHeight + 5, "Zeny", 0, 0, 12, 0, 0, 0 ); @@ -7916,7 +7907,7 @@ void UIMerchantShopMakeWnd::Paint() { char text[32] = {}; FormatGroupedInteger(g_session.m_zeny, grouped, 16); sprintf(text, "%s Zeny", grouped); - this->DrawTextAt(controls.fonts, controls.locale, 5, this->geometry.height - barHeight * 2 + 5, LookupMessage(1722), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, this->geometry.height - barHeight * 2 + 5, LookupMessage(1722), 0, 0, 12, 0, 0, 0); this->DrawRightAlignedText(155, this->geometry.height - barHeight * 2 + 5, text, 0, 0, 12, 0, 0); std::uint32_t color; @@ -7933,7 +7924,7 @@ void UIMerchantShopMakeWnd::Paint() { messageY = this->geometry.height - 72; } else { for (int i = 0, y = 72; i < this->visibleRows; ++i, y += 42) { - this->DrawTextAt(controls.fonts, controls.locale, this->geometry.width - 165, y - 15, LookupMessage(369), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->geometry.width - 165, y - 15, LookupMessage(369), 0, 0, 12, 0, 0, 0); DrawItemSlotBackground(*this, 3, y - 18); if (i >= this->unknown_012C) { continue; @@ -7951,27 +7942,27 @@ void UIMerchantShopMakeWnd::Paint() { } const int x = this->geometry.width - 165; - this->DrawTextAt(controls.fonts, controls.locale, x, y, LookupMessage(3222), 0, 0, 12, 0, 0, 0); - const int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(3222), 0, 0, 12, 0, 0); + this->DrawTextAt(x, y, LookupMessage(3222), 0, 0, 12, 0, 0, 0); + const int width = this->TextWidth(LookupMessage(3222), 0, 0, 12, 0, 0); const double rate = PriceCommission(price) * -0.01; price += static_cast(price * rate); FormatGroupedInteger(price, text, 24); const PriceColors colors = PriceColor(price); if (colors.secondary == 0xFFFFFFFF) { - this->DrawTextAt(controls.fonts, controls.locale, width + x, y, text, 0, 0, 12, colors.primary, 0, 0); + this->DrawTextAt(width + x, y, text, 0, 0, 12, colors.primary, 0, 0); } else { this->DrawEmboldenedText(width + x, y, text, colors.primary, colors.secondary, 0, 0, 12); } } - this->DrawTextAt(controls.fonts, controls.locale, 17, 4, LookupMessage(224), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 3, LookupMessage(224), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 2, 25, LookupMessage(282), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 4, LookupMessage(224), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 3, LookupMessage(224), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(2, 25, LookupMessage(282), 0, 0, 12, 0, 0, 0); message = LookupMessage(3223); messageY = this->geometry.height - 43; } - this->DrawTextAt(controls.fonts, controls.locale, 5, messageY, message, 0, 0, 12, 0xFF, 0, 0); + this->DrawTextAt(5, messageY, message, 0, 0, 12, 0xFF, 0, 0); ItemDescriptions descriptions{g_itemDescriptions}; int visible = 0; @@ -8567,7 +8558,7 @@ bool UIEditCtrl3::LinkDisplayName(const std::string& encoded, std::string& outpu // FUNCTION: fn_13342 void UIMerchantItemShopWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -8617,8 +8608,8 @@ void UIMerchantItemShopWnd::Paint() { this->m_context->registration.Add(this); sprintf(title, "%s", label); } - this->DrawTextAt(controls.fonts, controls.locale, 17, 3, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 2, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 3, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 2, title, 0, 0, 12, 0, 0, 0); } ItemDescriptions descriptions{g_itemDescriptions}; @@ -8643,9 +8634,9 @@ void UIMerchantItemShopWnd::Paint() { int x; if (this->unknown_010C != 0) { sprintf(price, LookupMessage(182), it->quantity); - const int quantityX = this->geometry.width - this->TextWidth(controls.fonts, controls.locale, " 100,000,000Z", 0, 0, 12, 0, 0) - - this->TextWidth(controls.fonts, controls.locale, price, 0, 0, 12, 0, 0) - 18; - this->DrawTextAt(controls.fonts, controls.locale, quantityX, top + 29, price, 0, 0, 12, 0xFF, 0, 0); + const int quantityX = this->geometry.width - this->TextWidth(" 100,000,000Z", 0, 0, 12, 0, 0) - + 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); } else { @@ -8663,8 +8654,8 @@ void UIMerchantItemShopWnd::Paint() { ); } - int width = this->TextWidth(controls.fonts, controls.locale, "Z", 0, 0, 12, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, this->geometry.width - width - 18, top + 29, "Z", 0, 0, 12, 0, 0, 0); + int width = this->TextWidth("Z", 0, 0, 12, 0, 0); + this->DrawTextAt(this->geometry.width - width - 18, top + 29, "Z", 0, 0, 12, 0, 0, 0); char text[128]; if (it->unknown_0014[0] != it->unknown_0014[1]) { @@ -8672,8 +8663,8 @@ void UIMerchantItemShopWnd::Paint() { } else { sprintf(text, " %s ", FormatGroupedInteger(static_cast(it->unknown_0014[0]), price, 128)); } - width += this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); - this->DrawAmount(controls.fonts, controls.locale, static_cast(it->unknown_0014[0]), text, this->geometry.width - width - 18, top + 29); + width += this->TextWidth(text, 0, 0, 12, 0, 0); + this->DrawAmount(static_cast(it->unknown_0014[0]), text, this->geometry.width - width - 18, top + 29); int nameWidth = this->geometry.width - width - left - 66; if (nameWidth > 130) { @@ -8695,13 +8686,11 @@ void UIMerchantItemShopWnd::Paint() { const int minutes = remaining / 60000 % 60; const int seconds = remaining / 1000 % 60; if (remaining <= 60000) { - this->DrawTextAt( - controls.fonts, controls.locale, 20, this->geometry.height - 50, + this->DrawTextAt(20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 12, 0xFF, 1, 0 ); } else { - this->DrawTextAt( - controls.fonts, controls.locale, 20, this->geometry.height - 50, + this->DrawTextAt(20, this->geometry.height - 50, FormatOwnedString(LookupMessage(2927), days, hours, minutes, seconds).c_str(), 0, 0, 12, 0, 1, 0 ); } @@ -8921,7 +8910,7 @@ void UISkillListWnd::Slot28(int x, int y) { if (std::strlen(name) != 0) { int tooltipY = (index - this->scroll) * 32 + 17; int tooltipX = 112; - if (this->TextWidth(this->m_context->fonts, this->m_context->locale, name, 0, 0, 12, 0, 0) > this->geometry.width - 132 && x > tooltipX) { + if (this->TextWidth(name, 0, 0, 12, 0, 0) > this->geometry.width - 132 && x > tooltipX) { this->ToScreen(tooltipX, tooltipY); reinterpret_cast(g_modeMgr.gameMode)->Show(name, tooltipX - 8, tooltipY, 0xFFFFFFFF, 0, 1); } @@ -8932,7 +8921,7 @@ void UISkillListWnd::Slot28(int x, int y) { // FUNCTION: fn_13331 void UIItemSellWnd2::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -9012,7 +9001,7 @@ void UIItemSellWnd2::Paint() { // FUNCTION: fn_13333 void UIItemShopWnd2::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -9228,7 +9217,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // FUNCTION: fn_13338 void UIItemWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(106), 0); + this->DrawTitleBar(true, LookupMessage(106), 0); if (this->geometry.height == 17) { return; @@ -9364,10 +9353,9 @@ void UIItemWnd::Paint() { const int count = reinterpret_cast(&g_session)->GetList0Size() + g_session.CountItems17F0() + g_session.CountItems2B50(); const std::uint32_t color = count >= g_extraInventorySlots + 100 ? 0xFF : 0x232323; - this->DrawTextAt(controls.fonts, controls.locale, 35, this->geometry.height - 15, FormatOwnedString("%d", count).c_str(), 0, 0, 11, color, 0, 0); - const int width = this->TextWidth(controls.fonts, controls.locale, FormatOwnedString("%d", count).c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, width + 36, this->geometry.height - 15, FormatOwnedString("/%d", g_extraInventorySlots + 100).c_str(), 0, 0, 11, 0, 0, 0 + this->DrawTextAt(35, this->geometry.height - 15, FormatOwnedString("%d", count).c_str(), 0, 0, 11, color, 0, 0); + const int width = this->TextWidth(FormatOwnedString("%d", count).c_str(), 0, 0, 11, 0, 0); + this->DrawTextAt(width + 36, this->geometry.height - 15, FormatOwnedString("/%d", g_extraInventorySlots + 100).c_str(), 0, 0, 11, 0, 0, 0 ); } diff --git a/Source/UI/Edit/UIEditCtrl3.cpp b/Source/UI/Edit/UIEditCtrl3.cpp index e3fc9ba5..86a13654 100644 --- a/Source/UI/Edit/UIEditCtrl3.cpp +++ b/Source/UI/Edit/UIEditCtrl3.cpp @@ -86,11 +86,11 @@ void UIEditCtrl3::PlaceLinks(const std::string& value, int y, int line, int firs int x = 3; if (this->invalidatesParent == 0 && this->firstVisible != 0) { - x = 3 - this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, this->text.c_str(), this->firstVisible, 0, 12, 0, 0); + x = 3 - this->TextWidth(this->text.c_str(), this->firstVisible, 0, 12, 0, 0); } button->line = line; - button->Move(x - 1 + this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, prefix.c_str(), 0, 0, 12, 0, 0), y); + button->Move(x - 1 + this->TextWidth(prefix.c_str(), 0, 0, 12, 0, 0), y); } this->SnapLinkSelection(prefix.size(), fitted.size()); diff --git a/Source/UI/Edit/UIEditLinks.cpp b/Source/UI/Edit/UIEditLinks.cpp index c5e24aec..67bfb8d6 100644 --- a/Source/UI/Edit/UIEditLinks.cpp +++ b/Source/UI/Edit/UIEditLinks.cpp @@ -145,7 +145,7 @@ void UIEditCtrl::UpdateLinks() { if (this->firstVisible != 0 && prefix.size() <= static_cast(this->firstVisible)) { button->Move(1000, this->textY - 1); } else { - button->Move(this->TextWidth(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, visible.c_str(), 0, 0, 12, 0, 0) + 2, this->textY - 1); + button->Move(this->TextWidth(visible.c_str(), 0, 0, 12, 0, 0) + 2, this->textY - 1); } this->SnapLinkSelection(prefix.size(), fitted.size()); diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index 9cca4e30..364ea90d 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -126,7 +126,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in current = reinterpret_cast((*reinterpret_cast(g_serverLanguage))[5])(g_serverLanguage, start, static_cast(end - start)); const int length = static_cast(current - start); const TextLocale locale = {}; - width += this->TextWidth(g_fontCache, locale, start, length, 0, 12, 0, 0); + width += this->TextWidth(start, length, 0, 12, 0, 0); bytes += length; if (length == 1 && *start == '\n') { @@ -177,7 +177,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in current = reinterpret_cast((*reinterpret_cast(g_serverLanguage))[5])(g_serverLanguage, start, static_cast(end - start)); const int length = static_cast(current - start); const TextLocale locale = {}; - width += this->TextWidth(g_fontCache, locale, start, length, 0, 12, 0, 0); + width += this->TextWidth(start, length, 0, 12, 0, 0); bytes += length; if (length == 1 && *start == '\n') { @@ -447,7 +447,7 @@ void UIEditCtrl3::PaintText() { int x = 3; if (this->invalidatesParent == 0 && this->firstVisible != 0) { - x = 3 - this->TextWidth(fonts, locale, this->text.c_str(), this->firstVisible, 0, 12, 0, 0); + x = 3 - this->TextWidth(this->text.c_str(), this->firstVisible, 0, 12, 0, 0); } std::string display; @@ -513,13 +513,13 @@ void UIEditCtrl3::PaintText() { begin = 0; } - startX = begin != 0 ? this->TextWidth(fonts, locale, lines[line].c_str(), begin, 0, 12, 0, 0) : 0; + startX = begin != 0 ? this->TextWidth(lines[line].c_str(), begin, 0, 12, 0, 0) : 0; int length = static_cast(std::strlen(lines[line].c_str())); if (breaks[line]) { length -= 2; } - endX = this->TextWidth(fonts, locale, lines[line].c_str(), length, 0, 12, 0, 0); + endX = this->TextWidth(lines[line].c_str(), length, 0, 12, 0, 0); } if (selectionEnd <= offset) { @@ -532,7 +532,7 @@ void UIEditCtrl3::PaintText() { if (static_cast(std::strlen(lines[line].c_str())) == end && breaks[line]) { length = end - 2; } - endX = length != 0 ? this->TextWidth(fonts, locale, lines[line].c_str(), length, 0, 12, 0, 0) : 0; + endX = length != 0 ? this->TextWidth(lines[line].c_str(), length, 0, 12, 0, 0) : 0; } int left = x + startX; @@ -571,7 +571,7 @@ void UIEditCtrl3::PaintText() { buffer[length - 2] = '\0'; } - this->DrawTextAt(fonts, locale, x, tagOffset + y, buffer, 0, 0, 12, color, 0, 0); + this->DrawTextAt(x, tagOffset + y, buffer, 0, 0, 12, color, 0, 0); for (std::vector& entry : this->entries) { for (std::size_t index = 0; index < entry.size(); ++index) { @@ -635,7 +635,7 @@ void UIEditCtrl3::PaintText() { int caretX = 0; if (column != 0) { - caretX = this->TextWidth(fonts, locale, lines[caretLine].c_str(), column, 0, 12, 0, 0); + caretX = this->TextWidth(lines[caretLine].c_str(), column, 0, 12, 0, 0); caretLine = this->textY; } @@ -648,7 +648,7 @@ void UIEditCtrl3::PaintText() { readingLength = reading - 2; } - const int readingX = readingLength != 0 ? this->TextWidth(fonts, locale, lines[caretLine].c_str(), readingLength, 0, 12, 0, 0) : 0; + const int readingX = readingLength != 0 ? this->TextWidth(lines[caretLine].c_str(), readingLength, 0, 12, 0, 0) : 0; if (this->m_edit->candidateCursor != 0) { int gap = readingX - caretX; @@ -666,7 +666,7 @@ void UIEditCtrl3::PaintText() { } if ((timeGetTime() / 500 & 1) == 0 && (!g_windowMgr.IsHoverOnWindow01C8Button() || g_inputSuggestionsEnabled)) { - this->DrawTextAt(fonts, locale, x - 2 + caretX, (wrapped + this->textY - first) * this->unknown_0138, "|", 0, 0, 12, color, 0, 0); + this->DrawTextAt(x - 2 + caretX, (wrapped + this->textY - first) * this->unknown_0138, "|", 0, 0, 12, color, 0, 0); const unsigned char* scroll = reinterpret_cast(&this->unknown_015C); if (scroll[0] == 0) { @@ -752,7 +752,7 @@ void UIEditCtrl3::PaintText() { // FUNCTION: fn_10742 int UIEditCtrl::MeasureText(const std::string& text, const int& bytes) { const TextLocale locale = {}; - return this->TextWidth(g_fontCache, locale, text.c_str(), bytes, 0, 12, 0, 0); + return this->TextWidth(text.c_str(), bytes, 0, 12, 0, 0); } // OFFSET: 0x0084F7B0 diff --git a/Source/UI/Emotion/UIEmotionWnd.cpp b/Source/UI/Emotion/UIEmotionWnd.cpp index 47707707..8e6aa8ae 100644 --- a/Source/UI/Emotion/UIEmotionWnd.cpp +++ b/Source/UI/Emotion/UIEmotionWnd.cpp @@ -98,7 +98,7 @@ void UIEmotionWnd::Slot15(int, int) { // FUNCTION: fn_11645 void UIEmotionWnd::Paint() { const TextLocale locale = {}; - int titleHeight = this->UIWindow::DrawTitleBar(g_fontCache, locale, true, LookupMessage(574), 0); + int titleHeight = this->UIWindow::DrawTitleBar(true, LookupMessage(574), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); } diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index cfda678d..acf552ab 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp @@ -44,7 +44,7 @@ void UIEntryQueueHelpWnd::Slot18() { // FUNCTION: fn_19681 void UIEntryQueueHelpWnd::Paint() { auto& controls = this->m_entryQueue->text.buttons; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2125), 0); + this->DrawTitleBar(true, LookupMessage(2125), 0); this->DrawPanelBackground(17, 0, ""); } @@ -179,7 +179,7 @@ void UIEntryQueueRequestWnd::Slot18() { // FUNCTION: fn_19693 void UIEntryQueueRequestWnd::Paint() { auto& controls = this->m_entryQueue->text.buttons; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2133), 0); + this->DrawTitleBar(true, LookupMessage(2133), 0); this->DrawPanelBackground(17, 0, ""); char text[100]; @@ -290,7 +290,7 @@ void UIEntryQueueStandByWnd::Slot18() { // FUNCTION: fn_19700 void UIEntryQueueStandByWnd::Paint() { auto& controls = this->m_entryQueue->text.buttons; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2135), 0); + this->DrawTitleBar(true, LookupMessage(2135), 0); this->DrawPanelBackground(17, 0, ""); } @@ -384,7 +384,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { if (this->m_labels[index]) { const char* label = labels[index]; const TextLocale locale = {}; - this->m_labels[index]->SetSize(this->TextWidth(g_fontCache, locale, label, 0, 0, 12, 0, 0), 25); + this->m_labels[index]->SetSize(this->TextWidth(label, 0, 0, 12, 0, 0), 25); this->m_labels[index]->SetText(label, 0); this->m_labels[index]->Move(157, y); this->AddChild(this->m_labels[index]); @@ -434,7 +434,7 @@ void UIEntryQueueWnd::Slot15(int width, int height) { // FUNCTION: fn_19708 void UIEntryQueueWnd::Paint() { const TextLocale locale = {}; - this->DrawTitleBar(g_fontCache, locale, true, LookupMessage(0x603), 0); + this->DrawTitleBar(true, LookupMessage(0x603), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -606,7 +606,7 @@ void UIEntryQueueWnd::SelectQueue(EntryQueueInfo* info) { const int width = label->geometry.width; const int y = label->geometry.y; const TextLocale locale = {}; - this->m_values[index]->Resize(this->TextWidth(g_fontCache, locale, text, 0, 0, 12, 0, 0), 25); + this->m_values[index]->Resize(this->TextWidth(text, 0, 0, 12, 0, 0), 25); this->m_values[index]->SetText(text, 0); this->m_values[index]->Move(x + width + 5, y); this->m_values[index]->Invalidate(); diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index b431e0c9..b2780528 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -30,7 +30,7 @@ UIAgitMessageBox::UIAgitMessageBox() // FUNCTION: fn_13068 void UIAgitMessageBox::Paint() { auto& controls = this->m_dialog->buttons; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(3640), 0); + this->DrawTitleBar(true, LookupMessage(3640), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); } @@ -104,7 +104,7 @@ void UIListBoxAgitMenu::Paint() { if (index == this->selected) { this->FillRegion(3, this->lineHeight * index + 1, this->geometry.width - 6, this->lineHeight - 2, RGB(red, green, blue)); } - this->DrawTextAt(owner.fonts, owner.locale, 3, this->lineHeight * index + 1, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(3, this->lineHeight * index + 1, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); } } diff --git a/Source/UI/Guild/UIGuildHelperWnd.cpp b/Source/UI/Guild/UIGuildHelperWnd.cpp index 425772ed..7a5cbd6d 100644 --- a/Source/UI/Guild/UIGuildHelperWnd.cpp +++ b/Source/UI/Guild/UIGuildHelperWnd.cpp @@ -54,10 +54,10 @@ UIGuildBanReasonDescWnd::UIGuildBanReasonDescWnd() { // FUNCTION: fn_13071 void UIGuildHelperWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2074), 0); + this->DrawTitleBar(true, LookupMessage(2074), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(controls.fonts, controls.locale, 15, 32, LookupMessage(2075), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(15, 32, LookupMessage(2075), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0095FCB0 @@ -109,8 +109,8 @@ void UICreateGuildWnd::Paint() { text = 2089; title = 2088; } - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(title), 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 23, LookupMessage(text), 0, 0, 12, 0, 0, 0); + this->DrawTitleBar(true, LookupMessage(title), 0); + this->DrawTextAt(16, 23, LookupMessage(text), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0095FBE0 @@ -132,7 +132,7 @@ void UICreateGuildWnd::Slot31(int, int) { // FUNCTION: fn_13078 void UIGuildTipWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2078), 0); + this->DrawTitleBar(true, LookupMessage(2078), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); } diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index 2d50ceef..272c2229 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -120,7 +120,7 @@ void UIGuildWnd::Paint() { } auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); unsigned borderRed, borderGreen, borderBlue; SkinPaletteChannels(ResourceMgr::Instance(), 14, 6, borderRed, borderGreen, borderBlue); this->FillRegion(0, 41, this->geometry.width, this->geometry.height - 41, RGB(borderRed, borderGreen, borderBlue)); @@ -1030,7 +1030,7 @@ void UIGuildInfoManageWnd::Slot15(int, int) { this->m_agitList = new UIListBoxAgit(*this->m_context, *this->m_listContext); this->m_agitList->SetSize(95, 158); - this->m_agitList->Move(this->TextWidth(this->m_controls->fonts, this->m_controls->locale, LookupMessage(333), 0, 0, 12, 0, 0) + 19, 129); + 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); @@ -1156,8 +1156,8 @@ void UIGuildNoticeWnd::Paint() { char label[64]; std::sprintf(label, "%s:", LookupMessage(515)); auto& controls = *this->m_controls; - this->DrawTextAt(controls.fonts, controls.locale, 5, 67, label, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 5, 86, LookupMessage(516), 0, 0, 12, 0, 0, 0); + 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); } @@ -1343,17 +1343,17 @@ void UIGuildSkillWnd::Paint() { gray = 120; } else { std::sprintf(text, g_serviceType == 12 ? "Nv : %d" : "Lv : %d", skill->level); - this->DrawTextAt(controls.fonts, controls.locale, x + 113, y + 58, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 113, y + 58, text, 0, 0, 12, 0, 0, 0); if (skill->unknown_000C == 0) { std::sprintf(text, LookupMessage(286)); } else { std::sprintf(text, "Sp : %d", skill->unknown_0014); } - this->DrawTextAt(controls.fonts, controls.locale, x + 212, y + 58, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 212, y + 58, text, 0, 0, 12, 0, 0, 0); gray = 0; } - this->DrawTextAt(controls.fonts, controls.locale, x + 112, y + 46, skill->DisplayName(*g_session.m_hotkeyScript), 0, 0, 12, RGB(gray, gray, gray), 0, 0); + this->DrawTextAt(x + 112, y + 46, skill->DisplayName(*g_session.m_hotkeyScript), 0, 0, 12, RGB(gray, gray, gray), 0, 0); if (++drawn == this->m_visibleRows * this->m_columns) { break; } @@ -1361,7 +1361,7 @@ void UIGuildSkillWnd::Paint() { char points[64]; std::sprintf(points, "SkillPoint : %d", g_session.m_guildSkillPoint); - this->DrawTextAt(controls.fonts, controls.locale, this->geometry.width - 100, this->geometry.height - 20, points, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->geometry.width - 100, this->geometry.height - 20, points, 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0095E9B0 @@ -1424,7 +1424,7 @@ void UIGuildPositionManageWnd::Paint() { auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 6; ++column) { - this->DrawTextAt(controls.fonts, controls.locale, x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); x += widths[column] + 1; } @@ -1445,7 +1445,7 @@ void UIGuildPositionManageWnd::Paint() { char buffer[512]; char path[128]; std::sprintf(buffer, "%d", position->id); - this->DrawTextAt(controls.fonts, controls.locale, 8, y, buffer, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, y, buffer, 0, 0, 12, 0, 0, 0); if (this->unknown_0180[drawn]) { this->unknown_0180[drawn]->SetText(position->name.c_str()); this->unknown_0180[drawn]->Move(g_guildPositionColumnWidths[0] + 9, y - 2); @@ -1495,9 +1495,7 @@ void UIGuildPositionManageWnd::Paint() { std::sprintf(buffer, "%d", position->tax); this->unknown_0154[drawn]->SetText(buffer); this->unknown_0154[drawn]->Move(taxX, y - 2); - this->DrawTextAt( - controls.fonts, controls.locale, - g_guildPositionColumnWidths[5] / 2 + g_guildPositionColumnWidths[4] + g_guildPositionColumnWidths[3] + g_guildPositionColumnWidths[2] + + this->DrawTextAt(g_guildPositionColumnWidths[5] / 2 + g_guildPositionColumnWidths[4] + g_guildPositionColumnWidths[3] + g_guildPositionColumnWidths[2] + g_guildPositionColumnWidths[1] + g_guildPositionColumnWidths[0] + 13, y, "%", 0, 0, 12, 0, 0, 0 ); @@ -1521,16 +1519,16 @@ void UIGuildInfoManageWnd::Paint() { GuildInfo& guild = g_guildInfo; char text[1024]; std::sprintf(text, "%s : %s", LookupMessage(328), guild.unknown_0000.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 49, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 49, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %d", LookupMessage(329), guild.unknown_0060); - this->DrawTextAt(controls.fonts, controls.locale, 8, 65, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 65, text, 0, 0, 12, 0, 0, 0); const std::string master = this->StripNamelessTag(g_guildInfo.unknown_0018); std::sprintf(text, "%s : %s", LookupMessage(330), master.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 81, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 81, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %d / %d", LookupMessage(331), guild.unknown_0064, guild.unknown_006C); - this->DrawTextAt(controls.fonts, controls.locale, 8, 97, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 97, text, 0, 0, 12, 0, 0, 0); - const int width = this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); std::sprintf(text, "%s", "유저인터페이스\\basic_interface\\grp_online.bmp"); CBitmapRes* online = static_cast(ResourceMgr::Instance().Load(Resolve(text))); int x; @@ -1541,23 +1539,23 @@ void UIGuildInfoManageWnd::Paint() { } else { this->DrawBitmap(width + 16, 95, &online->image, true); std::sprintf(text, " %d", guild.unknown_0068); - this->TextWidth(controls.fonts, controls.locale, LookupMessage(330), 0, 0, 12, 0, 0); + this->TextWidth(LookupMessage(330), 0, 0, 12, 0, 0); x = online->image.width + 16 + width; } - this->DrawTextAt(controls.fonts, controls.locale, x, 97, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x, 97, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %d", LookupMessage(332), guild.unknown_0070); - this->DrawTextAt(controls.fonts, controls.locale, 8, 113, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 113, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %s", LookupMessage(333), guild.unknown_0074.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, 8, 129, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(8, 129, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s : %d", LookupMessage(335), guild.unknown_008C); - this->DrawTextAt(controls.fonts, controls.locale, 200, 49, text, 0, 0, 12, guild.unknown_0060 >= 50 ? 0xFF : 0, 0, 0); + this->DrawTextAt(200, 49, text, 0, 0, 12, guild.unknown_0060 >= 50 ? 0xFF : 0, 0, 0); std::sprintf(text, "%s", LookupMessage(336)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 73, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 73, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s", LookupMessage(338)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 139, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 139, text, 0, 0, 12, 0, 0, 0); std::sprintf(text, "%s", LookupMessage(339)); - this->DrawTextAt(controls.fonts, controls.locale, 200, 213, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 213, text, 0, 0, 12, 0, 0, 0); unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, red, green, blue); @@ -1585,7 +1583,7 @@ void UIGuildInfoManageWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(204, y, 80, 16, RGB(hoverRed, hoverGreen, hoverBlue)); } - this->DrawTextAt(controls.fonts, controls.locale, 204, y, related->unknown_0008.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(204, y, related->unknown_0008.c_str(), 0, 0, 12, 0, 0, 0); ++row; y += 16; } @@ -1605,7 +1603,7 @@ void UIGuildInfoManageWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 6, 2, hoverRed, hoverGreen, hoverBlue); this->FillRegion(204, y, 80, 16, RGB(hoverRed, hoverGreen, hoverBlue)); } - this->DrawTextAt(controls.fonts, controls.locale, 204, y, related->unknown_0008.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(204, y, related->unknown_0008.c_str(), 0, 0, 12, 0, 0, 0); ++row; y += 16; } @@ -1677,7 +1675,7 @@ void UIGuildTotalInfoWnd::Paint() { auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 4; ++column) { - this->DrawTextAt(controls.fonts, controls.locale, x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); x += widths[column] + 1; } @@ -1700,15 +1698,12 @@ void UIGuildTotalInfoWnd::Paint() { this->m_rows[drawn]->SetTextFitted(entry->name.c_str()); this->m_rows[drawn]->Move(8, y); std::sprintf(buffer, "%d", entry->unknown_001C); - this->DrawTextAt(controls.fonts, controls.locale, g_guildTotalInfoColumnWidths[0] + 9, y, buffer, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(g_guildTotalInfoColumnWidths[0] + 9, y, buffer, 0, 0, 12, 0, 0, 0); std::sprintf(buffer, "%d/%d", entry->unknown_0020, entry->unknown_0024); - this->DrawTextAt( - controls.fonts, controls.locale, g_guildTotalInfoColumnWidths[0] + g_guildTotalInfoColumnWidths[1] + 10, y, buffer, 0, 0, 12, 0, 0, 0 + this->DrawTextAt(g_guildTotalInfoColumnWidths[0] + g_guildTotalInfoColumnWidths[1] + 10, y, buffer, 0, 0, 12, 0, 0, 0 ); std::sprintf(buffer, "%d", entry->unknown_0028); - this->DrawTextAt( - controls.fonts, controls.locale, - g_guildTotalInfoColumnWidths[0] + g_guildTotalInfoColumnWidths[1] + g_guildTotalInfoColumnWidths[2] + 11, y, buffer, 0, 0, 12, 0, 0, 0 + this->DrawTextAt(g_guildTotalInfoColumnWidths[0] + g_guildTotalInfoColumnWidths[1] + g_guildTotalInfoColumnWidths[2] + 11, y, buffer, 0, 0, 12, 0, 0, 0 ); if (++drawn == this->m_visibleRows * this->m_columns) { return; @@ -1872,7 +1867,7 @@ void UIGuildBanishedMemberWnd::Paint() { auto& controls = *this->m_controls; int x = 0; for (int column = 0; column < 2; ++column) { - this->DrawTextAt(controls.fonts, controls.locale, x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 8, 49, headers[column], 0, 0, 12, 0, 0, 0); x += widths[column] + 1; } @@ -2007,7 +2002,7 @@ bool UIGuildMemberManageWnd::DrawMember(GuildInfo::Member& member, int& index, i lastLogin[0] = '\0'; } auto& controls = *this->m_controls; - this->DrawTextAt(controls.fonts, controls.locale, 8, y + 17, FormatOwnedString(LookupMessage(3012), lastLogin).c_str(), 0, 0, 11, 0x404040, 0, 0); + this->DrawTextAt(8, y + 17, FormatOwnedString(LookupMessage(3012), lastLogin).c_str(), 0, 0, 11, 0x404040, 0, 0); return true; } @@ -2565,9 +2560,9 @@ void UIGuildMemberManageWnd::Paint() { int textX = 10; for (int column = 0; column < 6; ++column) { const char* header = headers[column]; - this->DrawTextAt(controls.fonts, controls.locale, textX, 51, header, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(textX, 51, header, 0, 0, 12, 0, 0, 0); if (column == this->m_sortColumn) { - const int arrowX = this->TextWidth(controls.fonts, controls.locale, header, 0, 0, 12, 0, 0) + textX; + const int arrowX = this->TextWidth(header, 0, 0, 12, 0, 0) + textX; if (this->m_sortOrders[this->m_sortColumn] == 1) { const auto* arrow = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\guild\\guild_arrow_up.bmp"))); this->DrawBitmap(arrowX, 53, arrow ? &arrow->image : nullptr, true); diff --git a/Source/UI/Guild/UIGuild_Storage_Log.cpp b/Source/UI/Guild/UIGuild_Storage_Log.cpp index c175470c..5299caff 100644 --- a/Source/UI/Guild/UIGuild_Storage_Log.cpp +++ b/Source/UI/Guild/UIGuild_Storage_Log.cpp @@ -138,7 +138,7 @@ void UIGuild_Storage_Log::FillRows() { std::sprintf(pages, "%02d / %02d", page, this->m_pageCounts[index]); } } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 175, 228, pages, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(175, 228, pages, 0, 0, 12, 0, 0, 0); const std::vector& logs = g_guildStorageLogs[index]; char number[256]; @@ -180,7 +180,7 @@ void UIGuild_Storage_Log::FillRows() { // OFFSET: 0x0094D290 // FUNCTION: fn_12904 void UIGuild_Storage_Log::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(0x9F3), 0); + this->DrawTitleBar(true, LookupMessage(0x9F3), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); const BitmapImage* out = reinterpret_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\out.bmp"))); @@ -193,12 +193,12 @@ void UIGuild_Storage_Log::Paint() { this->unknown_0158->colors[this->m_category] = 0xC89623; this->unknown_0158->Invalidate(); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 234, 23, LookupMessage(0x9F4), 0, 0, 11, 0xFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 6, 47, LookupMessage(0x9EE), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 70, 47, LookupMessage(0x9EA), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 150, 47, LookupMessage(0x9EB), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 200, 47, LookupMessage(0x9EC), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 320, 47, LookupMessage(0x9ED), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(234, 23, LookupMessage(0x9F4), 0, 0, 11, 0xFF, 0, 0); + this->DrawTextAt(6, 47, LookupMessage(0x9EE), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(70, 47, LookupMessage(0x9EA), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(150, 47, LookupMessage(0x9EB), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(200, 47, LookupMessage(0x9EC), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(320, 47, LookupMessage(0x9ED), 0, 0, 12, 0, 0, 0); this->FillRows(); int y = 60; diff --git a/Source/UI/Item/UIMerchantItemLogWnd.cpp b/Source/UI/Item/UIMerchantItemLogWnd.cpp index 33818eb2..f5a2302b 100644 --- a/Source/UI/Item/UIMerchantItemLogWnd.cpp +++ b/Source/UI/Item/UIMerchantItemLogWnd.cpp @@ -76,7 +76,7 @@ void UIMerchantItemLogWnd::Slot15(int width, int height) { // FUNCTION: fn_13576 void UIMerchantItemLogWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -139,7 +139,7 @@ void UIMerchantItemLogWnd::Paint() { char name[26] = {}; StringFormat(name, sizeof(name), static_cast(-1), "%s", log->name.c_str()); - this->DrawTextAt(controls.fonts, controls.locale, textX, textY, name, static_cast(std::strlen(name)), 0, 12, 0, 0, 0); + this->DrawTextAt(textX, textY, name, static_cast(std::strlen(name)), 0, 12, 0, 0, 0); textX += 150; char price[64]; @@ -147,13 +147,13 @@ void UIMerchantItemLogWnd::Paint() { std::memset(price, 0, sizeof(price)); std::memset(grouped, 0, sizeof(grouped)); const int length = std::sprintf(price, " %10s Zeny", FormatGroupedInteger(static_cast(it->unknown_0014[0]), grouped, sizeof(grouped))); - this->DrawTextAt(controls.fonts, controls.locale, textX, textY, price, length, 0, 12, 0, 0, 0); + this->DrawTextAt(textX, textY, price, length, 0, 12, 0, 0, 0); textX += 110; char date[20] = {}; Timestamp stamp(log->time); StringFormat(date, sizeof(date), static_cast(-1), "%02d/%02d - %02d:%02d:%02d", stamp.Month(), stamp.Day(), stamp.Hour(), stamp.Minute(), stamp.Second()); - this->DrawTextAt(controls.fonts, controls.locale, textX, textY, date, static_cast(std::strlen(date)), 0, 12, 0, 0, 0); + this->DrawTextAt(textX, textY, date, static_cast(std::strlen(date)), 0, 12, 0, 0, 0); ++visible; } diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index b340c408..aab7143a 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -676,7 +676,7 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std // FUNCTION: fn_13751 void UIParaItemShopWnd::Paint() { UIButtonContext& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); if (titleHeight == this->geometry.height) { return; } @@ -788,10 +788,10 @@ void UIParaItemShopWnd::Paint() { } else { text = FormatOwnedString(LookupMessage(1210), this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0), g_pendingAid); } - this->DrawTextAt(controls.fonts, controls.locale, 12, this->geometry.height - 21, text.c_str(), text.size(), 0, 12, 0, 0, 0); + this->DrawTextAt(12, this->geometry.height - 21, text.c_str(), text.size(), 0, 12, 0, 0, 0); text = FormatOwnedString(LookupMessage(1305), this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0), g_pendingGid); - this->DrawTextAt(controls.fonts, controls.locale, 12, this->geometry.height - barHeight - 21, text.c_str(), text.size(), 0, 12, 0, 0, 0); + this->DrawTextAt(12, this->geometry.height - barHeight - 21, text.c_str(), text.size(), 0, 12, 0, 0, 0); } } @@ -799,7 +799,7 @@ void UIParaItemShopWnd::Paint() { // FUNCTION: fn_13752 void UIParaResultWnd::Paint() { UIButtonContext& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; diff --git a/Source/UI/Items/MergeItemWnd.cpp b/Source/UI/Items/MergeItemWnd.cpp index b6fd7085..e27ec1ce 100644 --- a/Source/UI/Items/MergeItemWnd.cpp +++ b/Source/UI/Items/MergeItemWnd.cpp @@ -133,7 +133,7 @@ void CMergeItemWnd::Paint() { auto& controls = *this->m_controls; unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2169), 0); + this->DrawTitleBar(true, LookupMessage(2169), 0); this->FillRegion(0, 17, this->geometry.width, this->geometry.height, RGB(red, green, blue)); for (int index = 0; index < this->m_visibleCount; ++index) { diff --git a/Source/UI/Items/UIIllustWnd.cpp b/Source/UI/Items/UIIllustWnd.cpp index 18a27387..ee53d2de 100644 --- a/Source/UI/Items/UIIllustWnd.cpp +++ b/Source/UI/Items/UIIllustWnd.cpp @@ -58,7 +58,7 @@ void UIIllustWnd::Paint() { int top = 0; CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_bitmapName.c_str()))); if (this->m_titled != 0) { - top = this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + top = this->DrawTitleBar(false, "", 0); } this->DrawBitmap(0, top, &bitmap->image, true); } @@ -70,7 +70,7 @@ void UIMultiIllustWnd::Paint() { int top = 0; CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_bitmapName.c_str()))); if (this->m_titled != 0) { - top = this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + top = this->DrawTitleBar(false, "", 0); } this->DrawBitmap(0, top, &bitmap->image, true); } diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index 7058f1c8..948d925b 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -27,7 +27,7 @@ // FUNCTION: fn_13609 void UIItemRepairWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(812), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(812), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); } @@ -36,7 +36,7 @@ void UIItemRepairWnd::Paint() { // FUNCTION: fn_13612 void UIMakeTargetResultWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); diff --git a/Source/UI/Items/UIMakeTargetListWnd.cpp b/Source/UI/Items/UIMakeTargetListWnd.cpp index 972ca0ed..2872342f 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.cpp +++ b/Source/UI/Items/UIMakeTargetListWnd.cpp @@ -42,7 +42,7 @@ std::vector UIMakeTargetListWnd::BuildReplayRecords() { // FUNCTION: fn_13610 void UIMakeTargetListWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(425), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(425), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); } diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.cpp b/Source/UI/Items/UIMakeTargetProcessWnd.cpp index f02184df..ea48c8ea 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.cpp +++ b/Source/UI/Items/UIMakeTargetProcessWnd.cpp @@ -120,7 +120,7 @@ ITEM_INFO UIMakeTargetProcessWnd::GetItemAt(int x, int y) { // FUNCTION: fn_13611 void UIMakeTargetProcessWnd::Paint() { UIButtonContext& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -159,7 +159,7 @@ void UIMakeTargetProcessWnd::Paint() { const std::vector& lines = FindMetalProcessItems(this->makeType); int y = 42; for (unsigned int index = 0; index < lines.size(); ++index, y += 20) { - this->DrawTextAt(controls.fonts, controls.locale, 16, y, lines[index], 0, 0, 12, 0, 0, 0); + this->DrawTextAt(16, y, lines[index], 0, 0, 12, 0, 0, 0); } } diff --git a/Source/UI/Items/UIWeaponRefineWnd.cpp b/Source/UI/Items/UIWeaponRefineWnd.cpp index 8e2a65c9..719bf16a 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.cpp +++ b/Source/UI/Items/UIWeaponRefineWnd.cpp @@ -43,7 +43,7 @@ std::vector UIWeaponRefineWnd::BuildReplayRecords() { // FUNCTION: fn_13613 void UIWeaponRefineWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(910), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(910), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); } diff --git a/Source/UI/Lists/UIChatHisBox.cpp b/Source/UI/Lists/UIChatHisBox.cpp index 1ba9ee69..58a1936f 100644 --- a/Source/UI/Lists/UIChatHisBox.cpp +++ b/Source/UI/Lists/UIChatHisBox.cpp @@ -44,7 +44,7 @@ std::string UIChatHisBox::ResolvePlayerTags(const char* name) { const std::size_t found = tail.find(bracket); const std::string head = result.substr(0, position + found); position += found + std::strlen(bracket.c_str()); - tag->column = this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, head.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; + tag->column = this->TextWidth(head.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; } else { const std::size_t found = result.find(LookupMessage(581)); const std::string player = LookupPlayerName(tag->unknown_01F8); @@ -57,13 +57,13 @@ std::string UIChatHisBox::ResolvePlayerTags(const char* name) { const std::size_t start = tail.find(opening); const std::string head = result.substr(0, position + start); position += start + std::strlen(opening.c_str()) + 1; - tag->column = this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, head.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; + tag->column = this->TextWidth(head.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; const std::string bracket = display.BracketName(naming.DisplayName(reinterpret_cast(tag->unknown_00F8), 0)); tag->SetTooltip(bracket.c_str()); const std::string text = bracket.c_str(); tag->label = text; - tag->ResizeToTextClipped(this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, bracket.c_str(), 0, 0, 12, 0, 0) + 1, tag->geometry.height); + tag->ResizeToTextClipped(this->TextWidth(bracket.c_str(), 0, 0, 12, 0, 0) + 1, tag->geometry.height); this->lines[line] = result; } } diff --git a/Source/UI/Lists/UIComboBoxDefWnd.cpp b/Source/UI/Lists/UIComboBoxDefWnd.cpp index 7f4f0f08..215a0709 100644 --- a/Source/UI/Lists/UIComboBoxDefWnd.cpp +++ b/Source/UI/Lists/UIComboBoxDefWnd.cpp @@ -319,7 +319,7 @@ void UIComboBoxDef2Wnd::Paint() { } auto& controls = this->m_controls->buttons; - const int width = this->TextWidth(controls.fonts, controls.locale, this->label->text.c_str(), 0, 0, 12, 0, 0); + 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); if (x != this->previousTextX) { @@ -513,23 +513,23 @@ void UIDescriptRace::sub_8A0B10() { return; } - this->DrawTextAt(context.fonts, context.locale, 50, 23, LookupMessage(3018), 0, 0, 12, 0x99634C, 1, 0); - this->DrawTextAt(context.fonts, context.locale, 49, 22, LookupMessage(3018), 0, 0, 12, 0xFFFFFF, 1, 0); + this->DrawTextAt(50, 23, LookupMessage(3018), 0, 0, 12, 0x99634C, 1, 0); + this->DrawTextAt(49, 22, LookupMessage(3018), 0, 0, 12, 0xFFFFFF, 1, 0); std::vector lines; WrapPlainText(LookupMessage(3021), lines, 40, g_serverLanguage->language); int y = 22; for (unsigned index = 0; index < lines.size(); ++index) { - this->DrawTextAt(context.fonts, context.locale, 112, y, lines[index].c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(112, y, lines[index].c_str(), 0, 0, 12, 0, 0, 0); y += 20; } } else if (this->m_race == 0) { - this->DrawTextAt(context.fonts, context.locale, 50, 23, LookupMessage(3016), 0, 0, 12, 0x99634C, 1, 0); - this->DrawTextAt(context.fonts, context.locale, 49, 22, LookupMessage(3016), 0, 0, 12, 0xFFFFFF, 1, 0); + this->DrawTextAt(50, 23, LookupMessage(3016), 0, 0, 12, 0x99634C, 1, 0); + this->DrawTextAt(49, 22, LookupMessage(3016), 0, 0, 12, 0xFFFFFF, 1, 0); std::vector lines; WrapPlainText(LookupMessage(3020), lines, 40, g_serverLanguage->language); int y = 22; for (unsigned index = 0; index < lines.size(); ++index) { - this->DrawTextAt(context.fonts, context.locale, 112, y, lines[index].c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(112, y, lines[index].c_str(), 0, 0, 12, 0, 0, 0); y += 20; } } diff --git a/Source/UI/Lists/UIComboBoxEx.cpp b/Source/UI/Lists/UIComboBoxEx.cpp index 95e8c967..f7cef4ba 100644 --- a/Source/UI/Lists/UIComboBoxEx.cpp +++ b/Source/UI/Lists/UIComboBoxEx.cpp @@ -220,11 +220,11 @@ void UIComboBoxEx::DrawRows(bool centered) { int x = (3 - this->horizontalOffset); if (centered) { - const int width = this->TextWidth(owner.fonts, owner.locale, row.text.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(row.text.c_str(), 0, 0, 12, 0, 0); x = static_cast(static_cast(this->geometry.width) * 0.5f - static_cast(width) * 0.5f); } - this->DrawTextAt(owner.fonts, owner.locale, x, ((this->lineHeight * (index - this->topLine)) + 2), row.text.c_str(), 0, 0, 12, row.color, 0, 0); + this->DrawTextAt(x, ((this->lineHeight * (index - this->topLine)) + 2), row.text.c_str(), 0, 0, 12, row.color, 0, 0); } } diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index b4ea1918..595845de 100644 --- a/Source/UI/Lists/UIListBox.cpp +++ b/Source/UI/Lists/UIListBox.cpp @@ -232,7 +232,7 @@ void UIChatHisBox::AddText(const char* text, int color, const char* style) { void UIListBox::AddLine(const char* text) { this->lines.emplace_back(text); auto& owner = *this->m_listContext; - const int width = this->TextWidth(owner.fonts, owner.locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); } @@ -539,7 +539,7 @@ void UIComboBoxID::AddLine(const char* text, int id, int data) { const int index = static_cast(this->lines.size()); this->lines.emplace(index, IdListLine{id, text}); const TextLocale locale = {}; - const int width = this->TextWidth(g_fontCache, locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); @@ -553,7 +553,7 @@ void UIComboBoxID::AddLine(const char* text, int id, int data) { void UIListBoxID::AddLine(const char* text, int id) { this->lines.emplace(static_cast(this->lines.size()), IdListLine{id, text}); const TextLocale locale = {}; - const int width = this->TextWidth(g_fontCache, locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); } diff --git a/Source/UI/Lists/UIListBoxEx.cpp b/Source/UI/Lists/UIListBoxEx.cpp index 4757212e..66e1bb47 100644 --- a/Source/UI/Lists/UIListBoxEx.cpp +++ b/Source/UI/Lists/UIListBoxEx.cpp @@ -79,7 +79,7 @@ void UIListBoxEx::Resize(int width, int height) { void UIListBoxEx::AddLine(const char* text, std::uint32_t color) { this->lines.emplace(static_cast(this->lines.size()), ExtendedListLine{text, color}); auto& owner = *this->m_listContext; - const int width = this->TextWidth(owner.fonts, owner.locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->contentWidth = std::max(this->contentWidth, width); this->Refresh(); } diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index 1b0cde64..261b2a44 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -518,7 +518,7 @@ void UITabControl::AddTab(const char* label, const char* tooltip) { const int tabWidth = this->parent->geometry.width / this->labels.size() - this->tabPadding; for (std::size_t index = 0; index < this->labels.size(); ++index) { - if (this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0) > tabWidth) { + if (this->TextWidth(this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0) > tabWidth) { if (index != this->labels.size() - 1) { if (this->tooltips[index].empty()) { this->tooltips[index] = this->labels[index]; @@ -541,9 +541,9 @@ void UITabControl::AddTab(const char* label, const char* tooltip) { int width; if (this->layout == 0 || this->layout == 2) { - width = this->VerticalTextHeight(this->m_controls->fonts, this->m_controls->locale, label, 0, 0, this->unknown_00E8, 0); + width = this->VerticalTextHeight(label, 0, 0, this->unknown_00E8, 0); } else { - width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, label, 0, 0, this->unknown_00E8, 0, 0); + width = this->TextWidth(label, 0, 0, this->unknown_00E8, 0, 0); } this->widths.push_back(width + this->tabPadding); @@ -635,7 +635,7 @@ void UIEditCtrl_Custom::DrawLabel(int x, int y, const char* text) { const unsigned char bold = this->unknown_011C; const std::uint32_t color = this->textColor; if (outline == 0xFFFFFFFF) { - this->DrawTextAt(this->m_edit->buttons.fonts, this->m_edit->buttons.locale, x, y, text, 0, 0, 12, color, bold, 0); + this->DrawTextAt(x, y, text, 0, 0, 12, color, bold, 0); return; } @@ -657,10 +657,10 @@ void UIEditCtrl_Custom::PaintText() { const TextLocale& locale = this->m_edit->buttons.locale; const auto align = [&]() { if (this->unknown_0128 == 1) { - x = this->geometry.width - x - this->TextWidth(fonts, locale, display.c_str(), 0, 0, 12, this->unknown_011C, 0); + x = this->geometry.width - x - this->TextWidth(display.c_str(), 0, 0, 12, this->unknown_011C, 0); } else if (this->unknown_0128 == 2) { const float center = this->geometry.width * g_depthAverageHalf; - x = static_cast(center - this->TextWidth(fonts, locale, display.c_str(), 0, 0, 12, this->unknown_011C, 0) * g_depthAverageHalf); + x = static_cast(center - this->TextWidth(display.c_str(), 0, 0, 12, this->unknown_011C, 0) * g_depthAverageHalf); } }; @@ -680,8 +680,8 @@ void UIEditCtrl_Custom::PaintText() { } align(); - const int left = begin ? this->TextWidth(fonts, locale, display.c_str(), begin, 0, 12, 0, 0) : 0; - const int right = end ? this->TextWidth(fonts, locale, display.c_str(), end, 0, 12, 0, 0) : 0; + const int left = begin ? this->TextWidth(display.c_str(), begin, 0, 12, 0, 0) : 0; + const int right = end ? this->TextWidth(display.c_str(), end, 0, 12, 0, 0) : 0; if (std::abs(this->m_edit->input.cursor - this->m_edit->input.anchor) != 0) { this->DrawSelection(x + left, right - left); @@ -696,7 +696,7 @@ void UIEditCtrl_Custom::PaintText() { } else { this->DrawLabel(x, y, display.c_str()); if (IsInputSuggestionAllowed() == true && (timeGetTime() / 500 & 1) == 0) { - this->DrawTextAt(fonts, locale, x + left - 2, y, "|", 0, 0, 12, this->textColor, 0, 0); + this->DrawTextAt(x + left - 2, y, "|", 0, 0, 12, this->textColor, 0, 0); } } } else { @@ -745,13 +745,13 @@ void UIBasicItemCtrl::DrawItemIcon(int x, int y, int, bool compact) { } else { textY = y + 15; x += this->m_item.quantity < 1000 ? 14 : 0; - this->DrawTextAt(fonts, locale, x + 1, textY, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x - 1, textY, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x, y + 16, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x, y + 14, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 1, textY, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x - 1, textY, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x, y + 16, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x, y + 14, count.c_str(), 0, 0, 11, 0xFFFFFF, 0, 0); } - this->DrawTextAt(fonts, locale, x, textY, count.c_str(), 0, 0, 11, 0, 0, 0); + this->DrawTextAt(x, textY, count.c_str(), 0, 0, 11, 0, 0, 0); } // OFFSET: 0x008900D0 @@ -916,7 +916,7 @@ void UITabControl::Slot10(int argument1, int argument2, std::intptr_t argument3) void UITabControl::DrawVerticalTab(int index) { const int width = this->widths[index]; const int textHeight = - this->VerticalTextHeight(this->m_controls->fonts, this->m_controls->locale, this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0); + this->VerticalTextHeight(this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0); int y = 0; for (int previous = 0; previous < index; ++previous) { y += this->widths[previous] - 1; @@ -981,7 +981,7 @@ void UITabControl::DrawTabBorder(int x, int y, int width, int height, std::uint3 void UITabControl::DrawHorizontalTab(int index) { const int width = this->widths[index]; const int textWidth = - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0); + this->TextWidth(this->labels[index].c_str(), 0, 0, this->unknown_00E8, 0, 0); int x = 0; for (int previous = 0; previous < index; ++previous) { x += this->widths[previous] - 1; @@ -1008,8 +1008,7 @@ void UITabControl::DrawHorizontalTab(int index) { color = this->inactiveTextColor; } - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, (width - textWidth) / 2 + (width - textWidth) % 2 + x, y, this->labels[index].c_str(), 0, 0, + this->DrawTextAt((width - textWidth) / 2 + (width - textWidth) % 2 + x, y, this->labels[index].c_str(), 0, 0, this->unknown_00E8, color, 0, 0 ); } @@ -1045,7 +1044,7 @@ int UITabControl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; } - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text.c_str(), 0, 0, this->unknown_00E8, 0, 0); + const int width = this->TextWidth(text.c_str(), 0, 0, this->unknown_00E8, 0, 0); if ((this->tabPadding + width) * this->TabCount() >= this->parent->geometry.width - 90) { reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(1577), 0, true, false, 0, "Message", 280, 120, 0); } else { @@ -1266,8 +1265,7 @@ int UITreeView::LayoutNodes(std::list& nodes, int x, int y) { label->unknown_00DC = fitted; width = label->m_border ? maxWidth + 2 : maxWidth; } else { - width = label->TextWidth( - label->m_buttonContext->fonts, label->m_buttonContext->locale, label->label.c_str(), 0, label->m_fontFamily, label->m_fontHeight, + width = label->TextWidth(label->label.c_str(), 0, label->m_fontFamily, label->m_fontHeight, label->m_outlined, 0 ) + 2; @@ -1365,14 +1363,14 @@ void UIChatHisBox::Paint() { const int index = top + row; int x; if (g_serviceType == 19 && g_tipOfTheDayEnglish) { - const int width = this->TextWidth(fonts, locale, this->lines[index].c_str(), 0, 0, 12, 0, 0); - this->DrawTextAt(fonts, locale, this->geometry.width - width - 18, this->lineHeight * row + 4, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); + const int width = this->TextWidth(this->lines[index].c_str(), 0, 0, 12, 0, 0); + this->DrawTextAt(this->geometry.width - width - 18, this->lineHeight * row + 4, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); x = this->geometry.width - width - 19; } else { - this->DrawTextAt(fonts, locale, 3, this->lineHeight * row + 4, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(3, this->lineHeight * row + 4, this->lines[index].c_str(), 0, 0, 12, 0, 0, 0); x = 2; } - this->DrawTextAt(fonts, locale, x, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0); + this->DrawTextAt(x, this->lineHeight * row + 3, this->lines[index].c_str(), 0, 0, 12, this->unknown_00E4[index], 0, 0); this->PlaceNaviLinks(index); this->PlaceItemTags(index); } @@ -1854,8 +1852,7 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou if (button) { buttons.push_back(button); button->line = static_cast(this->lines.size()); - button->column = this->TextWidth( - this->m_listContext->fonts, this->m_listContext->locale, result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; + button->column = this->TextWidth(result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; result += button->GetLine(0); } } @@ -1879,7 +1876,7 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou button->m_hoverColor = 0x82F2E1; button->SetId(0x1D0); button->ResizeToTextClipped( - this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, label.c_str(), 0, 0, 12, 0, 0) + 1, + this->TextWidth(label.c_str(), 0, 0, 12, 0, 0) + 1, button->geometry.height); const std::string unknownName = LookupMessage(581); @@ -1893,8 +1890,7 @@ std::string UIChatHisBox::RenderItemLinks(const char* lineText, std::string& sou this->AddChild(button); buttons.push_back(button); button->line = static_cast(this->lines.size()); - button->column = this->TextWidth( - this->m_listContext->fonts, this->m_listContext->locale, result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; + button->column = this->TextWidth(result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; result += label; position += static_cast(encoded.size() + g_itemLinkTagEnd.size() + g_itemLinkTagBegin.size()); } @@ -1977,12 +1973,11 @@ std::string UIChatHisBox::RenderNavigationLinks(const char* text, std::string& s button->SetId(438); const int height = button->geometry.height; button->ResizeToTextClipped( - this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, label.c_str(), 0, 0, 12, 0, 0) + 1, height); + this->TextWidth(label.c_str(), 0, 0, 12, 0, 0) + 1, height); this->AddChild(button); buttons.push_back(button); button->line = static_cast(this->lines.size()); - button->column = this->TextWidth( - this->m_listContext->fonts, this->m_listContext->locale, result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; + button->column = this->TextWidth(result.c_str(), 0, 0, 12, 0, 0) - this->horizontalOffset; result += label; result += tail; @@ -2145,11 +2140,11 @@ void UIString::SetText(int width, int height, std::string text) { this->ParseTags(text); if (this->unknown_00AC.size() != 0) { - this->Resize(this->TextWidth(this->m_context->fonts, this->m_context->locale, this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0) + 24, 24); + this->Resize(this->TextWidth(this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0) + 24, 24); } else { this->Resize( - this->TextWidth(this->m_context->fonts, this->m_context->locale, this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0), - this->TextHeight(this->m_context->fonts, this->m_context->locale, this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0) + this->TextWidth(this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0), + this->TextHeight(this->unknown_00DC.c_str(), static_cast(this->unknown_00DC.size()), 0, 12, 0, 0) ); } } diff --git a/Source/UI/Lists/UITagListBox.cpp b/Source/UI/Lists/UITagListBox.cpp index 1079e39b..b82049e6 100644 --- a/Source/UI/Lists/UITagListBox.cpp +++ b/Source/UI/Lists/UITagListBox.cpp @@ -670,7 +670,7 @@ void UITagListBox::AddTagButton(STagInfoV2 tag, int lineCount) { button->Configure(tag.unknown_0010.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; button->ResizeToTextClipped( - this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, tag.unknown_0010.c_str(), 0, 0, 12, 0, 0) + 1, height + this->TextWidth(tag.unknown_0010.c_str(), 0, 0, 12, 0, 0) + 1, height ); button->m_hoverColor = 0x00FF7864; button->SetId(tag.unknown_0004); @@ -720,7 +720,7 @@ void UITagListBox::AddTagButton(STagInfoV2 tag, int lineCount) { const int prefixLength = static_cast(this->lines[index].size()) - bytes + tag.unknown_0008; const std::string stripped = StripColorTokens(this->lines[index].c_str(), prefixLength); const std::string prefix = stripped.substr(0, prefixLength); - x = this->TextWidth(this->m_listContext->fonts, this->m_listContext->locale, prefix.c_str(), 0, 0, 12, 0, 0) + 2; + x = this->TextWidth(prefix.c_str(), 0, 0, 12, 0, 0) + 2; line = index; break; } diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp index 26df64dd..382753a8 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp @@ -198,7 +198,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->types->Select(0); this->pageText = new UIStaticText(*this->m_context, controls); this->pageText->SetSize(this->geometry.width, 18); - const int textWidth = this->TextWidth(controls.fonts, controls.locale, "1/1", 0, 0, 12, 0, 0); + const int textWidth = this->TextWidth("1/1", 0, 0, 12, 0, 0); this->pageText->Resize((textWidth + 1), 16); this->pageText->SetText("1/1", 0); this->pageText->Move(this->geometry.width / 2 - textWidth / 2, 319); @@ -214,7 +214,7 @@ void UIAdvenPartyBoardWnd::Slot15(int, int) { this->stop = new UIBasicButton(*this->m_context, controls); const char* stopText = controls.services.MessageText(3375); - this->stop->Configure((this->TextWidth(controls.fonts, controls.locale, stopText, 0, 0, 12, 0, 0) + 10), stopText); + 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); @@ -305,7 +305,7 @@ 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(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); this->pageText->Resize((width + 1), 16); this->pageText->SetText(text, 0); this->pageText->Move(this->geometry.width / 2 - width / 2, 319); @@ -588,8 +588,8 @@ void UIAdvenPartyBoardWnd::Paint() { } const char* title = controls.services.MessageText(3504); - this->DrawTextAt(controls.fonts, controls.locale, 19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); + 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"); this->DrawBitmap(3, 3, icon ? &icon->image : nullptr, true); auto* barLeft = skin("btnbar_left2.bmp"); @@ -610,5 +610,5 @@ void UIAdvenPartyBoardWnd::Paint() { } } - this->DrawTextAt(controls.fonts, controls.locale, 36, 25, "~", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(36, 25, "~", 0, 0, 12, 0, 0, 0); } diff --git a/Source/UI/Party/UIApplyForPartyWnd.cpp b/Source/UI/Party/UIApplyForPartyWnd.cpp index 1ad121e0..a574828e 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.cpp +++ b/Source/UI/Party/UIApplyForPartyWnd.cpp @@ -50,7 +50,7 @@ void UIApplyForPartyWnd::Slot15(int, int) { for (int index = 0; index < 3; ++index) { auto* button = new UIBasicButton(*this->m_context, controls); const char* label = controls.services.MessageText(messages[index]); - const int width = this->TextWidth(controls.fonts, controls.locale, label, 0, 0, 12, 0, 0); + const int width = this->TextWidth(label, 0, 0, 12, 0, 0); button->Configure(width + 10, label); button->Move(positions[index], 165); button->SetId(ids[index]); @@ -128,11 +128,11 @@ void UIApplyForPartyWnd::Paint() { } const char* caption = controls.services.MessageText(3368); - this->DrawTextAt(controls.fonts, controls.locale, 19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); + 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(controls.fonts, controls.locale, x, y, value, 0, 0, 12, 0, 0, 0); }; + 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)); const std::string fitted = FitText(*this->geometry.surface, this->info.characterName, 119); text(60, 25, fitted.c_str()); diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index eb4cde39..8272b76e 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -573,7 +573,6 @@ void UIMiniPartyInfoWnd::Paint() { fitted = this->FitDisplayText(static_cast(static_cast(this->geometry.width) * 0.6f), text, 0, 12, 1); } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, 35, 9, fitted.c_str(), 0, 0, 12, this->m_owner->GetMember().offline == 1 ? 0xAAAAAA : 0xFFFFFF, 1, 0 + this->DrawTextAt(35, 9, fitted.c_str(), 0, 0, 12, this->m_owner->GetMember().offline == 1 ? 0xAAAAAA : 0xFFFFFF, 1, 0 ); } diff --git a/Source/UI/Party/UIPartyInfoWnd.cpp b/Source/UI/Party/UIPartyInfoWnd.cpp index d92b11d6..9f677ae0 100644 --- a/Source/UI/Party/UIPartyInfoWnd.cpp +++ b/Source/UI/Party/UIPartyInfoWnd.cpp @@ -88,7 +88,7 @@ void UIPartyInfoWnd::Paint() { this->DrawBitmap(0, 0, &background->image, false); } - const auto text = [&](int x, const char* value, int bytes = 0) { this->DrawTextAt(controls.fonts, controls.locale, x, 5, value, bytes, 0, 12, 0, 0, 0); }; + 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)); constexpr char prefix[] = "유저인터페이스\\UIadventurerAgency\\"; diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index 366d043d..b9d96db6 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -136,7 +136,7 @@ void UIRegisterPartyWnd::Slot15(int, int) { auto* submit = new UIBasicButton(*this->m_context, controls); const bool registered = g_adventurerAgencyMgr->registered; const char* title = controls.services.MessageText(registered ? 3376 : 3371); - submit->Configure(this->TextWidth(controls.fonts, controls.locale, title, 0, 0, 12, 0, 0) + 10, title); + submit->Configure(this->TextWidth(title, 0, 0, 12, 0, 0) + 10, title); submit->Move(108, 165); submit->SetId(registered ? 564 : 565); @@ -247,7 +247,7 @@ void UIRegisterPartyWnd::Paint() { const auto load = [&](const char* name) { return static_cast(controls.resources.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(controls.fonts, controls.locale, 86, 50, "~", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(86, 50, "~", 0, 0, 12, 0, 0, 0); int leftWidth = 0; int rightWidth = 0; int titleHeight = 0; @@ -274,8 +274,8 @@ void UIRegisterPartyWnd::Paint() { } const char* caption = controls.services.MessageText(3356); - this->DrawTextAt(controls.fonts, controls.locale, 19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); + 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); } diff --git a/Source/UI/Party/UIRequestJoinPartyWnd.cpp b/Source/UI/Party/UIRequestJoinPartyWnd.cpp index 8fa2d8a4..a2141a2f 100644 --- a/Source/UI/Party/UIRequestJoinPartyWnd.cpp +++ b/Source/UI/Party/UIRequestJoinPartyWnd.cpp @@ -60,7 +60,7 @@ void UIRequestJoinPartyWnd::Slot15(int, int) { for (int index = 0; index < 2; ++index) { auto* button = new UIBasicButton(*this->m_context, controls); const char* label = controls.services.MessageText(messages[index]); - button->Configure(this->TextWidth(controls.fonts, controls.locale, label, 0, 0, 12, 0, 0) + 10, label); + button->Configure(this->TextWidth(label, 0, 0, 12, 0, 0) + 10, label); button->Move(x[index], 136); button->SetId(ids[index]); this->AddChild(button); @@ -139,8 +139,8 @@ void UIRequestJoinPartyWnd::Paint() { } const char* caption = controls.services.MessageText(3505); - this->DrawTextAt(controls.fonts, controls.locale, 19, titleHeight - 13, caption, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 18, titleHeight - 14, caption, 0, 0, 12, 0, 0, 0); + 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); } @@ -192,7 +192,7 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t _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(controls.fonts, controls.locale, level, 0, 0, 12, 0, 0); + const int width = this->TextWidth(level, 0, 0, 12, 0, 0); this->levelText->Move(25 - width / 2, 56); this->details->Clear(); char messageText[1024] = {}; diff --git a/Source/UI/Quest/UIQuestDisplay.cpp b/Source/UI/Quest/UIQuestDisplay.cpp index 42a33e9f..c1b9e4a4 100644 --- a/Source/UI/Quest/UIQuestDisplay.cpp +++ b/Source/UI/Quest/UIQuestDisplay.cpp @@ -131,8 +131,8 @@ void UIQuestDisplay::Paint() { } const int y = index * 13 + top; - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 11, y + 29, hunt.c_str(), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 10, y + 28, hunt.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(11, y + 29, hunt.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, y + 28, hunt.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); } } diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index c773cc2b..2ad3d7c6 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -612,10 +612,10 @@ void UIRenewDetailQuestInfoWnd::Paint() { this->geometry.width >> 1, 39, g_renewQuestMgr->GetOngoingQuest(this->m_questId).m_title.c_str(), static_cast(g_renewQuestMgr->GetOngoingQuest(this->m_questId).m_title.size()), 0, 12, 0x55321D, 1 ); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 12, 393, this->m_timeText.c_str(), 0, 0, 12, 0x161BD2, 0, 0); + this->DrawTextAt(12, 393, this->m_timeText.c_str(), 0, 0, 12, 0x161BD2, 0, 0); } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 16, 2, LookupMessage(0xD48), 0, 0, 13, 0, 0, 0); + this->DrawTextAt(16, 2, LookupMessage(0xD48), 0, 0, 13, 0, 0, 0); } // OFFSET: 0x007FBAD0 @@ -801,7 +801,7 @@ void UIRenewQuestScrollBar::Paint() { void UIRenewQuestWnd::Paint() { this->ClearSurface(0xFFFF00FF); this->DrawPanelBackground(0, 0, FormatOwnedString("유저인터페이스\\renew_questui\\bg_quest%d.bmp", this->m_tab + 1).c_str()); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 45, 2, LookupMessage(3400), 0, 0, 13, 0, 0, 0); + this->DrawTextAt(45, 2, LookupMessage(3400), 0, 0, 13, 0, 0, 0); for (int index = 0; index < 9; ++index) { const int y = index * 46; @@ -828,8 +828,7 @@ void UIRenewQuestWnd::Paint() { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(background))); this->DrawBitmap(38, this->m_pressed + 24 + y, bitmap ? &bitmap->image : nullptr, true); this->m_rows.icons[index]->Move(46, this->m_pressed + 31 + y); - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 80, this->m_pressed + 30 + y, quest->m_title.empty() ? "" : quest->m_title.c_str(), 0, 0, 12, + this->DrawTextAt(80, this->m_pressed + 30 + y, quest->m_title.empty() ? "" : quest->m_title.c_str(), 0, 0, 12, 0xE47B2E, 1, 0 ); summary = quest->unknown_004C.empty() ? "" : quest->unknown_004C.c_str(); @@ -838,14 +837,13 @@ void UIRenewQuestWnd::Paint() { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\renew_questui\\bg_questList.bmp"))); this->DrawBitmap(38, y + 24, bitmap ? &bitmap->image : nullptr, true); this->m_rows.icons[index]->Move(46, y + 31); - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 80, y + 30, quest->m_title.empty() ? "" : quest->m_title.c_str(), 0, 0, 12, 0x955322, 1, 0 + this->DrawTextAt(80, y + 30, quest->m_title.empty() ? "" : quest->m_title.c_str(), 0, 0, 12, 0x955322, 1, 0 ); summary = quest->unknown_004C.empty() ? "" : quest->unknown_004C.c_str(); summaryY = y; } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 80, summaryY + 48, summary, 0, 0, 12, 0x38302E, 0, 0); + this->DrawTextAt(80, summaryY + 48, summary, 0, 0, 12, 0x38302E, 0, 0); } } diff --git a/Source/UI/Rodex/UIRodexComposeWnd.cpp b/Source/UI/Rodex/UIRodexComposeWnd.cpp index 9dba71ca..300a0cbf 100644 --- a/Source/UI/Rodex/UIRodexComposeWnd.cpp +++ b/Source/UI/Rodex/UIRodexComposeWnd.cpp @@ -263,7 +263,7 @@ UIRodexComposeWnd::~UIRodexComposeWnd() { // OFFSET: 0x007FF260 // FUNCTION: fn_09998 int UIRodexComposeWnd::MeasureText(const std::string& text, const unsigned& bytes) { - return this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), bytes, 0, 12, 0, 0); + return this->TextWidth(text.c_str(), bytes, 0, 12, 0, 0); } // OFFSET: 0x007FF290 @@ -463,7 +463,7 @@ void UIRodexComposeWnd::Paint() { } std::string countStr = FormatOwnedString("/ %d", 1000); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 261, 276, countStr.c_str(), 0, 0, 10, 0xD66E44, 0, 0); + this->DrawTextAt(261, 276, countStr.c_str(), 0, 0, 10, 0xD66E44, 0, 0); int length = this->m_contents->Length() + this->m_contents->unknown_00F0; std::string lengthStr = FormatOwnedString("%d", length); @@ -473,7 +473,7 @@ void UIRodexComposeWnd::Paint() { this->DrawBitmap(199, 305, weightBg, true); const char* weightMsg = LookupMessage(3035); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 245, 316, weightMsg, 0, 0, 11, 0x737373, 0, 0); + this->DrawTextAt(245, 316, weightMsg, 0, 0, 11, 0x737373, 0, 0); std::string weightStr = FormatOwnedString("%d", static_cast(g_session.unknown_6140)); this->DrawRightAlignedText(244, 316, weightStr.c_str(), 0, 0, 11, 0x737373, 0); @@ -484,12 +484,12 @@ void UIRodexComposeWnd::Paint() { const auto* zenyIcon = &static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\icon_zeny.bmp")))->image; this->DrawBitmap(19, 342, zenyIcon, true); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 135, 350, "Zeny", 0, 0, 11, 0x737373, 0, 0); + this->DrawTextAt(135, 350, "Zeny", 0, 0, 11, 0x737373, 0, 0); char zenyBuf[260] = {}; FormatGroupedInteger(static_cast(g_session.m_zeny), zenyBuf, sizeof(zenyBuf)); std::string zenyStr = FormatOwnedString("%s Zeny", zenyBuf); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 144, 350, zenyStr.c_str(), 0, 0, 11, 0x737373, 1, 0); + this->DrawTextAt(144, 350, zenyStr.c_str(), 0, 0, 11, 0x737373, 1, 0); const auto* taxBg = &static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\bg_tax.bmp")))->image; this->DrawBitmap(9, 377, taxBg, true); @@ -593,12 +593,12 @@ void UIRodexComposeWnd::Slot15(int, int) { this->unknown_00BC->SetSize(this->unknown_00BC->BitmapWidth(), this->unknown_00BC->BitmapHeight()); { const int textX = static_cast( - static_cast(this->unknown_00BC->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDD9), 0, 0, 12, 0, 0)) * + static_cast(this->unknown_00BC->geometry.width - this->TextWidth(LookupMessage(0xDD9), 0, 0, 12, 0, 0)) * g_depthAverageHalf ); UIBmpTextButton* button = this->unknown_00BC; const int textY = static_cast( - static_cast(button->geometry.height - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDD9), 0, 0, 12, 0, 0)) * + static_cast(button->geometry.height - this->TextHeight(LookupMessage(0xDD9), 0, 0, 12, 0, 0)) * g_depthAverageHalf ); button->AddTextStyle(0, 12, 0x313131, 0, 0, textX, textY); diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index 5653ee6d..3061fb2e 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -148,9 +148,9 @@ void UIRodexInboxWnd::Slot15(int width, int height) { tab->Invalidate(); } { - const int textX = static_cast(static_cast(this->unknown_0138->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDC), 0, 0, 12, 0, 0)) * g_depthAverageHalf); + const int textX = static_cast(static_cast(this->unknown_0138->geometry.width - this->TextWidth(LookupMessage(0xDDC), 0, 0, 12, 0, 0)) * g_depthAverageHalf); UIBmpRadioBtn* tab = this->unknown_0138; - const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDC), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); + const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(LookupMessage(0xDDC), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); tab->AddText(0, 12, 0xCCB5AD, true, false, textX, textY); this->unknown_0138->AddText(1, 12, 0x9C3E1F, true, false, textX, textY); this->unknown_0138->AddText(2, 12, 0x9C3E1F, true, false, textX, textY); @@ -170,9 +170,9 @@ void UIRodexInboxWnd::Slot15(int width, int height) { tab->Invalidate(); } { - const int textX = static_cast(static_cast(this->unknown_0134->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDA), 0, 0, 12, 0, 0)) * g_depthAverageHalf); + const int textX = static_cast(static_cast(this->unknown_0134->geometry.width - this->TextWidth(LookupMessage(0xDDA), 0, 0, 12, 0, 0)) * g_depthAverageHalf); UIBmpRadioBtn* tab = this->unknown_0134; - const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDA), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); + const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(LookupMessage(0xDDA), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); tab->AddText(0, 12, 0xCCB5AD, true, false, textX, textY); this->unknown_0134->AddText(1, 12, 0x9C3E1F, true, false, textX, textY); this->unknown_0134->AddText(2, 12, 0x9C3E1F, true, false, textX, textY); @@ -192,9 +192,9 @@ void UIRodexInboxWnd::Slot15(int width, int height) { tab->Invalidate(); } { - const int textX = static_cast(static_cast(this->unknown_0130->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDB), 0, 0, 12, 0, 0)) * g_depthAverageHalf); + const int textX = static_cast(static_cast(this->unknown_0130->geometry.width - this->TextWidth(LookupMessage(0xDDB), 0, 0, 12, 0, 0)) * g_depthAverageHalf); UIBmpRadioBtn* tab = this->unknown_0130; - const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDB), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); + const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(LookupMessage(0xDDB), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); tab->AddText(0, 12, 0xCCB5AD, true, false, textX, textY); this->unknown_0130->AddText(1, 12, 0x9C3E1F, true, false, textX, textY); this->unknown_0130->AddText(2, 12, 0x9C3E1F, true, false, textX, textY); @@ -358,9 +358,9 @@ void UIRodexInboxWnd::Slot15(int width, int height) { tab->Invalidate(); } { - const int textX = static_cast(static_cast(this->unknown_01D0->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDD), 0, 0, 12, 0, 0)) * g_depthAverageHalf); + const int textX = static_cast(static_cast(this->unknown_01D0->geometry.width - this->TextWidth(LookupMessage(0xDDD), 0, 0, 12, 0, 0)) * g_depthAverageHalf); UIBmpRadioBtn* tab = this->unknown_01D0; - const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xDDD), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); + const int textY = static_cast(static_cast(tab->geometry.height - this->TextHeight(LookupMessage(0xDDD), 0, 0, 12, 0, 0) - 3) * g_depthAverageHalf); tab->AddText(0, 12, 0xCCB5AD, true, false, textX, textY); this->unknown_01D0->AddText(1, 12, 0x9C3E1F, true, false, textX, textY); this->unknown_01D0->AddText(2, 12, 0x9C3E1F, true, false, textX, textY); @@ -493,7 +493,7 @@ void UIRodexInboxWnd::Paint() { } this->DrawRightAlignedText(0x111, 0x2E, FormatOwnedString("%d", g_rodexMailStore->unknown_0014).c_str(), 0, 0, 11, 0xC89482, 1); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x111, 0x2E, LookupMessage(0xBDA), 0, 0, 11, 0xC89482, 1, 0); + this->DrawTextAt(0x111, 0x2E, LookupMessage(0xBDA), 0, 0, 11, 0xC89482, 1, 0); } // OFFSET: 0x00808FD0 diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index b6015e43..f85658be 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -663,7 +663,7 @@ void UIRuneSetList::Select(int index) { // FUNCTION: fn_10163 void UIRuneSetinfoList::AddLine(std::string text, std::uint32_t color, bool bold) { const float centered = - static_cast(this->geometry.width - this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, bold, 0)) * + static_cast(this->geometry.width - this->TextWidth(text.c_str(), text.size(), 0, 12, bold, 0)) * 0.5f; const int x = static_cast(std::max(0.0f, centered)); RuneSetInfoLine line(text, color, bold, x); @@ -684,8 +684,7 @@ void UIRuneSetinfoList::Paint() { const int index = this->position + row; if (index >= 0 && static_cast(index) < this->m_lines.size()) { const RuneSetInfoLine& line = this->m_lines[index]; - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, line.x, this->m_itemHeight * row + 30, line.text.c_str(), 0, 0, 12, line.color, line.bold, 0 + this->DrawTextAt(line.x, this->m_itemHeight * row + 30, line.text.c_str(), 0, 0, 12, line.color, line.bold, 0 ); } } @@ -846,9 +845,8 @@ void UIRuneSet_Info::Refresh() { // FUNCTION: fn_10234 void UIRuneSystem_ActiveWnd::DrawCount(int x, int y, int count, int total, std::uint32_t color, int fontHeight) { const std::string text = FormatOwnedString("%d / %d", count, total); - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, fontHeight, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, static_cast(static_cast(x) - static_cast(width) * 0.5f), y, text.c_str(), 0, 0, + const int width = this->TextWidth(text.c_str(), text.size(), 0, fontHeight, 0, 0); + this->DrawTextAt(static_cast(static_cast(x) - static_cast(width) * 0.5f), y, text.c_str(), 0, 0, fontHeight, color, 0, 0 ); } @@ -1004,9 +1002,8 @@ void UIRuneSystem_Decom_RadioBtn::Paint() { this->DrawBitmap(0, static_cast((this->geometry.height - bitmap->image.height) * 0.5f), &bitmap->image, true); } if (!this->text.empty()) { - const int textHeight = this->TextHeight(controls.fonts, controls.locale, this->text.c_str(), 0, 0, this->fontHeight, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, bitmap->image.width + 3, static_cast((this->geometry.height - textHeight) * 0.5f), this->text.c_str(), 0, 0, + const int textHeight = this->TextHeight(this->text.c_str(), 0, 0, this->fontHeight, 0, 0); + this->DrawTextAt(bitmap->image.width + 3, static_cast((this->geometry.height - textHeight) * 0.5f), this->text.c_str(), 0, 0, this->fontHeight, color, 0, 0 ); } @@ -1023,7 +1020,7 @@ void UIRuneSystemWnd::Paint() { 0, this->geometry.height - 36, &static_cast(ResourceMgr::Instance().Load(Resolve(FormatOwnedString("유저인터페이스\\runesystem\\bg_left_down.bmp").c_str())))->image, false ); - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(4050), 0); + this->DrawTitleBar(true, LookupMessage(4050), 0); } // OFFSET: 0x0081E3F0 @@ -1080,8 +1077,8 @@ void UIDecomlist::Paint() { std::memset(text, 0, sizeof(text)); int capacity = sizeof(text); descriptions.Name(item, text, capacity, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 57, y + 8, text, 0, 0, 13, 0, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 58, y + 28, FormatOwnedString("%d", item.quantity).c_str(), 0, 0, 13, 0, 0, 0); + this->DrawTextAt(57, y + 8, text, 0, 0, 13, 0, 0, 0); + this->DrawTextAt(58, y + 28, FormatOwnedString("%d", item.quantity).c_str(), 0, 0, 13, 0, 0, 0); } this->DrawScrollBar(false); } @@ -1117,15 +1114,15 @@ void UIEquipRuneSetWnd::Paint() { int titleX = 37; if (runeSet->m_grade) { const std::string grade = FormatOwnedString("+%d", runeSet->m_grade); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 37, 12, grade.c_str(), 0, 0, 13, 0xFCDDE5, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 37, 11, grade.c_str(), 0, 0, 13, 0xFF7E00, 1, 0); + this->DrawTextAt(37, 12, grade.c_str(), 0, 0, 13, 0xFCDDE5, 1, 0); + this->DrawTextAt(37, 11, grade.c_str(), 0, 0, 13, 0xFF7E00, 1, 0); titleX = runeSet->m_grade > 9 ? 62 : 55; } titleX += 2; const std::string title = FormatOwnedString(LookupMessage(4042), runeSet->GetName()); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, titleX, 12, title.c_str(), 0, 0, 13, 0xFCDEE6, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, titleX, 11, title.c_str(), 0, 0, 13, 0x864D43, 1, 0); + this->DrawTextAt(titleX, 12, title.c_str(), 0, 0, 13, 0xFCDEE6, 1, 0); + this->DrawTextAt(titleX, 11, title.c_str(), 0, 0, 13, 0x864D43, 1, 0); const std::string tag = FormatOwnedString("유저인터페이스\\runesystem\\tag\\bt_tag_%d_equip.bmp", runeSet->GetTagId()); this->DrawBitmap(9, 6, &static_cast(ResourceMgr::Instance().Load(Resolve(tag.c_str())))->image, false); } @@ -1146,9 +1143,8 @@ void UIGage_Circle::Paint() { ); const std::string text = FormatOwnedString("%.2f%%", static_cast(static_cast(this->m_value) * 0.001f)); - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), this->m_textY, text.c_str(), 0, + const int width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), this->m_textY, text.c_str(), 0, 0, 12, 0xFFFFFF, 1, 0 ); } @@ -1170,7 +1166,7 @@ void UIRuneList::Paint() { this->DrawBitmap(0, y, &static_cast(ResourceMgr::Instance().Load(Resolve(background.c_str())))->image, true); this->DrawRuneIcon(18, y + 6, rune->GetResName(), active); const std::string name = FormatOwnedString(LookupMessage(4043), rune->GetName()); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 62, y + 9, name.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(62, y + 9, name.c_str(), 0, 0, 12, 0, 0, 0); } this->DrawScrollBar(true); } @@ -1202,20 +1198,20 @@ void UIRuneSetList::Paint() { } const std::string title = FormatOwnedString(LookupMessage(4042), runeSet->GetName()); - const int titleWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, title.c_str(), title.size(), 0, 12, 0, 0); + const int titleWidth = this->TextWidth(title.c_str(), title.size(), 0, 12, 0, 0); std::string grade; int gradeWidth = 0; if (runeSet->m_grade) { grade = FormatOwnedString("+%d", runeSet->m_grade); - gradeWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, grade.c_str(), grade.size(), 0, 12, 0, 0); + gradeWidth = this->TextWidth(grade.c_str(), grade.size(), 0, 12, 0, 0); } int x = static_cast(static_cast(this->geometry.width - gradeWidth - titleWidth) * 0.5f); if (runeSet->m_grade) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y + 7, grade.c_str(), 0, 0, 12, 0xFF7E00, 0, 0); + this->DrawTextAt(x, y + 7, grade.c_str(), 0, 0, 12, 0xFF7E00, 0, 0); x += gradeWidth + 5; } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y + 7, title.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x, y + 7, title.c_str(), 0, 0, 12, 0, 0, 0); } this->DrawScrollBar(true); } @@ -1432,8 +1428,8 @@ void UIRuneSystem_DecomResultWnd::Paint() { } const std::string count = FormatOwnedString("%d", this->m_counts[index]); - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, count.c_str(), count.size(), 0, 12, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x - static_cast(width * 0.5f) + 19, y, count.c_str(), 0, 0, 12, 0, 0, 0); + const int width = this->TextWidth(count.c_str(), count.size(), 0, 12, 0, 0); + this->DrawTextAt(x - static_cast(width * 0.5f) + 19, y, count.c_str(), 0, 0, 12, 0, 0, 0); } } } @@ -1478,10 +1474,10 @@ void UIRune_Info::Paint() { } const std::string name = FormatOwnedString("Rune of %s", this->m_rune->GetName()); - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, name.c_str(), name.size(), 0, 13, 1, 0); + const int width = this->TextWidth(name.c_str(), name.size(), 0, 13, 1, 0); const int x = static_cast(static_cast(this->geometry.width - width) * 0.5f + 2.0f); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, 25, name.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x - 1, 26, name.c_str(), 0, 0, 13, 0x864D43, 1, 0); + this->DrawTextAt(x, 25, name.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); + this->DrawTextAt(x - 1, 26, name.c_str(), 0, 0, 13, 0x864D43, 1, 0); } // OFFSET: 0x0081BA00 @@ -1493,22 +1489,20 @@ void UIRune_ViewInfo::Paint() { const int center = static_cast(static_cast(this->m_gauge->geometry.width) * 0.5f + static_cast(this->m_gauge->geometry.x)); const std::string activeText = FormatOwnedString("%d", active); - const int activeWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, activeText.c_str(), activeText.size(), 0, 12, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, center - activeWidth - 7, 406, activeText.c_str(), 0, 0, 12, 0xFF7E00, 0, 0); + const int activeWidth = this->TextWidth(activeText.c_str(), activeText.size(), 0, 12, 0, 0); + this->DrawTextAt(center - activeWidth - 7, 406, activeText.c_str(), 0, 0, 12, 0xFF7E00, 0, 0); const std::string totalText = FormatOwnedString("/ %d", active, total); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, center - 3, 406, totalText.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(center - 3, 406, totalText.c_str(), 0, 0, 12, 0, 0, 0); const std::string title = "수집 현황"; - const int titleWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, title.c_str(), title.size(), 0, 13, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, static_cast(261.0f - static_cast(titleWidth) * 0.5f), 27, title.c_str(), 0, 0, 13, 0x864D43, + const int titleWidth = this->TextWidth(title.c_str(), title.size(), 0, 13, 0, 0); + this->DrawTextAt(static_cast(261.0f - static_cast(titleWidth) * 0.5f), 27, title.c_str(), 0, 0, 13, 0x864D43, 1, 0 ); const std::string tagName = g_runeSystemMgr->GetTag(-1)->m_name; - const int tagWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, tagName.c_str(), tagName.size(), 0, 13, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, static_cast(261.0f - static_cast(tagWidth) * 0.5f), 74, tagName.c_str(), 0, 0, 13, 0xDB632A, + const int tagWidth = this->TextWidth(tagName.c_str(), tagName.size(), 0, 13, 0, 0); + this->DrawTextAt(static_cast(261.0f - static_cast(tagWidth) * 0.5f), 74, tagName.c_str(), 0, 0, 13, 0xDB632A, 1, 0 ); } @@ -1736,7 +1730,7 @@ void UIRune_ViewInfo::Slot15(int, int) { UIStaticText* title = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); this->AddChild(title); std::string text = "룬타블렛-룬도감"; - int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, 0, 0); + int width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); int x = static_cast(261.0f - static_cast(width) * 0.5f); title->SetSize(width + 10, 20); title->Move(x, 0x12A); @@ -1746,7 +1740,7 @@ void UIRune_ViewInfo::Slot15(int, int) { UIStaticText* rate = new UIStaticText(*this->m_context, *reinterpret_cast(nullptr)); this->AddChild(rate); text = "수집률"; - width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, 0, 0); + width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); x = static_cast(261.0f - static_cast(width) * 0.5f); rate->SetSize(width + 10, 20); rate->Move(x, 0x13B); @@ -1945,7 +1939,7 @@ void UIRuneSet_Info::Slot15(int, int) { const std::string gradeTitle = LookupMessage(4044); this->m_gradeText->SetText(gradeTitle.c_str(), 1); this->m_gradeText->SetColor(0xFF, 0xFF, 0xFF); - const int titleWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, gradeTitle.c_str(), 0, 0, 12, 0, 0); + const int titleWidth = this->TextWidth(gradeTitle.c_str(), 0, 0, 12, 0, 0); this->m_gradeText->Move(static_cast(500.0f - static_cast(titleWidth) * 0.5f), 0x82); this->m_gradeItems = new UIRuneSystem_ActiveWnd(*this->m_context); @@ -2098,8 +2092,8 @@ void UIRuneSet_Info::Paint() { const std::string collection = std::format("유저인터페이스\\collection\\{}.bmp", resource); this->DrawBitmap(0x188, 0xE1, reinterpret_cast(ResourceMgr::Instance().Load(Resolve(collection.c_str()))), true); if (this->m_runeSet->m_reward.values[0] != 0) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x1BC, 0x30, LookupMessage(4203), 0, 0, 13, 0xFFF0E1, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x1BC, 0x31, LookupMessage(4203), 0, 0, 13, 0x864D43, 1, 0); + this->DrawTextAt(0x1BC, 0x30, LookupMessage(4203), 0, 0, 13, 0xFFF0E1, 1, 0); + this->DrawTextAt(0x1BC, 0x31, LookupMessage(4203), 0, 0, 13, 0x864D43, 1, 0); } } } else { @@ -2111,27 +2105,24 @@ void UIRuneSet_Info::Paint() { } else { path = LookupMessage(4046); } - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, path.c_str(), path.size(), 0, 12, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, 0x1F5 - static_cast(static_cast(width) * 0.5f), 0x103, path.c_str(), 0, 0, 12, 0, 0, 0 + const int width = this->TextWidth(path.c_str(), path.size(), 0, 12, 0, 0); + this->DrawTextAt(0x1F5 - static_cast(static_cast(width) * 0.5f), 0x103, path.c_str(), 0, 0, 12, 0, 0, 0 ); } const std::string title = FormatOwnedString(LookupMessage(4042), this->m_runeSet->GetName()); - const int titleWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, title.c_str(), title.size(), 0, 13, 1, 0); + const int titleWidth = this->TextWidth(title.c_str(), title.size(), 0, 13, 1, 0); int x = static_cast(186.0f - static_cast(titleWidth) * 0.5f); if (this->m_runeSet->m_grade) { x += this->m_runeSet->m_grade > 9 ? 13 : 10; } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, 0x19, title.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, 0x1A, title.c_str(), 0, 0, 13, 0x864D43, 1, 0); + this->DrawTextAt(x, 0x19, title.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); + this->DrawTextAt(x, 0x1A, title.c_str(), 0, 0, 13, 0x864D43, 1, 0); if (this->m_runeSet->m_grade) { const std::string grade = FormatOwnedString("+%d", this->m_runeSet->m_grade); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, x - (this->m_runeSet->m_grade > 9 ? 5 : 0) - 20, 0x1A, grade.c_str(), 0, 0, 12, 0xFFF0E1, 1, 0 + this->DrawTextAt(x - (this->m_runeSet->m_grade > 9 ? 5 : 0) - 20, 0x1A, grade.c_str(), 0, 0, 12, 0xFFF0E1, 1, 0 ); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, x - (this->m_runeSet->m_grade > 9 ? 5 : 0) - 20, 0x1B, grade.c_str(), 0, 0, 12, 0xEC720F, 1, 0 + this->DrawTextAt(x - (this->m_runeSet->m_grade > 9 ? 5 : 0) - 20, 0x1B, grade.c_str(), 0, 0, 12, 0xEC720F, 1, 0 ); } } @@ -2154,10 +2145,10 @@ void UIRune_Decom::Paint() { } if (this->unknown_007C.size()) { - const int nameWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, this->unknown_007C.c_str(), this->unknown_007C.size(), 0, 13, 0, 0); + const int nameWidth = this->TextWidth(this->unknown_007C.c_str(), this->unknown_007C.size(), 0, 13, 0, 0); const int nameX = static_cast(static_cast(this->geometry.width - nameWidth) * 0.5f); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, nameX, 0x19, this->unknown_007C.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, nameX - 1, 0x1A, this->unknown_007C.c_str(), 0, 0, 13, 0x864D43, 1, 0); + this->DrawTextAt(nameX, 0x19, this->unknown_007C.c_str(), 0, 0, 13, 0xFFF0E1, 1, 0); + this->DrawTextAt(nameX - 1, 0x1A, this->unknown_007C.c_str(), 0, 0, 13, 0x864D43, 1, 0); } this->DrawBitmap(200, 0x149, reinterpret_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\runesystem\\bg_radio2.bmp"))), true); @@ -2213,14 +2204,13 @@ void UIRune_Decom::Paint() { } text += "%"; - int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x - width + 0x23, y + 0x13, text.c_str(), 0, 0, 12, 0xFFF7E7, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x - width + 0x22, y + 0x12, text.c_str(), 0, 0, 12, 0x875F51, 0, 0); + int width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); + this->DrawTextAt(x - width + 0x23, y + 0x13, text.c_str(), 0, 0, 12, 0xFFF7E7, 0, 0); + this->DrawTextAt(x - width + 0x22, y + 0x12, text.c_str(), 0, 0, 12, 0x875F51, 0, 0); text = FormatOwnedString("%d ~ %d", (*this->m_decomList)[index].m_minCount, (*this->m_decomList)[index].m_maxCount); - width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), text.size(), 0, 12, 0, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, x - static_cast(static_cast(width) * 0.5f) + 0x13, y + 0x23, text.c_str(), 0, 0, 11, + width = this->TextWidth(text.c_str(), text.size(), 0, 12, 0, 0); + this->DrawTextAt(x - static_cast(static_cast(width) * 0.5f) + 0x13, y + 0x23, text.c_str(), 0, 0, 11, 0x875F51, 0, 0 ); } diff --git a/Source/UI/Shop/ItemDrawing.cpp b/Source/UI/Shop/ItemDrawing.cpp index e59e5eb1..6c197424 100644 --- a/Source/UI/Shop/ItemDrawing.cpp +++ b/Source/UI/Shop/ItemDrawing.cpp @@ -25,14 +25,14 @@ void DrawItemWithQuantityAuxiliary( std::sprintf(text, "%d", item.quantity); if (plain != 0) { - window.DrawTextAt(fonts, locale, x + 16, y + 20, text, 0, 0, 11, 0, 0, 0); + window.DrawTextAt(x + 16, y + 20, text, 0, 0, 11, 0, 0, 0); } else { const int left = x + (item.quantity < 1000 ? 14 : 0); - window.DrawTextAt(fonts, locale, left + 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left - 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 15, text, 0, 0, 11, 0, 0, 0); + window.DrawTextAt(left + 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left - 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 15, text, 0, 0, 11, 0, 0, 0); } } @@ -81,13 +81,13 @@ void DrawItemWithQuantity( char text[16]; std::sprintf(text, "%d", item.quantity); if (plain != 0) { - window.DrawTextAt(fonts, locale, x + 16, y + 20, text, 0, 0, 11, 0, 0, 0); + window.DrawTextAt(x + 16, y + 20, text, 0, 0, 11, 0, 0, 0); } else { const int left = x + (item.quantity < 1000 ? 14 : 0); - window.DrawTextAt(fonts, locale, left + 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left - 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); - window.DrawTextAt(fonts, locale, left, y + 15, text, 0, 0, 11, 0, 0, 0); + window.DrawTextAt(left + 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left - 1, y + 15, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 16, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 14, text, 0, 0, 11, 0xFFFFFF, 0, 0); + window.DrawTextAt(left, y + 15, text, 0, 0, 11, 0, 0, 0); } } diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index cc8fc679..53f07d3a 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -279,7 +279,7 @@ void UIRoMapWnd::Paint() { this->DrawHoverTooltip(); this->DrawSelectedMapPreview(); this->FillSurface(0xFFFF00FF, reinterpret_cast(&this->m_kafraLeft)); - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, "", 0); + this->DrawTitleBar(true, "", 0); this->FillRegion(0, 16, this->geometry.width, 2, 0xF7DFC6); } @@ -287,7 +287,7 @@ void UIRoMapWnd::Paint() { // FUNCTION: fn_12675 void UISeekPartyListWnd::Paint() { const TextLocale locale = {}; - this->DrawTitleBar(g_fontCache, locale, true, "", 0); + this->DrawTitleBar(true, "", 0); if (this->m_minimized) { return; } @@ -324,13 +324,13 @@ void UISeekPartyListWnd::Paint() { } const int textY = y + 3; - this->DrawTextAt(g_fontCache, locale, 22, textY, entry.time.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(22, textY, entry.time.c_str(), 0, 0, 12, 0, 0, 0); const char* charName = this->ClipTextToWidth(entry.charName.c_str(), 130, 0, 12, 0); - this->DrawTextAt(g_fontCache, locale, 76, textY, charName, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(g_fontCache, locale, 215, textY, entry.level.c_str(), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(g_fontCache, locale, 280, textY, entry.location.c_str(), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(g_fontCache, locale, 22, y + 23, entry.jobs.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(76, textY, charName, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(215, textY, entry.level.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(280, textY, entry.location.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(22, y + 23, entry.jobs.c_str(), 0, 0, 12, 0, 0, 0); } y += 40; @@ -347,7 +347,7 @@ void UISeekPartyListWnd::Paint() { // FUNCTION: fn_12676 void UISeekPartyMBWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); if (this->m_minimized) { return; } @@ -369,7 +369,7 @@ void UISeekPartyMBWnd::Paint() { // FUNCTION: fn_12677 void UISeekPartyWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned red; unsigned green; @@ -394,7 +394,7 @@ void UISeekPartyWnd::Paint() { char text[10] = {}; const unsigned seconds = this->m_elapsed / 1000; std::sprintf(text, "%02d:%02d:%02d", seconds / 60 / 60 % 60, seconds / 60 % 60, seconds % 60); - this->DrawTextAt(controls.fonts, controls.locale, 10, this->geometry.height - 20, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, this->geometry.height - 20, text, 0, 0, 12, 0, 0, 0); } // OFFSET: 0x0092D660 @@ -429,11 +429,11 @@ void UIQuickSlotWnd::Paint() { this->DrawBitmap(x, 5, &image->image, true); if (entry.count != 0) { std::sprintf(text, "%d", entry.count); - this->DrawTextAt(painting.fonts, painting.locale, x + 15, 20, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(painting.fonts, painting.locale, x + 13, 20, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(painting.fonts, painting.locale, x + 14, 21, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(painting.fonts, painting.locale, x + 14, 19, text, 0, 0, 11, 0xFFFFFF, 0, 0); - this->DrawTextAt(painting.fonts, painting.locale, x + 14, 20, text, 0, 0, 11, 0, 0, 0); + this->DrawTextAt(x + 15, 20, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 13, 20, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 14, 21, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 14, 19, text, 0, 0, 11, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 14, 20, text, 0, 0, 11, 0, 0, 0); } } else { ITEM_INFO item = LookupClientItem(painting.inventory, static_cast(entry.id), 1); @@ -798,12 +798,12 @@ void UISerachStoreInfoWnd::Paint() { this->m_edits[3]->Invalidate(); this->DrawPanelBackground(0, 0, ""); - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(0x6F4), 0); + this->DrawTitleBar(true, LookupMessage(0x6F4), 0); DrawOutlinedText(*this, 5, 20, "Type", 0, 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); DrawOutlinedText(*this, 98, 20, "Item", 0, 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); DrawOutlinedText(*this, 185, 20, "Card", 0, 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); DrawOutlinedText(*this, 273, 20, "Zeny", 0, 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, 353, 38, "~", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(353, 38, "~", 0, 0, 12, 0, 0, 0); const std::string count = FormatOwnedString(LookupMessage(0x70A), g_session.unknown_5BE0); this->DrawRightAlignedText(this->geometry.width - 60, 60, count.c_str(), 0, 0, 12, 0, 0); @@ -814,25 +814,21 @@ void UISerachStoreInfoWnd::Paint() { DrawRectangleBorder(*this, 330, 80, 30, 21, 0xC0C0C0); this->FillRegion(5, 100, this->geometry.width - 10, 1, 0xC0C0C0); - this->DrawTextAt( - controls.fonts, controls.locale, (110 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(0x6F5), 0, 0, 12, 0, 0)) / 2 + 50, 85, + this->DrawTextAt((110 - this->TextWidth(LookupMessage(0x6F5), 0, 0, 12, 0, 0)) / 2 + 50, 85, LookupMessage(0x6F5), 0, 0, 12, 0, 0, 0 ); - this->DrawTextAt( - controls.fonts, controls.locale, (170 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(0x424), 0, 0, 12, 0, 0)) / 2 + 160, 85, + this->DrawTextAt((170 - this->TextWidth(LookupMessage(0x424), 0, 0, 12, 0, 0)) / 2 + 160, 85, LookupMessage(0x424), 0, 0, 12, 0, 0, 0 ); - this->DrawTextAt( - controls.fonts, controls.locale, (30 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(0x6F6), 0, 0, 12, 0, 0)) / 2 + 330, 85, + this->DrawTextAt((30 - this->TextWidth(LookupMessage(0x6F6), 0, 0, 12, 0, 0)) / 2 + 330, 85, LookupMessage(0x6F6), 0, 0, 12, 0, 0, 0 ); - this->DrawTextAt( - controls.fonts, controls.locale, (75 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(0x6F7), 0, 0, 12, 0, 0)) / 2 + 360, 85, + this->DrawTextAt((75 - this->TextWidth(LookupMessage(0x6F7), 0, 0, 12, 0, 0)) / 2 + 360, 85, LookupMessage(0x6F7), 0, 0, 12, 0, 0, 0 ); if (this->unknown_00F0.size() != 0) { - this->DrawTextAt(controls.fonts, controls.locale, 5, this->geometry.height - 20, this->unknown_00F0.c_str(), 0, 0, 12, 0xFF, 0, 0); + this->DrawTextAt(5, this->geometry.height - 20, this->unknown_00F0.c_str(), 0, 0, 12, 0xFF, 0, 0); } if (static_cast(this->unknown_00DC * 10 - 10) >= g_session.unknown_5BD4.size()) { @@ -876,25 +872,23 @@ void UISerachStoreInfoWnd::Paint() { if (lineEnd != std::string::npos) { storeName = storeName.substr(0, lineEnd); } - this->DrawTextAt(controls.fonts, controls.locale, 55, y, this->ClipTextToWidth(storeName.c_str(), 100, 0, 12, 0), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 165, y, this->ClipTextToWidth(entry->item.DisplayName(0).c_str(), 160, 0, 12, 0), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(55, y, this->ClipTextToWidth(storeName.c_str(), 100, 0, 12, 0), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(165, y, this->ClipTextToWidth(entry->item.DisplayName(0).c_str(), 160, 0, 12, 0), 0, 0, 12, 0, 0, 0); char text[100]; std::sprintf(text, "%d", entry->quantity); - this->DrawTextAt( - controls.fonts, controls.locale, (30 - this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0)) / 2 + 330, y, text, 0, 0, 12, 0, 0, 0 + this->DrawTextAt((30 - this->TextWidth(text, 0, 0, 12, 0, 0)) / 2 + 330, y, text, 0, 0, 12, 0, 0, 0 ); const std::string price = FormatGroupedInteger(entry->price, text, 100) + std::string(" Z"); - this->DrawAmount(controls.fonts, controls.locale, entry->price, price, 435 - this->TextWidth(controls.fonts, controls.locale, price.c_str(), 0, 0, 12, 0, 0), y); + this->DrawAmount(entry->price, price, 435 - this->TextWidth(price.c_str(), 0, 0, 12, 0, 0), y); row = next; } char page[12]; std::sprintf(page, " %d ", this->unknown_00DC); - this->DrawTextAt( - controls.fonts, controls.locale, (this->geometry.width - this->TextWidth(controls.fonts, controls.locale, page, 0, 0, 12, 0, 0)) / 2, + this->DrawTextAt((this->geometry.width - this->TextWidth(page, 0, 0, 12, 0, 0)) / 2, this->geometry.height - 20, page, 0, 0, 12, 0, 0, 0 ); } diff --git a/Source/UI/Shortcuts/ShortcutPainting.cpp b/Source/UI/Shortcuts/ShortcutPainting.cpp index a2d1507f..aae862c1 100644 --- a/Source/UI/Shortcuts/ShortcutPainting.cpp +++ b/Source/UI/Shortcuts/ShortcutPainting.cpp @@ -162,7 +162,7 @@ void ShortcutPainting::Paint(UIWindow& window, const ShortcutGrid& grid, const N for (int row = 0; row < grid.rows; ++row) { char text[24]; std::sprintf(text, "%d", (row + 1)); - window.DrawTextAt(this->fonts, this->locale, 6, ((row * 33) + 13), text, 0, 0, 11, 0x2F4A4A, 0, 0); + window.DrawTextAt(6, ((row * 33) + 13), text, 0, 0, 11, 0x2F4A4A, 0, 0); } this->cooldowns.PaintMain(this->icons, grid.rows, window.geometry.x, window.geometry.y, this->drawing, this->clock, this->commands, this->system); diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 84a4fd66..d279ccaa 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -714,7 +714,7 @@ void UIRoMapWnd::Slot31(int x, int y) { const TextLocale locale = {}; int width = 0; for (const std::string& name : this->unknown_01FC) { - const int textWidth = this->TextWidth(g_fontCache, locale, name.c_str(), 0, 0, 14, 0, 0); + const int textWidth = this->TextWidth(name.c_str(), 0, 0, 14, 0, 0); if (width < textWidth) { width = textWidth; } @@ -786,7 +786,7 @@ void UIMemorialDunWnd::ResetDungeonInfo() { // OFFSET: 0x0092C6B0 // FUNCTION: fn_12665 void UIMemorialDunWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(0x538), 0); + this->DrawTitleBar(true, LookupMessage(0x538), 0); if (this->geometry.height == 17) { return; } @@ -836,7 +836,7 @@ void UIMemorialDunWnd::Paint() { } } else if (g_session.unknown_5948 == 2) { if (g_session.unknown_596C) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 10, 55, LookupMessage(0x540), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 55, LookupMessage(0x540), 0, 0, 12, 0, 0, 0); strftime(timeText, 128, LookupMessage(0x4EC), _localtime32(reinterpret_cast(&g_session.unknown_596C))); sprintf(text, "^ff0000%s^ffffff", timeText); const int width = this->ColoredTextWidth(text, 0, 0, 12, 0); @@ -1237,18 +1237,18 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume local.sub_4EE2E0(text); const int previousWidth = this->m_inputWidth; if (text != nullptr && text[0] != '\0') { - const int measured = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, 0, 12, 0, 0); + const int measured = this->TextWidth(text, 0, 0, 12, 0, 0); if (measured + 10 < this->geometry.width - 0x32) { reinterpret_cast(&this->m_name)->sub_696770(&local); reinterpret_cast(&g_session.m_subChatWnds)->sub_914D30(&this->m_index)->sub_696770(reinterpret_cast(&this->m_name)); - const int renamed = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, 0, 12, 0, 0); + const int renamed = this->TextWidth(text, 0, 0, 12, 0, 0); this->m_inputWidth = renamed + 10; if (this->m_inputWidth < 0x19) { this->m_inputWidth = 0x19; } } } - const int measured = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, 0, 12, 0, 0); + const int measured = this->TextWidth(text, 0, 0, 12, 0, 0); if (this->geometry.width - 0x32 <= measured + 10) { reinterpret_cast(&g_windowMgr)->Confirm(LookupMessage(0x629), 0, true, false, 0, "Message", 0x118, 0x78, 0); } diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index 2f6a6e27..98d297ff 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -705,7 +705,7 @@ void UIStylingShopWnd::SetBuyEnabled(bool enabled) { void UIStylingShopWnd::Paint() { this->RefreshFavoriteButton(); this->ClearSurface(0xFFFFFFFF); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(2813), 0); + this->DrawTitleBar(true, LookupMessage(2813), 0); CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\styleshop\\bg_styling.bmp"))); if (background) { this->DrawBitmap(0, 0, &background->image, false); @@ -1708,10 +1708,10 @@ void UIShowInfoWnd::DrawPayments() { char text[16] = {}; std::sprintf(text, "%d\tZeny", zeny); if (!payable) { - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text, this->unknown_00A8, 0, 12, 0, 0); + const int width = this->TextWidth(text, this->unknown_00A8, 0, 12, 0, 0); this->FillRegion(x - 2, y + 5, width + 2, 1, color); } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y, text, 0, 0, this->unknown_00A8, color, 0, 0); + this->DrawTextAt(x, y, text, 0, 0, this->unknown_00A8, color, 0, 0); } else if (itemId) { this->DrawPaymentItem(*it, zeny, itemId, payable, row); if (!payable) { @@ -1724,20 +1724,20 @@ void UIShowInfoWnd::DrawPayments() { this->DrawPaymentItem(*it, zeny, itemId, true, row); this->m_checks[row]->SetTooltip(LookupMessage(2815)); ITEM_DESC description = FindItemDescription(costumeItemId); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); + this->DrawTextAt(x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); } else { ITEM_DESC description = FindItemDescription(itemId); if (!costumePayable) { const int width = - this->TextWidth(this->m_context->fonts, this->m_context->locale, description.identifiedName, this->unknown_00A8, 0, 12, 0, 0); + this->TextWidth(description.identifiedName, this->unknown_00A8, 0, 12, 0, 0); this->FillRegion(x - 2, y + 5, width + 2, 1, color); } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); + this->DrawTextAt(x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); } } } else { ITEM_DESC description = FindItemDescription(itemId); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); + this->DrawTextAt(x, y, description.identifiedName, 0, 0, this->unknown_00A8, color, 0, 0); } } else { char text[260]; @@ -1754,7 +1754,7 @@ void UIShowInfoWnd::DrawPayments() { if (this->unknown_00A1 == 1) { this->DrawBitmap(this->unknown_00C0, this->geometry.height / 8 * row + this->unknown_00C4, icon ? &icon->image : nullptr, false); } - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, x, y, text, 0, 0, this->unknown_00A8, 0x5A5A84, 0, 0); + this->DrawTextAt(x, y, text, 0, 0, this->unknown_00A8, 0x5A5A84, 0, 0); } } @@ -1775,7 +1775,7 @@ void UIShowInfoWnd::DrawPayments() { std::vector lines; WrapPixelText(*this->geometry.surface, *this->m_context->locale.serverLanguage, LookupMessage(2835), lines, this->geometry.width - 20); for (unsigned int i = 0; i < lines.size(); ++i) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 20, positions[i][1], lines[i].c_str(), 0, 0, 11, 0, 0, 0); + this->DrawTextAt(20, positions[i][1], lines[i].c_str(), 0, 0, 11, 0, 0, 0); } } } diff --git a/Source/UI/Text/NavigationLink.cpp b/Source/UI/Text/NavigationLink.cpp index 28f7ea62..b52c14ff 100644 --- a/Source/UI/Text/NavigationLink.cpp +++ b/Source/UI/Text/NavigationLink.cpp @@ -609,8 +609,7 @@ void LineCutter::UIText::Paint() { const TextLocale locale = {}; if (this->m_shadowed) { - this->DrawTextAt( - g_fontCache, locale, 1, 1, this->m_text.c_str(), this->m_text.size(), 0, this->m_fontHeight, this->m_shadowColor, this->m_bold, + this->DrawTextAt(1, 1, this->m_text.c_str(), this->m_text.size(), 0, this->m_fontHeight, this->m_shadowColor, this->m_bold, this->m_italic ); } @@ -620,8 +619,7 @@ void LineCutter::UIText::Paint() { *this, 1, 1, this->m_text.c_str(), this->m_text.size(), this->m_color, this->m_outlineColor, 0, this->m_fontHeight, this->m_bold, this->m_italic ); } else { - this->DrawTextAt( - g_fontCache, locale, 0, 0, this->m_text.c_str(), this->m_text.size(), 0, this->m_fontHeight, this->m_color, this->m_bold, this->m_italic + this->DrawTextAt(0, 0, this->m_text.c_str(), this->m_text.size(), 0, this->m_fontHeight, this->m_color, this->m_bold, this->m_italic ); } } @@ -1047,7 +1045,7 @@ tagSIZE CCreateLineInfo::MeasureText(UIWindow* window, std::string text, const L } const TextLocale locale = {}; - return window->TextSize(g_fontCache, locale, text.c_str(), text.size(), 0, style.fontHeight, style.bold, style.italic); + return window->TextSize(text.c_str(), text.size(), 0, style.fontHeight, style.bold, style.italic); } // OFFSET: 0x0083A180 @@ -1142,7 +1140,7 @@ UIWindow* CCreateLineInfo::CreateTextWindow(std::string text, const LineTextStyl window->m_shadowColor = this->unknown_0034; if (window->m_outlined == 1) { const TextLocale locale = {}; - const int textWidth = window->TextWidth(g_fontCache, locale, window->m_text.c_str(), 0, 0, style.fontHeight, style.bold, style.italic); + const int textWidth = window->TextWidth(window->m_text.c_str(), 0, 0, style.fontHeight, style.bold, style.italic); window->Resize(textWidth + 2, style.fontHeight + 2); } diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index 7b518afa..ec0f2294 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -111,7 +111,7 @@ 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(controls.fonts, controls.locale, name.c_str(), 0, 0, this->fontHeight, 0, 0)) / 2 + y; + int textY = (this->groupHeight - this->TextHeight(name.c_str(), 0, 0, this->fontHeight, 0, 0)) / 2 + y; if (group > this->unknown_007C) { y += std::min(static_cast(this->groups[this->unknown_007C].subs.size()), this->visibleSubs) * this->subHeight; @@ -120,7 +120,7 @@ void UIAchTab::DrawGroup(int group) { if (group == this->unknown_007C) { this->DrawBitmap(0, y, AchievementBitmap("유저인터페이스\\achievement_re\\tab_press.bmp"), false); - this->DrawTextAt(controls.fonts, controls.locale, 11, textY, name.c_str(), 0, 0, this->fontHeight, this->selectedGroupColor, 1, 0); + this->DrawTextAt(11, textY, name.c_str(), 0, 0, this->fontHeight, this->selectedGroupColor, 1, 0); int index = 0; std::map& subs = this->groups[group].subs; @@ -134,7 +134,7 @@ void UIAchTab::DrawGroup(int group) { const int rowY = (group + 1) * this->groupHeight + this->subHeight * row; ++row; name = this->groups[group].subs[it->first]; - const int height = this->TextHeight(controls.fonts, controls.locale, name.c_str(), 0, 0, this->fontHeight, 0, 0); + const int height = this->TextHeight(name.c_str(), 0, 0, this->fontHeight, 0, 0); const int rowHeight = this->subHeight; std::uint32_t color; @@ -148,13 +148,13 @@ void UIAchTab::DrawGroup(int group) { color = this->subColor; } - this->DrawTextAt(controls.fonts, controls.locale, 26, (rowHeight - height) / 2 + rowY, name.c_str(), 0, 0, this->fontHeight, color, 0, 0); + this->DrawTextAt(26, (rowHeight - height) / 2 + rowY, name.c_str(), 0, 0, this->fontHeight, color, 0, 0); } } } else { const char* bitmap = group == this->hoverGroup ? "유저인터페이스\\achievement_re\\tab_over.bmp" : "유저인터페이스\\achievement_re\\tab_out.bmp"; this->DrawBitmap(0, y, AchievementBitmap(bitmap), false); - this->DrawTextAt(controls.fonts, controls.locale, 11, textY, name.c_str(), 0, 0, this->fontHeight, this->groupColor, 1, 0); + this->DrawTextAt(11, textY, name.c_str(), 0, 0, this->fontHeight, this->groupColor, 1, 0); } } @@ -373,9 +373,9 @@ void UIAchListWnd::Paint() { this->DrawBitmap(8, top + 3, AchievementBitmap("유저인터페이스\\achievement_re\\list_pin.bmp"), true); } - this->DrawTextAt(controls.fonts, controls.locale, 53, top + 14, info.title.c_str(), 0, 0, 12, 0xA55239, 1, 0); + this->DrawTextAt(53, top + 14, info.title.c_str(), 0, 0, 12, 0xA55239, 1, 0); this->DrawCenteredText(258, top + 14, FormatOwnedString("%3d", info.unknown_0048).c_str(), 40, 0, 12, 0xA55239, 1); - this->DrawTextAt(controls.fonts, controls.locale, 10, top + 54, info.unknown_0018.c_str(), 0, 0, 12, 0xA55239, 0, 0); + this->DrawTextAt(10, top + 54, info.unknown_0018.c_str(), 0, 0, 12, 0xA55239, 0, 0); if (completed) { this->DrawBitmap(250, top + 5, AchievementBitmap("유저인터페이스\\achievement_re\\badge_complete.bmp"), true); } @@ -393,7 +393,7 @@ void UIAchListWnd::Paint() { if (completed) { const std::string date = FormatOwnedString("%4d.%2d.%2d", record.year, record.month, record.day); - const int width = this->TextWidth(controls.fonts, controls.locale, date.c_str(), 0, 0, 10, 0, 0); + const int width = this->TextWidth(date.c_str(), 0, 0, 10, 0, 0); DrawOutlinedText(*this, static_cast(276.0 - width * 0.5), top + 55, date.c_str(), 0, 0x635AA5, 0xFFFFFF, 0, 10, 0, 0); } } @@ -477,14 +477,14 @@ void UIAchTV::Paint() { for (int index = this->topLine; index < static_cast(end); ++index, ++row) { const std::string& line = this->lines[index]; if (this->outlineColor == 0) { - this->DrawTextAt(owner.fonts, owner.locale, 3, this->lineHeight * row + 4, line.c_str(), line.size(), 0, 12, this->textColor, 0, 0); + this->DrawTextAt(3, this->lineHeight * row + 4, line.c_str(), line.size(), 0, 12, this->textColor, 0, 0); } else { DrawOutlinedText(*this, 3, this->lineHeight * row + 4, line.c_str(), line.size(), this->textColor, this->outlineColor, 0, 12, 0, 0); } if (this->underline == 1) { const std::uint32_t color = this->textColor; - const int width = this->TextWidth(owner.fonts, owner.locale, this->lines[index].c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->lines[index].c_str(), 0, 0, 12, 0, 0); this->FillRegion(2, this->lineHeight * row + 10, width + 1, 1, color); } } @@ -495,27 +495,27 @@ void UIAchTV::Paint() { void UIAchSummaryWnd::Paint() { UIButtonContext& controls = *this->m_controls; this->DrawBitmap(0, 0, AchievementBitmap("유저인터페이스\\achievement_re\\bg_summary.bmp"), false); - this->DrawTextAt(controls.fonts, controls.locale, 82, 27, LookupMessage(2679), 0, 0, 12, 0xA55239, 1, 0); + 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); const int categories[6] = {2657, 2661, 2668, 2671, 2674, 2678}; for (int index = 0; index < 6; ++index) { const int row = index / 2 * 50; const int column = index % 2; - this->DrawTextAt(controls.fonts, controls.locale, column * 302 + 82, row + 107, LookupMessage(categories[index]), 0, 0, 12, 0xA55239, 1, 0); + this->DrawTextAt(column * 302 + 82, row + 107, LookupMessage(categories[index]), 0, 0, 12, 0xA55239, 1, 0); UICustomGageBar* gauge = this->gauges[index + 1]; this->DrawRightAlignedText(column * 304 + 296, row + 108, FormatOwnedString("%d/%d", gauge->value, gauge->maximum).c_str(), 0, 0, 11, 0x635AA5, 0); } - this->DrawTextAt(controls.fonts, controls.locale, 9, 292, LookupMessage(2651), 0, 0, 12, 0x9C6B5A, 1, 0); + this->DrawTextAt(9, 292, LookupMessage(2651), 0, 0, 12, 0x9C6B5A, 1, 0); int x = 260; for (auto it = this->recent.rbegin(); it != this->recent.rend(); ++it) { std::string icon = "유저인터페이스\\achievement_re\\icon_" + g_achievementMgr->GetUnknown0068(it->first) + ".bmp"; this->DrawBitmap(x - 242, 314, AchievementBitmap(icon.c_str()), true); this->DrawBitmap(x, 316, AchievementBitmap("유저인터페이스\\achievement_re\\badge_complete.bmp"), true); - this->DrawTextAt(controls.fonts, controls.locale, x + 23, 325, FormatOwnedString("%d", g_achievementMgr->GetUnknown0048(it->first)).c_str(), 0, 0, 12, 0xA55239, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, x - 241, 365, g_achievementMgr->GetUnknown0018(it->first).c_str(), 0, 0, 12, 0xC9977D, 0, 0); + this->DrawTextAt(x + 23, 325, FormatOwnedString("%d", g_achievementMgr->GetUnknown0048(it->first)).c_str(), 0, 0, 12, 0xA55239, 1, 0); + this->DrawTextAt(x - 241, 365, g_achievementMgr->GetUnknown0018(it->first).c_str(), 0, 0, 12, 0xC9977D, 0, 0); SessionRecord6144 record = g_session.FindRecord6144(it->first); if (g_achievementMgr->HasReward(it->first) == 1 && record.unknown_0030 == 0) { @@ -560,9 +560,9 @@ void UIAchUpperWnd::Paint() { } else { this->DrawBitmap(0, 0, AchievementBitmap("유저인터페이스\\achievement_re\\bg_upper.bmp"), false); this->DrawBitmap(575, 3, AchievementBitmap("유저인터페이스\\achievement_re\\upper_trophy.bmp"), true); - this->DrawTextAt(controls.fonts, controls.locale, 169, 11, LookupMessage(3106), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 169, 26, LookupMessage(3107), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 614, 15, this->title.c_str(), 0, 0, 11, 0x582708, 0, 0); + this->DrawTextAt(169, 11, LookupMessage(3106), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(169, 26, LookupMessage(3107), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(614, 15, this->title.c_str(), 0, 0, 11, 0x582708, 0, 0); this->DrawRightAlignedText(130, 13, FormatOwnedString("%d/%d", this->unknown_0094, this->unknown_0098).c_str(), 0, 0, 11, 0, 0); this->DrawRightAlignedText(737, 15, FormatOwnedString("(%d/%d)", this->unknown_009C, this->unknown_00A0).c_str(), 0, 0, 11, 0x582708, 0); this->DrawCenteredText(353, 6, FormatOwnedString("%d", g_session.unknown_614C).c_str(), 46, 0, 12, 0x582708, 1); @@ -590,7 +590,7 @@ void UIAchViewWnd::Paint() { this->DrawBitmap(264, 3, AchievementBitmap("유저인터페이스\\achievement_re\\detail_stamp.bmp"), true); } - this->DrawTextAt(controls.fonts, controls.locale, 15, 14, this->info->title.c_str(), 0, 0, 12, 0xA55239, 1, 0); + this->DrawTextAt(15, 14, this->info->title.c_str(), 0, 0, 12, 0xA55239, 1, 0); for (unsigned index = 0; index < this->info->rewards.size(); ++index) { if (this->info->unknown_0064 == 0) { @@ -624,7 +624,7 @@ void UIAchViewWnd::Paint() { // FUNCTION: fn_09224 void UIAchievementWnd::Paint() { this->ClearSurface(0xFFFFFFFF); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(2646), 0); + this->DrawTitleBar(true, LookupMessage(2646), 0); } // OFFSET: 0x007B7680 @@ -1101,12 +1101,10 @@ void UIAchTracingWnd::Paint() { buttons[3]->m_value = g_achievementTracking[index].id; if (!g_achievementTracking[index].expanded) { - this->DrawTextAt( - controls.fonts, controls.locale, buttons[0]->geometry.width + 16, y + 1, + this->DrawTextAt(buttons[0]->geometry.width + 16, y + 1, FormatOwnedString("(+%d)", g_achievementTracking[index].conditions.size()).c_str(), 0, 0, 12, 0xFFFFFF, 1, 0 ); - this->DrawTextAt( - controls.fonts, controls.locale, buttons[0]->geometry.width + 15, y, + this->DrawTextAt(buttons[0]->geometry.width + 15, y, FormatOwnedString("(+%d)", g_achievementTracking[index].conditions.size()).c_str(), 0, 0, 12, 0, 1, 0 ); } @@ -1115,12 +1113,12 @@ void UIAchTracingWnd::Paint() { y += 15; if (entry.expanded == 1) { for (const AchTracingCondition& condition : entry.conditions) { - this->DrawTextAt(controls.fonts, controls.locale, 21, y + 1, condition.text.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(21, y + 1, condition.text.c_str(), 0, 0, 12, 0, 0, 0); std::uint32_t color = 0xFFFFFF; if (condition.completed) { color = 0xDFF6F; } - this->DrawTextAt(controls.fonts, controls.locale, 20, y, condition.text.c_str(), 0, 0, 12, color, 0, 0); + this->DrawTextAt(20, y, condition.text.c_str(), 0, 0, 12, color, 0, 0); y += 15; } } diff --git a/Source/UI/Text/UIBalloonText.cpp b/Source/UI/Text/UIBalloonText.cpp index 2aa5f611..18c4a664 100644 --- a/Source/UI/Text/UIBalloonText.cpp +++ b/Source/UI/Text/UIBalloonText.cpp @@ -150,7 +150,7 @@ void UIBalloonText::Paint() { int y = 4; for (const std::string& line : this->m_lines) { - this->DrawTextAt(this->m_textContext->fonts, this->m_textContext->locale, 6, y, line.c_str(), 0, 0, this->m_fontHeight, this->m_textColor, 0, 0); + this->DrawTextAt(6, y, line.c_str(), 0, 0, this->m_fontHeight, this->m_textColor, 0, 0); const int height = Measure(*this, *this->m_textContext, line, 0, this->m_fontHeight).cy; y = (y + (height + 4)); @@ -409,8 +409,7 @@ void UINameBalloonText::SetName(const CActorNameCard& info, bool stripHash, unsi int width = 32; for (const std::string& line : this->m_lines) { - const int lineWidth = this->TextWidth( - this->m_textContext->fonts, this->m_textContext->locale, line.c_str(), 0, 0, g_nameBalloonFontHeight, g_serviceFlag06, 0) + 8; + const int lineWidth = this->TextWidth(line.c_str(), 0, 0, g_nameBalloonFontHeight, g_serviceFlag06, 0) + 8; width = std::max(lineWidth, width); } @@ -454,7 +453,7 @@ void UINameBalloonText::AddNameLine(const char* text) { this->m_lines.push_back(std::string(text)); const std::string& last = this->m_lines.back(); this->unknown_00B8 = - std::max(this->TextWidth(this->m_textContext->fonts, this->m_textContext->locale, last.c_str(), last.size(), 0, g_nameBalloonFontHeight, g_serviceFlag06, 0) + 8, 32); + std::max(this->TextWidth(last.c_str(), last.size(), 0, g_nameBalloonFontHeight, g_serviceFlag06, 0) + 8, 32); this->Resize(this->unknown_00B8, g_nameBalloonFontHeight + 8); this->Invalidate(); } @@ -470,8 +469,7 @@ void UIVerticalNameBalloonText::AddNameLine(const char* text) { std::string line; line.assign(text); this->m_lines.push_back(std::move(line)); - const int textHeight = this->VerticalTextHeight( - this->m_textContext->fonts, this->m_textContext->locale, this->m_lines.back().c_str(), 0, 0, g_nameBalloonFontHeight, g_serviceFlag06); + const int textHeight = this->VerticalTextHeight(this->m_lines.back().c_str(), 0, 0, g_nameBalloonFontHeight, g_serviceFlag06); this->textHeight = std::max(textHeight + 8, 32); this->Resize(g_nameBalloonFontHeight + 8, this->textHeight); this->Invalidate(); diff --git a/Source/UI/Text/UICharInfoBalloonText.cpp b/Source/UI/Text/UICharInfoBalloonText.cpp index aa5ad1ee..fc0d50d4 100644 --- a/Source/UI/Text/UICharInfoBalloonText.cpp +++ b/Source/UI/Text/UICharInfoBalloonText.cpp @@ -10,7 +10,7 @@ void UICharInfoBalloonText::Paint() { const bool rightColumn = (i & 1) != 0; this->DrawShadowedText(rightColumn ? 50 : 6, y, this->m_lines[i].c_str(), 0, this->m_textColor, this->m_outlineColor, 0, this->m_fontHeight, 0); if (rightColumn) { - y += this->TextHeight(this->m_textContext->fonts, this->m_textContext->locale, this->m_lines[i].c_str(), 0, 0, this->m_fontHeight, 0, 0) + 4; + y += this->TextHeight(this->m_lines[i].c_str(), 0, 0, this->m_fontHeight, 0, 0) + 4; } } } diff --git a/Source/UI/Text/UIStaticText.cpp b/Source/UI/Text/UIStaticText.cpp index 6ce6fbc7..485ef2d7 100644 --- a/Source/UI/Text/UIStaticText.cpp +++ b/Source/UI/Text/UIStaticText.cpp @@ -48,8 +48,8 @@ void UIStaticText::SetTextFitted(const char* value) { return; } - int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, this->fontFamily, this->fontHeight, this->bold, 0); - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, "...", 0, this->fontFamily, this->fontHeight, this->bold, 0); + int width = this->TextWidth(value, 0, this->fontFamily, this->fontHeight, this->bold, 0); + this->TextWidth("...", 0, this->fontFamily, this->fontHeight, this->bold, 0); if (this->geometry.width >= width) { this->text = value; @@ -72,7 +72,7 @@ void UIStaticText::SetTextFitted(const char* value) { } this->text = truncated + "..."; - width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->bold, 0); + width = this->TextWidth(this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->bold, 0); } this->Invalidate(); @@ -90,8 +90,8 @@ void UIStaticText::SetTextFittedCodePage(const char* value) { return; } - int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, this->fontFamily, this->fontHeight, 0, 0); - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, "...", 0, this->fontFamily, this->fontHeight, 0, 0); + int width = this->TextWidth(value, 0, this->fontFamily, this->fontHeight, 0, 0); + this->TextWidth("...", 0, this->fontFamily, this->fontHeight, 0, 0); if (this->geometry.width >= width) { this->text = value; this->Invalidate(); @@ -133,8 +133,7 @@ void UIStaticText::SetTextFittedCodePage(const char* value) { fitted.resize(byteLength - 1); } this->text = fitted + "..."; - width = this->TextWidth( - this->m_controls->fonts, this->m_controls->locale, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0, 0 + width = this->TextWidth(this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0, 0 ); } @@ -145,8 +144,7 @@ void UIStaticText::SetTextFittedCodePage(const char* value) { void UIStaticText::Paint() { this->FillRegion(0, 0, this->geometry.width, this->geometry.height, this->background); const auto draw = [&](int x, int y, std::uint32_t color, unsigned char boldValue, unsigned char italicValue) { - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, x, y, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, boldValue, italicValue + this->DrawTextAt(x, y, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, boldValue, italicValue ); }; @@ -239,19 +237,19 @@ void UIStaticText2::Paint() { this->ClearSurface(this->background); if (this->shadow != 0) { - this->DrawTextAt(controls.fonts, controls.locale, 2, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0xFFFFFF, this->bold, this->italic); + this->DrawTextAt(2, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0xFFFFFF, this->bold, this->italic); } if (this->outline != 0) { - this->DrawTextAt(controls.fonts, controls.locale, 0, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); - this->DrawTextAt(controls.fonts, controls.locale, 1, 0, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); - this->DrawTextAt(controls.fonts, controls.locale, 2, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); - this->DrawTextAt(controls.fonts, controls.locale, 1, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); + this->DrawTextAt(0, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); + this->DrawTextAt(1, 0, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); + this->DrawTextAt(2, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); + this->DrawTextAt(1, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic); } const std::uint32_t color = static_cast(this->red) | (static_cast(this->green) << 8) | (static_cast(this->blue) << 16); - this->DrawTextAt(controls.fonts, controls.locale, 1, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, this->bold, this->italic); + this->DrawTextAt(1, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, this->bold, this->italic); } // OFFSET: 0x0085DCA0 @@ -261,32 +259,27 @@ void UIStaticText3::Paint() { this->ClearSurface(this->background); if (this->shadow != 0) { - this->DrawTextAt( - controls.fonts, controls.locale, this->textX + 2, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0xFFFFFF, this->bold, this->italic + this->DrawTextAt(this->textX + 2, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, 0xFFFFFF, this->bold, this->italic ); } if (this->outline != 0) { - this->DrawTextAt( - controls.fonts, controls.locale, this->textX, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic + this->DrawTextAt(this->textX, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic ); - this->DrawTextAt( - controls.fonts, controls.locale, this->textX + 1, 0, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->DrawTextAt(this->textX + 1, 0, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic ); - this->DrawTextAt( - controls.fonts, controls.locale, this->textX + 2, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->DrawTextAt(this->textX + 2, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic ); - this->DrawTextAt( - controls.fonts, controls.locale, this->textX + 1, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, + this->DrawTextAt(this->textX + 1, 2, this->text.c_str(), 0, this->fontFamily, this->fontHeight, this->outlineColor, this->bold, this->italic ); } const std::uint32_t color = static_cast(this->red) | (static_cast(this->green) << 8) | (static_cast(this->blue) << 16); - this->DrawTextAt(controls.fonts, controls.locale, this->textX + 1, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, this->bold, this->italic); + this->DrawTextAt(this->textX + 1, 1, this->text.c_str(), 0, this->fontFamily, this->fontHeight, color, this->bold, this->italic); } // OFFSET: 0x00865CE0 @@ -302,15 +295,13 @@ void UIStaticText::SetFont(int family, int height, unsigned char bold, unsigned // FUNCTION: fn_10962 void UIBmpTextButton::AddTextStyle(int state, int height, std::uint32_t color, unsigned char bold, unsigned char shadow, int x, int y) { if (x == -1000) { - const int width = this->TextWidth( - this->m_buttonContext->fonts, this->m_buttonContext->locale, this->text.c_str(), this->text.size(), 0, height, bold, 0 + const int width = this->TextWidth(this->text.c_str(), this->text.size(), 0, height, bold, 0 ); x = static_cast((this->geometry.width - width) * 0.5); } if (y == -1000) { - const int textHeight = this->TextHeight( - this->m_buttonContext->fonts, this->m_buttonContext->locale, this->text.c_str(), this->text.size(), 0, height, bold, 0 + const int textHeight = this->TextHeight(this->text.c_str(), this->text.size(), 0, height, bold, 0 ); y = static_cast((this->geometry.height - textHeight) * 0.5); } @@ -333,7 +324,7 @@ void UIStaticText::SetTextAutoWidth(const char* value) { this->Invalidate(); const int height = this->geometry.height; - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, this->fontFamily, this->fontHeight, this->bold, 0); + const int width = this->TextWidth(value, 0, this->fontFamily, this->fontHeight, this->bold, 0); this->Resize(width + 2, height); } @@ -356,12 +347,12 @@ void UIStaticText::SetTextWithinWidth(const char* value, int outlineValue) { this->outline = outlineValue; this->tooltipEnabled = 0; - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, 0, this->fontHeight, this->bold, 0); + const int width = this->TextWidth(value, 0, 0, this->fontHeight, this->bold, 0); if (this->geometry.width < width) { this->SetTextFitted(value); } else { const int height = this->geometry.height; - const int textWidth = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, value, 0, 0, this->fontHeight, this->bold, 0); + const int textWidth = this->TextWidth(value, 0, 0, this->fontHeight, this->bold, 0); this->Resize(textWidth, height); } this->Invalidate(); diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 3918a204..7cfc2eb9 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -47,7 +47,7 @@ std::pair UITextViewer::LinkPosition(unsigned position, unsigned added if (accumulated > position) { const unsigned bytes = position + static_cast(plain.size()) - accumulated; const std::string prefix = plain.substr(0, bytes); - return {static_cast(index), this->TextWidth(owner.fonts, owner.locale, prefix.c_str(), 0, 0, 12, 0, 0) + 2}; + return {static_cast(index), this->TextWidth(prefix.c_str(), 0, 0, 12, 0, 0) + 2}; } } @@ -82,7 +82,7 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { auto* button = new UITextButton(*this->m_context, this->m_text->buttons); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(464); @@ -127,7 +127,7 @@ bool UITextViewer::AddNaviLinks(std::string text, unsigned addedLines) { auto* button = new UITextButton(*this->m_context, this->m_text->buttons); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(438); @@ -227,7 +227,7 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { auto* button = new UITextButton(*this->m_context, this->m_text->buttons); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(539); @@ -311,7 +311,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { auto* button = new UITextButton(*this->m_context, this->m_text->buttons); button->Configure(labels[fragment].c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, labels[fragment].c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(labels[fragment].c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(517); @@ -326,7 +326,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { auto* button = new UITextButton(*this->m_context, this->m_text->buttons); button->Configure(link.display.c_str(), 0x00F4934A, 0, 12, 0, 1); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); button->m_hoverColor = 0x00FF7864; button->SetId(517); @@ -374,7 +374,7 @@ bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) { button->m_hoverColor = 0x00EFB700; button->SetId(437); const int height = button->geometry.height; - const int width = this->TextWidth(owner.fonts, owner.locale, link.display.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(link.display.c_str(), 0, 0, 12, 0, 0); button->Resize(width + 1, height); parsed = RemoveTextLinkInfo(parsed); const auto position = this->LinkPosition(link.position, addedLines); diff --git a/Source/UI/Text/UITransBalloonText.cpp b/Source/UI/Text/UITransBalloonText.cpp index 9cdb23f5..3325b847 100644 --- a/Source/UI/Text/UITransBalloonText.cpp +++ b/Source/UI/Text/UITransBalloonText.cpp @@ -196,16 +196,14 @@ void UIAchBalloonText::Paint() { const int count = static_cast(this->m_lines.size()); const std::string& first = this->m_lines.front(); const int lineHeight = - this->TextHeight( - this->m_textContext->fonts, this->m_textContext->locale, first.c_str(), static_cast(first.size()), this->m_fontFamily, this->m_fontHeight, 1, 0 + this->TextHeight(first.c_str(), static_cast(first.size()), this->m_fontFamily, this->m_fontHeight, 1, 0 ) + 4; const int top = (this->geometry.height - lineHeight * count + 4) / 2; for (int index = 0; index < count; ++index) { const std::string& line = this->m_lines[index]; - const int width = this->TextWidth( - this->m_textContext->fonts, this->m_textContext->locale, line.c_str(), static_cast(line.size()), this->m_fontFamily, this->m_fontHeight, 1, 0 + const int width = this->TextWidth(line.c_str(), static_cast(line.size()), this->m_fontFamily, this->m_fontHeight, 1, 0 ); int y = top; if (index != 0) { diff --git a/Source/UI/UIBarGraph.cpp b/Source/UI/UIBarGraph.cpp index 3c06cfcb..1a124cb9 100644 --- a/Source/UI/UIBarGraph.cpp +++ b/Source/UI/UIBarGraph.cpp @@ -58,8 +58,7 @@ void UIBarGraph2::Paint() { } char text[16]; sprintf_s(text, sizeof(text), "%3ld", static_cast(this->m_value)); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, (this->geometry.width >> 1) - 20, (this->geometry.height >> 1) - 7, + this->DrawTextAt((this->geometry.width >> 1) - 20, (this->geometry.height >> 1) - 7, text, 0, 1, 16, 0xFFFF, 0, 0 ); return; diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index 13d8136f..585ddc61 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -1646,7 +1646,7 @@ void UIExpandedBartermarketWnd::Slot15(int width, int height) { // OFFSET: 0x008426E0 // FUNCTION: fn_10554 void UIBarterItemPurchaseWnd::Paint() { - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, LookupMessage(0xE69), 0); + this->DrawTitleBar(false, LookupMessage(0xE69), 0); if (this->geometry.height == 17) { return; } @@ -1724,7 +1724,7 @@ void UIBarterItemPurchaseWnd::Paint() { // OFFSET: 0x00842BF0 // FUNCTION: fn_10555 void UIBartermarketWnd::Paint() { - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, LookupMessage(0xBA), 0); + this->DrawTitleBar(false, LookupMessage(0xBA), 0); if (this->geometry.height == 17) { return; } @@ -1809,7 +1809,7 @@ void UIBartermarketWnd::Paint() { // OFFSET: 0x008473F0 // FUNCTION: fn_10585 void UIExpandedBartermarketWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, false, LookupMessage(0xE69), 0); + this->DrawTitleBar(false, LookupMessage(0xE69), 0); const int borderTiles = (this->geometry.height - 46 + 7) / 8; for (int tile = 0, y = 17; tile < borderTiles; ++tile, y += 8) { @@ -1891,7 +1891,7 @@ void UIExpandedBartermarketWnd::Paint() { // OFFSET: 0x00847AA0 // FUNCTION: fn_10586 void UIExpandedBarterItemPurchaseWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, false, LookupMessage(0xBA), 0); + this->DrawTitleBar(false, LookupMessage(0xBA), 0); const int borderHeight = this->geometry.height - 46; const int borderTiles = borderHeight / 8 + (borderHeight % 8 != 0); diff --git a/Source/UI/UIBroadcastBalloon.cpp b/Source/UI/UIBroadcastBalloon.cpp index 0ece8e88..660df765 100644 --- a/Source/UI/UIBroadcastBalloon.cpp +++ b/Source/UI/UIBroadcastBalloon.cpp @@ -30,7 +30,7 @@ void UIBroadcastBalloon::AddMessage(int category, const BroadcastBalloonMessage& int width = 0; int height = 0; for (const BroadcastBalloonLine& line : last.lines) { - const SIZE size = this->TextSize(this->m_controls->fonts, this->m_controls->locale, line.text.c_str(), 0, 0, last.fontHeight, 0, 0); + const SIZE size = this->TextSize(line.text.c_str(), 0, 0, last.fontHeight, 0, 0); if (width < size.cx) { width = size.cx; } @@ -96,7 +96,7 @@ void UIBroadcastBalloon::Paint() { y += 4; for (const BroadcastBalloonLine& line : message.lines) { this->sub_A86510(x + 6, y, line.text.c_str(), 0, line.color, line.outlineColor, 0, message.fontHeight, 0); - int lineHeight = this->TextHeight(this->m_controls->fonts, this->m_controls->locale, line.text.c_str(), 0, 0, message.fontHeight, 0, 0); + int lineHeight = this->TextHeight(line.text.c_str(), 0, 0, message.fontHeight, 0, 0); y += 4 + lineHeight; } y += 10; diff --git a/Source/UI/UICaptchaRegisterWnd.cpp b/Source/UI/UICaptchaRegisterWnd.cpp index 48b4898b..d8a331f6 100644 --- a/Source/UI/UICaptchaRegisterWnd.cpp +++ b/Source/UI/UICaptchaRegisterWnd.cpp @@ -122,7 +122,7 @@ void UICaptchaRegisterWnd::Slot15(int width, int height) { void UICaptchaRegisterWnd::Paint() { UIButtonContext& controls = *this->m_controls; DrawFilledRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height, 0xFFFFFFFF); - this->DrawTitleBar(controls.fonts, controls.locale, true, "", 0); + this->DrawTitleBar(true, "", 0); DrawRectangleBorder(*this, 34, 80, 222, 92, 0); } diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 6d9c83a7..1831999d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -556,11 +556,11 @@ void UIChangeMaterialWnd::Paint() { DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, controls.fonts, controls.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(controls.fonts, controls.locale, amount.c_str(), 0, 0x1D, 0x17, 1, 0); + const int width = this->TextWidth(amount.c_str(), 0, 0x1D, 0x17, 1, 0); DrawOutlinedText(*this, 0x4F + (0xC8 - width) / 2, 0x64, amount.c_str(), 0, 0x5082DC, 0x643C00, 0x1D, 0x17, 1, 0); if (!this->m_resultText.empty()) { - this->DrawTextAt(controls.fonts, controls.locale, 0x50, 0x103, this->m_resultText.c_str(), 0, 0, 0xC, 0x1E00E6, 0, 0); + this->DrawTextAt(0x50, 0x103, this->m_resultText.c_str(), 0, 0, 0xC, 0x1E00E6, 0, 0); } } @@ -609,18 +609,18 @@ void UIChangeMaterialWnd_List::Paint() { WORD language = g_serverLanguage->language; ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; std::string name = naming.DisplayName(item, 0); - if (this->TextWidth(context.fonts, context.locale, name.c_str(), 0, 0, 12, 0, 0) > 100) { + if (this->TextWidth(name.c_str(), 0, 0, 12, 0, 0) > 100) { name = this->FitDisplayText(100, name.c_str(), 0, 12, 0); } const int y = rowHeight * row; if (entry->state == 1) { DrawItemWithQuantity(*this, ResourceMgr::Instance(), descriptions, context.fonts, context.locale, 0, y, item, 1, 0); - this->DrawTextAt(context.fonts, context.locale, 30, y + 6, name.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(30, y + 6, name.c_str(), 0, 0, 12, 0, 0, 0); this->DrawRightAlignedText(163, y + 6, FormatOwnedString(LookupMessage(182), item.quantity).c_str(), 0, 0, 12, 0, 0); } else { DrawItemWithQuantityAuxiliary(*this, descriptions, context.fonts, context.locale, 1, 0, y, item, 1, 0); - this->DrawTextAt(context.fonts, context.locale, 30, y + 6, name.c_str(), 0, 0, 12, 0xAAAAAA, 0, 0); + this->DrawTextAt(30, y + 6, name.c_str(), 0, 0, 12, 0xAAAAAA, 0, 0); this->DrawRightAlignedText(163, y + 6, FormatOwnedString(LookupMessage(182), item.quantity).c_str(), 0, 0, 12, 0xAAAAAA, 0); } } @@ -796,13 +796,13 @@ void UIChangeMaterialWnd_CheckBox::Paint() { auto* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_unchecked.c_str()))); this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); if (!this->ascendingText.empty()) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0xc, 1, this->ascendingText.c_str(), 0, 0, 0xc, 0, 0, 0); + this->DrawTextAt(0xc, 1, this->ascendingText.c_str(), 0, 0, 0xc, 0, 0, 0); } } else if (this->geometry.unknown_0030 == 1) { auto* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_checked.c_str()))); this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); if (!this->descendingText.empty()) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0xc, 1, this->descendingText.c_str(), 0, 0, 0xc, 0, 0, 0); + this->DrawTextAt(0xc, 1, this->descendingText.c_str(), 0, 0, 0xc, 0, 0, 0); } } } diff --git a/Source/UI/UIHotkeyGuideWnd.cpp b/Source/UI/UIHotkeyGuideWnd.cpp index 8778a1b4..03ea8429 100644 --- a/Source/UI/UIHotkeyGuideWnd.cpp +++ b/Source/UI/UIHotkeyGuideWnd.cpp @@ -202,7 +202,7 @@ 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(controls.fonts, controls.locale, false, LookupMessage(3128), 0); + this->DrawTitleBar(false, LookupMessage(3128), 0); for (auto key = this->m_keys.begin(); key != this->m_keys.end(); ++key) { HotkeyGuideLabel& label = this->m_labels[*key]; @@ -235,9 +235,9 @@ void UIHotkeyGuideWnd::Paint() { } else { text = "Non"; } - int width = this->TextWidth(controls.fonts, controls.locale, text.c_str(), 0, 0, 12, 1, 0); + int width = this->TextWidth(text.c_str(), 0, 0, 12, 1, 0); int x = static_cast((100 - width) * 0.5 + (index / 6 * 246 + 156)); - this->DrawTextAt(controls.fonts, controls.locale, x, index % 6 * 30 + 315, text.c_str(), 0, 0, 12, 0xA55139, 1, 0); + this->DrawTextAt(x, index % 6 * 30 + 315, text.c_str(), 0, 0, 12, 0xA55139, 1, 0); ++index; } @@ -335,14 +335,14 @@ 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(controls.fonts, controls.locale, text.c_str(), 0, 0, 12, 0, 0); + int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); x = static_cast(static_cast(key->width - textWidth) * g_depthAverageHalf + static_cast(x)); } else if (key->align == 0) { x += key->padding; } else if (key->align == 2) { - int textWidth = this->TextWidth(controls.fonts, controls.locale, text.c_str(), 0, 0, 12, 0, 0); + int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); x += key->width - key->padding - textWidth; } int y = static_cast(static_cast(key->height - 12) * 0.5 + static_cast(key->y)); - this->DrawTextAt(controls.fonts, controls.locale, x, y, text.c_str(), 0, 0, 12, 0x2B2625, 0, 0); + this->DrawTextAt(x, y, text.c_str(), 0, 0, 12, 0x2B2625, 0, 0); } diff --git a/Source/UI/UIItemReformWnd.cpp b/Source/UI/UIItemReformWnd.cpp index 044d1cd9..651a1027 100644 --- a/Source/UI/UIItemReformWnd.cpp +++ b/Source/UI/UIItemReformWnd.cpp @@ -157,24 +157,24 @@ void UIItemReformWnd::Paint() { WORD language = g_serverLanguage->language; ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; if (std::atoi(this->reformItem.itemId.c_str()) > 0) { - this->DrawTitleBar(context.fonts, context.locale, false, naming.DisplayName(this->reformItem, 0).c_str(), 0); + this->DrawTitleBar(false, naming.DisplayName(this->reformItem, 0).c_str(), 0); } if (std::atoi(this->resultItem.itemId.c_str()) != 0) { this->DrawCenteredText(6, 104, this->FitDisplayText(200, naming.DisplayName(this->resultItem, 0).c_str(), 0, 14, 1).c_str(), 209, 0, 14, 0, 1); } for (unsigned int index = 0; index < this->materials.size(); ++index) { - const unsigned int half = this->TextWidth(context.fonts, context.locale, "/", 0, 0, 12, 0, 0) * 0.5; + const unsigned int half = this->TextWidth("/", 0, 0, 12, 0, 0) * 0.5; const int x = index % 3 * 69 + 42; const int y = index / 3 * 50 + 167; const int owned = g_session.GetInventoryItemCount(std::atoi(this->materials[index].itemId.c_str())); const int required = this->materials[index].quantity; const std::uint32_t color = owned < required ? 0x321EC8 : 0x3C3C3C; - this->DrawTextAt(context.fonts, context.locale, x - half, y, "/", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x - half, y, "/", 0, 0, 12, 0, 0, 0); this->DrawRightAlignedText(x - half, y, FormatOwnedString("%d", owned).c_str(), 0, 0, 12, color, 0); - this->DrawTextAt(context.fonts, context.locale, x + half, y, FormatOwnedString("%d", required).c_str(), 0, 0, 12, color, 0, 0); + this->DrawTextAt(x + half, y, FormatOwnedString("%d", required).c_str(), 0, 0, 12, color, 0, 0); } if (this->warning.size() != 0) { - this->DrawTextAt(context.fonts, context.locale, 8, 240, this->FitDisplayText(280, this->warning.c_str(), 0, 12, 0).c_str(), 0, 0, 12, 0xA0AFF, 0, 0); + this->DrawTextAt(8, 240, this->FitDisplayText(280, this->warning.c_str(), 0, 12, 0).c_str(), 0, 0, 12, 0xA0AFF, 0, 0); } } @@ -184,7 +184,7 @@ void UIItemReformWnd_DetailBtn::Paint() { this->ClearSurface(0xFFFF00FF); std::string text = LookupMessage(3854); UIButtonContext& controls = *this->m_buttonContext; - const unsigned int textWidth = this->TextWidth(controls.fonts, controls.locale, text.c_str(), 0, 0, 12, 0, 0); + 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); } @@ -231,8 +231,7 @@ void UIItemReformWnd_List::Paint() { bool languagePrefix = false; WORD language = g_serverLanguage->language; ItemNaming naming{descriptions, g_itemCardNames, *g_playerNameDictionary, languagePrefix, g_serviceType, language}; - this->DrawTextAt( - context.fonts, context.locale, 42, this->itemHeight * row + 10, this->FitDisplayText(160, naming.DisplayName(item, 0).c_str(), 0, 12, 0).c_str(), 0, 0, + this->DrawTextAt(42, this->itemHeight * row + 10, this->FitDisplayText(160, naming.DisplayName(item, 0).c_str(), 0, 12, 0).c_str(), 0, 0, 12, 0, 0, 0 ); } diff --git a/Source/UI/UILapineScrollBar.cpp b/Source/UI/UILapineScrollBar.cpp index ff83e6ef..47b7503b 100644 --- a/Source/UI/UILapineScrollBar.cpp +++ b/Source/UI/UILapineScrollBar.cpp @@ -247,7 +247,7 @@ void UILapineBoxWnd::Paint() { this->DrawBitmap(0, 0, &background->image, true); if (this->title.size() != 0) { - this->DrawTitleBar(controls.fonts, controls.locale, false, this->title.c_str(), 0); + this->DrawTitleBar(false, this->title.c_str(), 0); } this->DrawCenteredText(33, 47, LookupMessage(2896), 160, 0, 11, 0xCD7A51, 0); @@ -285,7 +285,7 @@ void UILapineBoxWnd::Paint() { if (timeGetTime() < this->noticeTick + this->noticeDuration) { CBitmapRes* icon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\icon_notify.bmp"))); this->DrawBitmap(6, 229, &icon->image, true); - this->DrawTextAt(controls.fonts, controls.locale, 25, 230, this->notice.c_str(), 0, 0, 12, 0xFF0000, 0, 0); + this->DrawTextAt(25, 230, this->notice.c_str(), 0, 0, 12, 0xFF0000, 0, 0); } } diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 965c910f..441019d5 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -153,7 +153,7 @@ void UILapineUpgradeBoxWnd::Paint() { this->DrawBitmap(0, 0, &background->image, true); if (this->title.size() != 0) { - this->DrawTitleBar(controls.fonts, controls.locale, false, this->title.c_str(), 0); + this->DrawTitleBar(false, this->title.c_str(), 0); } this->DrawCenteredText(35, 47, LookupMessage(2896), 156, 0, 11, 0xCD7A51, 0); @@ -167,7 +167,7 @@ void UILapineUpgradeBoxWnd::Paint() { if (timeGetTime() < this->noticeTick + this->noticeDuration) { CBitmapRes* icon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\lapine\\icon_notify.bmp"))); this->DrawBitmap(6, 229, &icon->image, true); - this->DrawTextAt(controls.fonts, controls.locale, 25, 230, this->notice.c_str(), 0, 0, 12, 0xFF0000, 0, 0); + this->DrawTextAt(25, 230, this->notice.c_str(), 0, 0, 12, 0xFF0000, 0, 0); } } diff --git a/Source/UI/UIMacroBlackListCheckWnd.cpp b/Source/UI/UIMacroBlackListCheckWnd.cpp index 71296a7f..faf31d78 100644 --- a/Source/UI/UIMacroBlackListCheckWnd.cpp +++ b/Source/UI/UIMacroBlackListCheckWnd.cpp @@ -97,7 +97,7 @@ void UIMacroBlackListCheckWnd::Slot15(int width, int height) { // FUNCTION: fn_09795 void UIMacroBlackListCheckWnd::Paint() { const TextLocale locale = {}; - const int titleHeight = this->UIWindow::DrawTitleBar(g_fontCache, locale, true, LookupMessage(0x92F), this->geometry.width + 1); + const int titleHeight = this->UIWindow::DrawTitleBar(true, LookupMessage(0x92F), this->geometry.width + 1); this->DrawPanelBackground(titleHeight, 0x21C, "유저인터페이스\\basic_interface\\blacklist_check_bg.bmp"); this->DrawButtonBar(2, this->geometry.width + 1, 1); diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 99df6ad7..dad8de44 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -147,8 +147,8 @@ void UIMacroReporterWnd::sub_7EF430(int aid, std::string name) { // FUNCTION: fn_09842 std::string UIMacroReporterWnd::sub_7EF680(int maxWidth, const char* text, int font, int height, unsigned char bold) { std::string source(text); - const int width = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, 0, font, height, bold, 0); - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, "...", 0, font, height, bold, 0); + const int width = this->TextWidth(text, 0, font, height, bold, 0); + this->TextWidth("...", 0, font, height, bold, 0); if (maxWidth >= width) { return text; } @@ -164,7 +164,7 @@ std::string UIMacroReporterWnd::sub_7EF680(int maxWidth, const char* text, int f fitted = ATL::CW2AEX<128>(wide.c_str(), CP_THREAD_ACP); fitted += "..."; - if (this->TextWidth(this->m_controls->fonts, this->m_controls->locale, fitted.c_str(), 0, font, height, bold, 0) <= maxWidth) { + if (this->TextWidth(fitted.c_str(), 0, font, height, bold, 0) <= maxWidth) { return fitted; } } @@ -198,7 +198,7 @@ void UIMacroReporterWnd::Paint() { } DrawFilledRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height, 0xFFFFFFFF); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, "", 0); + this->DrawTitleBar(true, "", 0); this->DrawButtonBar(1, 0, 1); if (this->m_mode != 0 && this->m_mode != 1) { @@ -231,8 +231,8 @@ void UIMacroReporterWnd::Paint() { // FUNCTION: fn_09849 void UIMacroUserInfoWnd::Paint() { this->ClearSurface(0xFAFAFA); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 5, 5, this->m_name.c_str(), 0, 0, 12, 0, 1, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 5, 20, this->m_message.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 5, this->m_name.c_str(), 0, 0, 12, 0, 1, 0); + this->DrawTextAt(5, 20, this->m_message.c_str(), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x007F1160 @@ -529,7 +529,7 @@ void UIMacroReporterWnd::Slot15(int, int) { UIEditCtrl* target = new UIEditCtrl(); this->m_edit = target; target->SetSize(15, 14); - target->Move(this->TextWidth(this->m_controls->fonts, this->m_controls->locale, labels[1].c_str(), 0, 0, 12, 0, 0) + 83, 30); + target->Move(this->TextWidth(labels[1].c_str(), 0, 0, 12, 0, 0) + 83, 30); target->flat = 0; target->Border(125, 125, 125); target->maximum = 1; diff --git a/Source/UI/UIPreviewEquipWnd.cpp b/Source/UI/UIPreviewEquipWnd.cpp index b96f87dc..8a550d72 100644 --- a/Source/UI/UIPreviewEquipWnd.cpp +++ b/Source/UI/UIPreviewEquipWnd.cpp @@ -79,8 +79,8 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { UIStaticText* shadow = new UIStaticText(*this->m_context, controls); shadow->SetSize( - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xB90), 0, 0, 12, 0, 0), - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xB90), 0, 0, 12, 0, 0) + this->TextWidth(LookupMessage(0xB90), 0, 0, 12, 0, 0), + this->TextHeight(LookupMessage(0xB90), 0, 0, 12, 0, 0) ); shadow->SetText(LookupMessage(0xB90), 0); shadow->SetColor(255, 255, 255); @@ -89,8 +89,8 @@ void UIPreviewEquipWnd::Slot15(int width, int height) { UIStaticText* title = new UIStaticText(*this->m_context, controls); title->SetSize( - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xB90), 0, 0, 12, 0, 0), - this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xB90), 0, 0, 12, 0, 0) + this->TextWidth(LookupMessage(0xB90), 0, 0, 12, 0, 0), + this->TextHeight(LookupMessage(0xB90), 0, 0, 12, 0, 0) ); title->SetText(LookupMessage(0xB90), 0); title->Move(18, 3); diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index a18f3ff8..d11a53b2 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -340,32 +340,28 @@ void UIRefining_BtnAgain::Paint() { UIBitmapButton::Paint(); auto& controls = *this->m_buttonContext; if (this->m_disabled == 1) { - int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(3241), 0, 0, 12, 1, 0); + 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); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 14, LookupMessage(3241), 0, 0, 12, color, 1, 0 ); return; } - int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(3241), 0, 0, 12, 1, 0); + 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); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 9, LookupMessage(3241), 0, 0, 12, color, 1, 0 ); std::string count = FormatOwnedString(LookupMessage(3285), this->unknown_0125); - width = this->TextWidth(controls.fonts, controls.locale, count.c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + width = this->TextWidth(count.c_str(), 0, 0, 11, 0, 0); + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 22, count.c_str(), 0, 0, 11, 0, 0, 0 ); - width = this->TextWidth(controls.fonts, controls.locale, IntToString(this->cost, 0).c_str(), 0, 0, 11, 1, 0); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + width = this->TextWidth(IntToString(this->cost, 0).c_str(), 0, 0, 11, 1, 0); + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 38, IntToString(this->cost, 0).c_str(), 0, 0, 11, 0xFFFFFF, 1, 0 ); } @@ -375,17 +371,15 @@ void UIRefining_BtnAgain::Paint() { void UIRefining_BtnRefining::Paint() { UIBitmapButton::Paint(); auto& controls = *this->m_buttonContext; - int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(2966), 0, 0, 13, 1, 0); + int width = this->TextWidth(LookupMessage(2966), 0, 0, 13, 1, 0); std::uint32_t color = this->m_disabled == 1 ? 0x94644A : 0x3E1B12; - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 11, LookupMessage(2966), 0, 0, 12, color, 1, 0 ); if (this->m_disabled == 0) { - width = this->TextWidth(controls.fonts, controls.locale, IntToString(this->cost, 0).c_str(), 0, 0, 12, 1, 0); - this->DrawTextAt( - controls.fonts, controls.locale, 83 - width, (this->geometry.unknown_0030 == 2) + 28, IntToString(this->cost, 0).c_str(), 0, 0, 12, 0xFFFFFF, 1, 0 + width = this->TextWidth(IntToString(this->cost, 0).c_str(), 0, 0, 12, 1, 0); + this->DrawTextAt(83 - width, (this->geometry.unknown_0030 == 2) + 28, IntToString(this->cost, 0).c_str(), 0, 0, 12, 0xFFFFFF, 1, 0 ); } } @@ -395,10 +389,9 @@ void UIRefining_BtnRefining::Paint() { void UIRefining_BtnReturn::Paint() { UIBitmapButton::Paint(); auto& controls = *this->m_buttonContext; - int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(2973), 0, 0, 12, 1, 0); + int width = this->TextWidth(LookupMessage(2973), 0, 0, 12, 1, 0); std::uint32_t color = this->highlighted == 1 ? 0xE1C1F : 0x3E1B12; - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - width) * 0.5f), + this->DrawTextAt(static_cast(static_cast(this->geometry.width - width) * 0.5f), (this->geometry.unknown_0030 == 2) + 14, LookupMessage(2973), 0, 0, 12, color, 1, 0 ); } @@ -418,8 +411,7 @@ void UIRefining_Notice::Paint() { auto& controls = *this->m_controls; int offset = 0; for (const std::string& line : lines) { - this->DrawTextAt( - controls.fonts, controls.locale, 18, static_cast((this->geometry.height - lines.size() * 11) * 0.5 + offset), line.c_str(), 0, 0, 11, color, 0, 0 + this->DrawTextAt(18, static_cast((this->geometry.height - lines.size() * 11) * 0.5 + offset), line.c_str(), 0, 0, 11, color, 0, 0 ); offset += 11; } @@ -1166,7 +1158,7 @@ void UIRefiningWnd::Paint() { rate = this->materials[this->selectedMaterial].unknown_0004; } const std::string label = FormatOwnedString("%s %d%%", LookupMessage(2974), rate); - const int labelWidth = this->TextWidth(controls.fonts, controls.locale, label.c_str(), 0, 0, 12, 1, 0); + const int labelWidth = this->TextWidth(label.c_str(), 0, 0, 12, 1, 0); rate = 0; if (this->item.unknown_0000[1] != 0 && !this->materials.empty() && this->selectedMaterial >= 0 && @@ -1174,31 +1166,29 @@ void UIRefiningWnd::Paint() { rate = this->materials[this->selectedMaterial].unknown_0004; } const std::string percent = FormatOwnedString("%d%%", rate); - const int percentWidth = this->TextWidth(controls.fonts, controls.locale, percent.c_str(), 0, 0, 12, 1, 0); + const int percentWidth = this->TextWidth(percent.c_str(), 0, 0, 12, 1, 0); const int x = static_cast((this->geometry.width - labelWidth) * 0.5); - this->DrawTextAt(controls.fonts, controls.locale, x, 31, LookupMessage(2974), 0, 0, 12, 0x422B1F, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, x - percentWidth + labelWidth, 31, percent.c_str(), 0, 0, 12, 0xDE612A, 1, 0); + this->DrawTextAt(x, 31, LookupMessage(2974), 0, 0, 12, 0x422B1F, 1, 0); + this->DrawTextAt(x - percentWidth + labelWidth, 31, percent.c_str(), 0, 0, 12, 0xDE612A, 1, 0); break; } case 3: { - const int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(2971), 0, 0, 12, 1, 0); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast((this->geometry.width - width) * 0.5), 31, LookupMessage(2971), 0, 0, 12, 0x422B1F, 1, 0 + const int width = this->TextWidth(LookupMessage(2971), 0, 0, 12, 1, 0); + this->DrawTextAt(static_cast((this->geometry.width - width) * 0.5), 31, LookupMessage(2971), 0, 0, 12, 0x422B1F, 1, 0 ); break; } case 4: case 5: case 6: { - const int width = this->TextWidth(controls.fonts, controls.locale, LookupMessage(2972), 0, 0, 12, 1, 0); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast((this->geometry.width - width) * 0.5), 31, LookupMessage(2972), 0, 0, 12, 0x422B1F, 1, 0 + const int width = this->TextWidth(LookupMessage(2972), 0, 0, 12, 1, 0); + this->DrawTextAt(static_cast((this->geometry.width - width) * 0.5), 31, LookupMessage(2972), 0, 0, 12, 0x422B1F, 1, 0 ); break; } } this->DrawButtonBar(2, 0, 1); - this->DrawTitleBar(controls.fonts, controls.locale, false, LookupMessage(2966), 0); + this->DrawTitleBar(false, LookupMessage(2966), 0); } diff --git a/Source/UI/UIReputeWnd.cpp b/Source/UI/UIReputeWnd.cpp index c7dfcfa7..2e4ba535 100644 --- a/Source/UI/UIReputeWnd.cpp +++ b/Source/UI/UIReputeWnd.cpp @@ -128,7 +128,7 @@ void UIReputeWnd::Slot15(int width, int height) { void UIReputeWnd::Paint() { auto& controls = *this->m_controls; this->ClearSurface(0xFFFFFFFF); - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, LookupMessage(3827), 0); + const int titleHeight = this->DrawTitleBar(false, LookupMessage(3827), 0); const int barHeight = this->DrawButtonBar(2, 0, 1); DrawRectangleBorder(*this, 0, titleHeight - 1, this->geometry.width, this->geometry.height - barHeight - titleHeight + 2, 0xC6C6C6); DrawRectangleBorder(*this, 0, titleHeight, this->geometry.width, 1, 0); @@ -160,7 +160,7 @@ void UIReputeWnd::Paint() { const char* background = info->updated ? "유저인터페이스\\Reputation\\bg_highlight.bmp" : "유저인터페이스\\Reputation\\bg_info.bmp"; CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(background))); this->DrawBitmap(left + 7, top + 50, &bitmap->image, false); - this->DrawTextAt(controls.fonts, controls.locale, left + 12, top + 56, info->name.c_str(), 0, 0, 12, 0, 1, 0); + this->DrawTextAt(left + 12, top + 56, info->name.c_str(), 0, 0, 12, 0, 1, 0); const std::int64_t point = info->point; if (point < 0) { @@ -198,7 +198,7 @@ void UIReputeWnd::Paint() { if (this->m_groupSelected) { this->FillRegion(375, 26, 256, 16, 0xEFEFEF); DrawRectangleBorder(*this, 374, 25, 258, 18, 0x636363); - this->DrawTextAt(controls.fonts, controls.locale, 377, 29, "GROUP :", 0, 0, 12, 0, 1, 0); + this->DrawTextAt(377, 29, "GROUP :", 0, 0, 12, 0, 1, 0); this->DrawRightAlignedText(627, 29, FormatOwnedString("%I64d P", this->m_totalPoints).c_str(), 0, 0, 12, 0, 1); const char* light; @@ -215,11 +215,10 @@ void UIReputeWnd::Paint() { } const std::string separator = " / "; - const unsigned int separatorWidth = this->TextWidth(controls.fonts, controls.locale, separator.c_str(), 0, 0, 12, 0, 0); + const unsigned int separatorWidth = this->TextWidth(separator.c_str(), 0, 0, 12, 0, 0); this->DrawCenteredText(574, 402, separator.c_str(), 49, 0, 12, 0, 1); this->DrawRightAlignedText(static_cast((49 - separatorWidth) * 0.5 + 574.0), 402, std::to_string(this->m_page).c_str(), 0, 0, 12, 0, 1); - this->DrawTextAt( - controls.fonts, controls.locale, static_cast((separatorWidth + 49) * 0.5 + 574.0), 402, std::to_string(this->m_pageCount).c_str(), 0, 0, 12, 0, 1, 0 + this->DrawTextAt(static_cast((separatorWidth + 49) * 0.5 + 574.0), 402, std::to_string(this->m_pageCount).c_str(), 0, 0, 12, 0, 1, 0 ); } diff --git a/Source/UI/UIRoundBoxTooltipWnd.cpp b/Source/UI/UIRoundBoxTooltipWnd.cpp index b9f72a65..fd08c9b9 100644 --- a/Source/UI/UIRoundBoxTooltipWnd.cpp +++ b/Source/UI/UIRoundBoxTooltipWnd.cpp @@ -193,9 +193,9 @@ int UIRoundBoxTooltipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, longest.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(longest.c_str(), 0, 0, 12, 0, 0); this->viewer->lineLimit = lines; - const int height = this->TextHeight(this->m_context->fonts, this->m_context->locale, text.c_str(), 0, 0, 12, 0, 0); + const int height = this->TextHeight(text.c_str(), 0, 0, 12, 0, 0); this->viewer->Resize(width + 15, static_cast(static_cast(height * lines + 10) + static_cast(lines - 1) * 4.8f + 1.0f)); this->Resize(this->viewer->geometry.width + 2, this->viewer->geometry.height + 2); this->Move(g_screenWidth + 26, g_screenHeight); diff --git a/Source/UI/Window/UIAccountLimitedToolWnd.cpp b/Source/UI/Window/UIAccountLimitedToolWnd.cpp index 79983507..fd14e644 100644 --- a/Source/UI/Window/UIAccountLimitedToolWnd.cpp +++ b/Source/UI/Window/UIAccountLimitedToolWnd.cpp @@ -143,29 +143,29 @@ void UIAccountLimitedToolWnd::Slot15(int, int) { // FUNCTION: fn_12901 void UIAccountLimitedToolWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, LookupMessage(3650), 0); + this->DrawTitleBar(false, LookupMessage(3650), 0); this->DrawPanelBackground(17, 0, ""); - this->DrawTextAt(controls.fonts, controls.locale, 5, 28, LookupMessage(3651), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 5, 50, LookupMessage(3652), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 28, LookupMessage(3651), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 50, LookupMessage(3652), 0, 0, 12, 0, 0, 0); this->FillRegion(3, 70, this->geometry.width - 6, 2, 0x99938A); - this->DrawTextAt(controls.fonts, controls.locale, 5, 80, LookupMessage(3653), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 5, 102, LookupMessage(3654), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 117, 102, "/", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 152, 102, "/", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 187, 102, "(YY/MM/DD)", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 296, 102, ":", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 335, 102, "(HH:MM)", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 5, 124, LookupMessage(3655), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 117, 124, "/", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 152, 124, "/", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 187, 124, "(YY/MM/DD)", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 296, 124, ":", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 335, 124, "(HH:MM)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 80, LookupMessage(3653), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 102, LookupMessage(3654), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(117, 102, "/", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(152, 102, "/", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(187, 102, "(YY/MM/DD)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(296, 102, ":", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(335, 102, "(HH:MM)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 124, LookupMessage(3655), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(117, 124, "/", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(152, 124, "/", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(187, 124, "(YY/MM/DD)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(296, 124, ":", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(335, 124, "(HH:MM)", 0, 0, 12, 0, 0, 0); this->FillRegion(3, 144, this->geometry.width - 6, 2, 0x99938A); - this->DrawTextAt(controls.fonts, controls.locale, 5, 154, LookupMessage(3916), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 172, 154, "(DD)", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 278, 154, ":", 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 322, 154, "(HH:MM)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 154, LookupMessage(3916), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(172, 154, "(DD)", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(278, 154, ":", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(322, 154, "(HH:MM)", 0, 0, 12, 0, 0, 0); this->FillRegion(3, 174, this->geometry.width - 6, 2, 0x99938A); } diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index 7477046c..be2d1b27 100644 --- a/Source/UI/Window/UIBasicInfoWnd.cpp +++ b/Source/UI/Window/UIBasicInfoWnd.cpp @@ -380,20 +380,19 @@ void UIBasicInfoWnd::DrawExpanded() { ); this->DrawBitmap(0, 0, &background->image, false); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 18, 3, LookupMessage(238), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, 2, LookupMessage(238), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(18, 3, LookupMessage(238), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(17, 2, LookupMessage(238), 0, 0, 12, 0, 0, 0); - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 9, 36, g_session.GetJobName(job, -1), 0, family, fontHeight, 0, 0, 0 + this->DrawTextAt(9, 36, g_session.GetJobName(job, -1), 0, family, fontHeight, 0, 0, 0 ); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 9, 51, LookupMessage(3068), 0, 1, 14, 0, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 9, 65, LookupMessage(3069), 0, 1, 14, 0, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 9, 80, LookupMessage(3628), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(9, 51, LookupMessage(3068), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(9, 65, LookupMessage(3069), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(9, 80, LookupMessage(3628), 0, 1, 14, 0, 0, 0); if (g_session.unknown_556C > 0) { const std::int64_t percent = static_cast(g_session.unknown_5568) * 100 / g_session.unknown_556C; std::string text = FormatOwnedString("%d%%", percent); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 173, 51, text.c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(173, 51, text.c_str(), 0, 1, 14, 0, 0, 0); } const int sp = *reinterpret_cast(&g_session.unknown_5570[0]); @@ -401,26 +400,24 @@ void UIBasicInfoWnd::DrawExpanded() { if (spMax > 0) { const std::int64_t percent = static_cast(sp) * 100 / spMax; std::string text = FormatOwnedString("%d%%", percent); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 173, 65, text.c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(173, 65, text.c_str(), 0, 1, 14, 0, 0, 0); } const int apMax = g_session.GetTraitStat(233); if (apMax > 0) { std::string text = FormatOwnedString("%d%%", 100 * g_session.GetTraitStat(232) / apMax); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 173, 80, text.c_str(), 0, 1, 14, 0, 0, 0); + this->DrawTextAt(173, 80, text.c_str(), 0, 1, 14, 0, 0, 0); } std::string baseLevel = FormatOwnedString(LookupMessage(1995), g_session.m_level); - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 17, this->layoutOffset + 71, baseLevel.c_str(), 0, 1, 14, 0, 0, 0 + this->DrawTextAt(17, this->layoutOffset + 71, baseLevel.c_str(), 0, 1, 14, 0, 0, 0 ); std::string jobLevel = FormatOwnedString(LookupMessage(1996), g_session.m_jobLevel); if (g_serviceType == 12) { jobLevel = FormatOwnedString("Classe. %d", g_session.m_jobLevel); } - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, 17, this->layoutOffset + 83, jobLevel.c_str(), 0, 1, 14, 0, 0, 0 + this->DrawTextAt(17, this->layoutOffset + 83, jobLevel.c_str(), 0, 1, 14, 0, 0, 0 ); char zenyBuffer[64]; @@ -429,8 +426,7 @@ void UIBasicInfoWnd::DrawExpanded() { std::string zenyText = FormatOwnedString(LookupMessage(1997), zenyBuffer); zenyText = " | " + zenyText; this->DrawRightAlignedText(width - 5, this->layoutOffset + 103, zenyText.c_str(), 0, 1, 14, 0, 0); - const int zenyWidth = this->TextWidth( - this->m_controls->fonts, this->m_controls->locale, zenyText.c_str(), 0, 1, 14, 0, 0 + const int zenyWidth = this->TextWidth(zenyText.c_str(), 0, 1, 14, 0, 0 ); const int denominator = g_session.m_maxWeight < 1 ? 1 : g_session.m_maxWeight; @@ -456,7 +452,7 @@ void UIBasicInfoWnd::DrawCollapsed() { this->FillRegion(1, 17, width - 2, height - 18, RGB(red, green, blue)); SkinPaletteChannels(ResourceMgr::Instance(), 14, 6, red, green, blue); DrawRoundedBorder(*this, 0, 14, width, height - 14, RGB(red, green, blue)); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + this->DrawTitleBar(false, "", 0); int family = 1; int fontHeight = 14; @@ -485,14 +481,14 @@ void UIBasicInfoWnd::DrawCollapsed() { "%s %d / %s / %s %d", LookupMessage(3070), g_session.m_level, g_session.GetJobName(g_session.GetDisplayJob(), -1), LookupMessage(3627), g_session.m_jobLevel ); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 8, 20, title.c_str(), 0, family, fontHeight, 0, 0, 0); + this->DrawTextAt(8, 20, title.c_str(), 0, family, fontHeight, 0, 0, 0); std::uint32_t hpColor = 0; if (g_session.unknown_556C > 0) { hpColor = 0.25f > static_cast(g_session.unknown_5568) / static_cast(g_session.unknown_556C) ? 255 : 0; } std::string hpText = FormatOwnedString("%s %d / %d", LookupMessage(3068), g_session.unknown_5568, g_session.unknown_556C); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 8, 36, hpText.c_str(), 0, family, fontHeight, hpColor, 0, 0); + this->DrawTextAt(8, 36, hpText.c_str(), 0, family, fontHeight, hpColor, 0, 0); std::int64_t current = BaseExpCurrent(); std::int64_t maximum = BaseExpMaximum(); @@ -512,7 +508,7 @@ void UIBasicInfoWnd::DrawCollapsed() { 0.1; } std::string expText = FormatOwnedString("| %s %.1lf%%", LookupMessage(3072), percent); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 136, 36, expText.c_str(), 0, family, fontHeight, 0, 0, 0); + this->DrawTextAt(136, 36, expText.c_str(), 0, family, fontHeight, 0, 0, 0); const int sp = *reinterpret_cast(&g_session.unknown_5570[0]); const int spMax = *reinterpret_cast(&g_session.unknown_5570[4]); @@ -521,10 +517,10 @@ void UIBasicInfoWnd::DrawCollapsed() { spColor = 0.25f > static_cast(sp) / static_cast(spMax) ? 255 : 0; } std::string spText = FormatOwnedString("%s %d / %d", LookupMessage(3069), sp, spMax); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 8, 52, spText.c_str(), 0, family, fontHeight, spColor, 0, 0); + this->DrawTextAt(8, 52, spText.c_str(), 0, family, fontHeight, spColor, 0, 0); std::string apText = FormatOwnedString("| %s %d / %d", LookupMessage(3628), g_session.GetTraitStat(232), g_session.GetTraitStat(233)); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 136, 52, apText.c_str(), 0, family, fontHeight, 0, 0, 0); + this->DrawTextAt(136, 52, apText.c_str(), 0, family, fontHeight, 0, 0, 0); } // OFFSET: 0x009983C0 @@ -616,7 +612,7 @@ void UIBasicInfoWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->FillRegion(1, 17, this->geometry.width - 2, this->geometry.height - 19, RGB(red, green, blue)); this->FillRegion(2, this->geometry.height - 2, this->geometry.width - 4, 1, RGB(red, green, blue)); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + this->DrawTitleBar(false, "", 0); std::int64_t current = BaseExpCurrent(); std::int64_t maximum = BaseExpMaximum(); @@ -678,10 +674,10 @@ void UIBasicInfoWnd::Paint() { length = std::sprintf(text, "Lv.%2d / %s / Lv.%2d / Exp. %.1lf %%", g_session.m_level, g_session.GetJobName(g_session.GetDisplayJob(), -1), g_session.m_jobLevel, percent); - if (this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, length, family, fontHeight, 0, 0) + 9 > this->geometry.width) { + if (this->TextWidth(text, length, family, fontHeight, 0, 0) + 9 > this->geometry.width) { length = std::sprintf(text, "Lv%2d / %s / Lv%2d / Exp%.1lf%%", g_session.m_level, g_session.GetJobName(g_session.GetDisplayJob(), -1), g_session.m_jobLevel, percent); - const int remaining = this->geometry.width - this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, length, family, fontHeight, 0, 0); + const int remaining = this->geometry.width - this->TextWidth(text, length, family, fontHeight, 0, 0); if (remaining < 0) { x = 3; } else { @@ -689,7 +685,7 @@ void UIBasicInfoWnd::Paint() { } } } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, x, 20, text, length, family, fontHeight, 0, 0, 0); + this->DrawTextAt(x, 20, text, length, family, fontHeight, 0, 0, 0); FormatGroupedInteger(g_session.m_zeny, zenyText, 64); @@ -697,10 +693,10 @@ void UIBasicInfoWnd::Paint() { if (g_session.unknown_556C != 0) { const std::uint32_t color = static_cast(g_session.unknown_5568) * 100.0f / static_cast(g_session.unknown_556C) < 25.0f ? 255 : 0; const int hpLength = std::sprintf(text, x == 9 ? "HP. %d / %d" : "HP %d / %d", g_session.unknown_5568, g_session.unknown_556C); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, x, 36, text, hpLength, 1, 14, color, 0, 0); - offset = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, hpLength, 1, 14, 0, 0); + this->DrawTextAt(x, 36, text, hpLength, 1, 14, color, 0, 0); + offset = this->TextWidth(text, hpLength, 1, 14, 0, 0); length = std::sprintf(text, " | "); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, offset + x, 36, text, length, 1, 14, 0, 0, 0); + this->DrawTextAt(offset + x, 36, text, length, 1, 14, 0, 0, 0); } const int sp = *reinterpret_cast(&g_session.unknown_5570[0]); @@ -710,12 +706,12 @@ void UIBasicInfoWnd::Paint() { } const std::uint32_t color = static_cast(sp) * 100.0f / static_cast(spMax) < 25.0f ? 255 : 0; - offset += this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, length, 1, 14, 0, 0); + offset += this->TextWidth(text, length, 1, 14, 0, 0); const int spLength = std::sprintf(text, x == 9 ? "SP. %d / %d" : "SP %d / %d", sp, spMax); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, offset + x, 36, text, spLength, 1, 14, color, 0, 0); + this->DrawTextAt(offset + x, 36, text, spLength, 1, 14, color, 0, 0); } else if (this->geometry.height == this->expandedHeight) { CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\basewin_bg2.bmp"))); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, false, "", 0); + this->DrawTitleBar(false, "", 0); this->DrawBitmap(0, 0, background ? &background->image : nullptr, false); int family; @@ -727,40 +723,40 @@ void UIBasicInfoWnd::Paint() { family = 1; fontHeight = 14; } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 9, 36, g_session.GetJobName(g_session.GetDisplayJob(), -1), 0, family, fontHeight, 0, 0, 0); + this->DrawTextAt(9, 36, g_session.GetJobName(g_session.GetDisplayJob(), -1), 0, family, fontHeight, 0, 0, 0); std::memset(text, 0, sizeof(text)); if (g_serviceType == 1) { - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 18, 3, "Basic Info", 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, 2, "Basic Info", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(18, 3, "Basic Info", 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(17, 2, "Basic Info", 0, 0, 12, 0, 0, 0); } else { - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 18, 3, LookupMessage(238), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, 2, LookupMessage(238), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(18, 3, LookupMessage(238), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(17, 2, LookupMessage(238), 0, 0, 12, 0, 0, 0); } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, 51, "HP", 0, 1, 14, 0, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, 65, "SP", 0, 1, 14, 0, 0, 0); + this->DrawTextAt(17, 51, "HP", 0, 1, 14, 0, 0, 0); + this->DrawTextAt(17, 65, "SP", 0, 1, 14, 0, 0, 0); if (g_session.unknown_556C != 0) { std::sprintf(text, "%d%%", g_session.unknown_5568 * 100 / g_session.unknown_556C); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 173, 51, text, 0, 1, 14, 0, 0, 0); + this->DrawTextAt(173, 51, text, 0, 1, 14, 0, 0, 0); } const int spMax = *reinterpret_cast(&g_session.unknown_5570[4]); if (spMax != 0) { std::sprintf(text, "%d%%", *reinterpret_cast(&g_session.unknown_5570[0]) * 100 / spMax); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 173, 65, text, 0, 1, 14, 0, 0, 0); + this->DrawTextAt(173, 65, text, 0, 1, 14, 0, 0, 0); } std::sprintf(text, g_serviceType == 12 ? "Base. %d" : "Base Lv. %d", g_session.m_level); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, this->layoutOffset + 71, text, 0, 1, 14, 0, 0, 0); + this->DrawTextAt(17, this->layoutOffset + 71, text, 0, 1, 14, 0, 0, 0); std::sprintf(text, g_serviceType == 12 ? "Classe. %d" : "Job Lv. %d", g_session.m_jobLevel); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 17, this->layoutOffset + 83, text, 0, 1, 14, 0, 0, 0); + this->DrawTextAt(17, this->layoutOffset + 83, text, 0, 1, 14, 0, 0, 0); std::memset(zenyText, 0, sizeof(zenyText)); FormatGroupedInteger(g_session.m_zeny, zenyText, 64); std::sprintf(text, "Zeny : %s", zenyText); - const int zenyWidth = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text, std::strlen(text), 1, 14, 0, 0); + const int zenyWidth = this->TextWidth(text, std::strlen(text), 1, 14, 0, 0); this->DrawRightAlignedText(this->geometry.width - 5, this->layoutOffset + 103, text, std::strlen(text), 1, 14, 0, 0); std::sprintf(text, g_serviceType == 12 ? "Peso : %3d / %3d" : "Weight : %3d / %3d", g_session.m_weight, g_session.m_maxWeight); diff --git a/Source/UI/Window/UIBattleMsgOptionWnd.cpp b/Source/UI/Window/UIBattleMsgOptionWnd.cpp index 9c289e6b..656300d2 100644 --- a/Source/UI/Window/UIBattleMsgOptionWnd.cpp +++ b/Source/UI/Window/UIBattleMsgOptionWnd.cpp @@ -186,7 +186,7 @@ void UIBattleMsgOptionWnd::UpdateScrollBar() { void UIBattleMsgOptionWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, true, this->text.c_str(), 0); + const int titleHeight = this->DrawTitleBar(true, this->text.c_str(), 0); this->DrawPanelBackground(titleHeight, 0, ""); const int leftHeight = this->geometry.height - 42; @@ -223,7 +223,7 @@ void UIBattleMsgOptionWnd::Paint() { this->FillRegion(26, y - 2, this->geometry.width - 42, 18, 0xFFFFFF); } - this->DrawTextAt(controls.fonts, controls.locale, 50, y, *it, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(50, y, *it, 0, 0, 12, 0, 0, 0); const bool online = this->unknown_00EC[index] != 0; auto* icon = static_cast(ResourceMgr::Instance().Load( Resolve(online ? "유저인터페이스\\basic_interface\\grp_online.bmp" : "유저인터페이스\\basic_interface\\grp_offline.bmp") diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index 8927b1a7..bccf9ccd 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -2886,7 +2886,7 @@ void CUIStaticText::UpdateText() { } const SIZE size = - this->TextSize(this->m_context->fonts, this->m_context->locale, this->unknown_0098.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0); + this->TextSize(this->unknown_0098.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0); if (this->horizontalAlign == 0) { this->textX = 0; @@ -2982,11 +2982,9 @@ void CUITextButton::UpdateText() { } const SIZE size = this->orientation == 1 - ? this->VerticalTextSize( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 + ? this->VerticalTextSize(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 ) - : this->TextSize( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 + : this->TextSize(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 ); if (this->horizontalAlign == 0) { @@ -3062,8 +3060,7 @@ void CUITextButton::SetText(const std::string& value) { // FUNCTION: fn_14561 void CUITextButton::Slot54(int) { if (this->orientation == 1) { - const int height = this->VerticalTextHeight( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold + const int height = this->VerticalTextHeight(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold ); this->Resize(this->geometry.width, height); if (this->verticalAlign == 0) { @@ -3074,8 +3071,7 @@ void CUITextButton::Slot54(int) { this->textY = this->geometry.height - height; } } else { - const int width = this->TextWidth( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 + const int width = this->TextWidth(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 ); this->Resize(width, this->geometry.height); if (this->horizontalAlign == 0) { @@ -3092,8 +3088,7 @@ void CUITextButton::Slot54(int) { // FUNCTION: fn_14688 void CUITabButton::Slot54(int padding) { if (this->orientation == 1) { - const int height = this->VerticalTextHeight( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold + const int height = this->VerticalTextHeight(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold ); this->Resize(this->geometry.width, padding + height); if (this->verticalAlign == 0) { @@ -3104,8 +3099,7 @@ void CUITabButton::Slot54(int padding) { this->textY = this->geometry.height - height; } } else { - const int width = this->TextWidth( - this->m_context->fonts, this->m_context->locale, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 + const int width = this->TextWidth(this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->bold, 0 ); this->Resize(width + 2, this->geometry.height); if (this->horizontalAlign == 0) { @@ -3131,8 +3125,7 @@ void CUITextButton::Slot55() { } if (this->disabled) { - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->disabledTextColor, this->bold, 0 ); return; @@ -3140,14 +3133,12 @@ void CUITextButton::Slot55() { if (this->state == 1) { if (this->shadow) { - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->shadowColor, this->bold, 0 ); } if (!this->outline) { - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, this->fontIndex, + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->textColors[this->state], this->bold, 0 ); return; @@ -3160,8 +3151,7 @@ void CUITextButton::Slot55() { } if (this->shadow) { - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, this->fontIndex, + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->shadowColor, this->bold, 0 ); } @@ -3172,8 +3162,7 @@ void CUITextButton::Slot55() { ); return; } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, this->fontIndex, this->fontHeight, this->textColors[this->state], this->bold, 0 ); } @@ -3188,23 +3177,23 @@ void CUIBasicButton::Slot55() { FontCache& fonts = this->m_context->fonts; const TextLocale& locale = this->m_context->locale; if (this->disabled) { - this->DrawTextAt(fonts, locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xE2E2E2, 0, 0); - this->DrawTextAt(fonts, locale, this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0x6F6F6F, 0, 0); + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xE2E2E2, 0, 0); + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0x6F6F6F, 0, 0); return; } switch (this->state) { case 0: - this->DrawTextAt(fonts, locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xD7D7D7, 0, 0); - this->DrawTextAt(fonts, locale, this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xD7D7D7, 0, 0); + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); break; case 1: - this->DrawTextAt(fonts, locale, this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); break; case 2: - this->DrawTextAt(fonts, locale, this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xC7A796, 0, 0); - this->DrawTextAt(fonts, locale, this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(this->textX + 1, this->textY + 1, this->displayText.c_str(), 0, 0, 12, 0xC7A796, 0, 0); + this->DrawTextAt(this->textX, this->textY, this->displayText.c_str(), 0, 0, 12, 0, 0, 0); break; } } @@ -3218,8 +3207,7 @@ void CUIStaticText::Paint() { } if (this->shadow) { - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX + 1, this->textY + 1, this->unknown_0098.c_str(), 0, this->fontIndex, + this->DrawTextAt(this->textX + 1, this->textY + 1, this->unknown_0098.c_str(), 0, this->fontIndex, this->fontHeight, this->shadowColor, this->bold, 0 ); } @@ -3230,8 +3218,7 @@ void CUIStaticText::Paint() { ); return; } - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, this->textX, this->textY, this->unknown_0098.c_str(), 0, this->fontIndex, this->fontHeight, + this->DrawTextAt(this->textX, this->textY, this->unknown_0098.c_str(), 0, this->fontIndex, this->fontHeight, this->color, this->bold, 0 ); } @@ -3363,7 +3350,7 @@ void CUIBasicButton::SetAutoWidth(bool enabled) { if (!enabled) { this->Resize(this->defaultWidth, this->geometry.height); } else { - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, this->text.c_str(), 0, 0, 12, 0, 0); + const int width = this->TextWidth(this->text.c_str(), 0, 0, 12, 0, 0); if (this->geometry.width < width + 8) { this->Resize(width + 8, this->geometry.height); } @@ -3398,7 +3385,7 @@ const char* UIWindow::ClipTextToWidth(const char* text, int maxWidth, int family return nullptr; } - const int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text, static_cast(std::strlen(text)), family, height, bold, 0); + const int width = this->TextWidth(text, static_cast(std::strlen(text)), family, height, bold, 0); int ellipsisWidth; { TextContext context(*this->geometry.surface); @@ -3419,7 +3406,7 @@ const char* UIWindow::ClipTextToWidth(const char* text, int maxWidth, int family const char* start = current; current = (*reinterpret_cast(g_serverLanguage))[5](g_serverLanguage, start, static_cast(end - start)); const int step = static_cast(current - start); - total += this->TextWidth(this->m_context->fonts, this->m_context->locale, start, step, family, height, bold, 0); + total += this->TextWidth(start, step, family, height, bold, 0); bytes += step; if (total > maxWidth) { bytes = previous; diff --git a/Source/UI/Window/UIDebuffRemoveWnd.cpp b/Source/UI/Window/UIDebuffRemoveWnd.cpp index c47bbaa5..fed59c71 100644 --- a/Source/UI/Window/UIDebuffRemoveWnd.cpp +++ b/Source/UI/Window/UIDebuffRemoveWnd.cpp @@ -18,7 +18,7 @@ struct DebuffRemovePacket { // FUNCTION: fn_12903 void UIDebuffRemoveWnd::Paint() { const TextLocale locale = {}; - this->DrawTitleBar(g_fontCache, locale, false, "", 0); + this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(17, 0, ""); } diff --git a/Source/UI/Window/UIEscOptionWnd.cpp b/Source/UI/Window/UIEscOptionWnd.cpp index 35187cc0..61ad8265 100644 --- a/Source/UI/Window/UIEscOptionWnd.cpp +++ b/Source/UI/Window/UIEscOptionWnd.cpp @@ -36,7 +36,7 @@ void UIEscOptionWnd::Slot15(int, int) { void UIEscOptionWnd::Paint() { const std::string name = ShortcutFilename(g_session.m_gid); const std::string title = FormatOwnedString("%s (%s)", LookupMessage(1483), name.c_str()); - this->m_titleHeight = this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, title.c_str(), 0); + this->m_titleHeight = this->DrawTitleBar(true, title.c_str(), 0); this->DrawPanelBackground(this->m_titleHeight, 0, ""); } diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index a23ebb50..9aeac113 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -441,7 +441,7 @@ void UIMonsterInfoWnd::Slot28(int x, int y) { name.erase(mark, name.size()); } - if (this->TextWidth(this->m_controls->fonts, this->m_controls->locale, name.c_str(), 0, 0, 12, 0, 0) > 100) { + 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); } } diff --git a/Source/UI/Window/UIHotKeyWnd.cpp b/Source/UI/Window/UIHotKeyWnd.cpp index e298a961..2c9bf37f 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -429,7 +429,7 @@ void UIHotKeyWnd::Paint() { FontCache& fonts = this->m_context->fonts; const TextLocale& locale = this->m_context->locale; - this->unknown_00BC = this->DrawTitleBar(fonts, locale, true, LookupMessage(1494), 0); + this->unknown_00BC = this->DrawTitleBar(true, LookupMessage(1494), 0); this->unknown_00C0 = this->DrawButtonBar(2, 0, 1); this->DrawPanelBackground(this->unknown_00BC, 0, ""); @@ -459,7 +459,7 @@ void UIHotKeyWnd::Paint() { const int rowY = this->unknown_00BC + this->unknown_00C4 + this->unknown_00CC + (visibleRow % this->m_rowsPerPage) * this->unknown_00D0; - const int textWidth = this->TextWidth(fonts, locale, text.c_str(), 0, 0, 12, 0, 0); + const int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); const int textX = (this->unknown_00D4 - textWidth) / 2; const int backgroundX = column ? this->geometry.width - this->unknown_00D4 - this->unknown_00C8 @@ -488,25 +488,25 @@ void UIHotKeyWnd::Paint() { this->FillRegion(backgroundX, rowY, 1, this->unknown_00D0, 0xC0C0C0); const std::string fitted = this->FitDisplayText(130, entry.info.description.c_str(), 0, 12, 0); - const int fittedWidth = this->TextWidth(fonts, locale, fitted.c_str(), 0, 0, 12, 0, 0); + const int fittedWidth = this->TextWidth(fitted.c_str(), 0, 0, 12, 0, 0); const int descriptionX = keyX + (halfWidth - this->unknown_00C8 - this->unknown_00D4 - fittedWidth) / 2; - this->DrawTextAt(fonts, locale, descriptionX, rowY + 5, fitted.c_str(), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(fonts, locale, textX + backgroundX, rowY + 5, text.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(descriptionX, rowY + 5, fitted.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(textX + backgroundX, rowY + 5, text.c_str(), 0, 0, 12, 0, 0, 0); ++visibleRow; } if (this->unknown_0114) { const std::string pages = FormatOwnedString("%d / %d", this->m_page, this->m_pageCount); - const int pagesWidth = this->TextWidth(fonts, locale, pages.c_str(), 0, 0, 12, 0, 0); + const int pagesWidth = this->TextWidth(pages.c_str(), 0, 0, 12, 0, 0); const int pageX = (this->m_prevButton->geometry.width - pagesWidth + 60) / 2 + this->m_prevButton->geometry.x; const std::string current = FormatOwnedString("%d", this->m_page); DrawOutlinedText(*this, pageX, 25, current.c_str(), 0, 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); - const int currentWidth = this->TextWidth(fonts, locale, current.c_str(), 0, 0, 12, 0, 0); + const int currentWidth = this->TextWidth(current.c_str(), 0, 0, 12, 0, 0); const std::string total = FormatOwnedString(" / %d", this->m_pageCount); DrawOutlinedText(*this, pageX + currentWidth, 25, total.c_str(), 0, 0x666666, 0xFFFFFF, 0, 11, 1, 0); } diff --git a/Source/UI/Window/UIJobListWnd.cpp b/Source/UI/Window/UIJobListWnd.cpp index 970a0f69..541eeb3c 100644 --- a/Source/UI/Window/UIJobListWnd.cpp +++ b/Source/UI/Window/UIJobListWnd.cpp @@ -60,7 +60,7 @@ void UIJobListWnd::Slot15(int width, int height) { // OFFSET: 0x0092C640 // FUNCTION: fn_12664 void UIJobListWnd::Paint() { - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, "", 0); + this->DrawTitleBar(true, "", 0); unsigned 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)); diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 10eb3cd4..a280bb22 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -295,8 +295,8 @@ void UIMessageBox::Paint() { } } - this->DrawTextAt(controls.fonts, controls.locale, 19, titleHeight - 13, this->caption.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 18, titleHeight - 14, this->caption.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(19, titleHeight - 13, this->caption.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(18, titleHeight - 14, this->caption.c_str(), 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); @@ -357,7 +357,7 @@ void UILoginWnd::Paint() { void UIMakeCharWnd::Paint() { CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\login_interface\\win_make2.bmp"))); this->DrawBitmap(0, 17, &background->image, false); - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(0x940), 0); + this->DrawTitleBar(true, LookupMessage(0x940), 0); this->DrawButtonBar(2, 0, 1); SpriteAtlasRecord record{}; @@ -424,38 +424,38 @@ void UIMerInfoWnd::Paint() { 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)); - this->DrawTextAt(controls.fonts, controls.locale, 5, 2, title, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 24, controls.services.MessageText(407), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 47, controls.services.MessageText(408), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 111, controls.services.MessageText(1184), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 135, controls.services.MessageText(1185), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 159, controls.services.MessageText(1186), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 230, 133, controls.services.MessageText(1187), 0, 0, 12, 0, 0, 0); + 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); 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); } - this->DrawTextAt(controls.fonts, controls.locale, 136, 24, g_session.m_mercenaryName, 0, 0, 12, 0x646464, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 135, 24, g_session.m_mercenaryName, 0, 0, 12, 0, 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); char level[12] = {}; _itoa(g_session.m_mercenaryLevel, level, 10); - this->DrawTextAt(controls.fonts, controls.locale, 135, 47, level, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(135, 47, level, 0, 0, 12, 0, 0, 0); if (g_session.m_mercenaryClass != -1) { char text[128] = {}; int bytes = std::sprintf(text, "%d / %d", g_session.m_mercenaryHp, g_session.m_mercenaryMaxHp); - this->DrawTextAt(controls.fonts, controls.locale, 218, 70, text, bytes, 1, 14, 0, 0, 0); + 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(controls.fonts, controls.locale, 218, 85, text, bytes, 1, 14, 0, 0, 0); + this->DrawTextAt(218, 85, text, bytes, 1, 14, 0, 0, 0); std::strftime(text, 128, controls.services.MessageText(1260), _localtime32(&g_session.m_mercenaryExpiration)); - this->DrawTextAt(controls.fonts, controls.locale, 155, 111, text, static_cast(std::strlen(text)), 0, 12, 255, 0, 0); + 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(controls.fonts, controls.locale, 170, 133, text, bytes, 1, 14, 0, 0, 0); + this->DrawTextAt(170, 133, text, bytes, 1, 14, 0, 0, 0); bytes = std::sprintf(text, "%d", g_session.m_mercenarySummons); - this->DrawTextAt(controls.fonts, controls.locale, 170, 157, text, bytes, 1, 14, 0, 0, 0); + this->DrawTextAt(170, 157, text, bytes, 1, 14, 0, 0, 0); bytes = std::sprintf(text, "%d", g_session.m_mercenaryKills); - this->DrawTextAt(controls.fonts, controls.locale, 245, 157, text, bytes, 1, 14, 0, 0, 0); + this->DrawTextAt(245, 157, text, bytes, 1, 14, 0, 0, 0); } } @@ -547,23 +547,23 @@ bool UIBank_NewWnd::IsNumeric(std::string text) { 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(controls.fonts, controls.locale, true, controls.services.MessageText(2771), 0); + const int titleHeight = this->DrawTitleBar(true, controls.services.MessageText(2771), 0); this->DrawBitmap(0, titleHeight, &background->image, false); char number[260] = {}; char text[260] = {}; - this->DrawTextAt(controls.fonts, controls.locale, 30, 29, controls.services.MessageText(2772), 0, 0, 12, 0, 0, 0); - const int x = this->TextWidth(controls.fonts, controls.locale, controls.services.MessageText(2772), 0, 0, 12, 0, 0) + 43; + 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; FormatGroupedInteger(g_session.m_bankBalance, number, 260); std::sprintf(text, "%s z", number); - this->DrawTextAt(controls.fonts, controls.locale, x, 29, text, 0, 0, 11, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 30, 46, controls.services.MessageText(2773), 0, 0, 12, 0, 0, 0); + 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); FormatGroupedInteger(g_session.m_zeny, number, 260); std::sprintf(text, "%s z", number); - this->DrawTextAt(controls.fonts, controls.locale, x, 46, text, 0, 0, 11, 0, 0, 0); + this->DrawTextAt(x, 46, text, 0, 0, 11, 0, 0, 0); if (!this->m_status.empty()) { - const int textWidth = this->TextWidth(controls.fonts, controls.locale, this->m_status.c_str(), 0, 0, 12, 0, 0); + const int textWidth = this->TextWidth(this->m_status.c_str(), 0, 0, 12, 0, 0); const int statusX = static_cast(this->geometry.width * 0.5f - textWidth * 0.5f); - this->DrawTextAt(controls.fonts, controls.locale, statusX, 112, this->m_status.c_str(), 0, 0, 11, 255, 0, 0); + this->DrawTextAt(statusX, 112, this->m_status.c_str(), 0, 0, 11, 255, 0, 0); } } @@ -571,7 +571,7 @@ void UIBank_NewWnd::Paint() { // FUNCTION: fn_11761 void UIChatRoomWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); unsigned red, green, blue; SkinPaletteChannels(ResourceMgr::Instance(), 20, 6, red, green, blue); @@ -1043,7 +1043,7 @@ void UILoginOTPWnd::Slot15(int, int) { UIStaticText* label = new UIStaticText(*this->m_context, controls); label->SetSize(80, 20); - label->Move(141 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(3410), 0, 0, 12, 0, 0), 67); + label->Move(141 - this->TextWidth(LookupMessage(3410), 0, 0, 12, 0, 0), 67); label->SetText(LookupMessage(3410), 0); this->AddChild(label); @@ -1058,18 +1058,18 @@ void UILoginOTPWnd::Slot15(int, int) { label = new UIStaticText(*this->m_context, controls); label->SetSize(200, 40); label->SetText(LookupMessage(3385), 0); - label->Move(static_cast(141.0f - this->TextWidth(controls.fonts, controls.locale, LookupMessage(3385), 0, 0, 12, 0, 0) * 0.5f), 28); + 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->SetSize(200, 40); label->SetText(LookupMessage(3386), 0); - label->Move(static_cast(141.0f - this->TextWidth(controls.fonts, controls.locale, LookupMessage(3386), 0, 0, 12, 0, 0) * 0.5f), 42); + 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->SetSize(80, 20); - label->Move(74 - this->TextWidth(controls.fonts, controls.locale, LookupMessage(3255), 0, 0, 12, 0, 0), 98); + label->Move(74 - this->TextWidth(LookupMessage(3255), 0, 0, 12, 0, 0), 98); label->SetText(LookupMessage(3255), 0); label->SetFont(0, 12, 1, 0); label->SetColor(64, 64, 64); @@ -1117,7 +1117,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(controls.fonts, controls.locale, true, controls.services.MessageText(3254), 280); + this->DrawTitleBar(true, controls.services.MessageText(3254), 280); } // OFFSET: 0x008C3620 @@ -1286,7 +1286,7 @@ void UIReplayRECControlWnd::ApplyMode() { // FUNCTION: fn_11771 void UINoticeWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + this->DrawTitleBar(false, "", 0); if (this->geometry.height == 17) { return; @@ -1447,7 +1447,7 @@ void UIPayConfirmWnd::Configure(const std::string& text, int itemId) { // FUNCTION: fn_11772 void UIPayConfirmWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, this->m_title.c_str(), 0); + this->DrawTitleBar(true, this->m_title.c_str(), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); @@ -1486,12 +1486,12 @@ void UIReplayRECControlWnd::Paint() { // FUNCTION: fn_11776 void UISelectReplayDataWnd::Paint() { auto& controls = *this->m_controls; - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2084), 0); + this->DrawTitleBar(true, LookupMessage(2084), 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); this->FillRegion(6, 32, 268, 77, 0xFFE7E7E7); - this->DrawTextAt(controls.fonts, controls.locale, 6, 19, LookupMessage(2085), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 6, 112, LookupMessage(2086), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(6, 19, LookupMessage(2085), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(6, 112, LookupMessage(2086), 0, 0, 12, 0, 0, 0); } // OFFSET: 0x008BA0B0 @@ -1504,7 +1504,7 @@ void UISelectServerWnd::Paint() { title = LookupMessage(2083); } - this->DrawTitleBar(controls.fonts, controls.locale, true, title, 0); + this->DrawTitleBar(true, title, 0); this->DrawPanelBackground(17, 0, ""); this->DrawButtonBar(2, 0, 1); } @@ -1513,13 +1513,13 @@ void UISelectServerWnd::Paint() { // FUNCTION: fn_11778 void UITalkboxTrapInputWnd::Paint() { auto& controls = *this->m_controls; - const int titleHeight = this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0); + const int titleHeight = this->DrawTitleBar(false, "", 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(2, 0, 1); - this->DrawTextAt(controls.fonts, controls.locale, 17, 3, LookupMessage(435), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 2, LookupMessage(435), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 17, 23, LookupMessage(436), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 22, LookupMessage(436), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 3, LookupMessage(435), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 2, LookupMessage(435), 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: 0x008BA660 @@ -2104,8 +2104,8 @@ void UIMonsterInfoWnd::DrawResistance(int x, int y, const char* label, int value SkinPaletteChannels(ResourceMgr::Instance(), 22, 2, red, green, blue); this->FillRegion(x, y, 70, 16, border); this->FillRegion(x + 1, y + 1, 68, 14, fill); - const int width = this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, (70 - width) / 2 + x, y + 2, text, 0, 0, 12, RGB(red, blue, green), 0, 0); + const int width = this->TextWidth(text, 0, 0, 12, 0, 0); + this->DrawTextAt((70 - width) / 2 + x, y + 2, text, 0, 0, 12, RGB(red, blue, green), 0, 0); } // OFFSET: 0x008B8ED0 @@ -2118,28 +2118,28 @@ void UIMonsterInfoWnd::Paint() { SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); const std::uint32_t fill = RGB(red, green, blue); this->ClearSurface(fill); - this->DrawPanelBackground(this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0), 0, ""); + this->DrawPanelBackground(this->DrawTitleBar(false, "", 0), 0, ""); this->DrawButtonBar(2, 0, 1); SkinPaletteChannels(ResourceMgr::Instance(), 22, 2, red, green, blue); const std::uint32_t border = RGB(red, green, blue); - this->DrawTextAt(controls.fonts, controls.locale, 17, 3, LookupMessage(406), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 16, 2, LookupMessage(406), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 120, 30, LookupMessage(407), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 160, 30, this->name.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(17, 3, LookupMessage(406), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(16, 2, LookupMessage(406), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(120, 30, LookupMessage(407), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(160, 30, this->name.c_str(), 0, 0, 12, 0, 0, 0); char text[256]; StringFormat(text, sizeof(text), static_cast(-1), "%d", this->info.level); - this->DrawTextAt(controls.fonts, controls.locale, 120, 50, LookupMessage(408), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 160, 50, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(120, 50, LookupMessage(408), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(160, 50, text, 0, 0, 12, 0, 0, 0); StringFormat(text, sizeof(text), static_cast(-1), "%d", this->info.hp); - this->DrawTextAt(controls.fonts, controls.locale, 120, 70, LookupMessage(409), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 160, 70, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(120, 70, LookupMessage(409), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(160, 70, text, 0, 0, 12, 0, 0, 0); StringFormat(text, sizeof(text), static_cast(-1), "%d", this->info.defense); - this->DrawTextAt(controls.fonts, controls.locale, 120, 90, LookupMessage(3910), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 160, 90, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(120, 90, LookupMessage(3910), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(160, 90, text, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 260, 30, LookupMessage(410), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(260, 30, LookupMessage(410), 0, 0, 12, 0, 0, 0); int message; switch (this->info.size) { case 0: @@ -2156,23 +2156,23 @@ void UIMonsterInfoWnd::Paint() { break; } if (message != 0) { - this->DrawTextAt(controls.fonts, controls.locale, 300, 30, LookupMessage(message), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(300, 30, LookupMessage(message), 0, 0, 12, 0, 0, 0); } StringFormat(text, sizeof(text), static_cast(-1), "%d", this->info.race); - this->DrawTextAt(controls.fonts, controls.locale, 260, 50, LookupMessage(411), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(260, 50, LookupMessage(411), 0, 0, 12, 0, 0, 0); if (static_cast(this->info.race) <= 9) { - this->DrawTextAt(controls.fonts, controls.locale, 300, 50, LookupMessage(3887 + static_cast(this->info.race)), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(300, 50, LookupMessage(3887 + static_cast(this->info.race)), 0, 0, 12, 0, 0, 0); } StringFormat(text, sizeof(text), static_cast(-1), "%d", this->info.magicDefense); - this->DrawTextAt(controls.fonts, controls.locale, 260, 90, LookupMessage(412), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 300, 90, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(260, 90, LookupMessage(412), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(300, 90, text, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 260, 70, LookupMessage(413), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(260, 70, LookupMessage(413), 0, 0, 12, 0, 0, 0); const int element = this->info.element % 20; if (element >= 0 && element <= 9) { - this->DrawTextAt(controls.fonts, controls.locale, 300, 70, LookupMessage(3897 + element), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(300, 70, LookupMessage(3897 + element), 0, 0, 12, 0, 0, 0); } this->DrawResistance(120, 110, LookupMessage(3898), this->info.resistances[0], border, fill); @@ -3021,7 +3021,7 @@ void UIPetInfoWnd::Paint() { unsigned blue; SkinPaletteChannels(ResourceMgr::Instance(), 2, 2, red, green, blue); this->ClearSurface(RGB(red, green, blue)); - this->DrawPanelBackground(this->DrawTitleBar(controls.fonts, controls.locale, false, "", 0), 0, ""); + this->DrawPanelBackground(this->DrawTitleBar(false, "", 0), 0, ""); const auto* leftCorner = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\sysboxs_ld.bmp"))); this->DrawBitmap(0, this->geometry.height - leftCorner->image.height, &leftCorner->image, false); @@ -3032,11 +3032,11 @@ void UIPetInfoWnd::Paint() { char title[32]; StringFormat(title, 32, static_cast(-1), "%s", LookupMessage(584)); - this->DrawTextAt(controls.fonts, controls.locale, 5, 2, title, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 24, LookupMessage(407), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 44, LookupMessage(408), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 69, LookupMessage(585), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 89, LookupMessage(586), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 2, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 24, LookupMessage(407), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 44, LookupMessage(408), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 69, LookupMessage(585), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 89, LookupMessage(586), 0, 0, 12, 0, 0, 0); char level[8]; char hunger[24]; @@ -3057,9 +3057,9 @@ void UIPetInfoWnd::Paint() { } _itoa(g_session.unknown_1040, level, 10); - this->DrawTextAt(controls.fonts, controls.locale, 135, 44, level, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 145, 69, hunger, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 145, 89, this->friendlyText.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(135, 44, level, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(145, 69, hunger, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(145, 89, this->friendlyText.c_str(), 0, 0, 12, 0, 0, 0); const int job = g_session.unknown_103C; @@ -3074,13 +3074,13 @@ void UIPetInfoWnd::Paint() { char command[] = "< Command >"; this->FillRegion(160, 44, 110, 18, 0xFAE6E6); - const int width = this->TextWidth(controls.fonts, controls.locale, command, 0, 0, 12, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 206 - width / 2, 48, command, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 119, LookupMessage(597), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 139, LookupMessage(g_session.unknown_1038 == 0 ? 600 : 598), 0, 0, 12, 0, 0, 0); + const int width = this->TextWidth(command, 0, 0, 12, 0, 0); + this->DrawTextAt(206 - width / 2, 48, command, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 119, LookupMessage(597), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 139, LookupMessage(g_session.unknown_1038 == 0 ? 600 : 598), 0, 0, 12, 0, 0, 0); if (this->unknown_00E4 == 1) { - this->DrawTextAt(controls.fonts, controls.locale, 100, 159, LookupMessage(2577), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 159, LookupMessage(2577), 0, 0, 12, 0, 0, 0); } } } @@ -3505,13 +3505,13 @@ void UIHomunInfoWnd::Paint() { DrawFilledRoundedBorder(*this, 0, this->geometry.height - 40, this->geometry.width, 40, 0xFFFFFF); char title[32]; std::sprintf(title, LookupMessage(936)); - this->DrawTextAt(controls.fonts, controls.locale, 5, 2, title, 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 24, LookupMessage(407), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 47, LookupMessage(408), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 105, LookupMessage(1019), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 131, LookupMessage(585), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 100, 159, LookupMessage(586), 0, 0, 12, 0, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 140, 159, ":", 0, 0, 12, 0, 0, 0); + this->DrawTextAt(5, 2, title, 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, 105, LookupMessage(1019), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 131, LookupMessage(585), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(100, 159, LookupMessage(586), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(140, 159, ":", 0, 0, 12, 0, 0, 0); const int* const stats = reinterpret_cast(&g_session.unknown_5570[0x2C]); char number[12]; int bytes = std::sprintf(number, "%d", stats[0]); @@ -3532,7 +3532,7 @@ void UIHomunInfoWnd::Paint() { this->DrawRightAlignedText(79, 150, number, bytes, 1, 14, 0, 0); char level[12]; _itoa(*reinterpret_cast(g_session.unknown_55C0), level, 10); - this->DrawTextAt(controls.fonts, controls.locale, 135, 47, level, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(135, 47, level, 0, 0, 12, 0, 0, 0); if (g_session.m_homunJob == -1) { return; } @@ -3560,7 +3560,7 @@ void UIHomunInfoWnd::Paint() { } else { std::strcpy(text, LookupMessage(676)); } - this->DrawTextAt(controls.fonts, controls.locale, 150, 159, text, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(150, 159, text, 0, 0, 12, 0, 0, 0); this->sub_A84400(225, 136, std::string(LookupMessage(3279)), 0, 0, 0, 0, 12, 0, 0); this->sub_A84400(8, 180, std::string(LookupMessage(3284)), 0, 0, 0, 0, 12, 0xFF, 0); } @@ -3726,7 +3726,7 @@ void UIPetInfoWnd::Slot15(int, int) { if (this->unknown_00E4 == true) { this->unknown_00E8 = new UICheckBox(*this->m_context, controls); this->unknown_00E8->SetSize(12, 12); - this->unknown_00E8->Move(this->TextWidth(controls.fonts, controls.locale, LookupMessage(2577), 0, 0, 12, 0, 0) + 110, 159); + 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"); this->unknown_00E8->SetChecked(g_petAutoFeed); this->AddChild(this->unknown_00E8); diff --git a/Source/UI/Window/UIMileageWnd.cpp b/Source/UI/Window/UIMileageWnd.cpp index 5fbfdf27..cbf02166 100644 --- a/Source/UI/Window/UIMileageWnd.cpp +++ b/Source/UI/Window/UIMileageWnd.cpp @@ -53,11 +53,11 @@ void UIMileageWnd::Paint() { text = remaining; } - int textWidth = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text.c_str(), 0, 0, 12, 0, 0); + int textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); DrawOutlinedText(*this, (this->geometry.width - textWidth) >> 1, 15, text.c_str(), 0, 0xFFFFFF, 0, 0, 12, 0, 0); text = FormatOwnedString("%d", this->m_point).c_str(); - textWidth = this->TextWidth(this->m_controls->fonts, this->m_controls->locale, text.c_str(), 0, 0, 12, 0, 0); + textWidth = this->TextWidth(text.c_str(), 0, 0, 12, 0, 0); DrawOutlinedText(*this, this->geometry.width - textWidth - 9, this->geometry.height - 16, text.c_str(), 0, 0xFFFFFF, 0, 0, 12, 0, 0); } diff --git a/Source/UI/Window/UINavigationHelpWnd.cpp b/Source/UI/Window/UINavigationHelpWnd.cpp index 4cbf5f12..09084141 100644 --- a/Source/UI/Window/UINavigationHelpWnd.cpp +++ b/Source/UI/Window/UINavigationHelpWnd.cpp @@ -52,7 +52,7 @@ void UINavigationHelpWnd::Slot15(int width, int height) { // OFFSET: 0x0092CEC0 // FUNCTION: fn_12667 void UINavigationHelpWnd::Paint() { - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(2240), 0); + this->DrawTitleBar(true, LookupMessage(2240), 0); this->DrawPanelBackground(17, 0, ""); } diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index 48de77de..374730a5 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -188,7 +188,7 @@ void UINavigationWnd::Slot15(int width, int height) { UICheckBox* box = new UICheckBox(*this->m_context, *this->m_controls); this->unknown_0118 = box; - box->SetSize(this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0x8A3), 10, 0, 12, 0, 0), 12); + box->SetSize(this->TextWidth(LookupMessage(0x8A3), 10, 0, 12, 0, 0), 12); path = base; this->unknown_0118->SetImages((path + "checkbox_1.bmp").c_str(), (path + "checkbox_0.bmp").c_str(), LookupMessage(0x8A3)); this->unknown_0118->Move(-1000, -1000); @@ -198,7 +198,7 @@ void UINavigationWnd::Slot15(int width, int height) { box = new UICheckBox(*this->m_context, *this->m_controls); this->unknown_0114 = box; - box->SetSize(this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0x8A5), 10, 0, 12, 0, 0), 12); + box->SetSize(this->TextWidth(LookupMessage(0x8A5), 10, 0, 12, 0, 0), 12); path = base; this->unknown_0114->SetImages((path + "checkbox_1.bmp").c_str(), (path + "checkbox_0.bmp").c_str(), LookupMessage(0x8A5)); this->unknown_0114->Move(-1000, -1000); @@ -208,7 +208,7 @@ void UINavigationWnd::Slot15(int width, int height) { box = new UICheckBox(*this->m_context, *this->m_controls); this->unknown_011C = box; - box->SetSize(this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0x8A7), 10, 0, 12, 0, 0), 12); + box->SetSize(this->TextWidth(LookupMessage(0x8A7), 10, 0, 12, 0, 0), 12); path = base; this->unknown_011C->SetImages((path + "checkbox_1.bmp").c_str(), (path + "checkbox_0.bmp").c_str(), LookupMessage(0x8A7)); this->unknown_011C->Move(-1000, -1000); @@ -574,10 +574,10 @@ void UINavigationWnd::Slot11() { // OFFSET: 0x0092CEF0 // FUNCTION: fn_12668 void UINavigationWnd::Paint() { - this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, this->m_title.c_str(), 0); + this->DrawTitleBar(true, this->m_title.c_str(), 0); this->DrawPanelBackground(0x11, 0, ""); if (g_navigationMinimized) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 6, 20, this->m_subtitle.c_str(), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(6, 20, this->m_subtitle.c_str(), 0, 0, 12, 0, 0, 0); return; } @@ -657,8 +657,8 @@ void UINavigationWnd::Paint() { for (const NaviRouteLine& label : g_navigationLabels) { if (label.kind == g_navigationActiveLabel) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, label.x + 1, label.y + 1, label.text.c_str(), 0, 0, 12, 0x1E1E1E, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, label.x, label.y, label.text.c_str(), 0, 0, 12, 0xE6E6E6, 0, 0); + this->DrawTextAt(label.x + 1, label.y + 1, label.text.c_str(), 0, 0, 12, 0x1E1E1E, 0, 0); + this->DrawTextAt(label.x, label.y, label.text.c_str(), 0, 0, 12, 0xE6E6E6, 0, 0); } } } diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index 8f718411..3cbef0c9 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -172,7 +172,7 @@ void UINewMakeCharWnd::Paint() { CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\make_character_ver2\\bg_makeBg.bmp"))); this->DrawBitmap(0, 0, &background->image, false); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0x2C, 0x11, LookupMessage(0xD1B), 0, 0, 0xC, 0x5F5F5F, 1, 0); + this->DrawTextAt(0x2C, 0x11, LookupMessage(0xD1B), 0, 0, 0xC, 0x5F5F5F, 1, 0); for (int i = 0; i < 2; ++i) { CImfRes* offsets = static_cast(ResourceMgr::Instance().Load(this->m_raceOffsets.c_str())); diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index 78bc4058..2d9d3526 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -365,8 +365,8 @@ void UINewSelectCharWnd::Slot15(int width, int height) { this->AddChild(this->m_nextPageButton); UIStaticText* pageTitle = new UIStaticText(); - const int titleWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0xD0F), 0, 0, 0xC, 1, 0); - pageTitle->SetSize(titleWidth, this->TextHeight(this->m_context->fonts, this->m_context->locale, LookupMessage(0xD0F), 0, 0, 0xC, 1, 0)); + const int titleWidth = this->TextWidth(LookupMessage(0xD0F), 0, 0, 0xC, 1, 0); + pageTitle->SetSize(titleWidth, this->TextHeight(LookupMessage(0xD0F), 0, 0, 0xC, 1, 0)); pageTitle->SetText(LookupMessage(0xD0F), 0); pageTitle->SetColor(0x57, 0x66, 0x91); pageTitle->Move(0x380 - titleWidth / 2, 0x21A); @@ -375,8 +375,8 @@ void UINewSelectCharWnd::Slot15(int width, int height) { char pageText[16] = {}; std::sprintf(pageText, "%d / %d", this->m_page + 1, this->m_pageCount); this->m_pageText = new UIStaticText(); - const int pageWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, pageText, 0, 0, 0x12, 1, 0); - this->m_pageText->SetSize(pageWidth, this->TextHeight(this->m_context->fonts, this->m_context->locale, pageText, 0, 0, 0x12, 1, 0)); + const int pageWidth = this->TextWidth(pageText, 0, 0, 0x12, 1, 0); + this->m_pageText->SetSize(pageWidth, this->TextHeight(pageText, 0, 0, 0x12, 1, 0)); this->m_pageText->SetText(pageText, 0); this->m_pageText->SetFont(0, 0x12, 1, 0); this->m_pageText->SetColor(0xFF, 0xFF, 0xFF); @@ -483,7 +483,7 @@ void UINewSelectCharWnd::Slot15(int width, int height) { const CharacterInfo* character = reinterpret_cast(static_cast(g_charViewMode)->SendMsg(8, index, 0, 0, 0)); if (character != nullptr) { name->SetTextFitted(character->name); - name->Move(x + 0x58 - this->TextWidth(this->m_context->fonts, this->m_context->locale, name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2, y + 0xBD); + name->Move(x + 0x58 - this->TextWidth(name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2, y + 0xBD); } } @@ -512,8 +512,8 @@ void UINewSelectCharWnd::Paint() { } if (label) { - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, column * 163 + 136, 50, label, 0, 1, 15, 0xFF, 0, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, column * 163 + 142, 63, "Service", 0, 1, 15, 0xFF, 0, 0); + this->DrawTextAt(column * 163 + 136, 50, label, 0, 1, 15, 0xFF, 0, 0); + this->DrawTextAt(column * 163 + 142, 63, "Service", 0, 1, 15, 0xFF, 0, 0); } if (this->m_slotStatus[slot] == 0 && info) { @@ -820,7 +820,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_characterWindows[column]->SetTextFitted(info->name); UIStaticText* name = this->m_characterWindows[column]; name->Move( - (column % 5) * 0x9D - this->TextWidth(this->m_context->fonts, this->m_context->locale, name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, + (column % 5) * 0x9D - this->TextWidth(name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, (column / 5) * 0xC3 + 0xBD ); } @@ -886,7 +886,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_characterWindows[column]->SetTextFitted(info->name); UIStaticText* name = this->m_characterWindows[column]; name->Move( - (column % 5) * 0x9D - this->TextWidth(this->m_context->fonts, this->m_context->locale, name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, + (column % 5) * 0x9D - this->TextWidth(name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, (column / 5) * 0xC3 + 0xBD ); } @@ -919,7 +919,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_characterWindows[column]->SetTextFitted(info->name); UIStaticText* name = this->m_characterWindows[column]; name->Move( - (column % 5) * 0x9D - this->TextWidth(this->m_context->fonts, this->m_context->locale, name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, + (column % 5) * 0x9D - this->TextWidth(name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2 + 0x58, (column / 5) * 0xC3 + 0xBD ); break; diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index 57ce9333..f5966d18 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -334,7 +334,7 @@ void UINewSkillListWnd::sub_9AF300() { std::sprintf(text, g_serviceType == 12 ? "Nv :" : "Lv :"); const int labelX = this->m_locked != 0 || !usesLevel ? textX + 1 : textX + 12; const std::uint32_t gray = RGB(shade, shade, shade); - this->DrawTextAt(controls.fonts, controls.locale, labelX, textY, text, 0, 0, 12, gray, 0, 0); + this->DrawTextAt(labelX, textY, text, 0, 0, 12, gray, 0, 0); int levelX; if (usesLevel) { @@ -344,16 +344,16 @@ void UINewSkillListWnd::sub_9AF300() { } levelX = (this->m_locked == 0 ? 37 : 25) + textX; std::sprintf(text, "%2d", useLevel); - this->DrawTextAt(controls.fonts, controls.locale, levelX, textY, text, 0, 0, 12, useLevel == skill.level ? gray : 255, 0, 0); - levelX += 7 + this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, levelX, textY, "/ ", 0, 0, 12, gray, 0, 0); - levelX += this->TextWidth(controls.fonts, controls.locale, "/ ", 0, 0, 12, 0, 0); + this->DrawTextAt(levelX, textY, text, 0, 0, 12, useLevel == skill.level ? gray : 255, 0, 0); + levelX += 7 + this->TextWidth(text, 0, 0, 12, 0, 0); + this->DrawTextAt(levelX, textY, "/ ", 0, 0, 12, gray, 0, 0); + levelX += this->TextWidth("/ ", 0, 0, 12, 0, 0); std::sprintf(text, "%2d", skill.level); } else { std::sprintf(text, "%d", skill.level); levelX = textX + 25; } - this->DrawTextAt(controls.fonts, controls.locale, levelX, textY, text, 0, 0, 12, RGB(green, green, red), 0, 0); + this->DrawTextAt(levelX, textY, text, 0, 0, 12, RGB(green, green, red), 0, 0); if (skill.unknown_000C == 0) { std::sprintf(text, LookupMessage(286)); @@ -391,10 +391,10 @@ void UINewSkillListWnd::sub_9AF300() { std::sprintf(text, "Sp : %d", sp); } } - this->DrawTextAt(controls.fonts, controls.locale, textX + 100, textY, text, 0, 0, 12, gray, 0, 0); + this->DrawTextAt(textX + 100, textY, text, 0, 0, 12, gray, 0, 0); } - this->DrawTextAt(controls.fonts, controls.locale, textX, y + 35, skill.DisplayName(script), 0, 0, 12, RGB(shade, shade, shade), 0, 0); + this->DrawTextAt(textX, y + 35, skill.DisplayName(script), 0, 0, 12, RGB(shade, shade, shade), 0, 0); if (++drawn == this->m_visibleRows * this->m_columns) { break; } @@ -918,8 +918,8 @@ void UINewSkillListWnd::Paint() { this->DrawBitmap(x, this->geometry.height - bitmap->image.height, &bitmap->image, false); } - this->DrawTextAt(controls.fonts, controls.locale, 41, 6, LookupMessage(283), 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 40, 5, LookupMessage(283), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(41, 6, LookupMessage(283), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(40, 5, LookupMessage(283), 0, 0, 12, 0, 0, 0); const int points = this->m_skillPoints; char text[80]; @@ -937,8 +937,8 @@ void UINewSkillListWnd::Paint() { this->sub_9AE930(); } else { std::sprintf(text, LookupMessage(284), points); - this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 12, 0, 0); - this->DrawTextAt(controls.fonts, controls.locale, 30, this->geometry.height - 23, text, 0, 0, 12, 0, 0, 0); + this->TextWidth(text, 0, 0, 12, 0, 0); + this->DrawTextAt(30, this->geometry.height - 23, text, 0, 0, 12, 0, 0, 0); this->sub_9AF300(); } @@ -1673,7 +1673,7 @@ void UINewSkillListWnd::sub_9AF960() { added = 0; } if (added > 0) { - this->DrawTextAt(controls.fonts, controls.locale, x + 30, y + 44, FormatString("+%d", added), 0, 0, 11, 0xFF, 0, 0); + this->DrawTextAt(x + 30, y + 44, FormatString("+%d", added), 0, 0, 11, 0xFF, 0, 0); } } } @@ -1694,7 +1694,7 @@ void UINewSkillListWnd::sub_9AF960() { if (level != 0) { if (!usesLevel) { std::sprintf(text, "%d", skill.level); - const int width = this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 11, 1, 0); + const int width = this->TextWidth(text, 0, 0, 11, 1, 0); DrawOutlinedText(*this, (24 - width) / 2 + x + 4, textY, text, 0, (blue << 8 | green) << 8 | red, 0xFFFFFF, 0, 11, 1, 0); } else { int useLevel = reinterpret_cast(&g_session)->UseLevel(static_cast(skill.id)); @@ -1702,12 +1702,12 @@ void UINewSkillListWnd::sub_9AF960() { useLevel = skill.level; } std::sprintf(text, "%d / %d", useLevel, skill.level); - int textX = (24 - this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 11, 1, 0)) / 2 + x + 4; + int textX = (24 - this->TextWidth(text, 0, 0, 11, 1, 0)) / 2 + x + 4; std::sprintf(text, "%d", useLevel); DrawOutlinedText(*this, textX, textY, text, 0, useLevel == skill.level ? gray : 0x7F3CFF, 0xFFFFFF, 0, 11, 1, 0); - textX += this->TextWidth(controls.fonts, controls.locale, text, 0, 0, 11, 1, 0); + textX += this->TextWidth(text, 0, 0, 11, 1, 0); DrawOutlinedText(*this, textX, textY, " / ", 0, gray, 0xFFFFFF, 0, 11, 1, 0); - textX += this->TextWidth(controls.fonts, controls.locale, " / ", 0, 0, 11, 1, 0); + textX += this->TextWidth(" / ", 0, 0, 11, 1, 0); const std::uint32_t id = skill.id; int target = SkillValueOf(this->m_unknown_02A0, static_cast(id)); @@ -1724,13 +1724,12 @@ void UINewSkillListWnd::sub_9AF960() { } } - const int nameWidth = this->TextWidth(controls.fonts, controls.locale, skill.DisplayName(script), 0, 0, 11, 0, 0); + const int nameWidth = this->TextWidth(skill.DisplayName(script), 0, 0, 11, 0, 0); int nameOffset = 0; if (nameWidth < 48) { nameOffset = (48 - nameWidth) / 2; } - this->DrawTextAt( - controls.fonts, controls.locale, x - 8 + nameOffset, y + 30, this->ClipTextToWidth(skill.DisplayName(script), 48, 0, 11, 0), 0, 0, 11, gray, 0, 0 + this->DrawTextAt(x - 8 + nameOffset, y + 30, this->ClipTextToWidth(skill.DisplayName(script), 48, 0, 11, 0), 0, 0, 11, gray, 0, 0 ); if (g_session.m_skillBundle.HasHigherLevel(skill.id) == true) { diff --git a/Source/UI/Window/UINormalMB.cpp b/Source/UI/Window/UINormalMB.cpp index 89fb64b0..df8b6dbd 100644 --- a/Source/UI/Window/UINormalMB.cpp +++ b/Source/UI/Window/UINormalMB.cpp @@ -20,7 +20,7 @@ UINormalMB::UINormalMB(UIWindowContext& windows, UIFrameContext& frames) : UIFra // FUNCTION: fn_12906 void UINormalMB::Paint() { UIButtonContext& controls = this->m_textContext->buttons; - this->DrawTitleBar(controls.fonts, controls.locale, true, this->m_title.c_str(), 0); + this->DrawTitleBar(true, this->m_title.c_str(), 0); this->DrawPanelBackground(17, 0, ""); } diff --git a/Source/UI/Window/UIPartyBookingHelpWnd.cpp b/Source/UI/Window/UIPartyBookingHelpWnd.cpp index 4cf166ba..10e8b7a6 100644 --- a/Source/UI/Window/UIPartyBookingHelpWnd.cpp +++ b/Source/UI/Window/UIPartyBookingHelpWnd.cpp @@ -36,7 +36,7 @@ void UIPartyBookingHelpWnd::Slot15(int width, int height) { // OFFSET: 0x0092D630 // FUNCTION: fn_12670 void UIPartyBookingHelpWnd::Paint() { - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(1716), 0); + this->DrawTitleBar(true, LookupMessage(1716), 0); this->DrawPanelBackground(17, 0, ""); } diff --git a/Source/UI/Window/UIPetEvolutionWnd.cpp b/Source/UI/Window/UIPetEvolutionWnd.cpp index c34397f9..298d2270 100644 --- a/Source/UI/Window/UIPetEvolutionWnd.cpp +++ b/Source/UI/Window/UIPetEvolutionWnd.cpp @@ -60,7 +60,7 @@ void UIPetEvolutionWnd::Slot15(int width, int height) { // FUNCTION: fn_13764 void UIPetEvolutionWnd::Paint() { this->ClearSurface(0xFFFFFFFF); - this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(2567), 0); + this->DrawTitleBar(true, LookupMessage(2567), 0); char text[260]; std::memset(text, 0, sizeof(text)); @@ -104,19 +104,18 @@ void UIPetEvolutionWnd::Paint() { } } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 10, 200, LookupMessage(2569), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, 200, LookupMessage(2569), 0, 0, 12, 0, 0, 0); int index = 0; for (auto it = this->m_materials.begin(); it != this->m_materials.end(); ++it, ++index) { std::memset(text, 0, sizeof(text)); std::sprintf(text, "%dea", it->second); UITextButton* button = this->m_materialButtons[index]; - this->DrawTextAt( - this->m_controls->fonts, this->m_controls->locale, button->geometry.width + button->geometry.x + 10, button->geometry.y + 1, text, 0, 0, 12, 0, 1, 0 + this->DrawTextAt(button->geometry.width + button->geometry.x + 10, button->geometry.y + 1, text, 0, 0, 12, 0, 1, 0 ); } - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 10, this->geometry.height - 52, LookupMessage(2570), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(10, this->geometry.height - 52, LookupMessage(2570), 0, 0, 12, 0, 0, 0); } namespace { diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index ae75262b..cc0e4cbe 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -120,7 +120,7 @@ void UIRoMapWnd::DrawHoverTooltip() { const TextLocale locale = {}; bool leftSide = false; int maxWidth = 0; - const int lineHeight = this->TextHeight(g_fontCache, locale, " ", 0, 0, 12, 1, 0) + 3; + const int lineHeight = this->TextHeight(" ", 0, 0, 12, 1, 0) + 3; const WorldViewRecord* record = this->unknown_00BC; const int* anchor = this->unknown_00C8; const int recordLeft = record->left; @@ -135,7 +135,7 @@ void UIRoMapWnd::DrawHoverTooltip() { int y = anchor[1]; int count = 0; for (std::list::const_iterator it = record->unknown_004C.begin(); it != this->unknown_00BC->unknown_004C.end(); ++it) { - const int width = this->TextWidth(g_fontCache, locale, it->c_str(), 0, 0, 12, 1, 0); + const int width = this->TextWidth(it->c_str(), 0, 0, 12, 1, 0); if (maxWidth < width) { maxWidth = width; } @@ -188,11 +188,11 @@ void UIRoMapWnd::DrawMapNames() { continue; } - const int textWidth = this->TextWidth(g_fontCache, locale, std::string(name).c_str(), 0, 0, fontHeight, 0, 0); + const int textWidth = this->TextWidth(std::string(name).c_str(), 0, 0, fontHeight, 0, 0); const int x = std::abs(static_cast(static_cast(textWidth - area[2] - area[0]) * g_depthAverageHalf)); const int y = area[1] + 2; - this->DrawTextAt(g_fontCache, locale, x + 1, y + 1, name.c_str(), 0, 0, fontHeight, outline, 0, 0); - this->DrawTextAt(g_fontCache, locale, x, y, name.c_str(), 0, 0, fontHeight, color, 0, 0); + this->DrawTextAt(x + 1, y + 1, name.c_str(), 0, 0, fontHeight, outline, 0, 0); + this->DrawTextAt(x, y, name.c_str(), 0, 0, fontHeight, color, 0, 0); } } @@ -231,11 +231,11 @@ void UIRoMapWnd::DrawFieldLabels() { continue; } - const int textWidth = this->TextWidth(g_fontCache, locale, std::string(name).c_str(), 0, 0, townHeight, 0, 0); + const int textWidth = this->TextWidth(std::string(name).c_str(), 0, 0, townHeight, 0, 0); const int x = std::abs(static_cast(static_cast(textWidth - area[2] - area[0]) * g_depthAverageHalf)); const int y = townHeight + 2 + area[1]; - this->DrawTextAt(g_fontCache, locale, x + 1, y + 1, name.c_str(), 0, 0, townHeight, townOutline, 0, 0); - this->DrawTextAt(g_fontCache, locale, x, y, name.c_str(), 0, 0, townHeight, townColor, 0, 0); + this->DrawTextAt(x + 1, y + 1, name.c_str(), 0, 0, townHeight, townOutline, 0, 0); + this->DrawTextAt(x, y, name.c_str(), 0, 0, townHeight, townColor, 0, 0); continue; } @@ -259,17 +259,17 @@ void UIRoMapWnd::DrawFieldLabels() { levelY = y - levelHeight - 3; } - const int textWidth = this->TextWidth(g_fontCache, locale, std::string(name).c_str(), 0, 0, fieldHeight, 0, 0); + const int textWidth = this->TextWidth(std::string(name).c_str(), 0, 0, fieldHeight, 0, 0); const int x = std::abs(static_cast(static_cast(textWidth - field->right - field->left) * g_depthAverageHalf)); - this->DrawTextAt(g_fontCache, locale, x + 1, y + 1, name.c_str(), 0, 0, fieldHeight, fieldShadow, 0, 0); - this->DrawTextAt(g_fontCache, locale, x - 1, y - 1, name.c_str(), 0, 0, fieldHeight, fieldShadow, 0, 0); - this->DrawTextAt(g_fontCache, locale, x, y, name.c_str(), 0, 0, fieldHeight, fieldColor, 0, 0); + this->DrawTextAt(x + 1, y + 1, name.c_str(), 0, 0, fieldHeight, fieldShadow, 0, 0); + this->DrawTextAt(x - 1, y - 1, name.c_str(), 0, 0, fieldHeight, fieldShadow, 0, 0); + this->DrawTextAt(x, y, name.c_str(), 0, 0, fieldHeight, fieldColor, 0, 0); name = (*fieldIt)->unknown_0044; if (name.empty()) { continue; } - const int levelWidth = this->TextWidth(g_fontCache, locale, std::string(name).c_str(), 0, 0, levelHeight, 1, 0); + const int levelWidth = this->TextWidth(std::string(name).c_str(), 0, 0, levelHeight, 1, 0); const int levelX = std::abs(static_cast(static_cast(levelWidth - field->right - field->left) * g_depthAverageHalf)); DrawOutlinedText(*this, levelX, levelY, name.c_str(), 0, levelColor, levelOutline, 0, levelHeight, 1, 0); } diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index c05d9639..fb7dcd99 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -154,9 +154,9 @@ void UIRodexContentsWnd::Paint() { ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\bg_rodex_read.bmp")) ); this->DrawBitmap(0, 0, &background->image, false); - this->DrawTitleBar(controls.fonts, controls.locale, true, LookupMessage(2727), 0); - this->DrawTextAt(controls.fonts, controls.locale, 8, 29, this->m_title.c_str(), 0, 0, 12, 0x95330F, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, 9, 52, this->m_sender.c_str(), 0, 0, 12, 0x313131, 0, 0); + this->DrawTitleBar(true, LookupMessage(2727), 0); + this->DrawTextAt(8, 29, this->m_title.c_str(), 0, 0, 12, 0x95330F, 1, 0); + this->DrawTextAt(9, 52, this->m_sender.c_str(), 0, 0, 12, 0x313131, 0, 0); const auto* zenyIcon = static_cast( ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\icon_zeny.bmp")) @@ -168,7 +168,7 @@ void UIRodexContentsWnd::Paint() { std::memset(amount, 0, sizeof(amount)); FormatGroupedInteger(this->m_zeny, amount, sizeof(amount)); const std::string text = FormatOwnedString("%s Zeny", amount); - this->DrawTextAt(controls.fonts, controls.locale, 50, 350, text.c_str(), 0, 0, 11, 0x737373, 1, 0); + this->DrawTextAt(50, 350, text.c_str(), 0, 0, 11, 0x737373, 1, 0); } for (int x = 26; x < 196; x += 34) { diff --git a/Source/UI/Window/UIRoulletteWnd.cpp b/Source/UI/Window/UIRoulletteWnd.cpp index 713b2e47..5adf229e 100644 --- a/Source/UI/Window/UIRoulletteWnd.cpp +++ b/Source/UI/Window/UIRoulletteWnd.cpp @@ -188,7 +188,7 @@ void UIRoulletteWnd::Slot15(int, int) { // FUNCTION: fn_10087 void UIRoulletteWnd::Paint() { const TextLocale locale = {}; - this->DrawTitleBar(g_fontCache, locale, true, LookupMessage(2641), 0); + this->DrawTitleBar(true, LookupMessage(2641), 0); this->DrawPanelBackground(17, 0, "유저인터페이스\\basic_interface\\roullette\\roulletteBG.bmp"); char buffer[40] = {}; diff --git a/Source/UI/Window/UISelCharForUServerWnd.cpp b/Source/UI/Window/UISelCharForUServerWnd.cpp index 33a8241e..4f55fb19 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.cpp +++ b/Source/UI/Window/UISelCharForUServerWnd.cpp @@ -211,7 +211,7 @@ void UISelCharForUServerWnd::UpdateCharInfoBalloon(int x, int y, std::uint32_t c char name[25]; std::memcpy(name, info->name, sizeof(info->name)); name[24] = '\0'; - int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, name, 0, 0, 12, 0, 0) + 60; + int width = this->TextWidth(name, 0, 0, 12, 0, 0) + 60; char text[100]; this->unknown_19EC.push_back("Name"); diff --git a/Source/UI/Window/UISerachStoreInfoWnd.cpp b/Source/UI/Window/UISerachStoreInfoWnd.cpp index b6df4727..c461bf67 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.cpp +++ b/Source/UI/Window/UISerachStoreInfoWnd.cpp @@ -167,7 +167,7 @@ void UISerachStoreInfoWnd::Slot15(int width, int height) { this->m_prevButton->Configure(LookupMessage(0x41D), 0x8E8E8E, 0, 0xC, 0, 0); this->m_prevButton->m_hoverColor = 0xEFB700; this->m_prevButton->Move( - this->geometry.width / 2 - this->TextWidth(this->m_context->fonts, this->m_context->locale, LookupMessage(0x41D), 0, 0, 0xC, 0, 0) - 0x14, + this->geometry.width / 2 - this->TextWidth(LookupMessage(0x41D), 0, 0, 0xC, 0, 0) - 0x14, this->geometry.height - 0x15); this->m_prevButton->SetTooltip(LookupMessage(0x41D)); this->m_prevButton->SetId(0x13C); diff --git a/Source/UI/Window/UITransMenuWnd.cpp b/Source/UI/Window/UITransMenuWnd.cpp index 4632ca6f..eac1cacc 100644 --- a/Source/UI/Window/UITransMenuWnd.cpp +++ b/Source/UI/Window/UITransMenuWnd.cpp @@ -21,7 +21,7 @@ void UITransMenuWnd::Paint() { auto& controls = *this->m_controls; const int margin = this->m_margin; - this->DrawTextAt(controls.fonts, controls.locale, margin, (margin / 2 + cellHeight) * i + margin, this->m_items[i].text, 0, 0, this->m_lineHeight, color, 0, 0); + this->DrawTextAt(margin, (margin / 2 + cellHeight) * i + margin, this->m_items[i].text, 0, 0, this->m_lineHeight, color, 0, 0); } } diff --git a/Source/UI/Window/UIVideoWnd.cpp b/Source/UI/Window/UIVideoWnd.cpp index 0d87e8c3..c32c8050 100644 --- a/Source/UI/Window/UIVideoWnd.cpp +++ b/Source/UI/Window/UIVideoWnd.cpp @@ -60,11 +60,10 @@ void UIVideoSkipButton::Paint() { this->ClearSurface(0xFF000000); std::string text = "SKIP>"; UIButtonContext& controls = *this->m_buttonContext; - const int textWidth = this->TextWidth(controls.fonts, controls.locale, text.c_str(), 0, 0, 30, 1, 0); - const int textHeight = this->TextHeight(controls.fonts, controls.locale, text.c_str(), 0, 0, 30, 1, 0); + 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; - this->DrawTextAt( - controls.fonts, controls.locale, static_cast(static_cast(this->geometry.width - textWidth) * 0.5f + 5.0f), + this->DrawTextAt(static_cast(static_cast(this->geometry.width - textWidth) * 0.5f + 5.0f), static_cast(static_cast(this->geometry.height - textHeight) * 0.5f), text.c_str(), 0, 0, 30, color, 1, 0 ); } diff --git a/Source/UI/Window/UIViewCameraInfoWnd.cpp b/Source/UI/Window/UIViewCameraInfoWnd.cpp index a7b5128b..8e470575 100644 --- a/Source/UI/Window/UIViewCameraInfoWnd.cpp +++ b/Source/UI/Window/UIViewCameraInfoWnd.cpp @@ -35,11 +35,11 @@ void UIViewCameraInfoWnd::Paint() { } auto& controls = *this->m_controls; - this->DrawTextAt(controls.fonts, controls.locale, 10, 10, + this->DrawTextAt(10, 10, FormatOwnedString("range : %4.3f", mode->camera->camera.distance).c_str(), 0, 0, 12, 0xFF, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, 10, 25, + this->DrawTextAt(10, 25, FormatOwnedString("rotation : %4.3f", mode->camera->camera.yaw).c_str(), 0, 0, 12, 0xFF, 1, 0); - this->DrawTextAt(controls.fonts, controls.locale, 10, 40, + this->DrawTextAt(10, 40, FormatOwnedString("latitude : %4.3f", mode->camera->camera.pitch).c_str(), 0, 0, 12, 0xFF, 1, 0); } diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 1475c7f2..5b1296a9 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -953,8 +953,7 @@ void UIWindow::FillRegion(int x, int y, int width, int height, std::uint32_t col // OFFSET: 0x00A80580 // FUNCTION: fn_16975 -int UIWindow::TextWidth( - FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic +int UIWindow::TextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic ) { if (!text) { return 0; @@ -986,7 +985,7 @@ int UIWindow::ColoredTextWidth(const char* text, unsigned bytes, int family, int } } - int width = this->TextWidth(this->m_context->fonts, this->m_context->locale, text, bytes, family, height, bold, 0); + int width = this->TextWidth(text, bytes, family, height, bold, 0); std::uint32_t color = 0; if (ParseColorCode(FindColorCode(text, text + bytes), color) && color) { TextContext context(*this->geometry.surface); @@ -1000,8 +999,7 @@ int UIWindow::ColoredTextWidth(const char* text, unsigned bytes, int family, int // OFFSET: 0x00A84360 // FUNCTION: fn_17009 -void UIWindow::DrawTextAt( - FontCache& fonts, const TextLocale& locale, int x, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold, +void UIWindow::DrawTextAt(int x, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold, unsigned char italic ) { if (!bytes) { @@ -1314,7 +1312,7 @@ void UIWindow::DrawAuxiliary(int mode, int x, int y, BitmapImage* image, bool tr // OFFSET: 0x00A7BE90 // FUNCTION: fn_16941 -void UIWindow::DrawAmount(FontCache& fonts, const TextLocale& locale, int amount, std::string text, int x, int y) { +void UIWindow::DrawAmount(int amount, std::string text, int x, int y) { COLORREF color = 0; COLORREF shadow = 0; bool outlined = true; @@ -1364,8 +1362,7 @@ void UIWindow::DrawAmount(FontCache& fonts, const TextLocale& locale, int amount // OFFSET: 0x00A80170 // FUNCTION: fn_16971 -int UIWindow::TextHeight( - FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic +int UIWindow::TextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic ) { if (!text) { return 0; @@ -1385,7 +1382,7 @@ int UIWindow::TextHeight( // OFFSET: 0x00A80230 // FUNCTION: fn_16972 -int UIWindow::VerticalTextHeight(FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold) { +int UIWindow::VerticalTextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold) { if (!text) { return 0; } @@ -1417,8 +1414,7 @@ int UIWindow::VerticalTextHeight(FontCache& fonts, const TextLocale& locale, con // OFFSET: 0x00A80340 // FUNCTION: fn_16973 -SIZE UIWindow::TextSize( - FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic +SIZE UIWindow::TextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic ) { SIZE size = {}; if (!text) { @@ -1440,8 +1436,7 @@ SIZE UIWindow::TextSize( // OFFSET: 0x00A80430 // FUNCTION: fn_16974 -SIZE UIWindow::VerticalTextSize( - FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic +SIZE UIWindow::VerticalTextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic ) { SIZE size = {}; if (!text) { @@ -1620,7 +1615,7 @@ std::string UIWindow::FitVerticalDisplayText(int height, const char* text, int f display = std::move(navigation); display = DisplayTextTag(std::move(display), "", ""); - if (this->VerticalTextHeight(this->m_context->fonts, this->m_context->locale, display.c_str(), display.size(), family, fontHeight, bold) <= height) { + if (this->VerticalTextHeight(display.c_str(), display.size(), family, fontHeight, bold) <= height) { return display; } @@ -1637,7 +1632,7 @@ std::string UIWindow::FitVerticalDisplayText(int height, const char* text, int f break; } - extent = this->VerticalTextHeight(this->m_context->fonts, this->m_context->locale, fitted.c_str(), fitted.size(), family, fontHeight, bold); + extent = this->VerticalTextHeight(fitted.c_str(), fitted.size(), family, fontHeight, bold); length = CharPrevExA(static_cast(g_textCodePage), begin, begin + length, 0) - begin; } while (height < extent); @@ -1689,7 +1684,7 @@ void UIWindow::WrapTextWithBreaks(const char* text, std::vector* li return; } - const int totalWidth = this->TextWidth(this->m_context->fonts, this->m_context->locale, text, 0, 0, 12, 0, 0); + const int totalWidth = this->TextWidth(text, 0, 0, 12, 0, 0); const int length = static_cast(std::strlen(text)); if (totalWidth <= 0) { return; @@ -1711,7 +1706,7 @@ void UIWindow::WrapTextWithBreaks(const char* text, std::vector* li const char* next = (*reinterpret_cast(g_serverLanguage))[5](g_serverLanguage, current, static_cast(end - current)); const int characterBytes = static_cast(next - current); bytes += characterBytes; - lineWidth += this->TextWidth(this->m_context->fonts, this->m_context->locale, current, characterBytes, 0, 12, 0, 0); + lineWidth += this->TextWidth(current, characterBytes, 0, 12, 0, 0); if (characterBytes == 1 && *current == '\r') { newline = true; ++bytes; @@ -2179,8 +2174,8 @@ void UIPrivateAirplaneWnd::Paint() { this->DrawBitmap( 0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\private_airplane\\bg_pay.bmp")))->image, false ); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 19, 4, LookupMessage(0xd02), 0, 0, 12, 0xffffff, 0, 0); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 18, 3, LookupMessage(0xd02), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(19, 4, LookupMessage(0xd02), 0, 0, 12, 0xffffff, 0, 0); + this->DrawTextAt(18, 3, LookupMessage(0xd02), 0, 0, 12, 0, 0, 0); if (this->m_text.size() == 0) { return; @@ -2196,7 +2191,7 @@ void UIPrivateAirplaneWnd::Paint() { int offset = 0; for (auto it = lines.begin(); it != lines.end(); ++it, offset += 12) { const int y = static_cast(static_cast(32 - lines.size() * 12) * 0.5 + 78.0 + offset); - this->DrawTextAt(this->m_controls->fonts, this->m_controls->locale, 26, y, it->c_str(), 0, 0, 12, 0x3512b5, 0, 0); + this->DrawTextAt(26, y, it->c_str(), 0, 0, 12, 0x3512b5, 0, 0); } } @@ -2546,18 +2541,18 @@ void UINavigationV4Wnd::Paint() { if (g_navigationMinimized) { DrawFilledRoundedBorder(*this, 0, 0, 0x86, 0x3d, 0xffffff); DrawFilledRoundedBorder(*this, 1, 0x11, 0x84, 0x2b, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 3, 3, LookupMessage(0x8ad), 0, 0, 12, 0, 0, 0); + this->DrawTextAt(3, 3, LookupMessage(0x8ad), 0, 0, 12, 0, 0, 0); if (g_navigationText1.size() != 0) { this->DrawBitmap( 2, 0x12, &static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\navigation_interface3\\ico_destination.bmp")))->image, true ); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 5, 0x15, g_navigationText3.c_str(), 0, 0, 12, 0xffffff, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 5, 0x28, g_navigationText4.c_str(), 0, 0, 12, 0xffffff, 1, 0); + this->DrawTextAt(5, 0x15, g_navigationText3.c_str(), 0, 0, 12, 0xffffff, 1, 0); + this->DrawTextAt(5, 0x28, g_navigationText4.c_str(), 0, 0, 12, 0xffffff, 1, 0); } return; } - this->DrawPanelBackground(this->DrawTitleBar(this->m_context->fonts, this->m_context->locale, true, LookupMessage(0x8ad), 0), 0, ""); + this->DrawPanelBackground(this->DrawTitleBar(true, LookupMessage(0x8ad), 0), 0, ""); this->DrawButtonBar(0, 0, 1); this->FillRegion(0, 0x2b, 0x110, 1, 0xcccccc); this->DrawBitmap( @@ -2568,10 +2563,9 @@ void UINavigationV4Wnd::Paint() { if (g_navigationMode == 2 && g_navigationTab == 1) { this->FillRegion(1, 0x2c, 0x10e, 0x10e, 0xcccccc); this->DrawMapTexture(3, 0x2e, 0x10a); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 10, 0x30, g_navigationText0.c_str(), 0, 0, 12, 0xffffff, 1, 0); - this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 10, 0x44, g_navigationText1.c_str(), 0, 0, 12, 0xffffff, 1, 0); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, 10, this->geometry.height - 0x2a, g_navigationText2.c_str(), 0, 0, 12, 0xffffff, 1, 0 + this->DrawTextAt(10, 0x30, g_navigationText0.c_str(), 0, 0, 12, 0xffffff, 1, 0); + this->DrawTextAt(10, 0x44, g_navigationText1.c_str(), 0, 0, 12, 0xffffff, 1, 0); + this->DrawTextAt(10, this->geometry.height - 0x2a, g_navigationText2.c_str(), 0, 0, 12, 0xffffff, 1, 0 ); if (g_navigationPoints.begin() != g_navigationPoints.end()) { @@ -2682,12 +2676,10 @@ void UINavigationV4Wnd::Paint() { if (g_navigationLabels[index].kind == active) { const int labelX = g_navigationLabels[index].x; const int labelY = g_navigationLabels[index].y; - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, labelX + 1, labelY + 1, g_navigationLabels[index].text.c_str(), 0, 0, 12, + this->DrawTextAt(labelX + 1, labelY + 1, g_navigationLabels[index].text.c_str(), 0, 0, 12, g_navigationLabels[index].color, 0, 0 ); - this->DrawTextAt( - this->m_context->fonts, this->m_context->locale, labelX, labelY, g_navigationLabels[index].text.c_str(), 0, 0, 12, + this->DrawTextAt(labelX, labelY, g_navigationLabels[index].text.c_str(), 0, 0, 12, g_navigationLabels[index].shadowColor, 0, 0 ); } @@ -2698,7 +2690,7 @@ void UINavigationV4Wnd::Paint() { // FUNCTION: fn_03589 void UINavigationroadiconWnd::Paint() { CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\navigation_interface3\\bg_roadIocn_select.bmp"))); - const int titleHeight = this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(3203), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(3203), 0); this->DrawBitmap(0, titleHeight, bitmap ? &bitmap->image : nullptr, false); } @@ -3044,7 +3036,7 @@ void UINavigationRuideWnd::Slot15(int width, int) { // FUNCTION: fn_03587 void UINavigationRuideWnd::Paint() { this->FillRegion(0, 0, 272, 338, 0xCCCCCC); - const int titleHeight = this->DrawTitleBar(this->m_controls->fonts, this->m_controls->locale, true, LookupMessage(3204), 0); + const int titleHeight = this->DrawTitleBar(true, LookupMessage(3204), 0); this->DrawPanelBackground(titleHeight, 0, ""); this->DrawButtonBar(0, 0, 1); } diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index b1bedc20..32a23bda 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -148,10 +148,9 @@ public: void sub_8A8EE0(int x, int y, const ITEM_INFO* item, unsigned char identified); void sub_A85850(int x, int y, std::string text, int width, int align, std::uint32_t color, int arg7, int arg8, int arg9, int arg10, unsigned char bold); void FillRegion(int x, int y, int width, int height, std::uint32_t color); - int TextWidth(FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); + int TextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); int ColoredTextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold); - void DrawTextAt( - FontCache& fonts, const TextLocale& locale, int x, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold, + void DrawTextAt(int x, int y, const char* text, int bytes, int family, int height, std::uint32_t color, unsigned char bold, unsigned char italic ); void DrawVerticalText(int x, int y, const char* text, unsigned bytes, int family, int height, std::uint32_t color, unsigned char bold); @@ -188,12 +187,11 @@ public: void DrawBitmapRegion(int x, int y, const BitmapImage* image, bool transparent, bool whole, int left, int top, int right, int bottom); void DrawAuxiliaryScaled(int mode, int x, int y, int width, int height, BitmapImage* image, int option, bool rebuild); void DrawAuxiliary(int mode, int x, int y, BitmapImage* image, bool transparent, bool rebuild); - void DrawAmount(FontCache& fonts, const TextLocale& locale, int amount, std::string text, int x, int y); - int TextHeight(FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); - int VerticalTextHeight(FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold); - tagSIZE TextSize(FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); - tagSIZE VerticalTextSize( - FontCache& fonts, const TextLocale& locale, const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic + void DrawAmount(int amount, std::string text, int x, int y); + int TextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); + int VerticalTextHeight(const char* text, unsigned bytes, int family, int height, unsigned char bold); + tagSIZE TextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic); + tagSIZE VerticalTextSize(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic ); int FormattedTextWidth(std::string text, int family, int height, unsigned char bold); std::string FitDisplayText(int width, const char* text, int family, int height, unsigned char bold); @@ -214,8 +212,8 @@ public: const std::uint32_t* palette, float extentScale ); void AddRotatedSpriteCellOverlay(int x, int y, int width, int height, const SpriteRleImage* image, const SpriteFrameCell* cell, const std::uint32_t* palette); - int DrawTitleBar(FontCache& fonts, const TextLocale& locale, bool closeButton, const char* title, int width); - int DrawTitleBarAt(FontCache& fonts, const TextLocale& locale, int x, int width, bool closeButton, const char* title); + int DrawTitleBar(bool closeButton, const char* title, int width); + int DrawTitleBarAt(int x, int width, bool closeButton, const char* title); void DrawPanelBackground(int y, int width, const char* bitmapName); void DrawPanelBackgroundAt(int x, int y, int width, const char* bitmapName); void DrawRobeSprite(int job, int sex, int robe, int x, int y, bool overlay, int animation, int frame); diff --git a/Source/UI/WindowOverlay.cpp b/Source/UI/WindowOverlay.cpp index 1c3836a2..f6983864 100644 --- a/Source/UI/WindowOverlay.cpp +++ b/Source/UI/WindowOverlay.cpp @@ -158,7 +158,7 @@ int UIFrameWnd::DrawFittedItemName(int x, int y, const ITEM_INFO* item, std::uin color = (card >> 16 & 0xFF) | ((card & 0xFF) << 16) | (card & 0x0000FF00); this->DrawShadowedText(offset + x, y, text, bytes, color, 0xFFFFFF, 0, 12, 0); } - offset += this->TextWidth(this->m_context->fonts, this->m_context->locale, text, bytes, 0, 12, 0, 0); + offset += this->TextWidth(text, bytes, 0, 12, 0, 0); text = end; if (truncated) { break; diff --git a/Source/UI/WindowTitlebar.cpp b/Source/UI/WindowTitlebar.cpp index d6fcf23a..de3353d8 100644 --- a/Source/UI/WindowTitlebar.cpp +++ b/Source/UI/WindowTitlebar.cpp @@ -5,7 +5,7 @@ // OFFSET: 0x008D2CE0 // FUNCTION: fn_12098 -int UIWindow::DrawTitleBar(FontCache& fonts, const TextLocale& locale, bool closeButton, const char* title, int width) { +int UIWindow::DrawTitleBar(bool closeButton, const char* title, int width) { if (width == 0) { width = this->geometry.width; } @@ -37,8 +37,8 @@ int UIWindow::DrawTitleBar(FontCache& fonts, const TextLocale& locale, bool clos } } - this->DrawTextAt(fonts, locale, 19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, 18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); if (closeButton) { auto* icon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\sys_base_off.bmp"))); @@ -50,7 +50,7 @@ int UIWindow::DrawTitleBar(FontCache& fonts, const TextLocale& locale, bool clos // OFFSET: 0x008D2E50 // FUNCTION: fn_12099 -int UIWindow::DrawTitleBarAt(FontCache& fonts, const TextLocale& locale, int x, int width, bool closeButton, const char* title) { +int UIWindow::DrawTitleBarAt(int x, int width, bool closeButton, const char* title) { if (width <= 0) { width = this->geometry.width - x; } @@ -81,8 +81,8 @@ int UIWindow::DrawTitleBarAt(FontCache& fonts, const TextLocale& locale, int x, } } - this->DrawTextAt(fonts, locale, x + 19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); - this->DrawTextAt(fonts, locale, x + 18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); + this->DrawTextAt(x + 19, titleHeight - 13, title, 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(x + 18, titleHeight - 14, title, 0, 0, 12, 0, 0, 0); if (closeButton) { auto* icon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\sys_base_off.bmp")));