rodecomp/Source/UI/Menu/UIMenuIconWnd.cpp
ragnarok-clanker dc3d5ce1a5 Maintenance: Resubmission of 14942 (gate: three existing in-class helpers whose lines changed lacked an annotation; marked // INLINED
Batch #14943 by ragnarok-clanker: no function's compiled code changes; checked with 741 compiled unit(s), including every includer of Source/ActorPickNode.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeDragState.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Contents/AchievementMgr.h, Source/Contents/ActorNameCard.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObjectState.h, Source/Contents/Actors/Skill.h, Source/Contents/AdventureGuideMgr.h, Source/Contents/Camera/Camera.h, Source/Contents/Camera/CameraState.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AMachineEffect.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CaneOfEvilEyeEffect.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/CloudKillEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectMaker.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/FuumaShouakuEffect.h, Source/Contents/Effects/GravityControlEffect.h, Source/Contents/Effects/HealSpEffect.h, Source/Contents/Effects/Level99Effect.h, Source/Contents/Effects/MapChainEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/NyanggrassEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/PowderingEffect.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Effects/ShadowExceedEffect.h, Source/Contents/Effects/SkillEffects.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StormCannonEffect.h, Source/Contents/Effects/ThrowEffects.h, Source/Contents/EntryQueueMgr.h, Source/Contents/EquipmentResourceMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/GuildInfo.h, Source/Contents/Items/ItemDescription.h, Source/Contents/Items/ItemInfo.h, Source/Contents/MapSkyMgr.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Models/ModelNode.h, Source/Contents/NavigationManager.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/RDamageVar.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/RouletteMgr.h, Source/Contents/Schedule/Schedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/ClientSkills.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Skills/SkillInfo.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TipBoxTitles.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/World/World.h, Source/Contents/WorldView/WorldViewData.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/Textures/SpritePixels.h, Source/Render/Textures/Texture.h, Source/Resource/EZeffectResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Resource/XmlNode.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UISpriteButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/CashEmotion/UICashEmotionPack.h, Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UIChatRoomMakeWnd.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Chat/UISubChatMiniWnd.h, Source/UI/Chat/UIWhisperWnd.h, Source/UI/Clan/UIClanWnd.h, Source/UI/Dialogs/UIBookWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIMenuWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIMinimapZoomWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Dialogs/UISelectCartWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/Exchange/UIExchangeUI.h, Source/UI/FrameSkin.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Gauges/UIPcGage.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Guild/UIGuild_Storage_Log.h, Source/UI/Item/UIEquipmentPropertiesWnd.h, Source/UI/Item/UIItemBaseWnd.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemShopWnd.h, Source/UI/Item/UIItemShopWnd2.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIMerchantItemLogWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UICardItemIllustWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIGameItem.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemIdentifyWnd.h, Source/UI/Items/UIItemParamChangeDisplayWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Layout/WindowGeometry.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBoxV2Wnd.h, Source/UI/Lists/UIImgMenu.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITagListBox.h, Source/UI/Lists/UITreeView.h, Source/UI/Menu/UIMenuIconWnd.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIQuestDisplay.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h, Source/UI/Shop/UIMerchantItemPurchaseWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/Skill/UISkillDescribeWnd.h, Source/UI/Skill/UISkillListWnd.h, Source/UI/SkillDelayInfo/SkillDelayInfo.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/UIAchWnd.h, Source/UI/Text/UIBalloonText.h, Source/UI/Text/UINameBalloonText.h, Source/UI/Text/UIStaticTextControl.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBarGraph.h, Source/UI/UIBartermarketWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/UIMacroBlackListCheckWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroReport.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/UIPreviewEquipWnd.h, Source/UI/UIRefiningWnd.h, Source/UI/UIScrollWnd.h, Source/UI/UISlotBitmap.h, Source/UI/Window/FuncDrawWNDChar.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UIMonsterInfoWnd.h, Source/UI/Window/UINavigationHelpWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UIRodexContentsWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITransMenuWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Utility/Lexicon/LexiconSerializer.h.
2026-11-08 16:44:36 +00:00

500 lines
15 KiB
C++

#include "Render/Renderer.h"
#include "Client/Mode/ModeMessage.h"
#include "UI/Window/WindowId.h"
#include "UI/Window/UIEnums.h"
#include "UI/Menu/UIMenuIconWnd.h"
#include "Client/Application/ApplicationWindow.h"
#include "Client/Mode/CMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Replay.h"
#include "Client/Session.h"
#include "Contents/EntryQueueMgr.h"
#include "Contents/GuildMgr.h"
#include "Contents/MessageTable.h"
#include "Network/Connection/Connection.h"
#include "Network/Packets/PacketId.h"
#include "Network/Packets/PacketLengths.h"
#include "Script/LuaScript.h"
#include "UI/Window/UINavigationWnd.h"
#include "UI/Window/UIWindowMgr.h"
#include "Utility/Text/FormatString.h"
#include <windows.h>
#include <shellapi.h>
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <string>
#include "Contents/GuildInfo.h"
#include "Resource/MSGSTRINGID.h"
#pragma pack(push, 1)
struct MenuIconBankingCheckPacket {
/* 0000 */ std::int16_t id;
/* 0002 */ std::uint32_t aid;
};
struct MenuIconOpenUiPacket {
/* 0000 */ std::int16_t id;
/* 0002 */ unsigned char type;
};
#pragma pack(pop)
// OFFSET: 0x0084A1E0
// FUNCTION: fn_10606
UIMenuIcon::UIMenuIcon() {}
// OFFSET: 0x0084A240
// FUNCTION: fn_10607
UIMenuIconWnd::UIMenuIconWnd()
: UIFrameWnd(1), openButton(nullptr), notificationOpenButton(nullptr), closeButton(nullptr) {}
// OFFSET: 0x0084A850
// FUNCTION: fn_10612
bool UIMenuIconWnd::ToggleWindow(int id) {
const bool closed = g_windowMgr.CloseWindow(id);
if (!closed) {
g_windowMgr.EnsureWindow(id);
}
return !closed;
}
// OFFSET: 0x0084A880
// FUNCTION: fn_10613
UIWindow* UIMenuIconWnd::HitTest(int x, int y) {
if (!this->CanHitTest() || this->geometry.visible == 0 || x < this->geometry.x) {
return nullptr;
}
if (!g_session.m_showMenuIcon) {
if (x >= this->geometry.x + this->geometry.width || y < this->geometry.y || y >= this->geometry.y + this->notificationOpenButton->geometry.height) {
return nullptr;
}
if (this->notifiedCommands.size() == 0) {
return this->openButton;
}
return this->notificationOpenButton;
}
if (x >= this->geometry.x + this->geometry.width || y < this->geometry.y || y >= this->geometry.y + this->geometry.height) {
return nullptr;
}
for (auto child = this->m_children.rbegin(); child != this->m_children.rend(); ++child) {
UIWindow* hit = (*child)->HitTest((x - this->geometry.x), (y - this->geometry.y));
if (hit) {
return hit;
}
}
return this;
}
// OFFSET: 0x0084A960
// FUNCTION: fn_10614
bool UIMenuIconWnd::IsTransmitMouseInput() {
return true;
}
// OFFSET: 0x0084A970
// FUNCTION: fn_10615
void UIMenuIconWnd::Move(int x, int y) {
this->geometry.x = x;
this->geometry.y = y - 4;
g_windowMgr.StoreSnapRectangle(this);
}
// OFFSET: 0x0084A9A0
// FUNCTION: fn_10616
void UIMenuIconWnd::OnCreate(int width, int height) {
const int ids[24] = {192, 195, 194, 196, 379, 199, 373, 376, 361, 219, 430, 193, 461, 399, 476, 473, 511, 512, 370, 540, 544, 567, 581, 587};
std::string names[24] = {
"status", "equip", "item", "skill", "booking", "party", "guild", "battle", "quest", "map", "navigation", "option",
"bank", "rec", "mail", "achievement", "tip", "shop", "keyboard", "attendance", "adventurerAgency", "repute", "adventureguide", "probability",
};
unsigned int position = 0;
for (int index = 0; index < 24; ++index) {
if (ids[index] == 192 && g_session.IsDoramJob(g_session.m_job) == true) {
names[index] = "status_doram";
}
if (ids[index] == 379 || ids[index] == 600) {
continue;
}
UIMenuIcon* icon = new UIMenuIcon();
icon->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s.bmp", names[index].c_str()).c_str(), 0, 0);
icon->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s.bmp", names[index].c_str()).c_str(), 1, 0);
icon->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s_press.bmp", names[index].c_str()).c_str(), 2, 0);
icon->SetSize(icon->BitmapWidth(), icon->BitmapHeight());
const int row = position / 5 * 43;
const int x = position % 5 * 42 + 9;
icon->Move(x, row + 23);
icon->SetId(ids[index]);
icon->Enable(0);
this->AddChild(icon);
this->menuButtons[ids[index]] = icon;
switch (ids[index]) {
case ID_STATUS:
case ID_ITEMS:
case ID_SKILL:
case 473:
case 476: {
UIMenuIcon* badge = new UIMenuIcon();
badge->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s_new.bmp", names[index].c_str()).c_str(), 0, 0);
badge->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s_new.bmp", names[index].c_str()).c_str(), 1, 0);
badge->SetBitmap(FormatOwnedString("유저인터페이스\\menu_icon\\bt_%s_new_press.bmp", names[index].c_str()).c_str(), 2, 0);
badge->SetSize(badge->BitmapWidth(), badge->BitmapHeight());
badge->Move(x, row + 17);
badge->SetId(ids[index]);
badge->Enable(0);
this->AddChild(badge);
this->notificationButtons[ids[index]] = badge;
break;
}
}
++position;
}
this->openButton = new UIBitmapButton();
this->openButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_normal.bmp", 0, 0);
this->openButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_over.bmp", 1, 0);
this->openButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_press.bmp", 2, 0);
this->openButton->SetSize(this->openButton->BitmapWidth(), this->openButton->BitmapHeight());
this->openButton->Move(0, 4);
this->openButton->SetId(510);
this->openButton->Enable(0);
this->AddChild(this->openButton);
this->notificationOpenButton = new UIBitmapButton();
this->notificationOpenButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_new_normal.bmp", 0, 0);
this->notificationOpenButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_new_over.bmp", 1, 0);
this->notificationOpenButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_new_press.bmp", 2, 0);
this->notificationOpenButton->SetSize(this->notificationOpenButton->BitmapWidth(), this->notificationOpenButton->BitmapHeight());
this->notificationOpenButton->Move(0, 0);
this->notificationOpenButton->SetId(510);
this->notificationOpenButton->Enable(0);
this->AddChild(this->notificationOpenButton);
this->closeButton = new UIBitmapButton();
this->closeButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_close_normal.bmp", 0, 0);
this->closeButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_close_over.bmp", 1, 0);
this->closeButton->SetBitmap("유저인터페이스\\menu_icon\\bt_menu_close_press.bmp", 2, 0);
this->closeButton->SetSize(this->closeButton->BitmapWidth(), this->closeButton->BitmapHeight());
this->closeButton->Move(0, 4);
this->closeButton->SetId(201);
this->closeButton->Enable(0);
this->AddChild(this->closeButton);
this->SendMsg(this, UM_COMMAND, g_session.m_showMenuIcon == true ? 510 : 201, 0, 0, 0);
if (this->menuButtons.size() > 20) {
this->Resize(220, 238);
}
}
// OFFSET: 0x0084B940
// FUNCTION: fn_10617
void UIMenuIconWnd::Paint() {
this->m_primitives.clear();
this->openButton->Enable(0);
this->notificationOpenButton->Enable(0);
this->closeButton->Enable(0);
UIButton* toggle;
if (g_session.m_showMenuIcon) {
toggle = this->closeButton;
} else if (this->notifiedCommands.size() == 0) {
toggle = this->openButton;
} else {
toggle = this->notificationOpenButton;
}
toggle->Enable(1);
for (auto it = this->menuButtons.begin(); it != this->menuButtons.end(); ++it) {
if (!g_session.m_showMenuIcon) {
it->second->Enable(0);
if (this->notificationButtons.find(it->first) != this->notificationButtons.end()) {
this->notificationButtons[it->first]->Enable(0);
}
} else {
this->DrawNamed(g_renderer->primitives, 0, 13, "유저인터페이스\\menu_icon\\bg_menu.tga", 0xFFFFFFFF, 0, 0);
const bool pinned = std::find(this->notifiedCommands.begin(), this->notifiedCommands.end(), it->first) != this->notifiedCommands.end();
it->second->Enable(!pinned);
if (this->notificationButtons.find(it->first) != this->notificationButtons.end()) {
this->notificationButtons[it->first]->Enable(pinned);
}
}
}
}
// OFFSET: 0x0084BD20
// FUNCTION: fn_10618
void UIMenuIconWnd::OnLBtnDown(int x, int y) {}
// OFFSET: 0x0084BD30
// FUNCTION: fn_10619
void UIMenuIconWnd::OnLBtnUp(int x, int y) {}
// OFFSET: 0x0084BD40
// FUNCTION: fn_10620
void UIMenuIcon::OnMouseMove(int x, int y) {
int behaviorId = 10041;
int message = 4698;
bool known = true;
switch (this->geometry.id) {
case ID_STATUS:
behaviorId = 11;
message = 105;
break;
case 193:
message = 265;
break;
case ID_ITEMS:
behaviorId = 8;
message = 106;
break;
case ID_EQUIP:
behaviorId = 10;
message = 104;
break;
case ID_SKILL:
behaviorId = 37;
message = 283;
break;
case ID_FRIEND:
behaviorId = 69;
message = 103;
break;
case ID_MAP:
behaviorId = 140;
message = 2859;
break;
case 361:
behaviorId = 134;
message = 1317;
break;
case 370:
message = 3128;
break;
case 373:
behaviorId = 59;
message = 3134;
break;
case 376:
behaviorId = 157;
message = 2003;
break;
case 399:
behaviorId = 198;
message = 2350;
break;
case 430:
behaviorId = 203;
message = 2353;
break;
case 461:
behaviorId = 251;
message = 3135;
break;
case 473:
behaviorId = 270;
message = 2646;
break;
case 476:
behaviorId = 263;
message = 3136;
break;
case 511:
behaviorId = 315;
message = 3239;
break;
case 512:
behaviorId = 318;
message = 3137;
break;
case 540:
behaviorId = 328;
message = 3473;
break;
case 544:
behaviorId = 324;
message = 3514;
break;
case 567:
behaviorId = 346;
message = 3827;
break;
case 581:
behaviorId = 10002;
message = 4053;
break;
case 587:
message = 4119;
break;
default:
known = false;
break;
}
if (known) {
const char* behavior = nullptr;
g_session.m_hotkeyScript->Call("GetBeHaviorOfWindow", "d>s", behaviorId, &behavior);
if (std::strlen(behavior) == 0) {
this->m_tooltip = LookupMessage(message);
} else {
const std::string text = FormatOwnedString("%s (%s)", LookupMessage(message), behavior);
this->m_tooltip = text;
}
}
if (this->geometry.id == 193) {
const std::string text = FormatOwnedString("%s (%s)", LookupMessage(message), "Esc");
this->m_tooltip = text;
}
}
// OFFSET: 0x0084C250
// FUNCTION: fn_10621
void UIMenuIconWnd::OnMouseMove(int x, int y) {}
// OFFSET: 0x0084C260
// FUNCTION: fn_10622
int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
if (message == UM_COMMAND) {
if (!Replay::Instance().AllowsEvent(argument1)) {
switch (argument1) {
case ID_CLOSE:
g_session.m_showMenuIcon = false;
this->Invalidate();
break;
case ID_NOTICE: {
const int id = argument2;
auto found = std::find(this->notifiedCommands.begin(), this->notifiedCommands.end(), id);
if (argument3 > 0) {
if (found == this->notifiedCommands.end()) {
this->notifiedCommands.push_back(id);
}
} else if (found != this->notifiedCommands.end()) {
this->notifiedCommands.erase(found);
}
this->Invalidate();
break;
}
case ID_STATUS:
this->ToggleWindow(11);
break;
case ID_EQUIP:
this->ToggleWindow(10);
break;
case ID_ITEMS:
this->ToggleWindow(8);
break;
case ID_SKILL:
this->ToggleWindow(37);
break;
case ID_FRIEND:
this->ToggleWindow(69);
break;
case 373:
this->ToggleWindow(static_cast<int>(g_guildInfo.m_guildId) < 1 ? 212 : 59);
break;
case ID_QUEST:
this->ToggleWindow(10008);
break;
case ID_MAP:
this->ToggleWindow(140);
break;
case 430:
if (g_windowMgr.window_4F174) {
g_windowMgr.window_4F174->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0);
} else {
g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND);
}
break;
case ID_OPTION:
this->ToggleWindow(155);
break;
case 399:
if (Replay::Instance().state == 1) {
this->ToggleWindow(198);
} else {
g_windowMgr.Confirm("REC End please", 0, true, false, 0, "Message", 280, 120, 0);
}
break;
case 370:
this->ToggleWindow(303);
break;
case 461: {
MenuIconBankingCheckPacket packet;
packet.id = ID_CZ_REQ_BANKING_CHECK;
packet.aid = g_session.m_aid;
GetRagConnection().Send(g_packetLengths.FixedLength(packet.id), &packet);
break;
}
case 510:
g_session.m_showMenuIcon = true;
this->Invalidate();
break;
case 476:
if (g_windowMgr.LookupWindow(WID_REFININGWND)) {
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(LookupMessage(MSI_AURA_EFFECT_OFF)), 255, 0, 0, 0);
} else if (g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)) {
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(LookupMessage(MSI_BROADCASTING_GRADE_ENCHANT_SUCCESS)), 255, 0, 0, 0);
} else if (g_windowMgr.LookupWindow(WID_ENCHANTUI)) {
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(LookupMessage(MSI_ENCHANT_REQUEST)), 255, 0, 0, 0);
} else {
this->ToggleWindow(263);
}
break;
case 473:
this->ToggleWindow(270);
break;
case 511:
this->ToggleWindow(315);
break;
case 512:
g_modeMgr.GetGameMode()->SendMsg(MM_REQUEST_CASH_SHOP, 0, 0, 0, 0);
break;
case 540:
if (g_windowMgr.LookupWindow(WID_CHECKATTENDANCEWND)) {
g_windowMgr.CloseWindow(WID_CHECKATTENDANCEWND);
} else {
MenuIconOpenUiPacket packet;
packet.id = 0xA68;
packet.type = 5;
GetRagConnection().Send(g_packetLengths.FixedLength(packet.id), &packet);
}
break;
case 544:
this->ToggleWindow(324);
break;
case 567:
this->ToggleWindow(346);
break;
case 581:
this->ToggleWindow(10002);
break;
case 587:
if (g_windowMgr.Confirm(LookupMessage(MSI_GENDER_CHANGE_FAILED_CAUSE_MONSTER_TRANSFORM), 2, true, false, 0, "Message", 280, 120, 0) == 187) {
ShellExecuteA(hWnd, "open", LookupMessage(MSI_GENDER_CHANGE_FAILED_CAUSE_MARRIED), nullptr, nullptr, SW_SHOWNORMAL);
}
break;
}
}
} else if (message == UM_REFRESH) {
this->SendMsg(nullptr, UM_COMMAND, g_session.m_showMenuIcon == true ? 201 : 510, 0, 0, 0);
}
if (message == UM_COMMAND && argument1 == 376 && !Replay::Instance().AllowsEvent(argument1) && g_entryQueueMgr) {
if (reinterpret_cast<const unsigned char*>(g_entryQueueMgr)[0x3C] == 1) {
g_entryQueueMgr->SendRankingRequest();
}
this->ToggleWindow(157);
}
return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4);
}