diff --git a/Source/Client/Mode/CMode.h b/Source/Client/Mode/CMode.h index e084f7471..e4092b709 100644 --- a/Source/Client/Mode/CMode.h +++ b/Source/Client/Mode/CMode.h @@ -41,6 +41,7 @@ public: CMode(); std::uint32_t ClearTooltip(); void ExpireTooltip(); + void ShowTooltip(const char* value, int x, int y, std::uint32_t color, unsigned char option, unsigned char convert); void SetCursorAction(int action); void TakeScreenshot(); void DrawCursor(); diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index b7c6283be..11d621249 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -4574,14 +4574,12 @@ int CGameMode::ProcessGroundClick(int result) { return result; } -#include "Client/Mode/ModeTooltip.h" #include "Contents/Actors/Pc.h" #include "Contents/Actors/RenderObject.h" #include "Contents/World/WorldOcclusion.h" #include "UI/Dialogs/UIMenuWnd.h" #include "UI/Window/InputFocus.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Actors/Pc.h" #include "Contents/Actors/RenderObject.h" #include "Contents/World/WorldOcclusion.h" diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index d327d35fa..f218640ed 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -9,7 +9,6 @@ #include "Client/ModeFadeOut.h" #include "Client/Application/ErrorDialog.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Client/Replay.h" #include "Client/Input/InputCharset.h" @@ -53,6 +52,7 @@ #include "Utility/GGHashMgr.h" #include "Utility/Text/FormatString.h" #include "Utility/Text/TextTokens.h" +#include "Client/Mode/CMode.h" #include #include diff --git a/Source/Client/Mode/ModeTooltip.cpp b/Source/Client/Mode/ModeTooltip.cpp index 5a244b64b..75bce8857 100644 --- a/Source/Client/Mode/ModeTooltip.cpp +++ b/Source/Client/Mode/ModeTooltip.cpp @@ -1,9 +1,8 @@ #include "Client/Session.h" #include "Client/Mode/CMode.h" -#include "Client/Mode/ModeTooltip.h" +#include "Render/Renderer.h" #include "UI/Text/UITransBalloonText.h" #include "UI/Window/UIWindowMgr.h" -#include "UI/Window/UIWindowMgr.h" #include #include @@ -12,7 +11,7 @@ // OFFSET: 0x00AD6510 // FUNCTION: fn_17834 -void ModeTooltip::Show(const char* value, int x, int y, std::uint32_t color, unsigned char option, unsigned char convert) { +void CMode::ShowTooltip(const char* value, int x, int y, std::uint32_t color, unsigned char option, unsigned char convert) { if (std::strlen(value) == 0) { return; } @@ -25,28 +24,30 @@ void ModeTooltip::Show(const char* value, int x, int y, std::uint32_t color, uns strncpy_s(text, sizeof(text), value, _TRUNCATE); } - this->tick = timeGetTime(); + this->tooltipTick = timeGetTime(); - if (this->window) { - this->ordering.Promote(this->window); + UITransBalloonText* balloon = static_cast(this->tooltip); + if (balloon) { + g_windowMgr.Promote(balloon); } else { - this->window = new UITransBalloonText(); - this->window->SetSize(8, 8); - this->rendered.push_back(this->window); + balloon = new UITransBalloonText(); + this->tooltip = balloon; + balloon->SetSize(8, 8); + g_windowMgr.AddRendered(balloon); } - this->window->SetRichText(option); - this->window->SetText(text, 35); + balloon->SetRichText(option); + balloon->SetText(text, 35); const std::uint32_t rgb = ((color & 255) << 16) | (color & 0xFF00) | ((color >> 16) & 255); - this->window->SetColors(rgb, 0); - this->window->SetBackground(0x88000000u); + balloon->SetColors(rgb, 0); + balloon->SetBackground(0x88000000u); - const int maximumX = this->screenWidth - this->window->geometry.width + 3; - const int maximumY = this->screenHeight - this->window->geometry.height + 3; + const int maximumX = g_renderer->viewport.width - balloon->geometry.width + 3; + const int maximumY = g_renderer->viewport.height - balloon->geometry.height + 3; const int left = x < -3 ? -3 : x; const int top = y < -3 ? -3 : y; - this->window->Move(left < maximumX ? left : maximumX, top < maximumY ? top : maximumY); + balloon->Move(left < maximumX ? left : maximumX, top < maximumY ? top : maximumY); } // OFFSET: 0x00AD67A0 diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 3d2621862..88f7c2f06 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1,6 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/CashEmotionMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Render/DeviceContext/DeviceContext.h" @@ -46,6 +45,7 @@ #include "Contents/Schedule/EmotionSchedule.h" #include "Contents/Schedule/TimeScheduler.h" #include "UI/Emotion/UIEmotionWnd.h" +#include "Client/Mode/CMode.h" extern "C" { #include @@ -3839,7 +3839,7 @@ void UICashEmotionSprBtn::Slot28(int x, int y) { int screenY = -20; this->ToScreen(screenX, screenY); - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, false); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, false); } if (!this->m_disabled) { diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index b50d0d80a..c35a4d629 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -18,7 +18,6 @@ #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowManagerWindows.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Render/Text/TextContext.h" #include "UI/Party/UIMiniPartyWnd.h" @@ -36,6 +35,7 @@ #include "Contents/PlayerNameDictionary.h" #include "Utility/Text/FormatString.h" #include "Resource/SkinPalette.h" +#include "Client/Mode/CMode.h" #include #include @@ -1278,7 +1278,7 @@ void UIMessengerGroupWnd::Slot28(int x, int y) { this->iconPositions[this->iconIndex].x + 33; int tipY = this->selected / this->columns * this->rowHeight + 22; this->ToScreen(tipX, tipY); - reinterpret_cast(mode)->Show(text, tipX, tipY, 0xFFFFFFFFu, 0, 1); + mode->ShowTooltip(text, tipX, tipY, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index dc1863ddf..20bfa6e17 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -139,7 +139,6 @@ #include "UI/Text/NavigationLink.h" #include "Utility/Text/GroupedInteger.h" #include "Utility/Math/Int64Math.h" -#include "Client/Mode/ModeTooltip.h" #include "Script/LuaScript.h" #include "Utility/Text/StringUtil.h" #include "UI/SkillDelayInfo/SkillDelayInfo.h" @@ -1951,13 +1950,13 @@ void UIItemCollectionWnd::Slot28(int x, int y) { card.unknown_0060 = 0; card.SetItemId(cardId); - ModeTooltip* tooltip = reinterpret_cast(g_charViewMode); + CMode* tooltip = static_cast(g_charViewMode); std::uint32_t color = 0xFFFFFFFF; if (index >= ItemSlotsCount(this->m_item)) { color = ItemCardColor(&this->m_item); } - tooltip->Show(card.DisplayName(0).c_str(), slotX, slotY, color, 0, 1); + tooltip->ShowTooltip(card.DisplayName(0).c_str(), slotX, slotY, color, 0, 1); } // OFFSET: 0x008F46C0 @@ -1986,7 +1985,7 @@ void UIStatusWnd::Slot28(int x, int y) { int tipX = point.x - this->m_offsetX; int tipY = this->m_titleHeight - this->m_offsetY - 19 + point.y; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(statTexts[index], tipX, tipY, -1, true, true); + static_cast(g_charViewMode)->ShowTooltip(statTexts[index], tipX, tipY, -1, true, true); break; } } @@ -2009,7 +2008,7 @@ void UIStatusWnd::Slot28(int x, int y) { int tipX = point.x - 16; int tipY = point.y - 13; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(traitTexts[index], tipX, tipY, -1, true, true); + static_cast(g_charViewMode)->ShowTooltip(traitTexts[index], tipX, tipY, -1, true, true); return; } } @@ -5813,19 +5812,19 @@ void UIEquipWnd::Slot28(int x, int y) { } this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (item.quantity < 2) { if (item.identified == 1 && item.unknown_0098 != 0) { - tooltip->Show(FormatOwnedString(LookupMessage(0xA28), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(0xA28), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - tooltip->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } else if (item.identified == 1 && item.unknown_0098 != 0) { - tooltip->Show(FormatOwnedString(LookupMessage(0x9F7), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(0x9F7), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - tooltip->Show(FormatOwnedString(LookupMessage(0xB7), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(0xB7), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -5903,13 +5902,13 @@ void UIExchangeWnd::Slot28(int x, int y) { tooltipY = (tooltipY - 17) / this->m_rowHeight * this->m_rowHeight + 4; this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; item.unknown_0000[0] = 21; if (item.identified == 1 && item.unknown_0098 != 0) { - tooltip->Show(FormatOwnedString(LookupMessage(0xA28), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(0xA28), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - tooltip->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } diff --git a/Source/UI/Buttons/UIButton.cpp b/Source/UI/Buttons/UIButton.cpp index 87dad4814..8e01972fc 100644 --- a/Source/UI/Buttons/UIButton.cpp +++ b/Source/UI/Buttons/UIButton.cpp @@ -2,7 +2,6 @@ #include "UI/Window/WindowPolicy.h" #include "UI/Window/WindowDialogs.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/MessageTable.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeEvents.h" @@ -120,7 +119,7 @@ void UIButton::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } if (this->m_disabled == 0) { diff --git a/Source/UI/Buttons/UICheckBox.cpp b/Source/UI/Buttons/UICheckBox.cpp index b3d6be1c0..cd9e22679 100644 --- a/Source/UI/Buttons/UICheckBox.cpp +++ b/Source/UI/Buttons/UICheckBox.cpp @@ -1,6 +1,5 @@ #include "Client/Mode/CMode.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Replay.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" @@ -121,7 +120,7 @@ void UICheckBox::Slot28(int x, int y) { } const std::string& tooltip = this->geometry.unknown_0030 != 0 || this->m_uncheckedTooltip.empty() ? this->m_tooltip : this->m_uncheckedTooltip; - static_cast(g_charViewMode)->Show(tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(tooltip.c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x0085F9C0 diff --git a/Source/UI/Buttons/UIRadioBtn.cpp b/Source/UI/Buttons/UIRadioBtn.cpp index 9d00b11e1..658e5d966 100644 --- a/Source/UI/Buttons/UIRadioBtn.cpp +++ b/Source/UI/Buttons/UIRadioBtn.cpp @@ -1,5 +1,4 @@ #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" @@ -63,7 +62,7 @@ void UIRadioBtn::Slot28(int x, int y) { x = 10; y = -20; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index fc4845f16..2064930e6 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -5,7 +5,6 @@ #include "Client/Replay.h" #include "UI/Window/WindowPolicy.h" #include "Render/Text/FontCache.h" -#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "UI/UIBarGraph.h" #include "UI/Buttons/UIBmpRadioBtn.h" @@ -262,7 +261,7 @@ void UIBmpRadioBtn::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } } @@ -390,7 +389,7 @@ void UICaptchaImage::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } } @@ -412,7 +411,7 @@ void UIBarGraph4::Slot28(int, int) { std::memset(text, 0, sizeof(text)); const int permille = static_cast(static_cast(*this->m_current) / static_cast(*this->m_maximum) * 1000.0f); std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); - static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text, screenX, screenY, -1, false, true); } // OFFSET: 0x008918D0 @@ -433,7 +432,7 @@ void UIINT64BarGraph::Slot28(int, int) { std::memset(text, 0, sizeof(text)); const int permille = static_cast(static_cast(this->m_current) / static_cast(this->m_maximum) * 1000.0); std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); - static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text, screenX, screenY, -1, false, true); } // OFFSET: 0x00891A40 @@ -480,7 +479,7 @@ void UITabControl::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->tooltips[index].c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->tooltips[index].c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x00822660 @@ -526,7 +525,7 @@ void UIBasicItemCtrl::Slot28(int, int) { } if (!text.empty()) { - static_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), screenX, screenY, -1, false, true); } } @@ -557,7 +556,7 @@ void UIBasicSkillCtrl::Slot28(int, int) { } if (!text.empty()) { - static_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), screenX, screenY, -1, false, true); } } @@ -633,7 +632,7 @@ void UIMemberListBox::Slot28(int, int y) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->lines[line].c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->lines[line].c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x00891E40 @@ -655,7 +654,7 @@ void UIStaticItem::Slot28(int, int) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text, screenX, screenY, -1, false, true); } // OFFSET: 0x00892040 diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index e860c8f26..364053c22 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -4,7 +4,6 @@ #include "Client/Mode/CMode.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Registry.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" @@ -680,7 +679,7 @@ void UICashShopWnd_CartItem::Slot28(int x, int y) { x = 0; y = -10; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->m_item.unknown_0044.c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->m_item.unknown_0044.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } } @@ -691,7 +690,7 @@ void UICashShopWnd_Item::Slot28(int x, int y) { x = 0; y = -20; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->m_item.unknown_0044.c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->m_item.unknown_0044.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index 4839570b7..85d807187 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -83,7 +83,6 @@ #include "UI/Shop/PriceColor.h" #include "UI/Window/WindowDialogs.h" #include "Utility/Text/GroupedInteger.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Configuration/ServiceOptions.h" #include "Contents/Items/ItemNaming.h" @@ -340,7 +339,7 @@ void UIEditCtrl::Slot28(int x, int y) { top += window->geometry.y; } - static_cast(g_charViewMode)->Show(this->tooltip.c_str(), left, top, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->tooltip.c_str(), left, top, -1, false, true); } } @@ -5778,7 +5777,7 @@ void UIItemPurchaseWnd::Slot28(int x, int y) { FormatGroupedInteger(static_cast(item.unknown_0014[1]), price, 64), currency); } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -5801,7 +5800,7 @@ void UIItemSellWnd2::Slot28(int x, int y) { FormatGroupedInteger(static_cast(item.unknown_0014[1]), price, 64)); } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -5837,7 +5836,7 @@ void UIItemSellWnd::Slot28(int x, int y) { } } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } // OFFSET: 0x009865C0 @@ -5871,7 +5870,7 @@ void UIItemShopWnd2::Slot28(int x, int y) { } } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } // OFFSET: 0x00986970 @@ -5939,7 +5938,7 @@ void UIItemShopWnd::Slot28(int x, int y) { } } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -5953,11 +5952,11 @@ void UIItemStoreFindWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode)->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } } @@ -5972,11 +5971,11 @@ void UIItemStoreSubWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode)->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } } @@ -5991,11 +5990,11 @@ void UIItemStoreWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode)->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } } @@ -6010,12 +6009,12 @@ void UIItemWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(183), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(183), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -6044,7 +6043,7 @@ void UIMerchantItemMyShopWnd::Slot28(int x, int y) { item.quantity); } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -6058,8 +6057,8 @@ void UIMerchantItemPurchaseWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); char price[64]; - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString("%s %d %s %s Zeny", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588), + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString("%s %d %s %s Zeny", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588), FormatGroupedInteger(static_cast(item.unknown_0014[1]), price, 64)) .c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); @@ -6076,11 +6075,11 @@ void UIMerchantItemShopWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode)->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } return; } @@ -6095,11 +6094,11 @@ void UIMerchantItemShopWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX - 2, tooltipY + 24, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX - 2, tooltipY + 24, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode)->Show(item.DisplayName(0).c_str(), tooltipX - 2, tooltipY + 24, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.DisplayName(0).c_str(), tooltipX - 2, tooltipY + 24, g_session.GetItemNameColor(item), 0, 1); } } @@ -6113,12 +6112,12 @@ void UIMerchantItemWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString("%s %d %s", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588)).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString("%s %d %s", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588)).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -6134,12 +6133,12 @@ void UIMerchantMirrorItemWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2756), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2756), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString("%s %d %s", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588)).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString("%s %d %s", item.DisplayName(0).c_str(), item.quantity, LookupMessage(588)).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -8518,7 +8517,7 @@ void UISkillListWnd::Slot28(int x, int y) { int tooltipX = 112; 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); + g_modeMgr.gameMode->ShowTooltip(name, tooltipX - 8, tooltipY, 0xFFFFFFFF, 0, 1); } } } diff --git a/Source/UI/Item/UIMerchantItemLogWnd.cpp b/Source/UI/Item/UIMerchantItemLogWnd.cpp index 7372359f4..46ed75d9a 100644 --- a/Source/UI/Item/UIMerchantItemLogWnd.cpp +++ b/Source/UI/Item/UIMerchantItemLogWnd.cpp @@ -2,7 +2,6 @@ #include "Render/Text/TextContext.h" #include "UI/Item/UIMerchantItemLogWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemNaming.h" @@ -169,12 +168,12 @@ void UIMerchantItemLogWnd::Slot28(int x, int y) { this->ToScreen(tooltipX, tooltipY); if (item.identified == 1 && item.unknown_0098 != 0) { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(2551), item.DisplayName(0).c_str(), item.unknown_0098, item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - reinterpret_cast(g_modeMgr.gameMode) - ->Show(FormatOwnedString(LookupMessage(183), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, + g_modeMgr.gameMode + ->ShowTooltip(FormatOwnedString(LookupMessage(183), item.DisplayName(0).c_str(), item.quantity).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 969b07186..aee9bf2ca 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -7,7 +7,6 @@ #include "Client/Mode/CMode.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Replay.h" #include "Client/ReplayPacketRecorder.h" #include "Client/Session.h" @@ -30,6 +29,7 @@ #include "UI/Dialogs/UIPasswordWnd.h" #include "UI/Lists/UIScrollBar.h" #include "UI/Text/UIStaticText.h" +#include "UI/Window/UINewSelectCharWnd.h" #include "UI/Window/UIResizer.h" #include "UI/Window/UIWindowMgr.h" #include "Utility/Text/FormatString.h" @@ -197,7 +197,7 @@ void UIParaResultWnd::Slot28(int x, int y) { text = FormatOwnedString("%s %d -> %s Zeny", item.DisplayName(0).c_str(), item.unknown_0014[0], amount); } - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } @@ -598,7 +598,7 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std switch (message) { case 6: { this->RecordResponse(static_cast(a), b, c, d); - CMode* mode = g_modeMgr.gameMode; + CMode* mode = static_cast(g_charViewMode); if (a == 184) { mode->SendMsg(292, 0, 0, 0, 0); mode->SendMsg(40, 0, 0, 0, 0); diff --git a/Source/UI/Items/MergeItemWnd.cpp b/Source/UI/Items/MergeItemWnd.cpp index 0b0ac35d6..08472c143 100644 --- a/Source/UI/Items/MergeItemWnd.cpp +++ b/Source/UI/Items/MergeItemWnd.cpp @@ -4,7 +4,6 @@ #include "Client/Input/InputCharset.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" @@ -198,7 +197,7 @@ void CMergeItemWnd::Slot28(int x, int y) { if (item.unknown_0000[1] != 0) { this->ToScreen(screenX, screenY); std::string text = FormatOwnedString(LookupMessage(183), item.DisplayName(0).c_str(), item.quantity); - reinterpret_cast(g_modeMgr.gameMode)->Show(text.c_str(), screenX, screenY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.gameMode->ShowTooltip(text.c_str(), screenX, screenY, g_session.GetItemNameColor(item), 0, 1); } } diff --git a/Source/UI/Items/UIGameItem.cpp b/Source/UI/Items/UIGameItem.cpp index 8bff3290e..aa064212c 100644 --- a/Source/UI/Items/UIGameItem.cpp +++ b/Source/UI/Items/UIGameItem.cpp @@ -1,7 +1,6 @@ #include "UI/Items/UIGameItem.h" #include "UI/Text/ColoredText.h" #include "Client/Input/InputCharset.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -14,6 +13,7 @@ #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Window/WindowManagerWindows.h" #include "Utility/Text/FormatString.h" +#include "Client/Mode/CMode.h" #include #include @@ -102,12 +102,12 @@ void CUIGameItem::Slot28(int x, int y) { int screenY = y - 20; this->ToScreen(screenX, screenY); const std::uint32_t color = g_session.GetItemNameColor(this->itemInfo); - ModeTooltip* tooltip = reinterpret_cast(g_charViewMode); + CMode* tooltip = static_cast(g_charViewMode); if (this->itemInfo.unknown_0098 > 0) { const std::string text = FormatOwnedString(LookupMessage(0xA28), this->name.c_str(), this->itemInfo.unknown_0098); - tooltip->Show(text.c_str(), screenX, screenY, color, 0, 1); + tooltip->ShowTooltip(text.c_str(), screenX, screenY, color, 0, 1); } else { - tooltip->Show(this->name.c_str(), screenX, screenY, color, 0, 1); + tooltip->ShowTooltip(this->name.c_str(), screenX, screenY, color, 0, 1); } } diff --git a/Source/UI/Items/UISwapEquipmentWnd.cpp b/Source/UI/Items/UISwapEquipmentWnd.cpp index 33ed9e0a9..05c236e29 100644 --- a/Source/UI/Items/UISwapEquipmentWnd.cpp +++ b/Source/UI/Items/UISwapEquipmentWnd.cpp @@ -5,7 +5,6 @@ #include "Client/Mode/CMode.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Actors/Pc.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -450,7 +449,7 @@ void UISwapEquipmentWnd::Slot28(int x, int y) { text = item.DisplayName(0); } - reinterpret_cast(g_modeMgr.GetGameMode())->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + g_modeMgr.GetGameMode()->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } diff --git a/Source/UI/Party/UIApplyForPartyWnd.cpp b/Source/UI/Party/UIApplyForPartyWnd.cpp index 90897003d..a5f864d11 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.cpp +++ b/Source/UI/Party/UIApplyForPartyWnd.cpp @@ -1,5 +1,4 @@ #include "Client/Session.h" -#include "Client/Mode/ModeTooltip.h" #include "File/ShortcutFilename.h" #include "Render/Renderer.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -18,6 +17,7 @@ #include "UI/Party/UIPartyInfoWnd.h" #include "UI/Text/UIStaticText.h" #include "UI/Window/WindowManagerWindows.h" +#include "Client/Mode/CMode.h" #include @@ -178,7 +178,7 @@ void UIApplyForPartyWnd::Slot28(int x, int y) { int screenX = positions[index]; int screenY = 75; this->ToScreen(screenX, screenY); - static_cast(g_charViewMode)->Show(label, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(label, screenX, screenY, -1, false, true); } break; diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index 4966abbd6..3514fd191 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -1,7 +1,6 @@ #include "UI/Party/UIMiniPartyWnd.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/MapInfoMgr.h" #include "Contents/Actors/Pc.h" #include "Contents/World/World.h" @@ -19,6 +18,7 @@ #include "UI/Window/MiniPartyWndAreaMgr.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowDialogs.h" +#include "Client/Mode/CMode.h" #include #include @@ -111,7 +111,7 @@ void UIMiniPartyInfoWnd::Slot31(int x, int y) { // OFFSET: 0x00740D40 // FUNCTION: fn_07733 void UIMiniPartyInfoWnd::Slot28(int, int) { - ModeTooltip* mode = reinterpret_cast(g_modeMgr.GetGameMode()); + CMode* mode = g_modeMgr.GetGameMode(); if (!mode) { return; } @@ -136,7 +136,7 @@ void UIMiniPartyInfoWnd::Slot28(int, int) { int x = this->geometry.x + 15; int y = this->geometry.y - 12; this->ToScreen(x, y); - mode->Show(text, x, y, 0xFFFFFFFF, 0, 1); + mode->ShowTooltip(text, x, y, 0xFFFFFFFF, 0, 1); } } diff --git a/Source/UI/Rodex/UIRodexComposeWnd.cpp b/Source/UI/Rodex/UIRodexComposeWnd.cpp index d2160fe4a..2260a0e16 100644 --- a/Source/UI/Rodex/UIRodexComposeWnd.cpp +++ b/Source/UI/Rodex/UIRodexComposeWnd.cpp @@ -1,6 +1,7 @@ #include "Render/Text/FontCache.h" #include "Render/Text/TextContext.h" #include "UI/Rodex/UIRodexComposeWnd.h" +#include "Client/Mode/CMode.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeDragState.h" @@ -20,7 +21,6 @@ #include "UI/Window/UIWindowMgr.h" #include "UI/Window/WindowManagerWindows.h" #include "Client/Input/InputCharset.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemNaming.h" #include "Contents/MessageTable.h" @@ -204,15 +204,15 @@ void UIRodexComposeWnd::Slot28(int x, int y) { int tooltipX = this->m_itemIndex * 34 + 30; int tooltipY = 290; this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (item.identified == 1 && item.unknown_0098 != 0) { std::uint32_t color = g_session.GetItemNameColor(item); - tooltip->Show( + tooltip->ShowTooltip( FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, color, 0, 1 ); } else { std::uint32_t color = g_session.GetItemNameColor(item); - tooltip->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, color, 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, color, 0, 1); } } } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 0bd893819..51d3233af 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -1,6 +1,5 @@ #include "UI/Window/WindowDialogs.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Items/RuneSystem.h" #include "Contents/MessageTable.h" #include "Resource/Bitmap/BitmapResource.h" @@ -9,6 +8,7 @@ #include "UI/RuneSystem/UIRuneSystemWnd.h" #include "UI/Window/UIWindowMgr.h" #include "Utility/Text/FormatString.h" +#include "Client/Mode/CMode.h" // GLOBAL: gl_24886 extern const int g_runeSetSlotX[6] = {87, 201, 19, 269, 87, 201}; @@ -342,7 +342,7 @@ void UIEquipRuneSetWnd::Slot28(int x, int y) { } CTagData* tag = g_runeSystemMgr->GetTag(runeSet->GetTagId()); - reinterpret_cast(g_modeMgr.gameMode)->Show(tag->m_name.c_str(), screenX, screenY, 0xFFFFFF, 0, 1); + g_modeMgr.gameMode->ShowTooltip(tag->m_name.c_str(), screenX, screenY, 0xFFFFFF, 0, 1); return; } @@ -374,7 +374,7 @@ void UIEquipRuneSetWnd::Slot28(int x, int y) { if (!rune) { return; } - reinterpret_cast(g_modeMgr.gameMode)->Show(rune->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); + g_modeMgr.gameMode->ShowTooltip(rune->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); } // OFFSET: 0x0081C3D0 @@ -419,7 +419,7 @@ void UIRuneSetList::Slot28(int x, int y) { if (!rune) { return; } - reinterpret_cast(g_modeMgr.gameMode)->Show(rune->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); + g_modeMgr.gameMode->ShowTooltip(rune->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); } // OFFSET: 0x0081C6F0 @@ -440,7 +440,7 @@ void UIRuneSet_Info::Slot28(int x, int y) { int screenY = g_runeSetSlotY[index] - 24; this->ToScreen(screenX, screenY); if (g_modeMgr.gameMode) { - reinterpret_cast(g_modeMgr.gameMode)->Show(runeSet->m_slots[index]->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); + g_modeMgr.gameMode->ShowTooltip(runeSet->m_slots[index]->GetName(), screenX, screenY, 0xFFFFFF, 0, 1); } } } @@ -461,7 +461,7 @@ void UIRuneSystem_tagListWnd::Slot28(int x, int) { int screenY = -18; this->ToScreen(screenX, screenY); if (g_modeMgr.gameMode) { - reinterpret_cast(g_modeMgr.gameMode)->Show(name.c_str(), screenX, screenY, 0xFFFFFF, 0, 1); + g_modeMgr.gameMode->ShowTooltip(name.c_str(), screenX, screenY, 0xFFFFFF, 0, 1); } } } @@ -1232,9 +1232,9 @@ void UIRuneSetReWard::Slot28(int, int) { int x = 0; int y = 0; this->ToScreen(x, y); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (tooltip) { - tooltip->Show(item.DisplayName(0).c_str(), x, y - 10, 0xFFFFFF, 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), x, y - 10, 0xFFFFFF, 0, 1); } } @@ -1261,9 +1261,9 @@ void UIRuneSystem_ActiveWnd::Slot28(int x, int y) { int tipX = index % 4 * 54 + 14; int tipY = index > 3 ? 44 : -10; this->ToScreen(tipX, tipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (tooltip) { - tooltip->Show(item.DisplayName(0).c_str(), tipX, tipY, 0xFFFFFF, 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tipX, tipY, 0xFFFFFF, 0, 1); } } @@ -1285,9 +1285,9 @@ void UIRune_Decom::Slot28(int x, int y) { int tipX = index % 4 * 54 + 211; int tipY = index > 3 ? 387 : 333; this->ToScreen(tipX, tipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (tooltip) { - tooltip->Show(item.DisplayName(0).c_str(), tipX, tipY, 0xFFFFFF, 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tipX, tipY, 0xFFFFFF, 0, 1); } } diff --git a/Source/UI/Shortcuts/ShortcutTooltip.cpp b/Source/UI/Shortcuts/ShortcutTooltip.cpp index a00555f97..fbe0b3893 100644 --- a/Source/UI/Shortcuts/ShortcutTooltip.cpp +++ b/Source/UI/Shortcuts/ShortcutTooltip.cpp @@ -1,12 +1,12 @@ #include "Client/Session.h" #include "Contents/Hotkeys/HotkeyInfo.h" #include "Contents/MessageTable.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Skills/ClientSkills.h" #include "UI/Shortcuts/UIShortCutWnd.h" #include "UI/Buttons/UIButton.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/CMode.h" #include @@ -64,7 +64,7 @@ void UIShortCutWnd::Slot28(int x, int y) { ScreenPosition(window, tooltipX, tooltipY); if (g_charViewMode) { - reinterpret_cast(g_charViewMode)->Show(text, tooltipX, tooltipY, -1, 0, 1); + static_cast(g_charViewMode)->ShowTooltip(text, tooltipX, tooltipY, -1, 0, 1); } return; @@ -115,5 +115,5 @@ void UIShortCutWnd::Slot28(int x, int y) { } } - reinterpret_cast(g_charViewMode)->Show(text.c_str(), tooltipX, tooltipY, -1, 0, 1); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), tooltipX, tooltipY, -1, 0, 1); } diff --git a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp index 1c49ddfb3..88b9ee18f 100644 --- a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp +++ b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp @@ -12,7 +12,6 @@ #include "Resource/ResourceMgr.h" #include "UI/Window/WindowManagerWindows.h" #include "Client/Input/InputCharset.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Hotkeys/HotkeyInfo.h" @@ -117,7 +116,7 @@ void UIQuickSlotWnd::Slot28(int x, int y) { } if (!text.empty()) { - reinterpret_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, -1, 0, 1); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), screenX, screenY, -1, 0, 1); } } diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index 2e8e5e6da..7a7d054ff 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -1,7 +1,6 @@ #include "Client/Replay.h" #include "UI/Window/WindowPolicy.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Mode/CMode.h" #include "UI/StylingShop/UIStylingShopWnd.h" #include "Client/Mode/ModeEvents.h" @@ -206,7 +205,7 @@ void UIStylingShopButton::Slot28(int, int) { screenY += window->geometry.y; } - static_cast(g_charViewMode)->Show("No Color", screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip("No Color", screenX, screenY, -1, false, true); } // OFFSET: 0x0082A210 diff --git a/Source/UI/Text/NavigationLink.cpp b/Source/UI/Text/NavigationLink.cpp index 1a1f052ae..c4bf63580 100644 --- a/Source/UI/Text/NavigationLink.cpp +++ b/Source/UI/Text/NavigationLink.cpp @@ -1,4 +1,5 @@ #include "UI/Text/NavigationLink.h" +#include "Client/Mode/CMode.h" #include #include @@ -19,7 +20,6 @@ #include "Client/Input/InputCharset.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/CashEmotionMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -1666,9 +1666,9 @@ void UIItemImage::Slot28(int, int) { this->ToScreen(x, y); if (g_charViewMode) { - ModeTooltip* tooltip = reinterpret_cast(g_charViewMode); + CMode* tooltip = static_cast(g_charViewMode); const std::uint32_t color = g_session.GetItemNameColor(item); - tooltip->Show(item.DisplayName(0).c_str(), x, y, color, 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), x, y, color, 0, 1); } } diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index f7e9f7f72..17cebed50 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -19,7 +19,6 @@ #include "UI/Window/WindowBorder.h" #include "Utility/Text/FormatString.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include #include #include @@ -1162,7 +1161,7 @@ void UICustomGageBar::Slot28(int x, int y) { int tipX = 0; int tipY = -20; this->ToScreen(tipX, tipY); - reinterpret_cast(g_modeMgr.gameMode)->Show(label.c_str(), tipX, tipY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(label.c_str(), tipX, tipY, 0xFFFFFFFFu, 0, 1); } // OFFSET: 0x007B7AF0 @@ -1173,7 +1172,7 @@ void UIToolTipBitmapWnd::Slot28(int x, int y) { x = 0; y = -20; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/Text/UIStaticText.cpp b/Source/UI/Text/UIStaticText.cpp index bd7d28620..bf48998b7 100644 --- a/Source/UI/Text/UIStaticText.cpp +++ b/Source/UI/Text/UIStaticText.cpp @@ -1,9 +1,9 @@ #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "UI/Buttons/UIButton.h" #include "UI/Buttons/UIBmpTextButton.h" #include "UI/Text/UIStaticText.h" +#include "Client/Mode/CMode.h" #include @@ -199,7 +199,7 @@ void UIStaticText::Slot28(int, int) { y = (y + node->geometry.y); } - static_cast(g_charViewMode)->Show(this->tooltip.c_str(), x, y, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->tooltip.c_str(), x, y, -1, false, true); } // OFFSET: 0x0085FAB0 diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index 55464c07e..d4a7c8a09 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -4,7 +4,6 @@ #include "Client/Mode/CMode.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Items/ItemInfo.h" @@ -965,10 +964,10 @@ void UIBarterItemPurchaseWnd::Slot28(int x, int y) { BarterMarketItem item = found.second; ITEM_DESC description = FindItemDescription(item.field_2c); text = FormatOwnedString(LookupMessage(3553), description.identifiedName, item.field_28 * item.value); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; ITEM_INFO info = item.ToItemInfo(); if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); } } } @@ -984,10 +983,10 @@ void UIBartermarketWnd::Slot28(int x, int y) { std::string text; ITEM_DESC description = FindItemDescription(found.second.field_2c); text = FormatOwnedString(LookupMessage(3553), description.identifiedName, found.second.field_28); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; ITEM_INFO info = found.second.ToItemInfo(); if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); } } } @@ -1017,10 +1016,10 @@ void UIExpandedBarterItemPurchaseWnd::Slot28(int x, int y) { text += "\n"; } } - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.GetGameMode()); + CMode* tooltip = g_modeMgr.GetGameMode(); ITEM_INFO info = found.second.ToItemInfo(); if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); } } } @@ -1050,10 +1049,10 @@ void UIExpandedBartermarketWnd::Slot28(int x, int y) { text += "\n"; } } - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.GetGameMode()); + CMode* tooltip = g_modeMgr.GetGameMode(); ITEM_INFO info = found.second.ToItemInfo(); if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(info), 0, 1); } } } @@ -1083,9 +1082,9 @@ void UIPurchaseButton::Slot28(int x, int y) { int tooltipX = 0; int tooltipY = -4 - count * 16; this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, 0xFFFFFFFF, 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, 0xFFFFFFFF, 0, 1); } } @@ -1131,9 +1130,9 @@ void UIExpandedBarterPurchaseButton::Slot28(int x, int y) { int tooltipX = 0; int tooltipY = -4 - index * 16; this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (tooltip) { - tooltip->Show(text.c_str(), tooltipX, tooltipY, 0xFFFFFFFF, 0, 1); + tooltip->ShowTooltip(text.c_str(), tooltipX, tooltipY, 0xFFFFFFFF, 0, 1); } } } diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index a8e2d4854..c760843fb 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -1,9 +1,9 @@ #include "Render/Text/FontCache.h" #include "Render/Text/TextContext.h" #include "UI/UIChangeMaterialWnd.h" +#include "Client/Mode/CMode.h" #include "Client/Input/InputCharset.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ChangeMaterialMgr.h" @@ -152,7 +152,7 @@ void UIChangeMaterialWnd::Slot28(int x, int y) { this->ToScreen(x, y); const int itemId = std::atoi(item->itemId.c_str()); const std::string name = ItemDisplayName(itemId); - reinterpret_cast(g_modeMgr.gameMode)->Show(name.c_str(), x + 5, y - 5, -1, 0, 1); + g_modeMgr.gameMode->ShowTooltip(name.c_str(), x + 5, y - 5, -1, 0, 1); } // OFFSET: 0x005E2840 @@ -686,7 +686,7 @@ void UIChangeMaterialWnd_List::Slot28(int x, int y) { const std::string name = ItemDisplayName(entry->results.front().id); const std::string text = FormatOwnedString(LookupMessage(0xB7), name.c_str(), entry->results.front().quantity); - reinterpret_cast(g_charViewMode)->Show(text.c_str(), screenX + 5, screenY - 5, -1, 0, 1); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), screenX + 5, screenY - 5, -1, 0, 1); } // OFFSET: 0x005E1320 diff --git a/Source/UI/UICheckAttendanceWnd.cpp b/Source/UI/UICheckAttendanceWnd.cpp index 9a739fc50..6bcf5e2f6 100644 --- a/Source/UI/UICheckAttendanceWnd.cpp +++ b/Source/UI/UICheckAttendanceWnd.cpp @@ -4,7 +4,6 @@ #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/CheckAttendanceMgr.h" #include "Contents/Items/ItemDescription.h" @@ -287,7 +286,7 @@ void UICheckAttendanceWnd::Slot28(int x, int y) { int tipX = 0; int tipY = -20; this->ToScreen(tipX, tipY); - reinterpret_cast(g_modeMgr.gameMode)->Show(name, tipX + x, tipY + y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(name, tipX + x, tipY + y, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/UIGradeEnchantWnd.cpp b/Source/UI/UIGradeEnchantWnd.cpp index 9691d6bef..041b60e6a 100644 --- a/Source/UI/UIGradeEnchantWnd.cpp +++ b/Source/UI/UIGradeEnchantWnd.cpp @@ -1,7 +1,7 @@ #include "UI/Window/WindowDialogs.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "UI/UIGradeEnchantWnd.h" +#include "Client/Mode/CMode.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Mode/CGameMode.h" @@ -377,7 +377,7 @@ void UIGradeEnchant_BtnEnhancedUp::Slot28(int x, int y) { screenY += window->geometry.y; } - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); } // OFFSET: 0x007E8CC0 diff --git a/Source/UI/UIItemReformWnd.cpp b/Source/UI/UIItemReformWnd.cpp index 34e47749f..61bc40a11 100644 --- a/Source/UI/UIItemReformWnd.cpp +++ b/Source/UI/UIItemReformWnd.cpp @@ -3,7 +3,6 @@ #include "Client/Input/InputCharset.h" #include "Client/Input/Mouse.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" @@ -257,7 +256,7 @@ void UIItemReformWnd_Item::Slot28(int x, int y) { this->ToScreen(screenX, screenY); const int tipX = screenX + 5; const int tipY = screenY - 5; - reinterpret_cast(g_modeMgr.gameMode)->Show(this->item->DisplayName(0).c_str(), tipX, tipY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->item->DisplayName(0).c_str(), tipX, tipY, 0xFFFFFFFFu, 0, 1); } } diff --git a/Source/UI/UILapineBoxWnd.cpp b/Source/UI/UILapineBoxWnd.cpp index 159ff2a04..676c332a2 100644 --- a/Source/UI/UILapineBoxWnd.cpp +++ b/Source/UI/UILapineBoxWnd.cpp @@ -2,7 +2,6 @@ #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Items/ItemInfo.h" @@ -94,7 +93,7 @@ void UIIngredientInfoWnd::Slot28(int x, int y) { int tipX = 0; int tipY = -20; this->ToScreen(tipX, tipY); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), tipX, tipY, -1, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), tipX, tipY, -1, 0, 1); } } @@ -156,7 +155,7 @@ void UILapineBoxWnd::Slot28(int x, int y) { } this->ToScreen(tipX, tipY); - reinterpret_cast(g_modeMgr.gameMode)->Show(item.unknown_0044.c_str(), tipX, tipY, -1, 0, 1); + g_modeMgr.gameMode->ShowTooltip(item.unknown_0044.c_str(), tipX, tipY, -1, 0, 1); } item.~ITEM_INFO(); diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 36e35c600..99f7118dc 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -1,6 +1,5 @@ #include "Client/Mode/CMode.h" #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "UI/UILapineUpgradeBoxWnd.h" #include "Client/Mode/ModeMgr.h" @@ -461,7 +460,7 @@ void UILapineUpgradeBox_IngredientInfoWnd::Slot28(int x, int y) { int tipX = 0; int tipY = -20; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(this->tooltip.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->tooltip.c_str(), tipX, tipY, -1, false, true); } } @@ -474,7 +473,7 @@ void UILapineUpgradeBoxWnd::Slot28(int x, int y) { int tipX = 101; int tipY = 145; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(this->item.unknown_0044.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->item.unknown_0044.c_str(), tipX, tipY, -1, false, true); } } diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index 26b582f67..a4c37f52f 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -1,5 +1,4 @@ #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "UI/UIRefiningWnd.h" #include "Client/Application/ApplicationWindow.h" @@ -542,7 +541,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = 81; int tipY = 150; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(name, tipX, tipY - 20, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(name, tipX, tipY - 20, -1, false, true); return; } @@ -554,7 +553,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = 161; int tipY = 150; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(name, tipX, tipY - 20, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(name, tipX, tipY - 20, -1, false, true); return; } @@ -583,7 +582,7 @@ void UIRefiningWnd::Slot28(int x, int y) { int tipX = slot * 49 + 11; int tipY = 35; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(name, tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(name, tipX, tipY, -1, false, true); } } diff --git a/Source/UI/UIStaticBitmap.cpp b/Source/UI/UIStaticBitmap.cpp index 1a166cdd4..797f5d58a 100644 --- a/Source/UI/UIStaticBitmap.cpp +++ b/Source/UI/UIStaticBitmap.cpp @@ -1,10 +1,10 @@ #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "UI/Buttons/UIButton.h" #include "UI/UIStaticBitmap.h" +#include "Client/Mode/CMode.h" // OFFSET: 0x00850430 // FUNCTION: fn_10676 @@ -81,7 +81,7 @@ void UIStaticBitmap::Slot28(int x, int y) { screenY = (screenY + window->geometry.y); } - static_cast(g_charViewMode)->Show(this->tooltip.c_str(), screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->tooltip.c_str(), screenX, screenY, -1, false, true); } } diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index 166829c1e..826e5a861 100644 --- a/Source/UI/Window/UIBasicInfoWnd.cpp +++ b/Source/UI/Window/UIBasicInfoWnd.cpp @@ -1,6 +1,6 @@ #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "UI/Window/UIBasicInfoWnd.h" +#include "Client/Mode/CMode.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" @@ -213,7 +213,7 @@ void UIBasicInfoWnd::Slot28(int x, int y) { int screenX = 0; int screenY = top - 19; this->ToScreen(screenX, screenY); - static_cast(g_charViewMode)->Show(text, screenX, screenY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(text, screenX, screenY, -1, false, true); } // OFFSET: 0x009995A0 diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index 04c026897..25a2e7889 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -6,7 +6,6 @@ #include "UI/Lists/UIThumb.h" #include "UI/Edit/UIEditCtrl.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" @@ -551,7 +550,7 @@ void CUIThumb::Slot28(int, int) { screenX += node->geometry.x; screenY += node->geometry.y; } - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); } } @@ -848,7 +847,7 @@ void CUIButton::Slot28(int, int) { screenY = (screenY + node->geometry.y); } - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); } // OFFSET: 0x009EEA70 @@ -915,7 +914,7 @@ void CUITextButton::Slot28(int, int) { screenX += node->geometry.x; screenY += node->geometry.y; } - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltipText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltipText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); return; } @@ -925,7 +924,7 @@ void CUITextButton::Slot28(int, int) { screenX += node->geometry.x; screenY += node->geometry.y; } - reinterpret_cast(g_modeMgr.gameMode)->Show(this->fullText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->fullText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); } // OFFSET: 0x009ED360 @@ -1263,7 +1262,7 @@ void CUIStaticImage::Slot28(int, int) { int x = 0; int y = -8; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), x, y, 0xFFFFFFFFu, 0, 1); } // OFFSET: 0x009F08A0 @@ -2870,7 +2869,7 @@ void CUIStaticText::Slot28(int x, int y) { x = -6; y = -4; this->ToScreen(x, y); - reinterpret_cast(g_modeMgr.gameMode)->Show(this->Tooltip().c_str(), x, y, 0xFFFFFFFFu, 0, 1); + g_modeMgr.gameMode->ShowTooltip(this->Tooltip().c_str(), x, y, 0xFFFFFFFFu, 0, 1); } // OFFSET: 0x009F0AE0 diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 0d12e3628..195a208e8 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -1,4 +1,3 @@ -#include "Client/Mode/ModeTooltip.h" #include "Client/Mode/CMode.h" #include "UI/Window/UIWindowMgr.h" #include "Client/Session.h" @@ -441,7 +440,7 @@ void UIMonsterInfoWnd::Slot28(int x, int y) { } if (this->TextWidth(name.c_str(), 0, 0, 12, 0, 0) > 100) { - static_cast(g_charViewMode)->Show(name.c_str(), screenX + x, screenY + y, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(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 9fa5c81a0..12b1feee5 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -4,7 +4,6 @@ #include "UI/Window/UIHotKeyWnd.h" #include "UI/Chat/UINewChatWnd.h" #include "Client/Session.h" -#include "Client/Mode/ModeTooltip.h" #include "Contents/Hotkeys/UserHotkeyMgr.h" #include "Contents/Skills/AutomaticSkills.h" #include "Contents/MessageTable.h" @@ -372,7 +371,7 @@ void UIHotKeyWnd::ShowHotkeyTooltip(int x, int y) { const HotkeyEntry entry = this->GetHotkey(this->m_tab, index + (this->m_page * 9 - 9) * 4, true); if (!entry.info.text.empty()) { - reinterpret_cast(g_charViewMode)->Show(entry.info.text.c_str(), screenX, screenY, 0xFFFFFFFF, 0, 1); + static_cast(g_charViewMode)->ShowTooltip(entry.info.text.c_str(), screenX, screenY, 0xFFFFFFFF, 0, 1); } } @@ -406,7 +405,7 @@ void UISerachStoreInfoWnd::Slot28(int x, int y) { } if (text.size() != 0) { - reinterpret_cast(g_charViewMode)->Show(text.c_str(), screenX, screenY, g_session.GetItemNameColor(item), 0, 1); + static_cast(g_charViewMode)->ShowTooltip(text.c_str(), screenX, screenY, g_session.GetItemNameColor(item), 0, 1); } } diff --git a/Source/UI/Window/UIMileageWnd.cpp b/Source/UI/Window/UIMileageWnd.cpp index 8a9dff2fc..f150de0cb 100644 --- a/Source/UI/Window/UIMileageWnd.cpp +++ b/Source/UI/Window/UIMileageWnd.cpp @@ -1,5 +1,4 @@ #include "UI/Window/UINewSelectCharWnd.h" -#include "Client/Mode/ModeTooltip.h" #include "UI/Window/UIMileageWnd.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -11,6 +10,7 @@ #include "UI/Buttons/UIButton.h" #include "UI/Text/ColoredText.h" #include "Utility/Text/FormatString.h" +#include "Client/Mode/CMode.h" #include #include @@ -90,7 +90,7 @@ void UIMileageWnd::Slot28(int x, int y) { int tipX = 10; int tipY = -20; this->ToScreen(tipX, tipY); - static_cast(g_charViewMode)->Show(this->m_tooltip.c_str(), tipX, tipY, -1, false, true); + static_cast(g_charViewMode)->ShowTooltip(this->m_tooltip.c_str(), tipX, tipY, -1, false, true); } // OFFSET: 0x0094F040 diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index d5cb1f0e5..7fec16bc2 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -2,7 +2,6 @@ #include "UI/Window/UINewSkillListWnd.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Replay.h" #include "Client/Session.h" #include "Contents/Jobs/JobNames.h" @@ -42,6 +41,7 @@ #include "Resource/PaletteResource.h" #include "Resource/Sprites/ActionResource.h" #include "Resource/Sprites/SpriteResource.h" +#include "Client/Mode/CMode.h" #include #include @@ -1044,7 +1044,7 @@ void UINewSkillListWnd::Slot28(int x, int y) { int tooltipY = -20; this->ToScreen(tooltipX, tooltipY); const char* name = skill.first->DisplayName(*g_luaScript); - reinterpret_cast(g_modeMgr.gameMode)->Show(name, tooltipX + x, tooltipY + y, -1, 0, 1); + g_modeMgr.gameMode->ShowTooltip(name, tooltipX + x, tooltipY + y, -1, 0, 1); } } diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index 574cd6100..2eecabea2 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -1,11 +1,11 @@ #include "Render/Text/FontCache.h" #include "Render/Text/TextContext.h" #include "UI/Window/UIRodexContentsWnd.h" +#include "Client/Mode/CMode.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" @@ -212,12 +212,12 @@ void UIRodexContentsWnd::Slot28(int x, int y) { int tooltipX = this->m_itemIndex * 34 + 30; int tooltipY = 290; this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (item.identified == 1 && item.unknown_0098 != 0) { - tooltip->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - tooltip->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } } diff --git a/Source/UI/Window/UIRoulletteWnd.cpp b/Source/UI/Window/UIRoulletteWnd.cpp index 06d155872..c5ff7ba43 100644 --- a/Source/UI/Window/UIRoulletteWnd.cpp +++ b/Source/UI/Window/UIRoulletteWnd.cpp @@ -2,7 +2,6 @@ #include "Client/Input/InputCharset.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" -#include "Client/Mode/ModeTooltip.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" @@ -255,12 +254,12 @@ void UIRoulletteWnd::Slot28(int x, int y) { if (item.quantity != 0) { this->ToScreen(tooltipX, tooltipY); - ModeTooltip* tooltip = reinterpret_cast(g_modeMgr.gameMode); + CMode* tooltip = g_modeMgr.gameMode; if (item.identified == 1 && item.unknown_0098 != 0) { - tooltip->Show(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, + tooltip->ShowTooltip(FormatOwnedString(LookupMessage(2600), item.DisplayName(0).c_str(), item.unknown_0098).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } else { - tooltip->Show(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); + tooltip->ShowTooltip(item.DisplayName(0).c_str(), tooltipX, tooltipY, g_session.GetItemNameColor(item), 0, 1); } } }