From 780c281aa25c1b253319bcac6e6586e531889ef4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 8 Nov 2026 13:56:42 +0000 Subject: [PATCH] Maintenance: Name window messaging constants: literal window ids (LookupWindow/EnsureWindow/CloseWindow/... -> WindowId), UIWindowMgr Batch #14937 by ragnarok-clanker: no function's compiled code changes; checked with 251 compiled unit(s), including every includer of Source/Client/Mode/ModeMessage.h, Source/Contents/Actors/ActorEnums.h, Source/Network/Packets/PartyJoinPacket.h, Source/UI/Window/UIEnums.h, Source/UI/Window/WindowId.h. --- .../Client/Application/ApplicationWindow.cpp | 16 +- Source/Client/Browser/BrowserFactory.cpp | 5 +- Source/Client/Input/Language.cpp | 12 +- Source/Client/Mode/GameMode.cpp | 1252 +++++---- Source/Client/Mode/GameModeEquipWindow.cpp | 5 +- Source/Client/Mode/GameModeHandlers.cpp | 447 +-- Source/Client/Mode/GameModeItemLists.cpp | 3 +- Source/Client/Mode/GameModeMiniMap.cpp | 52 +- Source/Client/Mode/GameModeNotices.cpp | 780 ++--- Source/Client/Mode/GameModePackets.cpp | 2502 +++++++++-------- Source/Client/Mode/LoginMode.cpp | 269 +- Source/Client/Mode/LoginModeNotices.cpp | 3 +- Source/Client/Mode/ModeDragState.cpp | 9 +- Source/Client/Mode/ModeMessage.h | 106 + Source/Client/ModeScreenshot.cpp | 3 +- Source/Client/Replay.cpp | 5 +- Source/Client/Session.cpp | 64 +- Source/Client/SessionAchievements.cpp | 10 +- Source/Client/SessionState.cpp | 13 +- Source/Client/Stove/StoveMgr.cpp | 25 +- Source/Contents/Actors/ActorEnums.h | 66 + Source/Contents/Actors/GameActor.cpp | 24 +- Source/Contents/Actors/GameObject.cpp | 541 ++-- Source/Contents/Actors/MercenaryAI.cpp | 12 +- Source/Contents/Actors/Player.cpp | 213 +- Source/Contents/Actors/RenderObject.cpp | 264 +- Source/Contents/Actors/Skill.cpp | 8 +- Source/Contents/CashEmotionMgr.cpp | 110 +- Source/Contents/ChampionMonsterMgr.cpp | 3 +- Source/Contents/ClientItemLists.cpp | 72 +- Source/Contents/ClientState.cpp | 22 +- Source/Contents/ClientTiming.cpp | 6 +- .../Contents/Configuration/ServiceOptions.cpp | 58 +- .../Contents/Effects/DummyEffectLauncher.cpp | 5 +- Source/Contents/Effects/Effect.cpp | 3 +- Source/Contents/Effects/EffectActor.cpp | 3 +- Source/Contents/Effects/EffectLists.cpp | 3 +- Source/Contents/Effects/EffectMaker.cpp | 3 +- .../Effects/EffectPrimitiveMotion.cpp | 8 +- .../Effects/EffectPrimitiveRendering.cpp | 7 +- .../Effects/EffectPrimitiveSprites.cpp | 9 +- Source/Contents/Effects/MeteorEffect.cpp | 3 +- Source/Contents/Effects/MsgEffect.cpp | 7 +- .../Contents/Effects/PartyMemberEffects.cpp | 3 +- Source/Contents/Effects/RagEffect.cpp | 86 +- .../Contents/Effects/ShadowExceedEffect.cpp | 5 +- Source/Contents/Effects/ShowEffect.cpp | 5 +- Source/Contents/Emblems/EmblemCache.cpp | 3 +- Source/Contents/EnchantMgr.cpp | 24 +- Source/Contents/EntryQueueMgr.cpp | 28 +- Source/Contents/Items/BarterMarketItemMgr.cpp | 10 +- Source/Contents/Items/ItemInfo.cpp | 5 +- .../Contents/Items/SelectPackageItemMgr.cpp | 5 +- Source/Contents/Jobs/JobInheritance.cpp | 181 +- Source/Contents/Messenger/ClientMessenger.cpp | 34 +- Source/Contents/Messenger/MessengerMember.cpp | 135 +- Source/Contents/NavigationRoute.cpp | 28 +- .../Party/ChangePartyMasterCompletion.cpp | 6 +- Source/Contents/Party/MyPartyCompletion.cpp | 5 +- Source/Contents/Party/PartyBookingMgr.cpp | 6 +- Source/Contents/Party/PartyInfoCompletion.cpp | 21 +- Source/Contents/Party/PartyJoinResult.cpp | 29 +- Source/Contents/Party/PartyListCompletion.cpp | 6 +- .../Party/PartyRegistrationCompletion.cpp | 12 +- .../Party/StopRecruitingCompletion.cpp | 12 +- Source/Contents/RenewQuestMgr.cpp | 12 +- Source/Contents/ReputeMgr.cpp | 12 +- Source/Contents/RouletteMgr.cpp | 3 +- .../Schedule/PartialShutDownSchedule.cpp | 5 +- Source/Contents/Schedule/ShutDownSchedule.cpp | 3 +- Source/Contents/ShowRankingScheduler.cpp | 13 +- Source/Contents/Skills/ClientSkills.cpp | 22 +- Source/Contents/Skills/PlayerSkillBundle.cpp | 10 +- Source/Contents/Skills/SkillActionAlitea.cpp | 11 +- Source/Contents/Skills/SkillActionDruid.cpp | 3 +- Source/Contents/Skills/SkillActionKarnos.cpp | 3 +- Source/Contents/Skills/SkillActionMeister.cpp | 5 +- .../Skills/SkillActionShinkiroShiranui.cpp | 3 +- .../Skills/SkillActionSoulAscetic.cpp | 3 +- Source/Contents/Skills/SkillInfo.cpp | 7 +- Source/Contents/Sound/SoundMaker.cpp | 29 +- Source/Contents/SpriteLayerDrawing.cpp | 3 +- Source/Contents/Store/MCStoreInfoBackup.cpp | 7 +- Source/Contents/World/WorldEffects.cpp | 8 +- Source/Contents/World/WorldModelLoading.cpp | 6 +- Source/Contents/World/WorldObjects.cpp | 129 +- Source/Contents/WorldView/WorldViewData.cpp | 3 +- Source/Network/Packets/PartyJoinPacket.h | 3 +- Source/Network/Packets/SkillUpdatePacket.cpp | 5 +- Source/Resource/ResourceFailures.cpp | 7 +- Source/Script/LuaScript.cpp | 11 +- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 1016 +++---- Source/UI/Acceptance/UIExchangeAcceptWnd.cpp | 20 +- Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp | 16 +- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 30 +- Source/UI/Buttons/UIButton.cpp | 10 +- Source/UI/Buttons/UICheckBox.cpp | 5 +- Source/UI/Buttons/UIDescriptRace.cpp | 5 +- Source/UI/Buttons/UIRadioBtn.cpp | 5 +- Source/UI/Buttons/UITagButton.cpp | 3 +- Source/UI/Buttons/UITextButton.cpp | 133 +- Source/UI/Buttons/UITextureButton.cpp | 8 +- Source/UI/CashShop/UICashShopWnd.cpp | 130 +- Source/UI/Chat/ChatSuggestions.cpp | 3 +- Source/UI/Chat/UIChatRoomTitle.cpp | 11 +- Source/UI/Chat/UINewChatWnd.cpp | 93 +- Source/UI/Chat/UISubChatHisWnd.cpp | 10 +- Source/UI/Clan/UIClanWnd.cpp | 4 +- Source/UI/Dialogs/UIEditctrlWnd.cpp | 29 +- Source/UI/Dialogs/UIEmailAddressWnd.cpp | 6 +- Source/UI/Dialogs/UIWaitDBSaveWnd.cpp | 3 +- Source/UI/Edit/UIEditBoxEx.cpp | 5 +- Source/UI/Edit/UIEditCtrl.cpp | 1015 +++---- Source/UI/Edit/UIEditVariants.cpp | 27 +- Source/UI/Emotion/UIEmotionWnd.cpp | 12 +- Source/UI/Enchant/UIEnchantUI.cpp | 5 +- Source/UI/EntryQueue/UIEntryQueueWnd.cpp | 75 +- Source/UI/Exchange/UIExchangeUI.cpp | 26 +- Source/UI/GameSettings/GameSettingsUI.cpp | 53 +- Source/UI/Guild/UIAgitWnd.cpp | 21 +- Source/UI/Guild/UIGuildHelperWnd.cpp | 46 +- Source/UI/Guild/UIGuildWnd.cpp | 214 +- Source/UI/Guild/UIGuild_Storage_Log.cpp | 9 +- Source/UI/Item/UIEquipmentPropertiesWnd.cpp | 6 +- Source/UI/Item/UIMerchantItemLogWnd.cpp | 3 +- Source/UI/Item/UIParaItemShopWnd.cpp | 93 +- Source/UI/Items/MergeItemWnd.cpp | 7 +- Source/UI/Items/UIGameItem.cpp | 6 +- Source/UI/Items/UIIllustWnd.cpp | 9 +- Source/UI/Items/UIItemRepairWnd.cpp | 26 +- Source/UI/Items/UIMakeTargetListWnd.cpp | 29 +- Source/UI/Items/UIMakeTargetProcessWnd.cpp | 24 +- Source/UI/Items/UISwapEquipmentWnd.cpp | 36 +- Source/UI/Items/UIWeaponRefineWnd.cpp | 24 +- Source/UI/Lists/UIComboBox.cpp | 9 +- Source/UI/Lists/UIComboBoxDefWnd.cpp | 37 +- Source/UI/Lists/UIComboBoxEx.cpp | 11 +- Source/UI/Lists/UIListBox.cpp | 31 +- Source/UI/Lists/UIListBoxEx.cpp | 19 +- Source/UI/Lists/UIListBoxID.cpp | 16 +- Source/UI/Lists/UIScrollBar.cpp | 58 +- Source/UI/Lists/UITagListBox.cpp | 11 +- Source/UI/Menu/UIMenuIconWnd.cpp | 40 +- Source/UI/MiniPartyManager.cpp | 8 +- Source/UI/MiniPartyUsableArea.cpp | 3 +- Source/UI/Party/UIAdvenPartyBoardWnd.cpp | 38 +- Source/UI/Party/UIApplyForPartyWnd.cpp | 10 +- Source/UI/Party/UIMiniPartyWnd.cpp | 51 +- Source/UI/Party/UIPartyInfoWnd.cpp | 3 +- Source/UI/Party/UIRegisterPartyWnd.cpp | 9 +- Source/UI/Party/UIRequestJoinPartyMgr.cpp | 16 +- Source/UI/Party/UIRequestJoinPartyWnd.cpp | 11 +- .../ProbabilityTable/UIProbabilityTable.cpp | 5 +- Source/UI/Quest/UIOngoingQuestInfo.cpp | 5 +- Source/UI/Quest/UIQuestDisplay.cpp | 12 +- Source/UI/Quest/UIRecommendedQuestInfo.cpp | 5 +- Source/UI/Quest/UIRenewQuestUI.cpp | 36 +- Source/UI/Quest/UIRenewQuestWnd.cpp | 57 +- Source/UI/Rodex/UIRodexComposeWnd.cpp | 58 +- Source/UI/Rodex/UIRodexInboxWnd.cpp | 72 +- Source/UI/RuneSystem/UIRuneSystemWnd.cpp | 105 +- .../UISelectPackageItemBox.cpp | 8 +- Source/UI/Shop/UIMerchantShopTitle.cpp | 18 +- Source/UI/Shortcuts/NormalItemSlotLoad.cpp | 8 +- Source/UI/Shortcuts/ShortcutActivation.cpp | 3 +- Source/UI/Shortcuts/ShortcutBindings.cpp | 7 +- Source/UI/Shortcuts/ShortcutControls.cpp | 3 +- Source/UI/Shortcuts/ShortcutCooldowns.cpp | 19 +- Source/UI/Shortcuts/ShortcutDetails.cpp | 12 +- Source/UI/Shortcuts/ShortcutDrop.cpp | 30 +- Source/UI/Shortcuts/ShortcutVisibility.cpp | 21 +- Source/UI/Shortcuts/UIQuickSlotWnd.cpp | 42 +- Source/UI/Shortcuts/UIShortCutWnd.cpp | 97 +- Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp | 8 +- Source/UI/StylingShop/UIStylingShopWnd.cpp | 65 +- Source/UI/Text/NavigationLink.cpp | 14 +- Source/UI/Text/UIAchWnd.cpp | 57 +- Source/UI/Text/UITagTextViewer.cpp | 20 +- Source/UI/Text/UITextViewer.cpp | 12 +- Source/UI/Text/UITextViewerLinks.cpp | 11 +- Source/UI/Text/UITextViewerMessages.cpp | 17 +- Source/UI/UIBartermarketWnd.cpp | 241 +- Source/UI/UICaptchaRegisterWnd.cpp | 9 +- Source/UI/UIChangeMaterialWnd.cpp | 29 +- Source/UI/UICheckAttendanceWnd.cpp | 22 +- Source/UI/UIGradeEnchantWnd.cpp | 33 +- Source/UI/UIHotkeyGuideWnd.cpp | 9 +- Source/UI/UIItemReformWnd.cpp | 34 +- Source/UI/UILapineBoxWnd.cpp | 50 +- Source/UI/UILapineScrollBar.cpp | 12 +- Source/UI/UILapineUpgradeBoxWnd.cpp | 56 +- Source/UI/UIMacroDetectorWnd.cpp | 14 +- Source/UI/UIMacroReport.cpp | 7 +- Source/UI/UIMacroUserInfoWnd.cpp | 33 +- Source/UI/UIPreviewEquipWnd.cpp | 9 +- Source/UI/UIRefiningWnd.cpp | 39 +- Source/UI/UIReputeWnd.cpp | 10 +- Source/UI/UIRoundBoxTooltipWnd.cpp | 16 +- Source/UI/UIScrollWnd.cpp | 12 +- Source/UI/UISlotBitmap.cpp | 14 +- Source/UI/Window/FrameFocus.cpp | 6 +- Source/UI/Window/UIAccountLimitedToolWnd.cpp | 41 +- Source/UI/Window/UIBalloonOpenBtn.cpp | 8 +- Source/UI/Window/UIBasicInfoWnd.cpp | 107 +- Source/UI/Window/UIBattleMsgOptionWnd.cpp | 11 +- Source/UI/Window/UIBitmapTab.cpp | 2 +- Source/UI/Window/UIChangeNameWnd.cpp | 5 +- Source/UI/Window/UICollectionSystemWnd.cpp | 9 +- Source/UI/Window/UIEnums.h | 95 + Source/UI/Window/UIEscOptionWnd.cpp | 44 +- Source/UI/Window/UIFrameWnd.cpp | 98 +- Source/UI/Window/UIHotKeyWnd.cpp | 14 +- Source/UI/Window/UIJobListWnd.cpp | 11 +- Source/UI/Window/UIMessageBox.cpp | 297 +- Source/UI/Window/UIMiniBtnWnd.cpp | 5 +- Source/UI/Window/UINavigationHelpWnd.cpp | 66 +- Source/UI/Window/UINavigationWnd.cpp | 59 +- Source/UI/Window/UINewMakeCharWnd.cpp | 37 +- Source/UI/Window/UINewSelectCharWnd.cpp | 124 +- Source/UI/Window/UINewSkillListWnd.cpp | 53 +- Source/UI/Window/UINormalMB.cpp | 7 +- Source/UI/Window/UINoteWnd.cpp | 11 +- Source/UI/Window/UIOpenMailBoxWnd.cpp | 24 +- Source/UI/Window/UIPartyBookingHelpWnd.cpp | 8 +- Source/UI/Window/UIPetEvolutionWnd.cpp | 17 +- Source/UI/Window/UIRebirthWnd.cpp | 25 +- Source/UI/Window/UIResizer.cpp | 3 +- Source/UI/Window/UIRoMapWnd.cpp | 24 +- Source/UI/Window/UIRodexContentsWnd.cpp | 32 +- Source/UI/Window/UIRoulletteWnd.cpp | 19 +- Source/UI/Window/UISecondCostumeWnd.cpp | 3 +- Source/UI/Window/UISeekPartyListWnd.cpp | 29 +- Source/UI/Window/UISeekPartyMBWnd.cpp | 13 +- Source/UI/Window/UISelCharForUServerWnd.cpp | 9 +- Source/UI/Window/UISerachStoreInfoWnd.cpp | 20 +- Source/UI/Window/UIShowWarpWnd.cpp | 9 +- Source/UI/Window/UITab.cpp | 5 +- Source/UI/Window/UITransMenuWnd.cpp | 5 +- Source/UI/Window/UIVideoWnd.cpp | 18 +- Source/UI/Window/UIWindow.cpp | 88 +- Source/UI/Window/UIWindowFactory.cpp | 7 +- Source/UI/Window/UIWindowMgr.cpp | 832 +++--- Source/UI/Window/WindowAncestry.cpp | 9 +- Source/UI/Window/WindowDialogs.cpp | 61 +- Source/UI/Window/WindowId.h | 13 + Source/UI/Window/WindowMgrState.cpp | 31 +- Source/UI/Window/WindowMouseHit.cpp | 9 +- Source/UI/Window/WindowOrdering.cpp | 22 +- Source/UI/Window/WindowRetirement.cpp | 5 +- 249 files changed, 8153 insertions(+), 7471 deletions(-) diff --git a/Source/Client/Application/ApplicationWindow.cpp b/Source/Client/Application/ApplicationWindow.cpp index 82003cf05..ca17c03ef 100644 --- a/Source/Client/Application/ApplicationWindow.cpp +++ b/Source/Client/Application/ApplicationWindow.cpp @@ -1,4 +1,6 @@ #include "Client/Application/ApplicationWindow.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Application/ApplicationActivation.h" #include "Client/Application/Launcher.h" #include "Client/Browser/WebBrowser.h" @@ -66,7 +68,7 @@ LRESULT CALLBACK WindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lPa const LRESULT result = g_serverLanguage->Message(window, message, wParam, lParam, handled); if (handled) { if (g_serverLanguage->candidateCount == 0) { - g_windowMgr.CloseWindow(0x33); + g_windowMgr.CloseWindow(WID_CANDIDATEWND); } else { std::string candidates[9]; int info[4]; @@ -83,13 +85,13 @@ LRESULT CALLBACK WindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lPa for (int i = 0; i < count; ++i) { candidates[i] = g_serverLanguage->Candidate(first + i); } - g_windowMgr.EnsureWindow(0x33)->SendMsg(nullptr, 0x41, reinterpret_cast(candidates), reinterpret_cast(info), 0, 0); + g_windowMgr.EnsureWindow(WID_CANDIDATEWND)->SendMsg(nullptr, UM_IME_SET_CANDIDATE, reinterpret_cast(candidates), reinterpret_cast(info), 0, 0); } if (g_serverLanguage->DisplayLength()) { - g_windowMgr.EnsureWindow(0x55)->Invalidate(); + g_windowMgr.EnsureWindow(WID_KEYSTROKEWND)->Invalidate(); } else { - g_windowMgr.CloseWindow(0x55); + g_windowMgr.CloseWindow(WID_KEYSTROKEWND); } if (message == WM_IME_COMPOSITION) { @@ -190,8 +192,8 @@ LRESULT CALLBACK WindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lPa } break; case WM_KEYDOWN: - if (UIWindow* target = g_windowMgr.LookupWindow(0x130)) { - target->SendMsg(nullptr, 0, wParam, 0, 0, 0); + if (UIWindow* target = g_windowMgr.LookupWindow(WID_VIDEOWND)) { + target->SendMsg(nullptr, UM_DEFPUSH, wParam, 0, 0, 0); return 0; } if (g_windowMgr.ProcessKeyDown(wParam, lParam, ~(static_cast(lParam) >> 30) & 1)) { @@ -218,7 +220,7 @@ LRESULT CALLBACK WindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lPa } return 0; case WM_CHAR: - if (!g_windowMgr.LookupWindow(0x130) && g_windowMgr.unknown_0025) { + if (!g_windowMgr.LookupWindow(WID_VIDEOWND) && g_windowMgr.unknown_0025) { if (g_windowMgr.GetHoverWindow() && g_windowMgr.GetHoverWindow()->SendMsg(nullptr, WM_CHAR, wParam, lParam, 0, 0) == 3) { return 0; } diff --git a/Source/Client/Browser/BrowserFactory.cpp b/Source/Client/Browser/BrowserFactory.cpp index 4fd006948..4852b5495 100644 --- a/Source/Client/Browser/BrowserFactory.cpp +++ b/Source/Client/Browser/BrowserFactory.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Application/Launcher.h" #include "Client/Browser/WebBrowser.h" @@ -15,8 +16,8 @@ namespace { // FUNCTION: fn_17136 CWebBrowser* UIWindowMgr::CreateBrowser(int width, int height) { if (this->browsers.size() >= maximumBrowserCount) { - this->SendNotice(3, 0, 0, 0, 0, 0); - this->SendNotice(1, reinterpret_cast(LookupMessage(MSI_FAILED_ADD_TAB)), RGB(255, 0, 0), 0, 0, 0); + this->SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(MSI_FAILED_ADD_TAB)), RGB(255, 0, 0), 0, 0, 0); return nullptr; } diff --git a/Source/Client/Input/Language.cpp b/Source/Client/Input/Language.cpp index 6a808ce11..97a88327a 100644 --- a/Source/Client/Input/Language.cpp +++ b/Source/Client/Input/Language.cpp @@ -1,4 +1,6 @@ #include "Client/Input/InputCharset.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Input/Language.h" #include "Contents/CashEmotionMgr.h" @@ -157,7 +159,7 @@ void CLanguageBase::CopySelection() { // OFFSET: 0x00ACD540 // FUNCTION: fn_17764 void CLanguageBase::Paste() { - if (g_windowMgr.window_4F1FC == g_windowMgr.GetHoverWindow() || g_windowMgr.LookupWindow(278) || g_windowMgr.LookupWindow(128)) { + if (g_windowMgr.window_4F1FC == g_windowMgr.GetHoverWindow() || g_windowMgr.LookupWindow(WID_NEWMAKECHARWND) || g_windowMgr.LookupWindow(WID_CHANGENAMEWND)) { return; } @@ -352,7 +354,7 @@ void CLanguageBase::KeyDown(unsigned key, LPARAM) { break; case VK_LEFT: if (ChatWindow() && ChatWindow()->SuggestionsVisible() && ChatWindow()->m_suggestions) { - ChatWindow()->m_suggestions->SendMsg(nullptr, 176, VK_LEFT, 0, 0, 0); + ChatWindow()->m_suggestions->SendMsg(nullptr, UM_CASH_EMOTION_KEY, VK_LEFT, 0, 0, 0); return; } @@ -361,7 +363,7 @@ void CLanguageBase::KeyDown(unsigned key, LPARAM) { break; case VK_RIGHT: if (ChatWindow() && ChatWindow()->SuggestionsVisible() && ChatWindow()->m_suggestions) { - ChatWindow()->m_suggestions->SendMsg(nullptr, 176, VK_RIGHT, 0, 0, 0); + ChatWindow()->m_suggestions->SendMsg(nullptr, UM_CASH_EMOTION_KEY, VK_RIGHT, 0, 0, 0); return; } @@ -426,8 +428,8 @@ UIMacroDetectorWnd::UIMacroDetectorWnd() : UIFrameWnd(0), m_button(nullptr), m_imageData(nullptr), m_imageSize(0), m_imageReceived(0), unknown_00D0(0), totalDuration(0), startTick(0), messageDuration(0), m_lastAnswer(), message(), unknown_0110(0), messageTick(3000), m_image(nullptr), m_editCtrl(nullptr) { std::memset(this->m_captchaKey, 0, sizeof(this->m_captchaKey)); - g_windowMgr.CloseWindow(155); - g_windowMgr.CloseWindow(39); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); + g_windowMgr.CloseWindow(WID_CHOOSEWARPWND); } // OFFSET: 0x0099A060 // FUNCTION: fn_13537 diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index edbc09e10..39e71c26a 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -1,3 +1,5 @@ +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CGameMode.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMessage.h" @@ -362,8 +364,8 @@ bool CGameMode::IsOverWeight(bool notify) { if (g_session.m_weight * 100 / maxWeight >= 90) { if (notify) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(307)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(307)), 255, 0, 0, 0); } return true; @@ -377,7 +379,7 @@ bool CGameMode::IsOverWeight(bool notify) { __declspec(noinline) void CGameMode::CompleteUnknown0194(std::uint32_t id, const std::string& text) { auto it = this->unknown_0194.find(id); if (it != this->unknown_0194.end()) { - this->SendMsg(140, reinterpret_cast(text.c_str()), it->second, 0, 0); + this->SendMsg(MM_GUILD_MEMBER_STATUS_CHANGE, reinterpret_cast(text.c_str()), it->second, 0, 0); this->unknown_0194.erase(it); } } @@ -493,7 +495,7 @@ bool CGameMode::HasResurrectionItem() { // FUNCTION: fn_21287 void CGameMode::SendMousePointerState(int value) { if (this->mousePointer) { - this->mousePointer->SendMsg(nullptr, 2, 0, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->mousePointer->SendMsg(nullptr, AM_HIDEMOUSE, 0, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -569,11 +571,11 @@ float CGameMode::CameraDesiredYaw() { // OFFSET: 0x00CF06D0 // FUNCTION: fn_45499 int ConfirmGameModeActionB8() { - if (g_windowMgr.LookupWindow(0x271B)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xDDF)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xDDF)), 0xFF, 0, 0, 0); return 0; } - g_modeMgr.gameMode->SendMsg(0xB8, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND_HOMUN, 1, 0, 0, 0); return 0; } @@ -805,9 +807,9 @@ void CGameMode::SetFollowTicks(int updateTick, int lostTick) { // OFFSET: 0x00CF0AC0 // FUNCTION: fn_21421 bool CGameMode::IsMenuWindowOpen() const { - return g_windowMgr.LookupWindow(0x122) != nullptr || g_windowMgr.LookupWindow(0x12E) != nullptr - || g_windowMgr.LookupWindow(0x15C) != nullptr || g_windowMgr.LookupWindow(0x2716) != nullptr - || g_windowMgr.LookupWindow(0x169) != nullptr; + return g_windowMgr.LookupWindow(WID_LAPINEBOXWND) != nullptr || g_windowMgr.LookupWindow(WID_LAPINEUPGRADEBOXWND) != nullptr + || g_windowMgr.LookupWindow(WID_ITEMREFORMWND) != nullptr || g_windowMgr.LookupWindow(WID_ENCHANTUI) != nullptr + || g_windowMgr.LookupWindow(WID_RUNESYSTEMWND) != nullptr; } // OFFSET: 0x00CF0B30 @@ -817,8 +819,8 @@ bool CGameMode::ShowRestrictedNotice(int grade) { return false; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x31)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x31)), 255, 0, 0, 0); g_windowMgr.unknown_04DC.assign("", 0); return true; } @@ -847,7 +849,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i }; GetRagConnection().Send(g_packetLengths.FixedLength(packet[0]), packet); } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; case MM_DISCONNECT_CHARACTER: { const GameModePacketDword packet{0xCC, static_cast(argument1)}; @@ -942,7 +944,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x39: { + case MM_CLOSE_STORE: { const std::uint16_t packet = g_unknown_01738268 != 0 ? 0x9BE : 0x193; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; @@ -1001,7 +1003,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x50: { + case MM_REQ_CARTOFF: { const GameModePacketByte packet{0xB35, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1025,7 +1027,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x57: + case MM_WEAR_EQUIP_ARROW: if (!this->IsMenuWindowOpen() && *reinterpret_cast(&this->unknown_0100[4]) + 2000U <= timeGetTime() && this->unknown_0250 == 0) { @@ -1039,8 +1041,8 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; case MM_CLOSE_DIALOG: { this->unknown_024C = 0; - g_windowMgr.CloseWindow(0x10); - g_windowMgr.CloseWindow(0x11); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND); + g_windowMgr.CloseWindow(WID_CHOOSEWND); const GameModePacketDword packet{0x146, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1092,7 +1094,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x74: { + case MM_TESTPACKET: { const GameModePacketWord packet{0xF3, 2}; GetRagConnection().Send(4, &packet); return 0; @@ -1198,7 +1200,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } case MM_REQUEST_ACT: if (this->scene->player->unknown_02CC != 0 && (argument1 == 0 || argument1 == 7)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x75D)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x75D)), 0xFF, 0, 0, 0); } else { const GameModePacketDwordByte packet{ 0x437, static_cast(argument2), static_cast(argument1) @@ -1275,12 +1277,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x97: - this->SendMsg(0x75, this->unknown_02E0, 0, argument1, 0); + case MM_REQ_GIVE_MANNER_POINT_PLUS: + this->SendMsg(MM_REQ_GIVE_MANNER_POINT, this->unknown_02E0, 0, argument1, 0); g_session.DeleteProhibitionLog(this->unknown_02E0, argument1); return 0; - case 0x98: - this->SendMsg(0x75, this->unknown_02E0, 1, argument1, 0); + case MM_REQ_GIVE_MANNER_POINT_MINUS: + this->SendMsg(MM_REQ_GIVE_MANNER_POINT, this->unknown_02E0, 1, argument1, 0); g_session.AddProhibitionLog(this->unknown_02E0, argument1); return 0; case MM_ARROW_FROM_LIST: { @@ -1325,14 +1327,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x100: { + case MM_SKILL_SELECT_RESPONSE: { const GameModePacketDwordWord packet{ 0x443, static_cast(argument2), static_cast(argument1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xFD: { + case MM_OPEN_EQUIPEDITEM_CHANGE: { const GameModePacketDwordDword packet{0x2D8, 0, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1389,7 +1391,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i argument1, reinterpret_cast(argument2), reinterpret_cast(argument3), argument4 ); return 0; - case 0x108: { + case MM_PARTY_REQ_ACK_MASTER_TO_JOIN: { const GameModePacketDwordDwordByte packet{ 0xAF8, static_cast(argument1), static_cast(*reinterpret_cast(argument3)), @@ -1398,7 +1400,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x109: { + case MM_PARTY_REQ_MASTER_TO_JOIN: { const GameModePacketDwordDword packet{ 0xAE6, static_cast(*reinterpret_cast(argument2)), static_cast(*reinterpret_cast(argument1)) @@ -1406,13 +1408,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x105: - g_windowMgr.EnsureWindow(0xA8); + case MM_OPEN_SEEKPARTY_MEMBER: + g_windowMgr.EnsureWindow(WID_SEEKPARTYMBWND); return 0; - case 0x10D: - g_windowMgr.EnsureWindow(0xA9); + case MM_OPEN_SEEKPARTY_LIST: + g_windowMgr.EnsureWindow(WID_SEEKPARTYLISTWND); return 0; - case 0x103: { + case MM_GROUPINFO_CHANGE_V2: { const GameModePacketDwordByteByte packet{ 0x7D7, static_cast(argument1), static_cast(argument2), static_cast(argument3) @@ -1426,83 +1428,83 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x114: + case MM_PAUSE_REPLAY: this->UpdateReplayPause(true); Replay::Instance().SetState(7); return 0; - case 0x115: + case MM_RESUME_REPLAY: this->UpdateReplayPause(false); Replay::Instance().SetState(6); return 0; - case 0x117: + case MM_INCREASE_REPLAY_SPEED: Replay::Instance().IncreaseSpeed(); static_cast(g_modeMgr.GetGameMode())->UpdateReplayActionSpeeds(); return 0; - case 0x118: + case MM_DECREASE_REPLAY_SPEED: Replay::Instance().DecreaseSpeed(); static_cast(g_modeMgr.GetGameMode())->UpdateReplayActionSpeeds(); return 0; - case 0x116: + case MM_RESTART_REPLAY: g_loginStartMode = 0x19; Replay::Instance().SetState(6); g_modeMgr.Switch(0, "login.rsw"); return 0; - case 0x119: + case MM_EXIT_REPLAY: g_loginStartMode = 0x1A; Replay::Instance().SetState(6); g_modeMgr.Switch(0, "login.rsw"); return 0; - case 0x10E: { + case MM_REQ_CLOSE_BUYING_STORE: { const std::uint16_t packet = 0x815; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x11A: { + case MM_TRYCOLLECTION: { const GameModePacketDword packet{0x8B5, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x11F: { + case MM_REQ_RANKING: { const GameModePacketWord packet{0x97C, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x129: { + case MM_CANCEL_VENDING_MAKE: { const std::uint16_t packet = 0xA8C; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x12D: { + case MM_CLOSE_OFFLINE_STORE: { const GameModePacketDword packet{0xA80, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x132: { + case MM_MEMORIALDUNGEON_COMMAND: { const GameModePacketDword packet{0x2CF, 3}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x146: { + case MM_RESET_SKILL: { g_session.m_skillBundle.ResetFirstLevelChange(); const GameModePacketByte packet{0xBB1, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC2: { + case MM_OPEN_MAIL: { const GameModePacketByteInt64 packet{ 0x9EA, static_cast(argument2), static_cast(argument1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC4: { + case MM_DELETE_MAIL: { const GameModePacketByteInt64 packet{ 0x9F5, static_cast(argument2), static_cast(argument1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x148: { + case MM_CONFIG_CALL: { const GameModePacketDwordDword packet{ 0x2D8, 5, argument1 == 0 ? 0x3C00u : 0u }; @@ -1521,13 +1523,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB1: { + case MM_CHECK_ID: { GameModePacketPayload24 packet{0x213, {}}; std::memcpy(packet.payload, reinterpret_cast(argument1), sizeof(packet.payload)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB2: { + case MM_RC_ID: { GameModePacketPayload24 packet{0x212, {}}; std::memcpy(packet.payload, reinterpret_cast(argument1), sizeof(packet.payload)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -1538,7 +1540,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB8: { + case MM_COMMAND_HOMUN: { const GameModePacketByte packet{0x22D, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1588,44 +1590,44 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xCF: { + case MM_ITEM_FROM_LIST: { const GameModePacketDwordWord packet{ 0x25B, static_cast(argument1), static_cast(argument2) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x12B: { + case MM_CANCEL_BUYING_STORE_MAKE: { const std::uint16_t packet = 0xA94; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x136: { + case MM_REQ_OPEN_MSGBOX_EXTEND_BODYITEM_SIZE: { const std::uint16_t packet = 0xB14; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x137: { + case MM_REQ_EXTEND_BODYITEM_SIZE: { const std::uint16_t packet = 0xB16; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x138: { + case MM_CLOSE_MSGBOX_EXTEND_BODYITEM_SIZE: { const std::uint16_t packet = 0xB19; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x13E: { + case MM_OPEN_ACCOUNT_LIMITED_TOOL: { const std::uint16_t packet = 0xB4F; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x13F: { + case MM_CLOSE_ACCOUNT_LIMITED_TOOL: { const std::uint16_t packet = 0xB51; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x13A: + case MM_ADVANCED_STATUS_CHANGE: if (this->unknown_02D4 == 0 && this->unknown_0250 == 0) { this->unknown_02D4 = 1; const GameModePacketWordWord packet{ @@ -1634,13 +1636,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x13B: + case MM_REQ_MOVE_GUILD_AGIT: if (argument1 != 0) { const GameModePacketByte packet{0xB28, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x13C: + case MM_REQ_AGIT_INVESTMENT: if (argument1 != 0) { const GameModePacketByte packet{0xB2C, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -1651,21 +1653,21 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0xF5: + case MM_RELEASE_QUEST_SH: this->unknown_024C = 0; - g_windowMgr.CloseWindow(0x2B); - g_windowMgr.CloseWindow(0x2C); - g_windowMgr.CloseWindow(0x0C); - g_windowMgr.CloseWindow(0xB1); - g_windowMgr.CloseWindow(0xB2); - g_windowMgr.CloseWindow(0xB3); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMCOLLECTIONWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_2); return 0; case MM_REQ_HUNTING: { const std::uint16_t packet = 0x279; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x1A: + case MM_SETLOCKONMOUSE: this->unknown_0028 = argument1; if (argument1 == 0) { *reinterpret_cast(this->unknown_00EC) = 0; @@ -1697,12 +1699,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->drag.source = 0; this->drag.id = 0; this->drag.quantity = 0; - g_windowMgr.ShowWindowById(15, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 0); } return 0; case MM_QUERYRSWNAME: return reinterpret_cast(this->mapName); - case 0x21: + case MM_PLAYER_EMOTION_END: this->unknown_026E[0x16] = 0; return 0; case MM_ACK_SELL: @@ -1741,7 +1743,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x65: + case MM_INITWHISPERMENU: this->unknown_01FC = reinterpret_cast(argument1); this->actorMenuIds.clear(); this->actorMenuIds.push_back(0xB); @@ -1752,34 +1754,34 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_loginStartMode = 3; g_modeMgr.Switch(0, "login.rsw"); return 0; - case 0x123: { + case MM_NPC_TRADE_QUIT: { const std::uint16_t packet = 0x9D4; GetRagConnection().Send(2, &packet); return 0; } - case 0x124: { + case MM_NPC_MARKET_CLOSE: { const std::uint16_t packet = 0x9D8; GetRagConnection().Send(2, &packet); return 0; } - case 0x125: { + case MM_CANCEL_WRITE_RODEX: { const std::uint16_t packet = 0xA03; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); g_session.RestoreItems5C68(); g_session.ClearItemQuantities(); return 0; } - case 0x135: { + case MM_NPC_BARTER_MARKET_CLOSE: { const std::uint16_t packet = 0xB12; GetRagConnection().Send(2, &packet); return 0; } - case 0x142: { + case MM_NPC_EXPANDED_BARTER_MARKET_CLOSE: { const std::uint16_t packet = 0xB58; GetRagConnection().Send(2, &packet); return 0; } - case 0x143: + case MM_REQUEST_CASH_SHOP: if (IsNavigationActive()) { int value = argument1; if (value < 0 || value >= 0xB) { @@ -1791,14 +1793,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x14E: { + case MM_INVENTORY_TAB: { const GameModePacketBB packet{ 0x907, static_cast(argument1), static_cast(argument2 == 1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x14F: + case MM_MOVE_ITEM_TO_PERSONAL_FROM_STORAGE: if (!this->IsMenuWindowOpen()) { g_session.FlagItem1740(static_cast(argument1)); const GameModePacketDwordWordDword packet{ @@ -1809,10 +1811,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; case MM_ITEMTHROW_THROUGH_DROPCNTWND: - this->SendMsg(0x10, static_cast(this->drag.id), argument1, 0, 0); + this->SendMsg(MM_ITEMTHROW, static_cast(this->drag.id), argument1, 0, 0); return 0; - case 0x58: - this->SendMsg(0x80, 0, 0, 0, 0); + case MM_QUIT_GAME: + this->SendMsg(MM_REQ_DISCONNECT, 0, 0, 0, 0); return 0; case 0x24: case 0x55: @@ -1899,7 +1901,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i break; } if (j == this->unknown_0468 - 1) { - g_windowMgr.SendNotice(1, reinterpret_cast("TOO FAST CHATTING!"), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("TOO FAST CHATTING!"), 0x6E96FF, 0, 0, 0); this->RequestAdminStatus(); this->unknown_05A0 = 0; } @@ -1930,7 +1932,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_session.m_level >= *reinterpret_cast(g_session.unknown_7EE8)) || (g_session.IsSuperNovice2Job(g_session.GetDisplayJob()) && g_session.m_level >= *reinterpret_cast(g_session.unknown_7EF0))) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x7DF)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x7DF)), 0xFF, 0, 0, 0); break; } const std::uint16_t packet = 0x1ED; @@ -1996,9 +1998,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(size), packet); } g_session.ClearTradeItems(); - g_windowMgr.CloseWindow(0x19); - g_windowMgr.CloseWindow(0x16); - g_windowMgr.CloseWindow(0x18); + g_windowMgr.CloseWindow(WID_CHOOSESELLBUYWND); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); return 0; } case MM_ADDPARTYPOS: { @@ -2009,25 +2011,25 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->unknown_01B4[accountId].color = member.color; return 0; } - case 0x71: { + case MM_USING_SKILL: { if (g_replayAnimationScaling != 0) { return 0; } const auto* skill = reinterpret_cast(argument1); if (argument3 == 0 && this->scene->player->unknown_02CC != 0 && !g_session.IsHomunculusSkill(skill->id) && !g_session.IsMercenarySkill(skill->id)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 0, 0, 0); g_session.m_automaticSkills.Complete(skill->id); return 0; } - this->SendMsg(0x47, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_USE_SKILL, 0, 0, 0, 0); this->unknown_0418 = argument4 == -1; switch (skill->unknown_000C) { case 1: - this->SendMsg(0x48, 2, argument1, argument2, 0); + this->SendMsg(MM_HANG_USE_SKILL, 2, argument1, argument2, 0); return 0; case 2: - this->SendMsg(0x48, 1, argument1, argument2, 0); + this->SendMsg(MM_HANG_USE_SKILL, 1, argument1, argument2, 0); return 0; case 4: { std::uint32_t target; @@ -2037,18 +2039,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i const bool mercenary = g_session.IsMercenarySkill(skill->id) != 0; target = mercenary ? *reinterpret_cast(&g_session.unknown_5620[8]) : g_session.m_aid; } - this->SendMsg(0x45, skill->id, target, argument2, argument3); - this->SendMsg(0x48, 0, 0, 0, 0); + this->SendMsg(MM_USE_SKILL, skill->id, target, argument2, argument3); + this->SendMsg(MM_HANG_USE_SKILL, 0, 0, 0, 0); return 0; } case 8: - this->SendMsg(0x48, 3, argument1, argument2, 0); + this->SendMsg(MM_HANG_USE_SKILL, 3, argument1, argument2, 0); return 0; case 16: - this->SendMsg(0x48, 4, argument1, argument2, 0); + this->SendMsg(MM_HANG_USE_SKILL, 4, argument1, argument2, 0); return 0; case 32: - this->SendMsg(0x48, 5, argument1, argument2, 0); + this->SendMsg(MM_HANG_USE_SKILL, 5, argument1, argument2, 0); return 0; default: return 0; @@ -2065,7 +2067,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x11E: { + case MM_REQ_JOIN_GUILD2: { if (g_guildInfo.m_guildId == 0 || g_guildInfo.unknown_00AC == 0) { return 0; } @@ -2079,10 +2081,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i std::strncpy(reinterpret_cast(packet.payload), name, sizeof(packet.payload)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); const std::string notice = FormatOwnedString(LookupMessage(0x17E), name); - g_windowMgr.SendNotice(1, reinterpret_cast(notice.c_str()), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice.c_str()), 0xFFFF00, 0, 0, 0); return 0; } - case 0x134: { + case MM_NPC_BARTER_MARKET_PURCHASE: { unsigned char packet[0x800]{}; const int count = g_barterMarketItemMgr->GetAllItemCount(); const std::uint32_t size = 4U + static_cast(count) * 14U; @@ -2111,7 +2113,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->unknown_019C[static_cast(argument1)].second = argument3; return 0; case MM_ACK_EXCHANGE_ITEM: { - this->SendMsg(0x28, 0, 0, 0, 0); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); const GameModePacketByte packet{0xE6, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -2129,7 +2131,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); if (g_session.unknown_5464 != 0) { const std::string message = std::string(name) + LookupMessage(0x80B); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFFFF00, 0, 0, 0); } return 0; } @@ -2163,13 +2165,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(length, packet); return 0; } - case 0x8C: { + case MM_GUILD_MEMBER_STATUS_CHANGE: { if (!g_serviceOptions.Get(0xA5) || (argument2 != 0 && argument2 != 1)) { return 0; } char message[1024]; std::sprintf(message, LookupMessage(argument2 == 0 ? 0x1E6 : 0x1E5), argument1); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 4, 0, 0); return 0; } case MM_CONFORM_MAKEGROUP: { @@ -2186,7 +2188,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packetId), packet); return 0; } - case 0x111: { + case MM_REQ_TRADE_BUYING_STORE: { g_session.CopyItems1760To1770(); const int count = g_session.GetList10Size(); const std::uint32_t size = 12U + static_cast(count) * 8U; @@ -2217,7 +2219,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(length), packet); return 0; } - case 0x112: { + case MM_START_REPLAY_RECORDING: { Replay::Instance().ResetFile(); SYSTEMTIME time; GetLocalTime(&time); @@ -2249,7 +2251,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } char message[50]{}; std::sprintf(message, LookupMessage(0x7C6)); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x62B0FF, 0, 0, 0); Replay::Instance().SetState(2); { auto records = g_navigationManager.WriteReplayState(); @@ -2368,17 +2370,17 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } else { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, this->drag.id); if (item.unknown_0000[1] > 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6A0)), 0xFF, 0, 0, 0); } } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (this->drag.source == 1) { if (g_windowMgr.unknown_01D4 == nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x2B2)), 0xFF, 0, 0, 0); - this->SendMsg(0x12, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x2B2)), 0xFF, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (g_session.m_lockItemDrop) { @@ -2387,26 +2389,26 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } } if (this->drag.source == 0x1C) { - UIWindow* window = g_windowMgr.LookupWindow(0x127); + UIWindow* window = g_windowMgr.LookupWindow(WID_REFININGWND); if (window) { static_cast(window)->Reset(); } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (this->drag.source == 0x21) { - UIWindow* window = g_windowMgr.LookupWindow(0x157); + UIWindow* window = g_windowMgr.LookupWindow(WID_GRADEENCHANTWND); if (window) { static_cast(window)->ResetItem(); } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } - if (this->unknown_024C == 0 && !g_windowMgr.LookupWindow(0x271B) && + if (this->unknown_024C == 0 && !g_windowMgr.LookupWindow(WID_EXCHANGEUI) && !g_windowMgr.unknown_01E0 && !g_windowMgr.window_0288 && !g_windowMgr.unknown_0458 && - !g_windowMgr.LookupWindow(0x122) && !g_windowMgr.LookupWindow(0x12E) && - !g_windowMgr.LookupWindow(0x127) && !g_windowMgr.LookupWindow(0x128) && - !g_windowMgr.LookupWindow(0x14E) && !g_windowMgr.LookupWindow(0x157)) { + !g_windowMgr.LookupWindow(WID_LAPINEBOXWND) && !g_windowMgr.LookupWindow(WID_LAPINEUPGRADEBOXWND) && + !g_windowMgr.LookupWindow(WID_REFININGWND) && !g_windowMgr.LookupWindow(0x128) && + !g_windowMgr.LookupWindow(WID_BARTERMARKETWND) && !g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)) { if (this->drag.source != 1) { - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); g_windowMgr.RetireTransientWindow(); return 0; } @@ -2414,25 +2416,25 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } if (this->drag.quantity == 1) { - this->SendMsg(0x10, this->drag.id, 1, 0, 0); + this->SendMsg(MM_ITEMTHROW, this->drag.id, 1, 0, 0); } else { - g_windowMgr.ShowWindowById(0xF, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 0xD, 0, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 0, 0, 0, 0); } g_windowMgr.RetireTransientWindow(); return 0; } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); if (g_windowMgr.LookupWindow(0x128)) { return 0; } if (g_windowMgr.unknown_01E0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBD)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBD)), 0xFF, 0, 0, 0); } if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xAB0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAB0)), 0xFF, 0, 0, 0); } g_windowMgr.RetireTransientWindow(); return 0; @@ -2466,7 +2468,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (argument2 == 0) { g_session.unknown_54C4.clear(); } else { - g_windowMgr.EnsureWindow(0x22); + g_windowMgr.EnsureWindow(WID_MESSENGERGROUPWND); } const GameModePacketDwordByte packet{0x2C7, static_cast(argument1), static_cast(argument2 != 0)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -2518,8 +2520,8 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i int capacity = sizeof(name); item.GetIdDisplayName(name, capacity, 0); std::string text = FormatOwnedString(LookupMessage(0x24F), name); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); - g_windowMgr.SendNotice(0x13, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); return 0; } } @@ -2527,13 +2529,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x10B: { + case MM_CANCEL_ITEMLISTWIN: { const std::uint32_t packet[3] = {0x000C07E4, static_cast(argument1), 0}; GetRagConnection().Send(12, packet); g_session.ClearTradeItems(); return 0; } - case 0x12A: { + case MM_OPEN_BUYING_STORE_EXTENDED: { unsigned char packet[0x800]{}; const int count = g_session.GetList11Size(); const std::uint16_t packetId = 0xA92; @@ -2571,7 +2573,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; case MM_REQ_LEAVE_GROUP: { if (g_session.unknown_5948 == 1 || g_session.unknown_5948 == 2) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBD3)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBD3)), 0xFF, 0, 0, 0); } const int count = g_session.PartyCount(); if (g_session.unknown_5464 != 0) { @@ -2583,7 +2585,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (member.accountId != g_session.m_aid && member.offline == 0) { online = true; if (member.map == this->mapName) { - g_modeMgr.gameMode->SendMsg(0x104, member.accountId, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_GROUP_CHANGE_MASTER, member.accountId, 0, 0, 0); transferred = true; break; } @@ -2591,7 +2593,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } if (!transferred) { if (online) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xCC9)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xCC9)), 0xFF, 0, 0, 0); return 0; } if (g_windowMgr.Confirm(LookupMessage(0xCB9), 2, false, false, 0, "Message", 280, 120, 0) != 0xBB) { @@ -2603,20 +2605,20 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } } if (g_windowMgr.unknown_042C != nullptr) { - g_windowMgr.CloseWindow(0xD0); + g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND); } const std::uint16_t packet = 0x100; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } case MM_USE_SKILL: { - if (g_windowMgr.LookupWindow(0xC4) != nullptr) { + if (g_windowMgr.LookupWindow(WID_COLLECTIONSYSTEMWND) != nullptr) { g_session.m_automaticSkills.Complete(argument1); return 0; } if (argument4 == 0 && this->scene->player->unknown_02CC != 0 && !g_session.IsHomunculusSkill(argument1) && !g_session.IsMercenarySkill(argument1)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 11, 0, 0); g_session.m_automaticSkills.Complete(argument1); return 0; } @@ -2632,7 +2634,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (actor != nullptr && actor->unknown_0314 == 0) { return 0; } - g_windowMgr.EnsureWindow(0x5B)->SendMsg(nullptr, 0x50, 0, argument2, 0, 0); + g_windowMgr.EnsureWindow(WID_PETTAMINGDECEIVEWND)->SendMsg(nullptr, UM_SET_TARGET, 0, argument2, 0, 0); return 0; } if (argument1 == 20000) { @@ -2643,14 +2645,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (argument1 == 20001) { char message[260]; std::sprintf(message, "[ (val1 == 20001) ]"); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x6E96FF, 0, 0, 0); const GameModePacketDword packet{0x1F9, static_cast(argument2)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } if (argument1 == 40000) { if (static_cast(argument2) != g_session.unknown_1010) { - g_windowMgr.EnsureWindow(0xC4)->SendMsg(nullptr, 0x50, 0, argument2, 0, 0); + g_windowMgr.EnsureWindow(WID_COLLECTIONSYSTEMWND)->SendMsg(nullptr, UM_SET_TARGET, 0, argument2, 0, 0); } return 0; } @@ -2661,7 +2663,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i char message[260]; const char* name = CSkillInfo::DisplayName(*g_session.m_hotkeyScript, argument1); std::sprintf(message, LookupMessage(0x5B4), name); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFF, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFF, 11, 0, 0); g_session.m_automaticSkills.Complete(argument1); return 0; } @@ -2683,17 +2685,17 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (*reinterpret_cast(g_session.unknown_5570) < (argument1 == 154 ? 40 : 30)) { char message[256]; std::sprintf(message, LookupMessage(0xCA)); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFF, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFF, 11, 0, 0); return 0; } if (g_session.unknown_5C1C <= 0) { char message[256]; std::sprintf(message, LookupMessage(0x294)); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFF, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFF, 11, 0, 0); return 0; } if (argument1 == 154) { - g_windowMgr.EnsureWindow(0x5F); + g_windowMgr.EnsureWindow(WID_SELECTCARTWND); } } const std::uint16_t id = static_cast(argument1); @@ -2734,7 +2736,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->unknown_01BC[static_cast(argument1)].y = argument3; this->unknown_01BC[static_cast(argument1)].color = 0xFFFFA6D2; return 0; - case 0x106: { + case MM_NPC_MARKET_PURCHASE: { unsigned char packet[2048]{}; const int count = g_session.GetList2Size(); const std::uint32_t length = 4U + static_cast(count) * 8U; @@ -2755,21 +2757,21 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (this->unknown_0250 == 0) { GetRagConnection().Send(static_cast(packetLength), packet); } - g_windowMgr.LookupWindow(0xFF)->Show(0); - g_windowMgr.CloseWindow(0xC); + g_windowMgr.LookupWindow(WID_PARAITEMPURCHASEWND)->Show(0); + g_windowMgr.CloseWindow(WID_ITEMCOLLECTIONWND); } else { - g_windowMgr.CloseWindow(0xFF); - g_modeMgr.gameMode->SendMsg(0x28, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_PARAITEMPURCHASEWND); + g_modeMgr.gameMode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); } g_session.ClearTradeItems(); - g_windowMgr.CloseWindow(0xFE); + g_windowMgr.CloseWindow(WID_PARAITEMSHOPWND); return 0; } - case 0x130: { + case MM_SWAP_EQUIPMENT: { if (timeGetTime() - g_swapEquipmentTick < 10000U) { const char* suffix = LookupMessage(0xC9E); const std::string message = FormatOwnedString("%d%s", 10U - (timeGetTime() - g_swapEquipmentTick) / 1000U, suffix); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xC8FF00, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xC8FF00, 7, 0, 0); return 0; } g_swapEquipmentTick = timeGetTime(); @@ -2777,7 +2779,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x14B: { + case MM_STOVE_AUTHENTICATION: { if (g_stoveMgr->unknown_0008 != 0) { return 0; } @@ -2793,8 +2795,8 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MM_TAKE_OFF_EQUIP: { - if (g_windowMgr.LookupWindow(0x271B) != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI) != nullptr) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); return 0; } if (this->IsMenuWindowOpen() || @@ -2846,7 +2848,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MM_HANG_USE_SKILL: { - if (g_windowMgr.LookupWindow(0xC4) != nullptr || g_windowMgr.unknown_0304 != nullptr) { + if (g_windowMgr.LookupWindow(WID_COLLECTIONSYSTEMWND) != nullptr || g_windowMgr.unknown_0304 != nullptr) { return 0; } this->unknown_0408 = reinterpret_cast(argument1); @@ -2903,7 +2905,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i std::strcat(text, " !! "); std::strcat(text, LookupMessage(0x2F7)); const int address = reinterpret_cast(text); - actor->SendMsg(nullptr, 7, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; } if (argument1 == WE_CALLPARTNER) { @@ -2915,7 +2917,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i std::strcat(text, " !! "); std::strcat(text, skillName); const int address = reinterpret_cast(text); - actor->SendMsg(nullptr, 7, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; } if (argument1 == DC_SCREAM || argument1 == BA_FROSTJOKER || argument1 == ITEM_ENCHANTARMS || @@ -2925,7 +2927,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i std::strcpy(skillName, CSkillInfo::DisplayName(*g_session.m_hotkeyScript, argument1)); std::strcat(skillName, " !!"); const int address = reinterpret_cast(skillName); - actor->SendMsg(nullptr, 7, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; } case MM_REQ_CHANGE_MEMBERPOS: { @@ -2955,7 +2957,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC3: { + case MM_ADD_MAIL_ITEM: { if (static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen()) { return 0; } @@ -2966,7 +2968,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x10C: { + case MM_OPEN_WRITE_RODEX: { GameModePacketPayload24 packet{0xA08, {}}; if (argument1 != 0) { const std::string text(reinterpret_cast(argument1)); @@ -2980,15 +2982,15 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MM_WEAR_EQUIP: { - if (g_windowMgr.LookupWindow(0x271B) != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 255, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI) != nullptr) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6A3)), 255, 0, 0, 0); return 0; } if (this->IsMenuWindowOpen()) { return 0; } if (g_windowMgr.window_4F260 != nullptr || g_windowMgr.window_4F268 != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xE68)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE68)), 255, 0, 0, 0); return 0; } if (*reinterpret_cast(&this->unknown_0100[4]) + 2000U > timeGetTime() || this->unknown_0250 != 0) { @@ -2997,7 +2999,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i const EquipSlots slots = g_session.GetEquipSlots(argument2); const ITEM_INFO equipped = g_session.GetItem17F0(slots.values[2]); if (equipped.unknown_005D != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x2BB)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x2BB)), 255, 0, 0, 0); return 0; } if (equipped.unknown_0000[1] > 0 && equipped.quantity == 1) { @@ -3005,9 +3007,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } const ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(argument1)); if (item.unknown_0064 == 1) { - UIWindow* window = g_windowMgr.EnsureWindow(0x8A); + UIWindow* window = g_windowMgr.EnsureWindow(WID_YOURITEMWND); *reinterpret_cast(&this->unknown_0100[4]) = timeGetTime(); - window->SendMsg(nullptr, 0x5B, argument1, argument2, 0, 0); + window->SendMsg(nullptr, UM_SET_BABY_MSG, argument1, argument2, 0, 0); } else { *reinterpret_cast(&this->unknown_0100[4]) = timeGetTime(); const GameModePacketWordDword packet{0x998, static_cast(argument1), static_cast(argument2)}; @@ -3020,11 +3022,11 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } if (g_serviceType == 6 && g_windowMgr.unknown_0284 != nullptr) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x48)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x48)), 255, 0, 0, 0); return 0; } - this->SendMsg(0x28, 0, 0, 0, 0); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); const std::string name = this->ActorName(argument1); if (!name.empty()) { @@ -3050,7 +3052,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x107: { + case MM_NPC_MARKET_PURCHASE_V2: { unsigned char packet[0x800]{}; const int count = g_session.GetList2Size(); const std::uint32_t length = static_cast(count) * 10U + 4U; @@ -3072,21 +3074,21 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (this->unknown_0250 == 0) { GetRagConnection().Send(static_cast(length), packet); } - if (UIWindow* window = g_windowMgr.LookupWindow(0xFF)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_PARAITEMPURCHASEWND)) { window->Show(0); } - g_windowMgr.CloseWindow(0xC); + g_windowMgr.CloseWindow(WID_ITEMCOLLECTIONWND); } else { - g_windowMgr.CloseWindow(0xFF); + g_windowMgr.CloseWindow(WID_PARAITEMPURCHASEWND); if (g_modeMgr.gameMode != nullptr) { - g_modeMgr.gameMode->SendMsg(0x28, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); } } g_session.ClearTradeItems(); - g_windowMgr.CloseWindow(0xFE); + g_windowMgr.CloseWindow(WID_PARAITEMSHOPWND); return 0; } - case 0x110: { + case MM_REQ_CLICK_TO_BUYING_STORE: { if ((this->scene != nullptr && this->scene->player != nullptr && this->scene->player->render.unknown_0070 == 3) || static_cast(argument1) == g_session.m_aid || g_windowMgr.unknown_0418 != nullptr) { return 0; @@ -3100,7 +3102,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x13D: { + case MM_PRISON_USER: { if (!IsAdminAccount(g_session.m_aid) && !IsMonsterJob(g_session.m_aid)) { return 0; } @@ -3116,7 +3118,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet[0]), packet); return 0; } - case 0x14A: { + case MM_CHAT_ALLY: { if (std::strlen(g_windowMgr.unknown_04DC.c_str()) == 0 || g_guildInfo.m_guildId == 0 || g_session.IsBerserkActive() == 1) { return 0; } @@ -3218,36 +3220,36 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.ClearUnknown04DC(); return 0; } - case 0x28: + case MM_RELEASE_QUEST: this->unknown_024C = 0; if (argument1 == 0 && g_windowMgr.unknown_01F8 != nullptr) { - g_windowMgr.unknown_01F8->SendMsg(nullptr, 0xA6, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0x11); + g_windowMgr.unknown_01F8->SendMsg(nullptr, UM_CANCEL_NPC_CHOICE, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWND); } if (g_windowMgr.unknown_01F0 != nullptr) { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x59, 0, 0, 0, 0); + mode->SendMsg(MM_CLOSE_DIALOG, 0, 0, 0, 0); } } - g_windowMgr.CloseWindow(0x19); - g_windowMgr.CloseWindow(0x16); - g_windowMgr.CloseWindow(0x17); - g_windowMgr.CloseWindow(0x18); - g_windowMgr.CloseWindow(0x2B); - g_windowMgr.CloseWindow(0x2C); - g_windowMgr.CloseWindow(0xC); - g_windowMgr.CloseWindow(0x32); - g_windowMgr.CloseWindow(0xB1); - g_windowMgr.CloseWindow(0xB2); - g_windowMgr.CloseWindow(0xB3); - g_windowMgr.CloseWindow(0xFE); - g_windowMgr.CloseWindow(0x100); - g_windowMgr.CloseWindow(0xFF); - g_windowMgr.CloseWindow(0x14E); - g_windowMgr.CloseWindow(0x14F); - g_windowMgr.CloseWindow(0x155); - g_windowMgr.CloseWindow(0x156); - this->SendMsg(0x64, reinterpret_cast(""), -1, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSESELLBUYWND); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMCOLLECTIONWND); + g_windowMgr.CloseWindow(WID_ITEMPARAMCHANGEDISPLAYWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_2); + g_windowMgr.CloseWindow(WID_PARAITEMSHOPWND); + g_windowMgr.CloseWindow(WID_PARARESULTWND); + g_windowMgr.CloseWindow(WID_PARAITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_BARTERMARKETWND); + g_windowMgr.CloseWindow(WID_BARTERITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_EXPANDEDBARTERMARKETWND); + g_windowMgr.CloseWindow(WID_EXPANDEDBARTERITEMPURCHASEWND); + this->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(""), -1, 0, 0); return 0; case MM_CREATE_CHATROOM: { const ChatRoomSetting& setting = *reinterpret_cast(argument1); @@ -3300,7 +3302,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } case MM_JOIN_FRIEND: { if (argument3 != 0) { - g_windowMgr.EnsureWindow(0x22)->SendMsg(nullptr, 6, 0xD7, 1, 0, 0); + g_windowMgr.EnsureWindow(WID_MESSENGERGROUPWND)->SendMsg(nullptr, UM_COMMAND, ID_RADIOBTN, 1, 0, 0); } const GameModePacketDwordDwordDword packet{ 0x208, static_cast(argument1), static_cast(argument2), @@ -3309,7 +3311,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xBD: { + case MM_HOMUN_WAIT: { CGameActor* actor = static_cast(this->scene->GetGameActorByAID( *reinterpret_cast(&g_session.unknown_5570[8]))); if (actor != nullptr && actor->HasUnknown030CEntry()) { @@ -3349,7 +3351,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_session.ClearTradeItems(); return 0; } - case 0x141: { + case MM_NPC_EXPANDED_BARTER_MARKET_PURCHASE: { unsigned char packet[0x800] = {}; const int count = g_expandedBarterMarketItemMgr->GetEntryCount(); const std::uint32_t length = static_cast(count) * 12U + 4U; @@ -3374,8 +3376,8 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MM_USEITEM: { - if (g_windowMgr.LookupWindow(0x271B)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); return 0; } if (this->IsMenuWindowOpen() || this->unknown_02CC != 0 || *reinterpret_cast(this->unknown_02D0) != 0 || argument1 == 0 || this->unknown_0250 != 0) { @@ -3390,7 +3392,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (this->scene->player->render.unknown_0070 == 6 && (item.GetItemId() == 0x259 || item.GetItemId() == 0x25A || item.GetItemId() == 0x263 || item.GetItemId() == 0x25D || item.GetItemId() == 0x25E || item.GetItemId() == 0x5813)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x297)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x297)), 0xFF, 0, 0, 0); return 0; } if (Singleton::GetInstance()->OpenItem(argument1)) { @@ -3398,46 +3400,46 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } if (item.GetItemId() == 0x19295) { if (g_session.IsPlayerPerformerJob(g_session.m_job)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1022)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1022)), 0xFF, 0, 0, 0); return 0; } if (this->scene->player->unknown_02CC != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1070)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1070)), 0xFF, 0, 0, 0); return 0; } const unsigned baseJob = JobNames::BaseJob(g_session.GetDisplayJob()); if (g_session.GetDisplayJob() != baseJob) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1070)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1070)), 0xFF, 0, 0, 0); return 0; } if (this->scene->player->GetGdid() > 0 || g_session.PartyCount() > 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1023)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1023)), 0xFF, 0, 0, 0); return 0; } if (g_session.unknown_8128[4] != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1024)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1024)), 0xFF, 0, 0, 0); return 0; } for (const ActiveSkillEffect& effect : g_activeSkillEffects) { if (effect.id == 0x26D) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1025)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1025)), 0xFF, 0, 0, 0); return 0; } } if (g_windowMgr.Confirm(LookupMessage(0x1026), 2, false, false, 0, "Message", 280, 120, 0) != 0xBB) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1028)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1028)), 0xFF, 0, 0, 0); return 0; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1027)), 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1027)), 0, 0, 0, 0); } this->unknown_02CC = 1; const GameModePacketWordDword packet{0x439, static_cast(argument1), g_session.m_aid}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x3A: { + case MM_MAKE_GROUP: { if (g_session.unknown_5460 != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x56B)), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x56B)), 0x6E96FF, 0, 0, 0); return 0; } if (g_session.PartyCount() != 0) { @@ -3452,8 +3454,8 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.Confirm(LookupMessage(0x213), 0, true, false, 0, "Message", 280, 120, 0); return 0; } - g_windowMgr.CloseWindow(0x35); - g_windowMgr.EnsureWindow(0x35); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); + g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_PARTYCOUNT); g_session.unknown_54AC = name; return 0; } @@ -3481,14 +3483,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i char text[1024]; const char* skillName = CSkillInfo::DisplayName(*g_session.m_hotkeyScript, packet[2]); std::sprintf(text, LookupMessage(0x5B4), skillName); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 11, 0, 0); return 0; } char* text = reinterpret_cast(packet + 5); _snprintf_s(text, 21, _TRUNCATE, "%s", reinterpret_cast(request[4])); if (g_forbiddenWords.Contains(text)) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x32)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x32)), 0xFF, 0, 0, 0); return 0; } if (packet[1] == 0) { @@ -3531,7 +3533,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(packet[1], packet); return 0; } - case 0x126: { + case MM_REMOVE_RODEX_ITEM: { if (static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen()) { return 0; } @@ -3539,12 +3541,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x131: { + case MM_SWAP_EQUIPMENT_BY_INDEX: { if (timeGetTime() - g_swapEquipmentTick < 10000U) { const char* suffix = LookupMessage(0xC9E); const unsigned remaining = 10U - (timeGetTime() - g_swapEquipmentTick) / 1000U; const std::string text = FormatOwnedString("%d%s", remaining, suffix); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xC8FF00, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xC8FF00, 7, 0, 0); return 0; } const auto* request = reinterpret_cast(argument1); @@ -3574,14 +3576,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet[0]), packet); return 0; } - case 0x149: { + case MM_CASH_EMOTION: { CCashEmotionAction_Play action; action.ExecuteNamed(reinterpret_cast(argument1)); return 0; } case MM_MENUSELECTED: { if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_windowMgr.window_0288 || static_cast(argument1) >= this->actorMenuIds.size()) { return 0; @@ -3590,9 +3592,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i switch (action) { case MENUID_DEAL: if (this->unknown_024C == 1 || g_windowMgr.unknown_01F0 || g_windowMgr.unknown_01F8 || g_windowMgr.unknown_01F4) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x783)), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x783)), 0xFFFFFF, 0, 0, 0); } else if (static_cast(g_modeMgr.GetGameMode())->scene->player->GetStateFlags() != 2) { - this->SendMsg(0x31, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_REQ_EXCHANGE_ITEM, this->unknown_02E0, 0, 0, 0); } return 0; case MENUID_INVITE_IN_PARTY: @@ -3621,7 +3623,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (auto* actor = dynamic_cast(this->scene->GetGameActorByAID(this->unknown_02E0))) { code = ShortcutFilename(actor->GetPkState()); } - g_windowMgr.SendNotice(0xE, reinterpret_cast(name.c_str()), reinterpret_cast(category), + g_windowMgr.SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(name.c_str()), reinterpret_cast(category), reinterpret_cast(code.c_str()), 0, 0); return 0; } @@ -3629,7 +3631,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.RequestAddFriend(this->unknown_01FC.c_str()); return 0; case MENUID_INVITE_IN_GUILD: - this->SendMsg(0x73, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_REQ_JOIN_GUILD, this->unknown_02E0, 0, 0, 0); return 0; case 23: case 24: { @@ -3641,24 +3643,24 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i const int y = ScaleByScreenHeight(200); window->Move(UIWindowMgr::CenterOnViewportX(200), y); g_windowMgr.AddRendered(window); - window->SendMsg(nullptr, 0x50, action == 23 ? 0x97 : 0x98, 0, 0, 0); - window->SendMsg(nullptr, 0x1D, reinterpret_cast(LookupMessage(action == 23 ? 0x185 : 0x186)), 0, 0, 0); - window->SendMsg(nullptr, 0x51, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, action == 23 ? 0x97 : 0x98, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(action == 23 ? 0x185 : 0x186)), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_COUNT, 1, 0, 0, 0); return 0; } case MENUID_ALLY_GUILD: - this->SendMsg(0x77, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_REQ_ALLY_GUILD, this->unknown_02E0, 0, 0, 0); return 0; case MENUID_HOSTILE_GUILD: - this->SendMsg(0x7D, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_REQ_HOSTILE_GUILD, this->unknown_02E0, 0, 0, 0); return 0; case MENUID_DISCONNECT_CHARACTER: - this->SendMsg(0xE, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_DISCONNECT_CHARACTER, this->unknown_02E0, 0, 0, 0); return 0; case MENUID_PET_FEEDING: case MENUID_HOMUN_FEEDING: { if (action == 29 && g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBA9)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBA9)), 0xFF, 0, 0, 0); return 0; } auto* window = new UINormalMB; @@ -3670,12 +3672,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i case MENUID_PET_PERFORMANCE: case MENUID_PET_RETURN_EGG: case MENUID_PET_ACC_OFF: - this->SendMsg(0x96, action - 28, 0, 0, 0); + this->SendMsg(MM_COMMAND_PET, action - 28, 0, 0, 0); return 0; case MENUID_PET_SHOWINFO: - this->SendMsg(0x96, 0, 0, 0, 0); - if (!g_windowMgr.CloseWindow(0x58)) { - g_windowMgr.EnsureWindow(0x58); + this->SendMsg(MM_COMMAND_PET, 0, 0, 0, 0); + if (!g_windowMgr.CloseWindow(WID_PETINFOWND)) { + g_windowMgr.EnsureWindow(WID_PETINFOWND); } return 0; case MENUID_COPY_GID: { @@ -3687,15 +3689,15 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MENUID_SHOW_CHAT_PROHIBIT_LOG: - g_windowMgr.EnsureWindow(0x67)->SendMsg(nullptr, 0x22, this->unknown_02E0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_PROHIBITLISTWND)->SendMsg(nullptr, UM_SETINFO, this->unknown_02E0, 0, 0, 0); return 0; case MENUID_INVITE_IN_BABY: - this->SendMsg(0xB3, this->unknown_02E0, 0, 0, 0); + this->SendMsg(MM_REQ_JOIN_BABY, this->unknown_02E0, 0, 0, 0); return 0; case MENUID_HOMUN_SHOWINFO: - this->SendMsg(0xB8, 0, 0, 0, 0); - if (!g_windowMgr.CloseWindow(0x71)) { - g_windowMgr.EnsureWindow(0x71); + this->SendMsg(MM_COMMAND_HOMUN, 0, 0, 0, 0); + if (!g_windowMgr.CloseWindow(WID_HOMUNINFOWND)) { + g_windowMgr.EnsureWindow(WID_HOMUNINFOWND); } return 0; case MENUID_HOMUN_FOLLOW: { @@ -3709,9 +3711,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } case MENUID_MER_SHOWINFO: - this->SendMsg(0xBA, 1, 0, 0, 0); - if (!g_windowMgr.CloseWindow(0x7D)) { - g_windowMgr.EnsureWindow(0x7D); + this->SendMsg(MM_COMMAND_MER, 1, 0, 0, 0); + if (!g_windowMgr.CloseWindow(WID_MERINFOWND)) { + g_windowMgr.EnsureWindow(WID_MERINFOWND); } return 0; case MENUID_MER_FOLLOW: { @@ -3749,13 +3751,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i EmptyClipboard(); SetClipboardData(1, memory); CloseClipboard(); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("C-Code copied to clipboard"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("C-Code copied to clipboard"), 0x64FFFF, 0, 0, 0); } return 0; } case 63: - g_windowMgr.EnsureWindow(0x2715); + g_windowMgr.EnsureWindow(WID_MACROREPORT); return 0; default: return 0; @@ -3769,11 +3771,11 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i const bool doram = g_session.IsDoramJob(g_session.GetDisplayJob()); const CSkillInfo* skill = g_session.m_skillBundle.Find(doram ? 0x139A : 1); if (!skill || skill->level <= (doram ? 0 : 1)) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_USE_FAIL_SKILL_LEVEL")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_USE_FAIL_SKILL_LEVEL")), 0xFF, 0, 0, 0); return 0; } if (g_cashEmotionMgr->BasePackId() != argument2 && !g_cashEmotionMgr->IsOwnedPack(argument2)) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNPURCHASED")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNPURCHASED")), 0xFF, 0, 0, 0); return 0; } if (!g_cashEmotionMgr->GetEmotionData(argument2, argument1)) { @@ -3847,12 +3849,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i if (std::strstr(text, "NO MSG")) { std::sprintf(text, "Can NOT use space in Guild Name !!"); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); return 0; } if (g_forbiddenWords.Contains(name)) { StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(0xD07)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); return 0; } if (g_serviceType == 12 && std::strchr(name, 0x2323)) { @@ -3865,7 +3867,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } if (static_cast(g_modeMgr.GetGameMode())->scene->player->unknown_0305 == 1) { std::sprintf(text, LookupMessage(0xA2D)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); return 0; } GameModePacketDwordPayload24 packet; @@ -3883,9 +3885,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x12F: { + case MM_TAKE_OFF_SWAP_EQUIP: { int message = 0; - if (g_windowMgr.LookupWindow(0x271B)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { message = 0xBB9; } else if (this->unknown_0250) { message = 0xBB7; @@ -3897,7 +3899,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i message = 0xBBB; } if (message) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); return 0; } ITEM_INFO item(0); @@ -3908,12 +3910,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x140: { + case MM_GET_ACCOUNT_LIMITED_SALE_LIST: { auto& tick = *reinterpret_cast(&g_session.unknown_807C[0x18]); if (timeGetTime() - tick < 5000U) { const char* message = LookupMessage(0xC9E); const std::string text = FormatOwnedString("%d%s", 5U - (timeGetTime() - tick) / 1000U, message); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xC8FF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xC8FF00, 0, 0, 0); return 0; } tick = timeGetTime(); @@ -3921,9 +3923,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x145: { + case MM_USE_PACKAGEITEM: { int message = 0; - if (g_windowMgr.LookupWindow(0x271B)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { message = 0x6A3; } else if (this->IsMenuWindowOpen() || this->unknown_02CC || *reinterpret_cast(this->unknown_02D0)) { message = 0xF84; @@ -3933,18 +3935,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i message = 0xF83; } if (message) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); return 0; } const ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, argument1); if (this->scene->player->bodyState == 4 || this->scene->player->bodyState == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF82)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF82)), 0xFF, 0, 0, 0); return 0; } if (this->scene->player->render.unknown_0070 == 6) { const int itemId = item.GetItemId(); if (itemId == 0x259 || itemId == 0x25A || itemId == 0x263 || itemId == 0x25D || itemId == 0x25E || itemId == 0x5813) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x297)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x297)), 0xFF, 0, 0, 0); return 0; } } @@ -3956,18 +3958,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i *reinterpret_cast(packet + 8) = static_cast(argument2); *reinterpret_cast(packet + 12) = static_cast(argument3); GetRagConnection().Send(g_packetLengths.FixedLength(0xBAF), packet); - g_windowMgr.CloseWindow(0x2731); + g_windowMgr.CloseWindow(WID_SELECTPACKAGEITEMBOX); return 0; } case MM_ADD_EXCHANGE_ITEM: { if (g_session.HasExchangeItem(static_cast(argument1))) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x33)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x33)), 0xFF, 0, 0, 0); return 0; } if (g_session.IsExchangeItemListFull() && argument1 != 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x129)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x129)), 0xFF, 0, 0, 0); return 0; } if (*reinterpret_cast(this->unknown_0100) != 0) { @@ -4024,7 +4026,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC0: { + case MM_SEND_MAIL: { const auto& request = *reinterpret_cast(argument1); if (g_forbiddenWords.Contains(request.title.c_str()) || g_forbiddenWords.Contains(request.body.c_str())) { g_windowMgr.Confirm(LookupMessage(0xBD4), 0, true, false, 0, "Message", 0x118, 0x78, 0); @@ -4050,10 +4052,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i const std::int16_t length = static_cast(packet.size()); std::memcpy(packet.data() + 2, &length, sizeof(length)); GetRagConnection().Send(length, packet.data()); - g_windowMgr.CloseWindow(0x108); + g_windowMgr.CloseWindow(WID_RODEXCOMPOSEWND); return 0; } - case 0x113: { + case MM_STOP_REPLAY_RECORDING: { if (Replay::Instance().state == 2) { Replay::Instance().SetState(1); Replay::Instance().UpdateDuration(); @@ -4067,10 +4069,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i text += ReplayFileList::Instance().path; text += LookupMessage(0x7C7); std::sprintf(notice, "%s", text.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(notice), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice), 0x62B0FF, 0, 0, 0); return 0; } - case 0x121: { + case MM_CHAT_CLAN: { if (std::strlen(g_windowMgr.unknown_04DC.c_str()) == 0 || !g_clanInfo->m_hasClan || g_session.IsBerserkActive() == 1) { return 0; } @@ -4109,28 +4111,28 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(length), packet); return 0; } - case 0x12E: { + case MM_WEAR_SWAP_EQUIP: { if (this->IsMenuWindowOpen()) { return 0; } - if (g_windowMgr.LookupWindow(0x271B) != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB9)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI) != nullptr) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB9)), 0xFF, 0, 0, 0); return 0; } if (this->unknown_0250 != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB7)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB7)), 0xFF, 0, 0, 0); return 0; } if (g_windowMgr.unknown_0304 != nullptr || g_windowMgr.unknown_0308 != nullptr || g_windowMgr.unknown_02FC != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBBA)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBBA)), 0xFF, 0, 0, 0); return 0; } if (static_cast(g_modeMgr.GetGameMode())->scene->player->unknown_0264[3] != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB8)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB8)), 0xFF, 0, 0, 0); return 0; } if (g_windowMgr.unknown_01F0 != nullptr || g_windowMgr.unknown_01F8 != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBBB)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBBB)), 0xFF, 0, 0, 0); return 0; } ITEM_INFO item = g_session.FindItemByIdentity(static_cast(argument1), argument2); @@ -4162,7 +4164,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x14D: { + case MM_MOVE_ITEM_TO_PERSONAL: { g_session.FlagItem1738(static_cast(argument1)); const GameModePacketDwordWordDword packet{ 0xC22, g_unknown_01738268 != 0 ? 1U : 0U, static_cast(argument1), static_cast(argument2) @@ -4190,9 +4192,9 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(length), packet); } g_session.ClearTradeItems(); - g_windowMgr.CloseWindow(0x19); - g_windowMgr.CloseWindow(0x16); - g_windowMgr.CloseWindow(0x17); + g_windowMgr.CloseWindow(WID_CHOOSESELLBUYWND); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); return 0; } case MM_CHANGE_CHATROOM: { @@ -4271,7 +4273,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0xA5: { + case MM_SONG_TALK: { CFile file; const char* path = nullptr; if (argument1 == 0) { @@ -4326,7 +4328,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x10A: { + case MM_ITEMLISTWIN_RES: { const int count = g_session.GetList4Size(); const std::uint32_t length = 12U + static_cast(count) * 4U; if (length > 0x800) { @@ -4353,13 +4355,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } case MM_WHISPER_FILTER: if (g_session.unknown_5460 != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x56B)), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x56B)), 0x6E96FF, 0, 0, 0); } else if (g_session.PartyCount() == 0) { - g_windowMgr.CloseWindow(0xCF); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_HEIGHT_220); g_session.unknown_54AC = reinterpret_cast(argument1); } return 0; - case 0x144: { + case MM_REFRESH_PLAYERGAGE: { if (this->itemWindow == nullptr) { return 0; } @@ -4393,7 +4395,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->unknown_0248 = timeGetTime(); GetRagConnection().Close(); if (g_windowMgr.Confirm(LookupMessage(2), 0, true, true, 0, "Message", 280, 120, 0) != 0x10D) { - this->SendMsg(0x8D, 0, 0, 0, 0); + this->SendMsg(MM_QUIT_TO_IDENTRY, 0, 0, 0, 0); } return 0; case MM_BROADCASTMSG: { @@ -4428,7 +4430,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } case MM_CONTACTNPC: { if (this->scene->player != nullptr) { - this->scene->player->SendMsg(nullptr, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_FREEZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } const auto* request = reinterpret_cast(argument1); if (request[1] == 0x2D) { @@ -4444,7 +4446,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } case MM_USE_SKILL_TOGROUND: { if (this->scene->player->unknown_02CC != 0 && !g_session.IsHomunculusSkill(argument1) && !g_session.IsMercenarySkill(argument1)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x75E)), 0xFF, 0, 0, 0); return 0; } if (this->IsMenuWindowOpen()) { @@ -4459,7 +4461,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i char message[0x800]; const char* name = CSkillInfo::DisplayName(*g_session.m_hotkeyScript, skill); std::sprintf(message, LookupMessage(0x5B4), name); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFF, 0xB, 0, 0); return 0; } if (level == 0) { @@ -4519,7 +4521,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(header[1], packet); return 0; } - case 0x10F: { + case MM_REQ_OPEN_BUYING_STORE: { const int count = g_session.GetList11Size(); unsigned char packet[0x800]; const std::uint16_t header[] = {0x811, static_cast(0x59 + count * 10)}; @@ -4553,7 +4555,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(header[1]), packet); return 0; } - case 0x128: { + case MM_OFFLINE_STORE_CREATE: { unsigned char packet[0x800] = {}; const int count = g_session.GetList11Size(); const std::uint16_t header[] = {0xA7F, static_cast(0x58 + count * 8)}; @@ -4723,7 +4725,7 @@ std::uint64_t CGameMode::LaunchDummyEffect(const vector3d* position, int effectI CDummyEffectLauncher* launcher = new CDummyEffectLauncher; if (launcher != nullptr) { const int address = reinterpret_cast(position); - launcher->SendMsg(nullptr, 14, 0, address, address >> 31, effectId, effectId >> 31, lifeFrames, lifeFrames >> 31, value, value >> 31, 0, 0, 0, 0); + launcher->SendMsg(nullptr, AM_SETPOS, 0, address, address >> 31, effectId, effectId >> 31, lifeFrames, lifeFrames >> 31, value, value >> 31, 0, 0, 0, 0); this->scene->objects.push_back(launcher); return launcher->identity; } @@ -4738,8 +4740,8 @@ void CGameMode::RequestPlayerAction(int target, int argument) { if (value != 10000) { const int maxWeight = g_session.m_maxWeight < 1 ? 1 : g_session.m_maxWeight; if (g_session.m_weight * 100 / maxWeight >= 90) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(307)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(307)), 0xFF, 0, 0, 0); value = this->unknown_040C; if (value != 40000) { return; @@ -4749,12 +4751,12 @@ void CGameMode::RequestPlayerAction(int target, int argument) { switch (reinterpret_cast(this->unknown_0408)) { case SUT_NOSKILL: - this->scene->player->SendMsg(nullptr, 10, 0, target, 0, argument, argument >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDATTACK, 0, target, 0, argument, argument >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case SUT_TO_CHARACTER: case SUT_TO_ALL: - this->scene->player->SendMsg(nullptr, 41, 0, target, 0, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 90, 0, this->unknown_0414, this->unknown_0414 >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDSKILL, 0, target, 0, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_SET_SKILL_USE_LEVEL, 0, this->unknown_0414, this->unknown_0414 >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } } @@ -4797,7 +4799,7 @@ void CGameMode::SendMousePointerPosition(float x, float y, int value) { position[0] = x; position[1] = y; const std::intptr_t address = reinterpret_cast(position); - this->mousePointer->SendMsg(nullptr, 1, 0, address, address >> 31, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->mousePointer->SendMsg(nullptr, AM_SETPOSMOUSE, 0, address, address >> 31, value, value >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00CED330 @@ -4876,7 +4878,7 @@ bool CGameMode::ConfirmDraggedItemUse() { if (g_replayAnimationScaling) { this->unknown_05EC[0] = 0; } - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(657), 0, true, false, 0, "Message", 280, 120, 0); return true; } @@ -4888,7 +4890,7 @@ bool CGameMode::ConfirmDraggedItemUse() { // FUNCTION: fn_21432 void CGameMode::RefreshStatusStateEffect(int actorId) { if (g_windowMgr.unknown_0508 != 2 && actorId == static_cast(g_session.m_aid)) { - this->scene->player->unknown_0544->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + this->scene->player->unknown_0544->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } } @@ -4989,11 +4991,11 @@ void CGameMode::UpdateReplayActionSpeeds() { // OFFSET: 0x00CF1010 // FUNCTION: fn_45498 int ConfirmGameModeAction96() { - if (g_windowMgr.LookupWindow(0x271B)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xDDE)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xDDE)), 0xFF, 0, 0, 0); return 0; } - g_modeMgr.gameMode->SendMsg(0x96, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND_PET, 1, 0, 0, 0); return 0; } @@ -5043,7 +5045,7 @@ static_assert(offsetof(GameModeTextRecord, buffer) == 0x1E); // FUNCTION: fn_21433 void CGameMode::NotifyUnknown0604(int value) { for (std::list::iterator it = this->unknown_0604.begin(); it != this->unknown_0604.end(); ++it) { - (*it)->SendMsg(nullptr, 60, value, 0, 0, 0); + (*it)->SendMsg(nullptr, UM_REFRESH, value, 0, 0, 0); } } @@ -5205,7 +5207,7 @@ void CGameMode::UpdatePetFriendlyWindow(int previousFriendly) { if (g_session.GetPetFriendlyState(g_session.m_petFriendly) == 0 && g_session.m_petFriendly <= 100) { if (this->unknown_0628.find(g_session.unknown_1010) == this->unknown_0628.end()) { if (g_windowMgr.window_038C == nullptr) { - g_windowMgr.EnsureWindow(0x58); + g_windowMgr.EnsureWindow(WID_PETINFOWND); } this->UpdateUnknown0628(g_session.unknown_1010, true); @@ -5530,7 +5532,7 @@ void CPingLiveSchedule::Process(const std::uint64_t& now) { if (g_session.m_lastReceiveTick + 60000 < tick) { this->active = false; GetRagConnection().Close(); - g_windowMgr.EnsureWindow(332); + g_windowMgr.EnsureWindow(WID_DISCONNECTEDSERVERMSGWND); return; } @@ -5679,7 +5681,7 @@ void CGameMode::TargetActorByAid(int aid) { } if (allowed && g_mouse.buttons[0] == 1 && force != 0 && !HIBYTE(GetAsyncKeyState(VK_MENU))) { - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); *reinterpret_cast(&this->unknown_00D8[0x20]) = 0; if (g_session.GetSceneUnknown004C() == 0 && (HIBYTE(GetAsyncKeyState(VK_CONTROL)) || forceOption != 0)) { this->RequestPlayerAction(aid, 0); @@ -6177,7 +6179,7 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { } UIWindow* window = g_windowMgr.LookupWindow(values->values[0]); if (window != nullptr) { - window->SendMsg(nullptr, 6, values->values[1], values->values[2], values->values[3], values->values[4]); + window->SendMsg(nullptr, UM_COMMAND, values->values[1], values->values[2], values->values[3], values->values[4]); } break; } @@ -6210,7 +6212,7 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { } case 905: this->SendMsg(values->values[0], values->values[1], values->values[2], values->values[3], 0); - this->SendMsg(0x47, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_USE_SKILL, 0, 0, 0, 0); break; case 906: { const GameModeUiWhisperMessage* whisper = reinterpret_cast(message); @@ -6245,7 +6247,7 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { case 911: { std::vector states(values->length - 6, 0); std::memcpy(&states[0], values->values, states.size()); - g_windowMgr.CloseWindow(0x1A); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); g_navigationManager.LoadStates(states); if (g_windowMgr.window_4F174 != nullptr) { static_cast(g_windowMgr.window_4F174)->FillRouteGroups(); @@ -6334,14 +6336,14 @@ void CGameMode::ReceiveUiDragMessage(const unsigned char* message) { } else if (this->unknown_05EC[0] == 1 && g_windowMgr.window_01EC != nullptr) { if (drag.type == 6) { const ItemCardName card = FindItemCardName(std::atoi(drag.name.c_str())); - g_windowMgr.window_01EC->SendMsg(nullptr, 0x1D, 0, reinterpret_cast(card.name), 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETTEXT, 0, reinterpret_cast(card.name), 0, 0); } else { const ITEM_DESC description = FindItemDescription(std::atoi(drag.name.c_str())); - g_windowMgr.window_01EC->SendMsg(nullptr, 0x1D, 0, reinterpret_cast(description.identifiedName), 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETTEXT, 0, reinterpret_cast(description.identifiedName), 0, 0); } } - this->SendMsg(0x12, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00CEA0C0 @@ -6448,7 +6450,7 @@ void __stdcall OpenWordDisplay(CGameActor* actor) { } UIWordDisplayWnd* window = new UIWordDisplayWnd(); - window->SendMsg(nullptr, 34, actor->render.accountId, 0, 0, 0); + window->SendMsg(nullptr, AM_UPDATEGAGE, actor->render.accountId, 0, 0, 0); g_windowMgr.AddRendered(window); actor->unknown_018C = reinterpret_cast(window); } @@ -6526,7 +6528,7 @@ void CGameMode::ChangeZoneServer(std::string mapName, int x, int y, int ip, int this->unknown_0244 = 1; this->unknown_0248 = timeGetTime(); - this->scene->player->SendMsg(nullptr, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_FREEZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_screenShakeDuration > 0) { g_screenShakeDuration = g_screenShakeMode == 2 ? 10001 : g_screenShakeDuration; } @@ -6536,7 +6538,7 @@ void CGameMode::ChangeZoneServer(std::string mapName, int x, int y, int ip, int if (!this->unknown_0018) { GetRagConnection().Close(); if (g_windowMgr.Confirm(LookupMessage(1), 1, true, true, 0, "Message", 280, 120, 0) != 269) { - this->SendMsg(141, 0, 0, 0, 0); + this->SendMsg(MM_QUIT_TO_IDENTRY, 0, 0, 0, 0); } return; } @@ -6557,7 +6559,7 @@ void CGameMode::ChangeZoneServer(std::string mapName, int x, int y, int ip, int GetRagConnection().SetBlock(1); } - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(122), 16, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(122), 16, 1); g_windowMgr.unknown_0474 = 185; } @@ -6780,7 +6782,7 @@ void CGameMode::PlayItemUseEffect(int itemId, std::uint32_t aid) { const int job = player->GetEffectiveJob(-1); char text[0x100]; strcpy_s(text, sizeof(text), LookupMessage(job >= 4054 && job <= 4112 ? 0x704 : 0x703)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF00, 8, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF00, 8, 0, 0); } } else { actor = this->scene->GetGameActorByAID(aid); @@ -7165,7 +7167,7 @@ void CGameMode::PlayItemUseEffect(int itemId, std::uint32_t aid) { if (effectId > 0) { while (static_cast(actor)->HasId(effectId)) { - actor->SendMsg(nullptr, 109, 0, effectId, effectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, effectId, effectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_effectMgr->HasAllocator(effectId)) { g_effectMgr->Spawn(actor->render.accountId, effectId, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); @@ -7176,7 +7178,7 @@ void CGameMode::PlayItemUseEffect(int itemId, std::uint32_t aid) { if (secondEffectId > 0) { while (static_cast(actor)->HasId(secondEffectId)) { - actor->SendMsg(nullptr, 109, 0, secondEffectId, secondEffectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, secondEffectId, secondEffectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_effectMgr->HasAllocator(secondEffectId)) { g_effectMgr->Spawn(actor->render.accountId, secondEffectId, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); @@ -7235,7 +7237,7 @@ void CGameMode::InitializeState() { this->minimapMarkers.clear(); if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 486, 0, 0, 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_CLEAR_QUEST_MARKS, 0, 0, 0, 0); } g_snapMgr.Clear(); @@ -7243,34 +7245,34 @@ void CGameMode::InitializeState() { this->broadcastBalloon = nullptr; this->noticeBalloon = nullptr; g_windowMgr.SetSurface0478(nullptr); - g_windowMgr.EnsureWindow(0); - g_windowMgr.ShowWindowsWithId(67, 1); - g_windowMgr.EnsureWindow(204); + g_windowMgr.EnsureWindow(WID_BASICINFOWND); + g_windowMgr.ShowWindowsWithId(WID_WHISPERWND, 1); + g_windowMgr.EnsureWindow(WID_QUESTDISPLAY); - const char* worldName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(9, 0, 0, 0, 0)); + const char* worldName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); if (std::strcmp(worldName, "new_event.rsw") != 0) { - g_windowMgr.EnsureWindow(190); + g_windowMgr.EnsureWindow(WID_NCASH_CALLWND); } if (g_session.unknown_593C) { - g_windowMgr.EnsureWindow(137); + g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND); } if (!g_replayAnimationScaling && g_serviceOptions.Get(270)) { - g_windowMgr.EnsureWindow(159); + g_windowMgr.EnsureWindow(WID_QUIKSLOTWND); } if (g_session.m_partyBooking.unknown_0000) { - g_windowMgr.EnsureWindow(164); + g_windowMgr.EnsureWindow(WID_SEEKPARTYWND); } if (g_searchStoreInfoCreated) { - g_windowMgr.EnsureWindow(181); + g_windowMgr.EnsureWindow(WID_SEARCH_STORE_INFO); } - g_windowMgr.EnsureWindow(268); + g_windowMgr.EnsureWindow(WID_OPENROULLETTEWND); if (g_refreshWindow289) { - g_windowMgr.EnsureWindow(289); + g_windowMgr.EnsureWindow(WID_VIEWCAMERAINFOWND); } this->running = 1; @@ -7373,16 +7375,16 @@ void CGameMode::InitializeState() { *reinterpret_cast(&this->unknown_05EC[0x08]) = 0; *reinterpret_cast(&this->unknown_05EC[0x0C]) = 0; g_soundMgr->SetListenerYaw(this->camera->camera.desiredYaw); - this->SendMsg(41, 0, 0, 0, 0); + this->SendMsg(MM_TOGGLE_PLAYERGAGE, 0, 0, 0, 0); if (g_isStopByLogin) { g_isStopByLogin = 0; g_guildInfo.Init(); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(22)), 0xFFE6E6, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(22)), 0xFFE6E6, 0, 0, 0); inet_ntoa(*reinterpret_cast(&g_session.unknown_0EA0[0x0C])); if (!g_accountLinkedUserDataMgr->m_loaded) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3457)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3457)), 255, 0, 0, 0); } } @@ -7399,7 +7401,7 @@ void CGameMode::InitializeState() { if (!g_replayAnimationScaling && !s_window315Checked) { s_window315Checked = 1; if (g_window315Enabled) { - g_windowMgr.EnsureWindow(315); + g_windowMgr.EnsureWindow(WID_TIPBOXWND); } } @@ -7444,15 +7446,15 @@ void CGameMode::InitializeState() { g_windowMgr.window_4F168 = nullptr; const int replayState = Replay::Instance().state; if (g_replayAnimationScaling) { - g_windowMgr.EnsureWindow(187); + g_windowMgr.EnsureWindow(WID_REPLAYCONTROLWND); if (replayState == 8) { - g_windowMgr.window_4F168->SendMsg(nullptr, 35, 0, 0, 0, 0); + g_windowMgr.window_4F168->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } } if (replayState == 3) { Replay::Instance().SetState(2); - g_windowMgr.EnsureWindow(198); + g_windowMgr.EnsureWindow(WID_REPLAYRECCONTROLWND); g_windowMgr.window_4F164->Move(Replay::Instance().unknown_01F4, Replay::Instance().unknown_01F8); g_windowMgr.window_4F164->SendMsg(nullptr, 123, 0, 0, 0, 0); } else if (replayState == 8) { @@ -7461,9 +7463,9 @@ void CGameMode::InitializeState() { g_navigationManager.ResumeRoute(); if (g_mileageWndActive) { - UIWindow* mileage = g_windowMgr.EnsureWindow(267); + UIWindow* mileage = g_windowMgr.EnsureWindow(WID_MILEAGEWND); if (mileage) { - mileage->SendMsg(nullptr, 34, g_mileageWndActive, g_mileageWndPoint, g_mileageWndElapsed, g_mileageWndBonus); + mileage->SendMsg(nullptr, UM_SETINFO, g_mileageWndActive, g_mileageWndPoint, g_mileageWndElapsed, g_mileageWndBonus); } } @@ -7486,11 +7488,11 @@ void CGameMode::ProcessRightButtonDrag() { switch (g_mouse.buttons[1]) { case 1: { if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } - this->SendMsg(0x12, 0, 0, 0, 0); - this->SendMsg(0x47, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_USE_SKILL, 0, 0, 0, 0); this->unknown_00E4 = g_mouse.x; this->unknown_00E8 = g_mouse.y; if (!g_serviceOptions.Get(0x78)) { @@ -7509,7 +7511,7 @@ void CGameMode::ProcessRightButtonDrag() { automatic->DisableAll(); } - shortcuts->SendMsg(nullptr, 0x29, 8, 0, 0, 0); + shortcuts->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 8, 0, 0, 0); return; } case 2: @@ -7679,7 +7681,7 @@ void CGameMode::ProcessMouseWheel(int requireControl) { automatic->DisableAll(); } - shortcuts->SendMsg(nullptr, 0x29, 7, 0, 0, 0); + shortcuts->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 7, 0, 0, 0); } else { if (!shortcuts) { return; @@ -7691,7 +7693,7 @@ void CGameMode::ProcessMouseWheel(int requireControl) { automatic->DisableAll(); } - shortcuts->SendMsg(nullptr, 0x29, 6, 0, 0, 0); + shortcuts->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 6, 0, 0, 0); } return; } @@ -7842,9 +7844,9 @@ void CGameMode::Initialize(const char* name) { this->broadcastBalloon = nullptr; this->noticeBalloon = nullptr; g_windowMgr.HideWindow01C8(); - g_windowMgr.ShowWindowsWithId(0x43, 0); - g_windowMgr.EnsureWindow(7); - g_windowMgr.SendNotice(4, 0, 0, 0, 0, 0); + g_windowMgr.ShowWindowsWithId(WID_WHISPERWND, 0); + g_windowMgr.EnsureWindow(WID_LOADINGWND); + g_windowMgr.SendNotice(UIM_LOADINGPERCENT, 0, 0, 0, 0, 0); g_windowMgr.CenterSurface0478(); g_windowMgr.DrawWindows(); if (g_renderer->Draw()) { @@ -7891,7 +7893,7 @@ void CGameMode::Initialize(const char* name) { if (*reinterpret_cast(g_session.unknown_5554) && g_session.IsAdminSubMode(7)) { char message[256]; std::sprintf(message, "Now Auto chat Save System is ENABLED."); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 0, 0, 0); } if (g_replayAnimationScaling == 0) { @@ -7906,7 +7908,7 @@ void CGameMode::Initialize(const char* name) { if (g_session.HasNoUnknown1784Items()) { if (g_launchPassCommandLine) { - this->SendMsg(0x14B, 1, 0, 0, 0); + this->SendMsg(MM_STOVE_AUTHENTICATION, 1, 0, 0, 0); g_stoveMgr->FetchAllProducts(); } else { std::int16_t packet = 0x8C9; @@ -7959,11 +7961,11 @@ void CGameMode::Initialize(const char* name) { g_windowMgr.LoadReplayReserved(Replay::Instance().ReadSection(0x15)); Replay::Instance().Rewind(); this->replayPauseTick = 0; - g_windowMgr.ShowWindowById(1, Replay::Instance().header.options.recordRestricted); + g_windowMgr.ShowWindowById(WID_CHATWND, Replay::Instance().header.options.recordRestricted); } if (g_screenShakeMode == 2) { - this->scene->player->SendMsg(nullptr, 0x6E, 0, 0x22, 0, g_screenShakeDuration <= 10000 && g_screenShakeDuration != 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 0x22, 0, g_screenShakeDuration <= 10000 && g_screenShakeDuration != 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.GetOption(6) > 0) { @@ -7971,7 +7973,7 @@ void CGameMode::Initialize(const char* name) { char message[256]; std::memset(message, 0, sizeof(message)); StringFormat(message, sizeof(message), static_cast(-1), LookupMessage(0xDFA), g_serviceOptions.Get(0xFA) ? "ON" : "OFF"); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFF, 0, 0, 0); } if (g_equipmentPropertiesMgr == nullptr) { @@ -8248,7 +8250,7 @@ void CGameMode::ProcessActorClick(int& handled, ActorPickInfo* pick, CGameActor* } if (g_mouse.buttons[0] == 1 && attack != 0 && !HIBYTE(GetAsyncKeyState(VK_MENU))) { - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); *reinterpret_cast(&this->unknown_00EC[0x08]) = targetAid; this->unknown_00F8 = 0; if (g_session.GetSceneUnknown004C() == 0 && (HIBYTE(GetAsyncKeyState(VK_CONTROL)) || forceOption != 0)) { @@ -8345,14 +8347,14 @@ __forceinline void CGameMode::ShowHoverActorName(CGameActor* actor) { // FUNCTION: fn_21328 int CGameMode::ProcessMousePick(int result, ActorPickInfo* pick) { if (g_mouse.buttons[0] == 1 && pick) { - UIMacroReporterWnd* reporter = static_cast(g_windowMgr.LookupWindow(286)); + UIMacroReporterWnd* reporter = static_cast(g_windowMgr.LookupWindow(WID_MACROREPORTERWND)); if (reporter && reporter->unknown_010C == true && reporter->m_mode == 0) { reporter->AddPickedActor(reinterpret_cast(pick)); return -1; } } - if (g_windowMgr.LookupWindow(196) || reinterpret_cast(this->unknown_0408) == 1) { + if (g_windowMgr.LookupWindow(WID_COLLECTIONSYSTEMWND) || reinterpret_cast(this->unknown_0408) == 1) { return result; } @@ -8376,7 +8378,7 @@ int CGameMode::ProcessMousePick(int result, ActorPickInfo* pick) { this->SetCursorAction(5); if (lockedPick != 0) { if (g_mouse.buttons[0] == 1) { - this->SendMsg(26, 0, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 0, 0, 0, 0); } else { this->SetCursorAction(0); if (!pick) { @@ -8450,7 +8452,7 @@ int CGameMode::ProcessGroundClick(int result) { ground->DrawGrid(matrix, column, row, color); }; - UIWindow* macroArea = g_windowMgr.LookupWindow(0x11E); + UIWindow* macroArea = g_windowMgr.LookupWindow(WID_MACROREPORTERWND); if (macroArea) { const unsigned char* macroFields = reinterpret_cast(macroArea); if (macroFields[0x10C] == 1 && *reinterpret_cast(macroFields + 0xEC) == 1) { @@ -8628,9 +8630,9 @@ int CGameMode::ProcessGroundClick(int result) { if (this->scene->player) { const int skill = this->unknown_040C; - this->scene->player->SendMsg(nullptr, 0x41, 0, skill, skill >> 31, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDGROUNDSKILL, 0, skill, skill >> 31, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0); const int level = this->unknown_0414; - this->scene->player->SendMsg(nullptr, 0x5A, 0, level, level >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_SET_SKILL_USE_LEVEL, 0, level, level >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -8685,7 +8687,7 @@ int CGameMode::ProcessGroundClick(int result) { g_windowMgr.UpdateNavigationList(); clickTick = timeGetTime(); if (HIBYTE(GetAsyncKeyState(VK_SHIFT)) || g_windowMgr.window_027C || this->scene->player->render.unknown_0070 == 6) { - this->scene->player->SendMsg(nullptr, 0x10, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_REQ_CHANGE_DIR, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return result; } @@ -8709,10 +8711,10 @@ int CGameMode::ProcessGroundClick(int result) { } if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->scene->player) { - this->scene->player->SendMsg(nullptr, 0x11, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_REQ_MOVE, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } return result; } @@ -8754,7 +8756,7 @@ void CGameMode::Update() { PumpApplicationMessages(); this->ProcessIncomingPackets(); if (Replay::Instance().AdvanceFrame() == 0) { - g_windowMgr.window_4F168->SendMsg(nullptr, 35, 0, 0, 0, 0); + g_windowMgr.window_4F168->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } if (this->running != 0) { @@ -8801,12 +8803,12 @@ void CGameMode::Update() { } if (reachable) { if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } - this->scene->player->SendMsg(nullptr, 0x11, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_REQ_MOVE, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } else { - this->scene->player->SendMsg(nullptr, 0x10, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_REQ_CHANGE_DIR, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -8964,9 +8966,9 @@ void CGameMode::ProcessInput() { if (this->unknown_0408 != nullptr) { if (*reinterpret_cast(&g_session.unknown_544C[0x00]) == 0) { if (g_mouse.wheel > 0) { - this->SendMsg(0x5D, 1, 0, 0, 0); + this->SendMsg(MM_USESKILL_LEVEL_PLUS, 1, 0, 0, 0); } else if (g_mouse.wheel < 0) { - this->SendMsg(0x5E, 1, 0, 0, 0); + this->SendMsg(MM_USESKILL_LEVEL_MINUS, 1, 0, 0, 0); } } *reinterpret_cast(&g_session.unknown_544C[0x00]) = 0; @@ -8974,15 +8976,15 @@ void CGameMode::ProcessInput() { if (g_mouse.buttons[0] == 3) { if (this->scene->player) { - this->scene->player->SendMsg(nullptr, 0xF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_ATTACKCLICKUP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - this->SendMsg(0x11, g_mouse.x, g_mouse.y, 0, 0); + this->SendMsg(MM_DROP, g_mouse.x, g_mouse.y, 0, 0); UIMenuWnd* menu = static_cast(g_windowMgr.unknown_0210); if (menu) { if (menu->unknown_00DC) { menu->unknown_00DC = 0; } else { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } } this->unknown_00F8 = 1; @@ -8990,7 +8992,7 @@ void CGameMode::ProcessInput() { g_pickModifierKey = HIBYTE(GetAsyncKeyState(VK_SHIFT)); ActorPickInfo* pick = g_actorPickNode.Pick(static_cast(g_mouse.x), static_cast(g_mouse.y)); - UIWindow* blocker = g_windowMgr.LookupWindow(0x271B); + UIWindow* blocker = g_windowMgr.LookupWindow(WID_EXCHANGEUI); if (!blocker) { this->OpenActorMenu(pick, handled); } @@ -9031,7 +9033,7 @@ void CGameMode::ProcessInput() { } if (this->unknown_0250 == 0 && (this->unknown_024C == 0 || this->scene->player->unknown_0264[3] != 0) && !blocker && g_windowMgr.window_0288 == nullptr && - !g_windowMgr.LookupWindow(0x169)) { + !g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { handled = this->ProcessGroundClick(this->ProcessMousePick(handled, pick)); this->UpdateHoverNameBalloon(); if (handled != 1 && g_mouse.buttons[0] == 1) { @@ -9043,7 +9045,7 @@ void CGameMode::ProcessInput() { if ((handled == 1 || g_mouse.buttons[0] == 1) && g_mouse.buttons[0] == 1) { g_unknown173AD3F = false; - this->SendMsg(0x47, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_USE_SKILL, 0, 0, 0, 0); if (timeGetTime() > this->unknown_0248 + 5000) { this->unknown_0244 = 0; } @@ -9090,7 +9092,7 @@ void CGameMode::UpdateHoverNameBalloon() { } } else { if (!this->unknown_0028) { - this->SendMsg(5, 0, 0, 0, 0); + this->SendMsg(MM_HIDEMOUSEPOINTER, 0, 0, 0, 0); return; } @@ -9107,11 +9109,11 @@ void CGameMode::UpdateHoverNameBalloon() { if (actor->GetEffectiveJob(-1) != 45 && (actor->unknown_0314 || (actor->render.visible == 1 && actor->render.enabled == 1 && !StateFlag02(actor->GetStateFlags())))) { - this->SendMsg(4, static_cast(actor->render.position.x), static_cast(actor->render.position.z), 0, 0); + this->SendMsg(MM_SHOWMOUSEPOINTER, static_cast(actor->render.position.x), static_cast(actor->render.position.z), 0, 0); return; } - this->SendMsg(5, 0, 0, 0, 0); + this->SendMsg(MM_HIDEMOUSEPOINTER, 0, 0, 0, 0); } #include "Client/Browser/WebBrowser.h" @@ -9168,14 +9170,14 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { std::string defaults[3]; std::string* parts = arguments ? arguments : defaults; if (g_serviceType == 4 && talkType == TT_REQ_NUM_USER) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); return; } switch (talkType) { case TT_GUILD_CHAT: g_windowMgr.SetUnknown04DC(parts[0].c_str()); - this->SendMsg(0x81, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_GUILD, 0, 0, 0, 0); break; case TT_REQ_WHISPER_PC_EX: case TT_REQ_WHISPER_PC_IN: { @@ -9196,11 +9198,11 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_REQ_SAVE_CHAT_FROM_CHATROOM: - g_windowMgr.SendNotice(7, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_SAVE_CHAT_TO_FILE_FROM_CHATROOM, 0, 0, 0, 0, 0); break; case TT_REQ_AUTO_SAVE_CHAT: { if (g_session.IsAdminSubMode(7) == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); break; } char text[128]; @@ -9228,11 +9230,11 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { g_modeMgr.GetGameMode(); CloseWhisperRecord(); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); break; } case TT_UNKNOWN: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x5F)), 0xFFFF, 0, 0, 0); break; case TT_NORMAL: case TT_NORMAL_FROM_CHATROOM: { @@ -9272,42 +9274,42 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { clanChat = 1; } if (talkType == TT_NORMAL_FROM_CHATROOM) { - this->SendMsg(6, 0, 0, 0, 0); + this->SendMsg(MM_CHATMSG, 0, 0, 0, 0); break; } if (g_session.unknown_5484 != 0) { - this->SendMsg(0xFE, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_BATTLEFIELD, 0, 0, 0, 0); break; } const int sendMode = *reinterpret_cast(&g_session.unknown_5490[8]); if (sendMode == 2 && g_guildInfo.m_guildId != 0) { - this->SendMsg(alternate ? 6 : 0x81, 0, 0, 0, 0); + this->SendMsg(alternate ? MM_CHATMSG : MM_CHAT_GUILD, 0, 0, 0, 0); break; } if (sendMode == 1) { if (party == 0 && g_session.PartyCount() != 0) { - this->SendMsg(0x42, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_PARTY, 0, 0, 0, 0); } else { - this->SendMsg(6, 0, 0, 0, 0); + this->SendMsg(MM_CHATMSG, 0, 0, 0, 0); } break; } if (sendMode == 3 && g_clanInfo->m_hasClan == 1) { - this->SendMsg(0x121, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_CLAN, 0, 0, 0, 0); break; } if (sendMode == 4 && g_guildInfo.m_guildId != 0) { - this->SendMsg(static_cast(clanChat) ? 6 : 0x14A, 0, 0, 0, 0); + this->SendMsg(static_cast(clanChat) ? MM_CHATMSG : MM_CHAT_ALLY, 0, 0, 0, 0); break; } if (party != 0 && g_session.PartyCount() != 0) { - this->SendMsg(0x42, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_PARTY, 0, 0, 0, 0); } else if (alternate != 0) { - this->SendMsg(0x81, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_GUILD, 0, 0, 0, 0); } else if (static_cast(clanChat)) { - this->SendMsg(0x14A, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_ALLY, 0, 0, 0, 0); } else { - this->SendMsg(6, 0, 0, 0, 0); + this->SendMsg(MM_CHATMSG, 0, 0, 0, 0); } break; } @@ -9326,18 +9328,18 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { std::sprintf(text, "[ To Friends ] : (Hi) %s%s", g_serverLanguage->Prefix(false), copy.c_str()); } } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x1EFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x1EFFFF, 0, 0, 0); break; } case TT_LEVEL: for (int count = 32; count != 0; --count) { - this->SendMsg(0x5B, reinterpret_cast("LEVEL"), 0, 0, 0); + this->SendMsg(MM_ITEM_CREATE, reinterpret_cast("LEVEL"), 0, 0, 0); } break; case TT_SP: for (int count = 5; count != 0; --count) { - this->SendMsg(0x5B, reinterpret_cast("SPPOINT"), 0, 0, 0); - this->SendMsg(0x5B, reinterpret_cast("JOBLEVEL"), 0, 0, 0); + this->SendMsg(MM_ITEM_CREATE, reinterpret_cast("SPPOINT"), 0, 0, 0); + this->SendMsg(MM_ITEM_CREATE, reinterpret_cast("JOBLEVEL"), 0, 0, 0); } break; case TT_RANDOM_LOADING_SCREEN_ON_OFF: { @@ -9349,82 +9351,82 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { g_randomLoadingScreen = true; text = "RANDOM LOADING SCREEN OFF"; } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x6E96FF, 0, 0, 0); break; } case TT_SET1_ON_OFF: - g_modeMgr.gameMode->SendMsg(0x2A, 0x71, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6C, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6D, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x8D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x71, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6C, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x8D, 0, 0, 0); break; case TT_SET2_ON_OFF: - g_modeMgr.gameMode->SendMsg(0x2A, 0x71, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6C, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6D, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x78, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x79, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x8D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x71, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6C, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x78, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x79, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x8D, 0, 0, 0); break; case TT_SET3_ON_OFF: - g_modeMgr.gameMode->SendMsg(0x2A, 0x71, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6C, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x6D, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x8D, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0xA5, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x87, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0xA7, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x71, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6C, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x6D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x8D, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0xA5, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x87, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0xA7, 0, 0, 0); break; case TT_QUICKSPELL3_ON_OFF: - g_modeMgr.gameMode->SendMsg(0x2A, 0x78, 0, 0, 0); - g_modeMgr.gameMode->SendMsg(0x2A, 0x79, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x78, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x79, 0, 0, 0); break; case TT_SKILLFAIL_ON_OFF: g_serviceOptions.Set(0x71, !g_serviceOptions.Get(0x71)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0x71) ? 0x2DA : 0x2DB)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0x71) ? 0x2DA : 0x2DB)), 0x64FFFF, 0, 0, 0); break; case TT_LOGINOUT_ON_OFF: g_serviceOptions.Set(0xA5, !g_serviceOptions.Get(0xA5)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xA5) ? 0x414 : 0x415)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xA5) ? 0x414 : 0x415)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettings(); break; case TT_EMBLEM_FRAME_ON_OFF: g_serviceOptions.Set(0xF3, !g_serviceOptions.Get(0xF3)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xF3) ? 0xDC7 : 0xDC8)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xF3) ? 0xDC7 : 0xDC8)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettings(); break; case TT_BATTLE_ON_OFF: g_windowMgr.chatModeChanged = g_windowMgr.chatModeChanged == 0; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (g_windowMgr.chatModeChanged) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x311)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x311)), 0x64FFFF, 0, 0, 0); } else { if (!g_windowMgr.inputSuggestionsEnabled) { ChatWindow()->ToggleInput(); } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x312)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x312)), 0x64FFFF, 0, 0, 0); } break; case TT_BATTLECHAT_ON_OFF: g_session.unknown_5484 = 1 - g_session.unknown_5484; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_session.unknown_5484 ? 0x555 : 0x556)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_session.unknown_5484 ? 0x555 : 0x556)), 0x64FFFF, 0, 0, 0); break; case TT_AUTO_MSG_ON_OFF: g_windowToggleFlag = !g_windowToggleFlag; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (g_windowToggleFlag) { - g_windowMgr.EnsureWindow(0x74); + g_windowMgr.EnsureWindow(WID_AUTOMESSAGEWND); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x3AF)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x3AF)), 0x64FFFF, 0, 0, 0); } break; case TT_TRACEAI_ON_OFF: g_session.m_traceAi = g_session.m_traceAi == 0; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (g_session.m_traceAi != 0) { char path[256]; GetCurrentDirectoryA(sizeof(path), path); @@ -9437,9 +9439,9 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { file.Open(path, 0x1001, true, false); file.Write("", 0); file.Close(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x3BC)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x3BC)), 0x64FFFF, 0, 0, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x3BD)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x3BD)), 0x64FFFF, 0, 0, 0); } break; case TT_VOLUME: { @@ -9448,7 +9450,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { g_soundMgr->Set3DVolume(volume); char text[120]; std::sprintf(text, "%s %d", LookupMessage(0x19), volume); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettings(); break; } @@ -9458,14 +9460,14 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { g_soundMgr->SetTargetVolume(CSoundMgr::Volume(g_soundMgr)); char text[120]; std::sprintf(text, "%s %d", LookupMessage(0x1A), volume); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettings(); break; } case TT_EFFECT_SOUND_ON_OFF: g_serviceOptions.Set(0xB, !g_serviceOptions.Get(0xB)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xB) ? 0x1B : 0x1C)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_serviceOptions.Get(0xB) ? 0x1B : 0x1C)), 0x64FFFF, 0, 0, 0); if (g_serviceOptions.Get(0xB)) { g_soundMgr->unknown = 0; } @@ -9473,17 +9475,17 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; case TT_TINGONLY_ON_OFF: g_soundMgr->unknown = g_soundMgr->unknown == 0; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_soundMgr->unknown ? 0x5DA : 0x5DB)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_soundMgr->unknown ? 0x5DA : 0x5DB)), 0x64FFFF, 0, 0, 0); break; case TT_FRAMESKIP_ON_OFF: g_frameskip = 1 - g_frameskip; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_frameskip ? 0x1D : 0x1E)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_frameskip ? 0x1D : 0x1E)), 0x64FFFF, 0, 0, 0); break; case TT_MUSIC_ON_OFF: g_serviceOptions.Set(7, !g_serviceOptions.Get(7)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_serviceOptions.Get(7) ? 0x1F : 0x20)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_serviceOptions.Get(7) ? 0x1F : 0x20)), 0x64FFFF, 0, 0, 0); if (g_serviceOptions.Get(7)) { g_soundMgr->PlayStream(nullptr, 0, false); } else { @@ -9494,7 +9496,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { case TT_REQ_MOVETO_MAP: { const int third = std::atoi(parts[2].c_str()); const int second = std::atoi(parts[1].c_str()); - this->SendMsg(0x5C, reinterpret_cast(parts[0].c_str()), second, third, 0); + this->SendMsg(MM_MOVETO_MAP, reinterpret_cast(parts[0].c_str()), second, third, 0); break; } case TT_REQ_PK: { @@ -9508,343 +9510,343 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { case TT_REQ_EXCHANGE_ITEM: { const std::uint32_t id = this->nameCard.FindId(parts[0].c_str()); if (id != 0) { - this->SendMsg(0x31, id, 0, 0, 0); + this->SendMsg(MM_REQ_EXCHANGE_ITEM, id, 0, 0, 0); } break; } case TT_OPEN_TIP: - if (!g_windowMgr.CloseWindow(0x13B)) { - g_windowMgr.EnsureWindow(0x13B); + if (!g_windowMgr.CloseWindow(WID_TIPBOXWND)) { + g_windowMgr.EnsureWindow(WID_TIPBOXWND); } break; case TT_REQ_EMOTION_SURPRISE: - this->SendMsg(0x149, reinterpret_cast("ET_SURPRISE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SURPRISE"), 0, 0, 0); break; case TT_REQ_EMOTION_QUESTION: - this->SendMsg(0x149, reinterpret_cast("ET_QUESTION"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_QUESTION"), 0, 0, 0); break; case TT_REQ_EMOTION_DELIGHT: - this->SendMsg(0x149, reinterpret_cast("ET_DELIGHT"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_DELIGHT"), 0, 0, 0); break; case TT_REQ_EMOTION_THROB: - this->SendMsg(0x149, reinterpret_cast("ET_THROB"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_THROB"), 0, 0, 0); break; case TT_REQ_EMOTION_SWEAT: - this->SendMsg(0x149, reinterpret_cast("ET_SWEAT"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SWEAT"), 0, 0, 0); break; case TT_REQ_EMOTION_AHA: - this->SendMsg(0x149, reinterpret_cast("ET_AHA"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_AHA"), 0, 0, 0); break; case TT_REQ_EMOTION_FRET: - this->SendMsg(0x149, reinterpret_cast("ET_FRET"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_FRET"), 0, 0, 0); break; case TT_REQ_EMOTION_ANGER: - this->SendMsg(0x149, reinterpret_cast("ET_ANGER"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ANGER"), 0, 0, 0); break; case TT_REQ_EMOTION_MONEY: - this->SendMsg(0x149, reinterpret_cast("ET_MONEY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_MONEY"), 0, 0, 0); break; case TT_REQ_EMOTION_THINK: - this->SendMsg(0x149, reinterpret_cast("ET_THINK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_THINK"), 0, 0, 0); break; case TT_REQ_EMOTION_SCISSOR: - this->SendMsg(0x149, reinterpret_cast("ET_SCISSOR"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SCISSOR"), 0, 0, 0); break; case TT_REQ_EMOTION_ROCK: - this->SendMsg(0x149, reinterpret_cast("ET_ROCK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ROCK"), 0, 0, 0); break; case TT_REQ_EMOTION_WRAP: - this->SendMsg(0x149, reinterpret_cast("ET_WRAP"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_WRAP"), 0, 0, 0); break; case TT_REQ_EMOTION_BIGTHROB: - this->SendMsg(0x149, reinterpret_cast("ET_BIGTHROB"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_BIGTHROB"), 0, 0, 0); break; case TT_REQ_EMOTION_THANKS: - this->SendMsg(0x149, reinterpret_cast("ET_THANKS"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_THANKS"), 0, 0, 0); break; case TT_REQ_EMOTION_KEK: - this->SendMsg(0x149, reinterpret_cast("ET_KEK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_KEK"), 0, 0, 0); break; case TT_REQ_EMOTION_SORRY: - this->SendMsg(0x149, reinterpret_cast("ET_SORRY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SORRY"), 0, 0, 0); break; case TT_REQ_EMOTION_SMILE: - this->SendMsg(0x149, reinterpret_cast("ET_SMILE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SMILE"), 0, 0, 0); break; case TT_REQ_EMOTION_PROFUSELY_SWEAT: - this->SendMsg(0x149, reinterpret_cast("ET_PROFUSELY_SWEAT"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_PROFUSELY_SWEAT"), 0, 0, 0); break; case TT_REQ_EMOTION_SCRATCH: - this->SendMsg(0x149, reinterpret_cast("ET_SCRATCH"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SCRATCH"), 0, 0, 0); break; case TT_REQ_EMOTION_BEST: - this->SendMsg(0x149, reinterpret_cast("ET_BEST"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_BEST"), 0, 0, 0); break; case TT_REQ_EMOTION_STARE_ABOUT: - this->SendMsg(0x149, reinterpret_cast("ET_STARE_ABOUT"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_STARE_ABOUT"), 0, 0, 0); break; case TT_REQ_EMOTION_HUK: - this->SendMsg(0x149, reinterpret_cast("ET_HUK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HUK"), 0, 0, 0); break; case TT_REQ_EMOTION_O: - this->SendMsg(0x149, reinterpret_cast("ET_O"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_O"), 0, 0, 0); break; case TT_REQ_EMOTION_X: - this->SendMsg(0x149, reinterpret_cast("ET_X"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_X"), 0, 0, 0); break; case TT_REQ_EMOTION_HELP: - this->SendMsg(0x149, reinterpret_cast("ET_HELP"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HELP"), 0, 0, 0); break; case TT_REQ_EMOTION_GO: - this->SendMsg(0x149, reinterpret_cast("ET_GO"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_GO"), 0, 0, 0); break; case TT_REQ_EMOTION_CRY: - this->SendMsg(0x149, reinterpret_cast("ET_CRY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_CRY"), 0, 0, 0); break; case TT_REQ_EMOTION_KIK: - this->SendMsg(0x149, reinterpret_cast("ET_KIK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_KIK"), 0, 0, 0); break; case TT_REQ_EMOTION_CHUP: - this->SendMsg(0x149, reinterpret_cast("ET_CHUP"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_CHUP"), 0, 0, 0); break; case TT_REQ_EMOTION_CHUPCHUP: - this->SendMsg(0x149, reinterpret_cast("ET_CHUPCHUP"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_CHUPCHUP"), 0, 0, 0); break; case TT_REQ_EMOTION_HNG: - this->SendMsg(0x149, reinterpret_cast("ET_HNG"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HNG"), 0, 0, 0); break; case TT_REQ_EMOTION_OK: - this->SendMsg(0x149, reinterpret_cast("ET_OK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_OK"), 0, 0, 0); break; case TT_REQ_EMOTION_STARE: - this->SendMsg(0x149, reinterpret_cast("ET_STARE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_STARE"), 0, 0, 0); break; case TT_REQ_EMOTION_HUNGRY: - this->SendMsg(0x149, reinterpret_cast("ET_HUNGRY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HUNGRY"), 0, 0, 0); break; case TT_REQ_EMOTION_COOL: - this->SendMsg(0x149, reinterpret_cast("ET_COOL"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_COOL"), 0, 0, 0); break; case TT_REQ_EMOTION_MERONG: - this->SendMsg(0x149, reinterpret_cast("ET_MERONG"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_MERONG"), 0, 0, 0); break; case TT_REQ_EMOTION_SHY: - this->SendMsg(0x149, reinterpret_cast("ET_SHY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SHY"), 0, 0, 0); break; case TT_REQ_EMOTION_GOODBOY: - this->SendMsg(0x149, reinterpret_cast("ET_GOODBOY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_GOODBOY"), 0, 0, 0); break; case TT_REQ_EMOTION_SPTIME: - this->SendMsg(0x149, reinterpret_cast("ET_SPTIME"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SPTIME"), 0, 0, 0); break; case TT_REQ_EMOTION_SEXY: - this->SendMsg(0x149, reinterpret_cast("ET_SEXY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SEXY"), 0, 0, 0); break; case TT_REQ_EMOTION_COMEON: - this->SendMsg(0x149, reinterpret_cast("ET_COMEON"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_COMEON"), 0, 0, 0); break; case TT_REQ_EMOTION_SLEEPY: - this->SendMsg(0x149, reinterpret_cast("ET_SLEEPY"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SLEEPY"), 0, 0, 0); break; case TT_REQ_EMOTION_CONGRATULATION: - this->SendMsg(0x149, reinterpret_cast("ET_CONGRATULATION"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_CONGRATULATION"), 0, 0, 0); break; case TT_REQ_EMOTION_HPTIME: - this->SendMsg(0x149, reinterpret_cast("ET_HPTIME"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HPTIME"), 0, 0, 0); break; case TT_REQ_EMOTION_SPARK: - this->SendMsg(0x149, reinterpret_cast("ET_SPARK"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SPARK"), 0, 0, 0); break; case TT_REQ_EMOTION_CONFUSE: - this->SendMsg(0x149, reinterpret_cast("ET_CONFUSE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_CONFUSE"), 0, 0, 0); break; case TT_REQ_EMOTION_OHNO: - this->SendMsg(0x149, reinterpret_cast("ET_OHNO"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_OHNO"), 0, 0, 0); break; case TT_REQ_EMOTION_HUM: - this->SendMsg(0x149, reinterpret_cast("ET_HUM"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HUM"), 0, 0, 0); break; case TT_REQ_EMOTION_BLABLA: - this->SendMsg(0x149, reinterpret_cast("ET_BLABLA"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_BLABLA"), 0, 0, 0); break; case TT_REQ_EMOTION_OTL: - this->SendMsg(0x149, reinterpret_cast("ET_OTL"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_OTL"), 0, 0, 0); break; case TT_REQ_EMOTION_LUV: - this->SendMsg(0x149, reinterpret_cast("ET_LUV"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_LUV"), 0, 0, 0); break; case TT_REQ_EMOTION_MOBILE: - this->SendMsg(0x149, reinterpret_cast("ET_MOBILE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_MOBILE"), 0, 0, 0); break; case TT_REQ_EMOTION_MAIL: - this->SendMsg(0x149, reinterpret_cast("ET_MAIL"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_MAIL"), 0, 0, 0); break; case TT_REQ_EMOTION_ANTENNA0: - this->SendMsg(0x149, reinterpret_cast("ET_ANTENNA0"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ANTENNA0"), 0, 0, 0); break; case TT_REQ_EMOTION_ANTENNA1: - this->SendMsg(0x149, reinterpret_cast("ET_ANTENNA1"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ANTENNA1"), 0, 0, 0); break; case TT_REQ_EMOTION_ANTENNA2: - this->SendMsg(0x149, reinterpret_cast("ET_ANTENNA2"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ANTENNA2"), 0, 0, 0); break; case TT_REQ_EMOTION_ANTENNA3: - this->SendMsg(0x149, reinterpret_cast("ET_ANTENNA3"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ANTENNA3"), 0, 0, 0); break; case TT_REQ_EMOTION_HUM2: - this->SendMsg(0x149, reinterpret_cast("ET_HUM2"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_HUM2"), 0, 0, 0); break; case TT_REQ_EMOTION_ABS: - this->SendMsg(0x149, reinterpret_cast("ET_ABS"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ABS"), 0, 0, 0); break; case TT_REQ_EMOTION_OOPS: - this->SendMsg(0x149, reinterpret_cast("ET_OOPS"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_OOPS"), 0, 0, 0); break; case TT_REQ_EMOTION_SPIT: - this->SendMsg(0x149, reinterpret_cast("ET_SPIT"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SPIT"), 0, 0, 0); break; case TT_REQ_EMOTION_ENE: - this->SendMsg(0x149, reinterpret_cast("ET_ENE"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_ENE"), 0, 0, 0); break; case TT_REQ_EMOTION_PANIC: - this->SendMsg(0x149, reinterpret_cast("ET_PANIC"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_PANIC"), 0, 0, 0); break; case TT_REQ_EMOTION_WHISP: - this->SendMsg(0x149, reinterpret_cast("ET_WHISP"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_WHISP"), 0, 0, 0); break; case TT_REQ_EMOTION_DICE: - this->SendMsg(0x149, reinterpret_cast("ET_DICE1"), 0, 0, 0); + this->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_DICE1"), 0, 0, 0); break; case TT_BROADCAST: - this->SendMsg(7, 0, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 0, 0, 0, 0); break; case TT_LOCALBROADCAST: - this->SendMsg(7, 1, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 1, 0, 0, 0); break; case TT_NAMELESS_BROADCAST: - this->SendMsg(7, 2, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 2, 0, 0, 0); break; case TT_NAMELESS_LOCALBROADCAST: - this->SendMsg(7, 3, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 3, 0, 0, 0); break; case TT_NAMELESS_BLUEBROADCAST: - this->SendMsg(7, 4, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 4, 0, 0, 0); break; case TT_NAMELESS_BLUELOCALBROADCAST: - this->SendMsg(7, 5, 0, 0, 0); + this->SendMsg(MM_BROADCASTMSG, 5, 0, 0, 0); break; case TT_REQ_NUM_USER: - this->SendMsg(0x20, 0, 0, 0, 0); + this->SendMsg(MM_REQ_NUM_USER, 0, 0, 0, 0); break; case TT_HOMUN_WAIT: - this->SendMsg(0xbd, 0, 0, 0, 0); + this->SendMsg(MM_HOMUN_WAIT, 0, 0, 0, 0); break; case TT_DISCONNECT_CHARACTER: - this->SendMsg(0xe, 0, 0, 0, 0); + this->SendMsg(MM_DISCONNECT_CHARACTER, 0, 0, 0, 0); break; case TT_DISCONNECT_ALL_CHARACTER: - this->SendMsg(0xf, 0, 0, 0, 0); + this->SendMsg(MM_DISCONNECT_ALL_CHARACTER, 0, 0, 0, 0); break; case TT_REQ_BREAK_GUILD: - this->SendMsg(0x6a, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REQ_DISORGANIZE_GUILD, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_MAKE_GUILD: - this->SendMsg(0x70, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REQ_MAKE_GUILD, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_MAKE_GROUP: - this->SendMsg(0x3a, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_MAKE_GROUP, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_SEEK_PARTY: - this->SendMsg(0x105, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_OPEN_SEEKPARTY_MEMBER, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_RECRUIT: - this->SendMsg(0x10d, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_OPEN_SEEKPARTY_LIST, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_ITEM_CREATE: - this->SendMsg(0x5b, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_ITEM_CREATE, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REMOVE: - this->SendMsg(0x9b, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REMOVE_TO_AID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_SHIFT: - this->SendMsg(0x9c, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_SHIFT_TO_GID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_RECALL_AID: - this->SendMsg(0x9d, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_RECALL_AID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_RECALL_GID: - this->SendMsg(0x9e, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_RECALL_GID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_CHECK_ID: - this->SendMsg(0xb1, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_CHECK_ID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_RC_ID: - this->SendMsg(0xb2, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_RC_ID, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_BILLING_INFO: - this->SendMsg(0xa1, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_BILLING_INFO, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_EXPEL_GROUP_MEMBER: - this->SendMsg(0x3e, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REQ_EXPEL_GROUP_MEMBER, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_RESETSTATE: - this->SendMsg(0x8e, 0, 0, 0, 0); + this->SendMsg(MM_RESET_PARAMETER, 0, 0, 0, 0); break; case TT_REQ_INVITE_PARTY: - this->SendMsg(0x3b, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_REQ_INVITE_GUILD: - this->SendMsg(0x11e, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_REQ_JOIN_GUILD2, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_PRISON_USER: - this->SendMsg(0x13d, reinterpret_cast(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_PRISON_USER, reinterpret_cast(parts[0].c_str()), 0, 0, 0); break; case TT_OPEN_ACCOUNT_LIMITED_TOOL: - this->SendMsg(0x13e, 0, 0, 0, 0); + this->SendMsg(MM_OPEN_ACCOUNT_LIMITED_TOOL, 0, 0, 0, 0); break; case TT_SHOW_EMOTIONLIST: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x25D)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x224)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x22b)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x22c)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x22d)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x22e)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x22f)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x230)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x231)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x232)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x233)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x234)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x235)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x236)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x237)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x238)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x239)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x23a)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x23b)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x23c)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x23d)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x304)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x305)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x306)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x307)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x308)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x309)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30a)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30b)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30c)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30d)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30e)), 0xFFFF64, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x30f)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x25D)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x224)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x22b)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x22c)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x22d)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x22e)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x22f)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x230)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x231)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x232)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x233)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x234)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x235)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x236)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x237)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x238)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x239)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x23a)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x23b)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x23c)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x23d)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x304)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x305)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x306)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x307)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x308)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x309)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30a)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30b)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30c)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30d)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30e)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x30f)), 0xFFFF64, 0, 0, 0); break; } case TT_REQ_RESETSKILL: - this->SendMsg(0x146, std::atoi(parts[0].c_str()), 0, 0, 0); + this->SendMsg(MM_RESET_SKILL, std::atoi(parts[0].c_str()), 0, 0, 0); break; case TT_CHANGE_MAPTYPE: { const int third = std::atoi(parts[2].c_str()); const int second = std::atoi(parts[1].c_str()); - this->SendMsg(0x8F, std::atoi(parts[0].c_str()), second, third, 0); + this->SendMsg(MM_REQ_CHANGE_MAPTYPE, std::atoi(parts[0].c_str()), second, third, 0); break; } case TT_HIDE: { @@ -9854,14 +9856,14 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { } else { SetMemberFlags(&flags); } - this->SendMsg(0x90, 0x40, 0, 0, 0); + this->SendMsg(MM_CHANGE_EFFECTSTATE, 0x40, 0, 0, 0); break; } case TT_COPY_NAME: if (IsAdminAccount(g_session.m_aid)) { const unsigned char enabled = this->unknown_05CC[1]; this->unknown_05CC[1] = enabled == 0; - g_windowMgr.SendNotice(1, reinterpret_cast(enabled == 0 ? "Copy_Name_On!!" : "Copy_Name_Off!!"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(enabled == 0 ? "Copy_Name_On!!" : "Copy_Name_Off!!"), 0x64FFFF, 0, 0, 0); } break; case TT_REQ_ACCEPT_INVITE_PARTY: @@ -9873,7 +9875,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_REQ_OPEN_EQUIPEDITEM_ONOFF: - this->SendMsg(0xFD, *reinterpret_cast(g_session.unknown_5974) == 0, 0, 0, 0); + this->SendMsg(MM_OPEN_EQUIPEDITEM_CHANGE, *reinterpret_cast(g_session.unknown_5974) == 0, 0, 0, 0); break; case TT_SHOW_WEB_ADDRESSBAR: { CWebBrowser* browser = g_windowMgr.activeBrowser; @@ -9918,27 +9920,27 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_NAVIGATION3: - g_windowMgr.EnsureWindow(0xCB); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); break; case TT_SHOW_BUILD_INFO: { char text[1024]; std::memset(text, 0, sizeof(text)); sprintf_s(text, sizeof(text), "", "", ""); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); sprintf_s(text, sizeof(text), "ver : %d.%d.%d", 14, 2, 3); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); sprintf_s(text, sizeof(text), "s/n : %s", ""); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); _snprintf_s(text, _TRUNCATE, "verification : %s", "XXXXXXX"); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); break; } case TT_CLAN_CHAT: g_windowMgr.SetUnknown04DC(parts[0].c_str()); - this->SendMsg(0x121, 0, 0, 0, 0); + this->SendMsg(MM_CHAT_CLAN, 0, 0, 0, 0); break; case TT_SHOW_CASHSHOP_BTN_ON_OFF: { - UIWindow* window = g_windowMgr.LookupWindow(0xBE); + UIWindow* window = g_windowMgr.LookupWindow(WID_NCASH_CALLWND); if (window) { g_serviceOptions.Set(0xDA, !g_serviceOptions.Get(0xDA)); window->Show(g_serviceOptions.Get(0xDA)); @@ -9946,7 +9948,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_SHOW_GOLDPCCAFE_ON_OFF: { - UIWindow* window = g_windowMgr.LookupWindow(0x10B); + UIWindow* window = g_windowMgr.LookupWindow(WID_MILEAGEWND); if (window) { g_serviceOptions.Set(0xDB, !g_serviceOptions.Get(0xDB)); window->Show(g_serviceOptions.Get(0xDB)); @@ -9954,7 +9956,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_SHOW_ROULETTE_BTN_ON_OFF: { - UIWindow* window = g_windowMgr.LookupWindow(0x10C); + UIWindow* window = g_windowMgr.LookupWindow(WID_OPENROULLETTEWND); if (window) { g_serviceOptions.Set(0xDC, !g_serviceOptions.Get(0xDC)); window->Show(g_serviceOptions.Get(0xDC)); @@ -10018,8 +10020,8 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { break; } case TT_ADVEN_PARTY_BOARD: - if (!g_windowMgr.CloseWindow(0x144)) { - g_windowMgr.EnsureWindow(0x144); + if (!g_windowMgr.CloseWindow(WID_ADVENPARTYBOARDWND)) { + g_windowMgr.EnsureWindow(WID_ADVENPARTYBOARDWND); } break; case TT_REMOVE_ON: @@ -10053,7 +10055,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { SYSTEMTIME time; GetLocalTime(&time); if (this->unknown_0648 == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast("확률 로그 시작"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("확률 로그 시작"), 0x64FFFF, 0, 0, 0); std::string name(FormatString("ProbabilityLog(%02d-%02d-%02d).txt", time.wYear, time.wMonth, time.wDay)); FILE* file = std::fopen(name.c_str(), "a"); if (file) { @@ -10062,7 +10064,7 @@ void CGameMode::ExecuteTalkType(int talkType, std::string* arguments) { } std::fclose(file); } else { - g_windowMgr.SendNotice(1, reinterpret_cast("확률 로그 끝"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("확률 로그 끝"), 0x64FFFF, 0, 0, 0); std::string name(FormatString("ProbabilityLog(%02d-%02d-%02d).txt", time.wYear, time.wMonth, time.wDay)); FILE* file = std::fopen(name.c_str(), "a"); if (file) { @@ -10294,7 +10296,7 @@ void CGameMode::ProcessActorPick(int& handled, ActorPickInfo* pick, CGameActor* int& forced = this->forcedAttack; if (g_mouse.buttons[0] == 1 && attack != 0 && !HIBYTE(GetAsyncKeyState(VK_MENU))) { - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); *reinterpret_cast(&this->unknown_00EC[0x08]) = actor->render.accountId; *reinterpret_cast(&this->unknown_00EC[0x0C]) = 0; if (g_session.GetSceneUnknown004C() == 0 && (HIBYTE(GetAsyncKeyState(VK_CONTROL)) || forceOption != 0)) { @@ -10312,7 +10314,7 @@ void CGameMode::ProcessActorPick(int& handled, ActorPickInfo* pick, CGameActor* if (this->IsOverWeight(true)) { return; } - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); g_hoverActorGid = actor->GetPkState(); *reinterpret_cast(&this->unknown_00EC[0x0C]) = 0; } @@ -10793,10 +10795,10 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { int column; int row; this->WorldCell(actor->render.position.x, actor->render.position.z, column, row); - this->scene->player->SendMsg(nullptr, 16, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_REQ_CHANGE_DIR, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); if (g_windowMgr.HasPendingDialog() == true) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFBB)), 255, 25, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFBB)), 255, 25, 0, 0); return result; } @@ -10915,7 +10917,7 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { } if (g_mouse.buttons[0] == 1 && attack && !HIBYTE(GetAsyncKeyState(VK_MENU))) { - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); *reinterpret_cast(&this->unknown_00EC[8]) = pick->accountId; *reinterpret_cast(&this->unknown_00EC[4]) = pick->accountId; this->unknown_00F8 = 0; @@ -10995,7 +10997,7 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { return result; } - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); *reinterpret_cast(&this->unknown_00EC[8]) = pick->accountId; *reinterpret_cast(&this->unknown_00EC[4]) = pick->accountId; this->unknown_00F8 = 0; @@ -11025,14 +11027,14 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { return result; } - this->SendMsg(0x1A, 1, 0, 0, 0); + this->SendMsg(MM_SETLOCKONMOUSE, 1, 0, 0, 0); this->unknown_00F8 = 0; const int skillUse = reinterpret_cast(&this->unknown_0408); if (!HIBYTE(GetAsyncKeyState(VK_CONTROL)) && forceOption == 0) { - this->scene->player->SendMsg(nullptr, 103, 0, pick->accountId, 0, skillUse, skillUse >> 31, 1, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDTOUCHSKILL, 0, pick->accountId, 0, skillUse, skillUse >> 31, 1, 0, 0, 0, 0, 0, 0, 0); this->forcedAttack = 0; } else { - this->scene->player->SendMsg(nullptr, 103, 0, pick->accountId, 0, skillUse, skillUse >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDTOUCHSKILL, 0, pick->accountId, 0, skillUse, skillUse >> 31, 0, 0, 0, 0, 0, 0, 0, 0); this->forcedAttack = 1; } return result; @@ -11040,7 +11042,7 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { default: if (reinterpret_cast(this->unknown_0408) == 5) { const long long skillUse = static_cast(reinterpret_cast(this)) + offsetof(CGameMode, unknown_0408); - this->scene->player->SendMsg(nullptr, 103, 0, pick->accountId, 0, static_cast(skillUse), static_cast(skillUse >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDTOUCHSKILL, 0, pick->accountId, 0, static_cast(skillUse), static_cast(skillUse >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } return result; } @@ -11049,7 +11051,7 @@ int CGameMode::HandleActorPick(ActorPickInfo* pick, int result) { return 0; case 1: if (g_mouse.buttons[0] == 1 && reinterpret_cast(this->unknown_0408) == 0) { - this->scene->player->SendMsg(nullptr, 18, 0, pick->accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_PROCEEDPICKUPITEM, 0, pick->accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case 4: { diff --git a/Source/Client/Mode/GameModeEquipWindow.cpp b/Source/Client/Mode/GameModeEquipWindow.cpp index c513dc38c..b3a3126ae 100644 --- a/Source/Client/Mode/GameModeEquipWindow.cpp +++ b/Source/Client/Mode/GameModeEquipWindow.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/EquipWindowLook.h" #include "Client/Session.h" #include "Contents/Items/ItemInfo.h" @@ -59,7 +60,7 @@ void CGameMode::ReceiveEquipWindowMicroscope(const unsigned char* packet) { std::memcpy(g_equipWindowLook.name, packet + 4, sizeof(g_equipWindowLook.name)); g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } diff --git a/Source/Client/Mode/GameModeHandlers.cpp b/Source/Client/Mode/GameModeHandlers.cpp index 392354849..45cbf61c8 100644 --- a/Source/Client/Mode/GameModeHandlers.cpp +++ b/Source/Client/Mode/GameModeHandlers.cpp @@ -1,4 +1,7 @@ #include "Client/Mode/CGameMode.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "Contents/Actors/ActorEnums.h" #include "Network/Packets/NoticeEnums.h" #include "Contents/Skills/SkillUnitId.h" #include "Network/Packets/ModeResultEnums.h" @@ -388,11 +391,11 @@ void CGameMode::ReceiveGroundSkillExtended(const unsigned char* record) { return; } CGraffiSkill* skill = new CGraffiSkill; - skill->SendMsg(nullptr, 22, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETMASTERGID, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int address = reinterpret_cast(packet.text); const int x = packet.x; const int y = packet.y; - skill->SendMsg(nullptr, 117, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SET_SKILL, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); return; @@ -437,7 +440,7 @@ void CGameMode::ReceiveGroundSkillExtended(const unsigned char* record) { } skill->unknown_0410 = packet.owner; const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D413F0 @@ -481,7 +484,7 @@ void CGameMode::SpawnGroundSkill(std::uint32_t aid, std::uint32_t owner, int val } skill->unknown_0410 = owner; const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } @@ -519,7 +522,7 @@ void CGameMode::ReceivePartyBookingRegisterResult(const unsigned char* packet) { [[fallthrough]]; case 0: case 1: - g_windowMgr.CloseWindow(164); + g_windowMgr.CloseWindow(WID_SEEKPARTYWND); break; } } @@ -530,13 +533,13 @@ void CGameMode::ReceivePartyBookingUpdateResult(const unsigned char* packet) { const std::int16_t result = *reinterpret_cast(packet + 2); if (result == 0) { g_session.m_partyBooking.unknown_0034 = GetTickCount(); - g_windowMgr.EnsureWindow(164); - UISeekPartyWnd* seekWindow = static_cast(g_windowMgr.LookupWindow(164)); + g_windowMgr.EnsureWindow(WID_SEEKPARTYWND); + UISeekPartyWnd* seekWindow = static_cast(g_windowMgr.LookupWindow(WID_SEEKPARTYWND)); if (seekWindow) { - UIWindow* jobWindow = g_windowMgr.LookupWindow(168); + UIWindow* jobWindow = g_windowMgr.LookupWindow(WID_SEEKPARTYMBWND); if (jobWindow) { seekWindow->SetJobs(reinterpret_cast(reinterpret_cast(jobWindow) + 0x16D)); - g_windowMgr.CloseWindow(168); + g_windowMgr.CloseWindow(WID_SEEKPARTYMBWND); } } } else if (result == 2) { @@ -554,7 +557,7 @@ void CGameMode::ReceivePartyBookingSearchResult(const unsigned char* packet) { PARTY_BOOKING_AD_INFO* infos = new PARTY_BOOKING_AD_INFO[count]; std::memcpy(infos, packet + 5, size); g_session.m_partyBooking.m_filterEnabled = true; - UIWindow* window = g_windowMgr.LookupWindow(169); + UIWindow* window = g_windowMgr.LookupWindow(WID_SEEKPARTYLISTWND); if (!window) { return; } @@ -574,7 +577,7 @@ void CGameMode::ReceivePartyBookingSearchResult(const unsigned char* packet) { // FUNCTION: fn_21784 void CGameMode::ReceivePartyBookingDelete(const unsigned char* packet) { g_session.m_partyBooking.Remove(*reinterpret_cast(packet + 2)); - if (UIWindow* window = g_windowMgr.LookupWindow(169)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SEEKPARTYLISTWND)) { window->Invalidate(); } } @@ -583,7 +586,7 @@ void CGameMode::ReceivePartyBookingDelete(const unsigned char* packet) { // FUNCTION: fn_21785 void CGameMode::ReceivePartyBookingInsert(const unsigned char* packet) { g_session.m_partyBooking.OnAdvertisement(*reinterpret_cast(packet + 2)); - if (UIWindow* window = g_windowMgr.LookupWindow(169)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SEEKPARTYLISTWND)) { window->Invalidate(); } } @@ -592,7 +595,7 @@ void CGameMode::ReceivePartyBookingInsert(const unsigned char* packet) { // FUNCTION: fn_21786 void CGameMode::ReceivePartyBookingUpdate(const unsigned char* packet) { g_session.m_partyBooking.SetJobs(*reinterpret_cast(packet + 2), reinterpret_cast(packet + 6)); - if (UIWindow* window = g_windowMgr.LookupWindow(169)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SEEKPARTYLISTWND)) { window->Invalidate(); } } @@ -602,7 +605,7 @@ void CGameMode::ReceivePartyBookingUpdate(const unsigned char* packet) { void CGameMode::ReceiveToggleNotice(const unsigned char* packet) { g_toggleNoticeState = packet[2]; const char* message = LookupMessage(g_toggleNoticeState == 0 ? 1326 : 1325); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00D3BF00 @@ -652,8 +655,8 @@ void CGameMode::ReceivePendingResult(const unsigned char* packet) { } if (!text.empty()) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), color, 0, 0, 0); } } @@ -681,14 +684,14 @@ void CGameMode::ReceiveItem1718BasicList(const unsigned char* packet) { g_session.AddItem1718(item, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(22)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(23)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -697,49 +700,49 @@ void CGameMode::ReceiveItem1718BasicList(const unsigned char* packet) { void CGameMode::ReceiveItem1718Result(const unsigned char* packet) { switch (packet[2]) { case PURCHASE_SUCCEED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; case PURCHASE_FAIL_MONEY: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(55)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(55)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_COUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_WEIGHT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_EACHITEM_COUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1940)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1940)), 0xFF, 0, 0, 0); break; case 10: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2917)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2917)), 0xFFFF00, 0, 0, 0); break; case 11: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 0xFF, 0, 0, 0); break; case 12: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3555)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3555)), 0xFFFF00, 0, 0, 0); break; case 13: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3557)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3557)), 0xFF, 0, 0, 0); break; case 14: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3556)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3556)), 0xFF, 0, 0, 0); break; } - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(23); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); } // OFFSET: 0x00D3C710 @@ -764,10 +767,10 @@ void CGameMode::ReceiveItem1718IndexList(const unsigned char* packet) { } } - UIWindow* window = g_windowMgr.EnsureWindow(22); - window->SendMsg(nullptr, 0x24, 1, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - g_windowMgr.EnsureWindow(24)->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); + window->SendMsg(nullptr, UM_SETTITLE, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMSELLWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00D3CC10 @@ -801,9 +804,9 @@ void CGameMode::ReceivePetAct(unsigned char* packet) { g_session.FormatMonsterSpeech(talk, speech, *reinterpret_cast(packet + 2), 1 - kind); if (std::strcmp(speech, "") != 0) { const std::int64_t text = reinterpret_cast(speech); - actor->SendMsg(nullptr, 7, 0, static_cast(text), static_cast(text >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, static_cast(text), static_cast(text >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (!g_serviceOptions.Get(114) && !g_serviceOptions.Get(148)) { - g_windowMgr.SendNotice(1, reinterpret_cast(speech), 0xFAFAFA, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(speech), 0xFAFAFA, 0, 0, 0); } } } @@ -814,22 +817,22 @@ void CGameMode::ReceivePetAct(unsigned char* packet) { void CGameMode::NotifyResult2571(int result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2571)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2571)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2572)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2572)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2573)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2573)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2574)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2574)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2575)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2575)), 0xFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2576)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2576)), 0xFF, 0, 0, 0); break; case 7: g_session.ResetUnknown1050(); @@ -884,7 +887,7 @@ void CGameMode::ReceivePlayerMessage82(const unsigned char* packet) { return; } - player->SendMsg(nullptr, 0x52, 0, *reinterpret_cast(packet + 6) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_MAKE_SKILL_RECHARGEGAGE, 0, *reinterpret_cast(packet + 6) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_session.unknown_555C[0x0A] = true; } @@ -925,13 +928,13 @@ void CGameMode::ReceiveHomunculusInfo(const unsigned char* data) { g_session.InvalidateWindowFrames(); *reinterpret_cast(&g_session.unknown_5620[4]) = packet->unknown_0047; if (g_windowMgr.window_03C4) { - g_windowMgr.window_03C4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.window_03C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } int& notified = *reinterpret_cast(&g_session.unknown_5620[0]); const std::int16_t state = packet->unknown_001D; if ((state == 1 || state == 5 || state == 10) && notified != state) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); notified = packet->unknown_001D; } } @@ -958,7 +961,7 @@ void CGameMode::ReceiveHomunculusInfo3(const unsigned char* data) { case 5: case 10: if (notified != state) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); notified = packet->unknown_001D; } } @@ -982,7 +985,7 @@ void CGameMode::ReceiveHomunculusInfo3(const unsigned char* data) { *reinterpret_cast(g_session.unknown_1664) = packet->unknown_0051; g_session.InvalidateWindowFrames(); if (g_windowMgr.window_03C4) { - g_windowMgr.window_03C4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.window_03C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } *reinterpret_cast(&g_session.unknown_5620[4]) = packet->unknown_0053; @@ -1029,13 +1032,13 @@ void CGameMode::ReceiveHomunculusInfo2(const unsigned char* data) { g_session.InvalidateWindowFrames(); *reinterpret_cast(&g_session.unknown_5620[4]) = packet->unknown_0047; if (g_windowMgr.window_03C4) { - g_windowMgr.window_03C4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.window_03C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } int& notified = *reinterpret_cast(&g_session.unknown_5620[0]); const std::int16_t state = packet->unknown_001D; if ((state == 1 || state == 5 || state == 10) && notified != state) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); notified = packet->unknown_001D; } } @@ -1058,7 +1061,7 @@ void CGameMode::ReceiveMinimapMarker(const unsigned char* data) { if (g_windowMgr.window_4F1CC) { for (auto it = this->minimapMarkers.begin(); it != this->minimapMarkers.end(); ++it) { if (0 != it->second.unknown_0006) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 485, it->second.unknown_0004, it->second.unknown_0006, it->second.unknown_0000, it->second.unknown_0002); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_ADD_QUEST_MARK, it->second.unknown_0004, it->second.unknown_0006, it->second.unknown_0000, it->second.unknown_0002); } } } @@ -1079,10 +1082,10 @@ void CGameMode::ReceiveBookOpen(const unsigned char* packet) { CFile file; if (!file.Open(path, 0, true, false)) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("책이 없습니다"), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("책이 없습니다"), 0xFF, 0, 0, 0); } else { - g_windowMgr.EnsureWindow(106)->SendMsg(nullptr, 0x5E, reinterpret_cast(number), 287, *reinterpret_cast(packet + 6), 0); + g_windowMgr.EnsureWindow(WID_BOOKWND)->SendMsg(nullptr, UM_GETBOOKCONTENTS, reinterpret_cast(number), 287, *reinterpret_cast(packet + 6), 0); file.Close(); } } @@ -1094,32 +1097,32 @@ void CGameMode::ReceiveResultNotice00FC(const unsigned char* packet) { switch (packet[2]) { case ENTERROOM_FULL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x43)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x43)), 0xFF, 0, 0, 0); break; case ENTERROOM_WRONG_PASSWORD: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(7)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(7)), 0xFF, 0, 0, 0); break; case ENTERROOM_KICKED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x44)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x44)), 0xFF, 0, 0, 0); break; case REFUSETYPE_ZENY: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x37)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x37)), 0xFF, 0, 0, 0); break; case REFUSETYPE_LOWLEVEL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1B0)), 0xFF, 0, 0, 0); break; case REFUSETYPE_HIGHLEVEL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B1)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1B1)), 0xFF, 0, 0, 0); break; case REFUSETYPE_JOB: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B2)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1B2)), 0xFF, 0, 0, 0); break; } } @@ -1231,7 +1234,7 @@ void CGameMode::ReceiveBillingInfo(const unsigned char* packet) { } } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFFFF, 0, 0, 0); } struct ActorMessage32 { @@ -1250,12 +1253,12 @@ void CGameMode::ReceiveServerRateNotice(const unsigned char* packet) { g_session.unknown_54A4 = packet[6]; g_session.unknown_54A8 = packet[7]; if (g_windowMgr.unknown_030C) { - reinterpret_cast(g_windowMgr.unknown_030C)->SendMsg(nullptr, 60, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_030C)->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } char text[128]; std::memset(text, 0, sizeof(text)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (g_session.unknown_54A0) { case EXP_NOTSHARED: std::sprintf(text, "%s - %s : %s", LookupMessage(291), LookupMessage(292), LookupMessage(287)); @@ -1268,7 +1271,7 @@ void CGameMode::ReceiveServerRateNotice(const unsigned char* packet) { break; } if (std::strlen(text) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 12, 0, 0); } switch (g_session.unknown_54A4) { @@ -1280,7 +1283,7 @@ void CGameMode::ReceiveServerRateNotice(const unsigned char* packet) { break; } if (std::strlen(text) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 12, 0, 0); } switch (g_session.unknown_54A8) { @@ -1292,7 +1295,7 @@ void CGameMode::ReceiveServerRateNotice(const unsigned char* packet) { break; } if (std::strlen(text) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 12, 0, 0); } } @@ -1316,7 +1319,7 @@ void CGameMode::ReceiveActorMessage32(const unsigned char* packet) { } const std::int64_t argument = reinterpret_cast(&message); - actor->SendMsg(nullptr, 32, 0, static_cast(argument), static_cast(argument >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_CHAT_TITLE, 0, static_cast(argument), static_cast(argument >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D3F3E0 @@ -1326,9 +1329,9 @@ void CGameMode::ReceiveRequestResult(const unsigned char* packet) { switch (*reinterpret_cast(packet + 6)) { case 0: case 8: { - UIWindow* window = g_windowMgr.LookupWindow(318); + UIWindow* window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND); if (window) { - window->SendMsg(nullptr, 122, *reinterpret_cast(packet + 8), *reinterpret_cast(packet + 12), 0, 0); + window->SendMsg(nullptr, UM_UPDATE_CASHSHOP_BALANCE, *reinterpret_cast(packet + 8), *reinterpret_cast(packet + 12), 0, 0); } if (*reinterpret_cast(packet + 6) == 8) { text = LookupMessage(1814); @@ -1361,8 +1364,8 @@ void CGameMode::ReceiveRequestResult(const unsigned char* packet) { } if (!text.empty()) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); } } @@ -1407,47 +1410,47 @@ void CGameMode::ReceiveStatusNotice(const unsigned char* packet) { default: return; } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x9B9BFF, 8, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x9B9BFF, 8, 0, 0); } // OFFSET: 0x00D40080 // FUNCTION: fn_21816 void CGameMode::ReceiveWindow181Message(const unsigned char* packet) { - UIWindow* window = g_windowMgr.LookupWindow(181); + UIWindow* window = g_windowMgr.LookupWindow(WID_SEARCH_STORE_INFO); if (window) { - window->SendMsg(nullptr, 60, 1, packet[2], 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 1, packet[2], 0, 0); } } // OFFSET: 0x00D40120 // FUNCTION: fn_21817 void CGameMode::ReceiveNamedResultNotice(const unsigned char* packet) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); std::string name(reinterpret_cast(packet + 2)); switch (packet[26]) { case 0: switch (packet[27]) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3389)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3389)).c_str()), 0xFFFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3390)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3390)).c_str()), 0xFFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3391)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3391)).c_str()), 0xFFFF, 0, 0, 0); break; } break; case 1: switch (packet[27]) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3392)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3392)).c_str()), 0xFFFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3393)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3393)).c_str()), 0xFFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast((name + LookupMessage(3394)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((name + LookupMessage(3394)).c_str()), 0xFFFF, 0, 0, 0); break; } break; @@ -1457,28 +1460,28 @@ void CGameMode::ReceiveNamedResultNotice(const unsigned char* packet) { // OFFSET: 0x00D40360 // FUNCTION: fn_21818 void CGameMode::ReceiveResultNotice0118(const unsigned char* packet) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (packet[2]) { case WT_EXCLUDE_WHISPER: switch (packet[3]) { case WHIPSER_SETTING_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(194)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((this->unknown_0118 + LookupMessage(194)).c_str()), 0xFFFF, 0, 0, 0); break; case WHISPER_SETTING_FAILED_OVERCOUNT: - g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(195)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((this->unknown_0118 + LookupMessage(195)).c_str()), 0xFFFF, 0, 0, 0); break; } break; case WT_INCLUDE_WHISPER: switch (packet[3]) { case WHISPER_SETTING_SUCCEED: - g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(196)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((this->unknown_0118 + LookupMessage(196)).c_str()), 0xFFFF, 0, 0, 0); break; case WHIPSER_SETTING_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(197)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((this->unknown_0118 + LookupMessage(197)).c_str()), 0xFFFF, 0, 0, 0); break; case WHISPER_SETTING_FAILED_OVERCOUNT: - g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(198)).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast((this->unknown_0118 + LookupMessage(198)).c_str()), 0xFFFF, 0, 0, 0); break; } break; @@ -1563,7 +1566,7 @@ void CGameMode::ReceiveSummonHpInit(const unsigned char* buffer) { CRenderObject* actor = this->scene->GetGameActorByAID(packet->summonId); if (actor != nullptr) { const std::int64_t id = packet->summonId; - actor->SendMsg(nullptr, 34, 0, static_cast(id), static_cast(id >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, static_cast(id), static_cast(id >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1587,7 +1590,7 @@ void CGameMode::ReceiveSummonHpUpdate(const unsigned char* buffer) { CRenderObject* actor = this->scene->GetGameActorByAID(packet->summonId); if (actor != nullptr) { const std::int64_t id = packet->summonId; - actor->SendMsg(nullptr, 34, 0, static_cast(id), static_cast(id >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, static_cast(id), static_cast(id >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1719,51 +1722,51 @@ void CGameMode::ReceiveRuneRewardPacket(const unsigned char* packet) { const vector3d offset = {598.0f, 219.0f, 0.0f}; const int* words = reinterpret_cast(&offset); effect->SetWindowOffset(words[0], words[1], words[2], 1, 361); - if (UIWindow* window = g_windowMgr.LookupWindow(361)) { - window->SendMsg(window, 0x3C, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(362)) { - window->SendMsg(nullptr, 0x0D, reinterpret_cast(packet), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_RUNESYSTEM_DECOMRESULTWND)) { + window->SendMsg(nullptr, UM_SETSTATE, reinterpret_cast(packet), 0, 0, 0); window->Invalidate(); } break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4075)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4075)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4076)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4076)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4076), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4077)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4077)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4077), 0, true, false, 0, "Message", 280, 120, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4078)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4078)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4078), 0, true, false, 0, "Message", 280, 120, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4079)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4079)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4079), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4080)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4080)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4080), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4081)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4081)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4081), 0, true, false, 0, "Message", 280, 120, 0); break; case 8: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4082)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4082)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(4082), 0, true, false, 0, "Message", 280, 120, 0); break; } g_runeSystemMgr->SetRequestPending(false); - if (UIWindow* window = g_windowMgr.LookupWindow(361)) { - window->SendMsg(window, 0x3C, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); window->SendMsg(nullptr, 0x69, 1000, 0, 0, 0); } } @@ -1808,9 +1811,9 @@ void CGameMode::ReceiveRuneActivation(const unsigned char* data) { } tag->UpdateActiveCount(1); - UIWindow* window = g_windowMgr.LookupWindow(361); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { - window->SendMsg(window, 60, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } } @@ -1840,9 +1843,9 @@ void CGameMode::ReceiveRuneSetGrades(const unsigned char* data) { tag->UpdateActiveCount(0); tag->m_locked = true; - UIWindow* window = g_windowMgr.LookupWindow(361); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { - window->SendMsg(window, 60, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } } @@ -1852,36 +1855,36 @@ void CGameMode::ReceiveRuneRewardResult(int result, int tagId, std::int64_t id, switch (result) { case 0: { g_runeSystemMgr->SetRewardStep(tagId, id, step); - UIWindow* window = g_windowMgr.LookupWindow(361); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { if (step > 0) { - window->SendMsg(window, 178, 224, step - 1, 0, 0); + window->SendMsg(window, UM_RUNE_REWARD_EFFECT, 224, step - 1, 0, 0); } - window->SendMsg(window, 60, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4202)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4202)), 0x64FFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4210)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4210)), 0x64FFFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4211)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4211)), 0x64FFFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4212)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4212)), 0x64FFFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4213)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4213)), 0x64FFFF, 0, 0, 0); break; case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4214)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4214)), 0x64FFFF, 0, 0, 0); break; case 7: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4215)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4215)), 0x64FFFF, 0, 0, 0); break; } } @@ -1899,9 +1902,9 @@ void CGameMode::ReceiveRuneRewardSteps(const unsigned char* data) { g_runeSystemMgr->SetRewardStep(packet->tagId, entry.id, entry.step); } - UIWindow* window = g_windowMgr.LookupWindow(361); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { - window->SendMsg(window, 60, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } } // OFFSET: 0x00D66B10 @@ -1910,7 +1913,7 @@ void CGameMode::ReceiveRodexMailDeleteResult(int mailId, int result) { int message; if (result == 0) { if (g_windowMgr.unknown_045C) { - reinterpret_cast(g_windowMgr.unknown_045C)->SendMsg(nullptr, 6, 201, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_045C)->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } std::map::iterator mail = g_rodexMailStore->m_mails0.find(mailId); @@ -1918,8 +1921,8 @@ void CGameMode::ReceiveRodexMailDeleteResult(int mailId, int result) { if (!mail->second.isRead) { --g_rodexMailStore->unknown_0018; if (g_rodexMailStore->unknown_0018 == 0) { - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 476, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 476, 0, 0); } } } @@ -1935,7 +1938,7 @@ void CGameMode::ReceiveRodexMailDeleteResult(int mailId, int result) { } g_windowMgr.Confirm(LookupMessage(message), 0, true, false, 0, "Message", 280, 120, false); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(message)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00D67360 @@ -1980,8 +1983,8 @@ void CGameMode::ReceiveRuneGradeResult(int result, int tagId, int type, std::int } g_runeSystemMgr->SetRequestPending(false); - if (UIWindow* window = g_windowMgr.LookupWindow(361)) { - window->SendMsg(window, 0x3C, type, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { + window->SendMsg(window, UM_REFRESH, type, 0, 0, 0); window->SendMsg(nullptr, 0x69, 1000, 0, 0, 0); } } @@ -1993,48 +1996,48 @@ int CGameMode::HandleRuneResult(int result) { case 0: return 0; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF4)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF4)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF4), 0, true, false, 0, "Message", 280, 120, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF5)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF5)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF5), 0, true, false, 0, "Message", 280, 120, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF6)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF6)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF6), 0, true, false, 0, "Message", 280, 120, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF7)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF7)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF7), 0, true, false, 0, "Message", 280, 120, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF8)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF8)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF8), 0, true, false, 0, "Message", 280, 120, 0); break; case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFF9)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFF9)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFF9), 0, true, false, 0, "Message", 280, 120, 0); break; case 7: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFA)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFFA)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFFA), 0, true, false, 0, "Message", 280, 120, 0); break; case 8: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFB)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFFB)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFFB), 0, true, false, 0, "Message", 280, 120, 0); break; case 10: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFFC), 0, true, false, 0, "Message", 280, 120, 0); break; case 11: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFFD)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFFD), 0, true, false, 0, "Message", 280, 120, 0); break; case 12: case 13: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFFE)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFFE)), 0xFF, 0, 0, 0); g_windowMgr.Confirm(LookupMessage(0xFFE), 0, true, false, 0, "Message", 280, 120, 0); break; } @@ -2049,9 +2052,9 @@ void CGameMode::ApplyRuneSetResult(int result, int tagId, int runeSetId) { g_runeSystemMgr->SetCurRuneSet(tagId, runeSetId, -1, -1); } - UIWindow* window = g_windowMgr.LookupWindow(0x169); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { - window->SendMsg(window, 0x3C, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } } @@ -2064,9 +2067,9 @@ void CGameMode::ApplyRuneSetResultWithRequest(int result, int tagId, int runeSet g_runeSystemMgr->SendRequest(0x0BCB, nullptr, tagId); - UIWindow* window = g_windowMgr.LookupWindow(0x169); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (window) { - window->SendMsg(window, 0x3C, 0, 0, 0, 0); + window->SendMsg(window, UM_REFRESH, 0, 0, 0, 0); } } @@ -2078,12 +2081,12 @@ void CGameMode::ReceiveGameOptionResult(int command, int result, int enabled) { } if (command == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF15)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF15)), 0x64FFFF, 0, 0, 0); } g_gameOptionFlag = enabled != 0; g_windowMgr.RefreshGameSettings(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(g_gameOptionFlag ? 0xF17 : 0xF16)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(g_gameOptionFlag ? 0xF17 : 0xF16)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00D678E0 @@ -2098,7 +2101,7 @@ void CGameMode::ReceiveServiceRequest(unsigned char type, int value) { this->OpenServiceWindow(type); break; case OUT_UI_TIP: - if (UITipboxWnd* window = static_cast(g_windowMgr.EnsureWindow(315))) { + if (UITipboxWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_TIPBOXWND))) { window->ShowTip(value); } break; @@ -2106,12 +2109,12 @@ void CGameMode::ReceiveServiceRequest(unsigned char type, int value) { g_renewQuestMgr->ShowQuestInfo(value); break; case OUT_UI_ATTENDANCE: - if (UIWindow* window = g_windowMgr.EnsureWindow(328)) { - window->SendMsg(nullptr, 0x22, value, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_CHECKATTENDANCEWND)) { + window->SendMsg(nullptr, UM_SETINFO, value, 0, 0, 0); } break; case OUT_UI_ENCHANTGRADE: - g_windowMgr.EnsureWindow(343); + g_windowMgr.EnsureWindow(WID_GRADEENCHANTWND); break; } } @@ -2131,7 +2134,7 @@ void CGameMode::ReceiveGradeEnchantResult(const unsigned char* packet) { } } - auto* window = static_cast(g_windowMgr.LookupWindow(343)); + auto* window = static_cast(g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)); if (window) { const int result = *reinterpret_cast(packet + 6); switch (result) { @@ -2181,8 +2184,8 @@ void CGameMode::ReceiveAchievementUpdate( static_cast(this->unknown_05FC)->m_outlineColor = 0; this->unknown_05FC->Move(0, 50); g_effectMgr->Spawn(g_session.m_aid, 0x446, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); - if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { - window->SendMsg(nullptr, 6, 0x11E, 0x1D9, 1, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0x1D9, 1, 0); } } @@ -2199,13 +2202,13 @@ void CGameMode::ReceiveAchievementUpdate( record.rewarded = rewarded; g_session.UpdateRecord6144(record); - if (UIWindow* window = g_windowMgr.LookupWindow(0x10E)) { - window->SendMsg(nullptr, 60, id, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ACHIEVEMENTWND)) { + window->SendMsg(nullptr, UM_REFRESH, id, 0, 0, 0); } g_session.RefreshTrackedAchievement(id); if (g_session.HasUnknown6178Records() == true) { - if (UIWindow* window = g_windowMgr.EnsureWindow(0x10F)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ACHTRACINGWND)) { window->Invalidate(); } } @@ -2218,8 +2221,8 @@ void CGameMode::ReceiveAchievementResult(unsigned char result, int id) { return; } - if (UIWindow* window = g_windowMgr.LookupWindow(270)) { - window->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ACHIEVEMENTWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } const int index = g_session.AddUnknown6160(id); @@ -2265,19 +2268,19 @@ void CGameMode::ReceiveItemReward2(const unsigned char* data) { g_session.AddStackedItem(reward); g_session.RemoveItem1710(reward.unknown_0000[1], reward.quantity); g_session.unknown_6140 = value; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2594)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2594)), 0x64FFFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2630)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2630)), 0x64FFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2629)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2629)), 0x64FFFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2697)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2697)), 0x64FFFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2699)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2699)), 0x64FFFF, 0, 0, 0); break; } } @@ -2306,20 +2309,20 @@ void CGameMode::ReceiveItemReward(const unsigned char* data) { g_session.AddStackedItem(item); g_session.RemoveItem1710(packet->index, packet->quantity); g_session.unknown_6140 = packet->value; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2594)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2594)), 0x64FFFF, 0, 0, 0); break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2630)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2630)), 0x64FFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2629)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2629)), 0x64FFFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2697)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2697)), 0x64FFFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2699)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2699)), 0x64FFFF, 0, 0, 0); break; } } @@ -2348,7 +2351,7 @@ int CGameMode::RejectRequest(int, int, int, int, int) { // OFFSET: 0x00D65FA0 // FUNCTION: fn_22006 void CGameMode::EnsureWindow259(const unsigned char*) { - g_windowMgr.EnsureWindow(0x103); + g_windowMgr.EnsureWindow(WID_SECONDCOSTUMEWND); } // OFFSET: 0x00D66A50 @@ -2359,13 +2362,13 @@ void CGameMode::IgnoreRemovedPacket12(const unsigned char*, int, int, int, int) // OFFSET: 0x00D67670 // FUNCTION: fn_22031 void CGameMode::ToggleWindow169(unsigned char enable) { - UIWindow* window = g_windowMgr.LookupWindow(0x169); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (enable != 0) { if (!window) { - g_windowMgr.EnsureWindow(0x169); + g_windowMgr.EnsureWindow(WID_RUNESYSTEMWND); } } else if (window) { - g_windowMgr.CloseWindow(0x169); + g_windowMgr.CloseWindow(WID_RUNESYSTEMWND); } } @@ -2379,7 +2382,7 @@ struct RequestWindow169Packet { // OFFSET: 0x00D67600 // FUNCTION: fn_22030 void CGameMode::RequestWindow169(unsigned char enable) { - UIWindow* window = g_windowMgr.LookupWindow(0x169); + UIWindow* window = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND); if (enable != 0) { if (!window) { RequestWindow169Packet packet; @@ -2388,7 +2391,7 @@ void CGameMode::RequestWindow169(unsigned char enable) { GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); } } else if (window) { - g_windowMgr.CloseWindow(0x169); + g_windowMgr.CloseWindow(WID_RUNESYSTEMWND); } } @@ -2396,7 +2399,7 @@ void CGameMode::RequestWindow169(unsigned char enable) { // FUNCTION: fn_22020 void CGameMode::ShowNoticeText(std::string text) { const std::string message = FormatOwnedString(LookupMessage(0xF18), text.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0x64FFFF, 0, 0, 0); } struct DdukddakBoxTestEntry { @@ -2483,7 +2486,7 @@ void CGameMode::ReceiveBroadcastBalloonNotice(const unsigned char* packet) { balloon->AddMessage(0, message); } if (g_serviceType == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); } } } @@ -2540,8 +2543,8 @@ void CGameMode::ReceiveWindow95Data(const unsigned char* packet) { std::vector data; data.insert(data.end(), packet + 8, packet + 8 + size); - if (UIWindow* window = g_windowMgr.EnsureWindow(95)) { - window->SendMsg(nullptr, 0x22, reinterpret_cast(data.data()), size, *reinterpret_cast(packet + 4), 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_SELECTCARTWND)) { + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(data.data()), size, *reinterpret_cast(packet + 4), 0); } } @@ -2560,7 +2563,7 @@ void CGameMode::ReceiveSimulationResult(const unsigned char* packet) { const SimulationResultPacket& value = *reinterpret_cast(packet); switch (value.kind) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast("Simulator Start Fail!!!!!!!!!!!!"), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("Simulator Start Fail!!!!!!!!!!!!"), 255, 0, 0, 0); break; case 1: this->ReceivePackageSimulation(packet); @@ -2643,7 +2646,7 @@ void CGameMode::Zc_Skill_Entry(const unsigned char* record) { skill->unknown_0410 = packet.owner; const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D40730 @@ -2664,9 +2667,9 @@ void CGameMode::Zc_Skill_Entry2(const unsigned char* record) { CGraffiSkill* skill = new CGraffiSkill; this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); - skill->SendMsg(nullptr, 22, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETMASTERGID, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int address = reinterpret_cast(packet.text); - skill->SendMsg(nullptr, 117, 0, address, address >> 31, data.x, data.x >> 31, data.y, data.y >> 31, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SET_SKILL, 0, address, address >> 31, data.x, data.x >> 31, data.y, data.y >> 31, 0, 0, 0, 0, 0, 0); return; } @@ -2692,7 +2695,7 @@ void CGameMode::Zc_Skill_Entry2(const unsigned char* record) { } const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D40970 @@ -2706,11 +2709,11 @@ void CGameMode::ReceiveGroundSkill8(const unsigned char* record) { CGraffiSkill* skill = new CGraffiSkill; this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); - skill->SendMsg(nullptr, 22, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETMASTERGID, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int address = reinterpret_cast(packet.text); const int x = packet.x; const int y = packet.y; - skill->SendMsg(nullptr, 117, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SET_SKILL, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); return; } @@ -2750,7 +2753,7 @@ void CGameMode::ReceiveGroundSkill8(const unsigned char* record) { } skill->unknown_0410 = packet.owner; const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D40BC0 @@ -2764,11 +2767,11 @@ void CGameMode::ReceiveGroundSkill32(const unsigned char* record) { CGraffiSkill* skill = new CGraffiSkill; this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); - skill->SendMsg(nullptr, 22, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETMASTERGID, 0, packet.aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int address = reinterpret_cast(packet.text); const int x = packet.x; const int y = packet.y; - skill->SendMsg(nullptr, 117, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SET_SKILL, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); return; } @@ -2810,7 +2813,7 @@ void CGameMode::ReceiveGroundSkill32(const unsigned char* record) { } skill->unknown_0410 = packet.owner; const int address = reinterpret_cast(&data); - skill->SendMsg(nullptr, 45, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } #pragma pack(push, 1) @@ -2875,14 +2878,14 @@ Unknown015D4818* g_unknown_015D4818; // OFFSET: 0x00D3BD40 // FUNCTION: fn_21790 void CGameMode::ReceivePendingItem1718List(const unsigned char* packet) { - if (g_windowMgr.unknown_01E4 || g_windowMgr.LookupWindow(318)) { + if (g_windowMgr.unknown_01E4 || g_windowMgr.LookupWindow(WID_CASHSHOP_WND)) { return; } g_session.ClearTradeItems(); if (g_session.m_channelCopId == 1) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("한게임 유저는 12월 3일부로 유료아이템 구매가 불가능합니다."), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("한게임 유저는 12월 3일부로 유료아이템 구매가 불가능합니다."), 0xFF, 0, 0, 0); return; } @@ -2908,12 +2911,12 @@ void CGameMode::ReceivePendingItem1718List(const unsigned char* packet) { g_pendingGid = *reinterpret_cast(packet + 8); this->unknown_024C = 1; - UIWindow* window = g_windowMgr.EnsureWindow(22); - window->SendMsg(nullptr, 0x24, 0, 1, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window = g_windowMgr.EnsureWindow(23); - window->SendMsg(nullptr, 0x24, 1, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); + window->SendMsg(nullptr, UM_SETTITLE, 0, 1, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window = g_windowMgr.EnsureWindow(WID_ITEMPURCHASEWND); + window->SendMsg(nullptr, UM_SETTITLE, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00D66860 @@ -2935,7 +2938,7 @@ void CGameMode::ReceiveClanChat(const unsigned char* packet) { } if (!g_serviceOptions.Get(148)) { - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xB4B4FF, 21, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xB4B4FF, 21, 0, 0); } } @@ -3000,10 +3003,10 @@ static_assert(sizeof(SearchStoreItemPacketOld) == 0x8D); void CGameMode::ReceiveSearchStoreItems(const unsigned char* packet) { const SearchStorePacketHeader* header = reinterpret_cast(packet); const SearchStoreItemPacket* items = reinterpret_cast(packet + 7); - UIWindow* window = g_windowMgr.LookupWindow(181); + UIWindow* window = g_windowMgr.LookupWindow(WID_SEARCH_STORE_INFO); if (header->reset) { if (window) { - window->SendMsg(nullptr, 60, 1, 387, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 1, 387, 0, 0); } g_session.unknown_5BD4.clear(); } @@ -3038,7 +3041,7 @@ void CGameMode::ReceiveSearchStoreItems(const unsigned char* packet) { g_session.unknown_5BD4.push_back(entry); } if (window) { - window->SendMsg(nullptr, 60, 1, 184, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 1, 184, 0, 0); } } @@ -3047,10 +3050,10 @@ void CGameMode::ReceiveSearchStoreItems(const unsigned char* packet) { void CGameMode::ReceiveSearchStoreItemsOld(const unsigned char* packet) { const SearchStorePacketHeader* header = reinterpret_cast(packet); const SearchStoreItemPacketOld* next = reinterpret_cast(packet + 7); - UIWindow* window = g_windowMgr.LookupWindow(181); + UIWindow* window = g_windowMgr.LookupWindow(WID_SEARCH_STORE_INFO); if (header->reset) { if (window) { - window->SendMsg(nullptr, 60, 1, 387, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 1, 387, 0, 0); } g_session.unknown_5BD4.clear(); } @@ -3084,6 +3087,6 @@ void CGameMode::ReceiveSearchStoreItemsOld(const unsigned char* packet) { g_session.unknown_5BD4.push_back(entry); } if (window) { - window->SendMsg(nullptr, 60, 1, 184, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 1, 184, 0, 0); } } diff --git a/Source/Client/Mode/GameModeItemLists.cpp b/Source/Client/Mode/GameModeItemLists.cpp index 6e9e0f8b9..184d4bb8c 100644 --- a/Source/Client/Mode/GameModeItemLists.cpp +++ b/Source/Client/Mode/GameModeItemLists.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "UI/Window/WindowId.h" #include "Contents/Items/InventoryType.h" #include "Client/Session.h" #include "Contents/ClientState.h" @@ -181,7 +182,7 @@ void CGameMode::ReceiveInventoryStart(const unsigned char* packet) { case INVTYPE_GUILD_STORAGE: { char title[24] = {}; memcpy_s(title, sizeof(title), packet + 5, length); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (window) { const std::size_t titleLength = std::strlen(title); if (titleLength != 0) { diff --git a/Source/Client/Mode/GameModeMiniMap.cpp b/Source/Client/Mode/GameModeMiniMap.cpp index 3c7b6702d..b265536c2 100644 --- a/Source/Client/Mode/GameModeMiniMap.cpp +++ b/Source/Client/Mode/GameModeMiniMap.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Input/Mouse.h" #include "Client/Session.h" @@ -173,14 +175,14 @@ void CGameMode::RemoveMiniMapPing(std::uint32_t id) { void CGameMode::DrawMiniMapMembers(const TextureRegion& view) { int index = 0; if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E4, 0, this->unknown_01B4.size(), 0, 0); - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E4, 1, this->unknown_01BC.size(), 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_MARK_COUNT, 0, this->unknown_01B4.size(), 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_MARK_COUNT, 1, this->unknown_01BC.size(), 0, 0); } for (auto it = this->unknown_01B4.begin(); it != this->unknown_01B4.end(); ++it) { this->DrawMiniMapMarker(view, it->second.x, it->second.y, 2, std::string(), 2, it->second.color, false); if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E3, 0, index, it->second.x, it->second.y); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_MARK_POS, 0, index, it->second.x, it->second.y); } ++index; } @@ -189,7 +191,7 @@ void CGameMode::DrawMiniMapMembers(const TextureRegion& view) { if (this->unknown_01B4.find(it->first) == this->unknown_01B4.end()) { this->DrawMiniMapMarker(view, it->second.x, it->second.y, 2, std::string(), 1, it->second.color, false); if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E3, 1, index, it->second.x, it->second.y); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_MARK_POS, 1, index, it->second.x, it->second.y); } } ++index; @@ -440,7 +442,7 @@ void CGameMode::DrawMiniMapMarker( if (g_windowMgr.window_4F1CC && (s_lastMarkerX != x || s_lastMarkerY != y)) { s_lastMarkerX = x; s_lastMarkerY = y; - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E2, x, y, 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_BOSS_POS, x, y, 0, 0); } } else if (kind == 1) { this->DrawMiniMapTriangle(static_cast(drawX), static_cast(drawY), static_cast(size + 1), 0xAAFFFFFF); @@ -454,7 +456,7 @@ void CGameMode::DrawMiniMapMarker( this->DrawTexture(border, 0, 0.0999f, 0x99FFFFFF, g_texMgr.Default(), region); this->DrawTexture(rect, 0, 0.0999f, color, g_texMgr.Default(), region); if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E3, x, y, 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_MARK_POS, x, y, 0, 0); } } else if (kind == 3) { const double arm = size * 4; @@ -483,7 +485,7 @@ void CGameMode::DrawMiniMapMarker( s_lastPlayerX = x; s_lastPlayerY = y; if (g_windowMgr.window_4F1CC) { - g_windowMgr.window_4F1CC->SendMsg(nullptr, 0x1E1, x, y, 0, 0); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_SET_PLAYER_POS, x, y, 0, 0); } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_01C0)) { window->Invalidate(); @@ -491,9 +493,9 @@ void CGameMode::DrawMiniMapMarker( } } else if (kind == 6) { if (texture.size() == 0) { - g_windowMgr.LookupWindow(14)->SendMsg(nullptr, 6, 0x1C5, color, rect.left, rect.top); + g_windowMgr.LookupWindow(WID_MINIMAPZOOMWND)->SendMsg(nullptr, UM_COMMAND, 0x1C5, color, rect.left, rect.top); } else { - g_windowMgr.LookupWindow(14)->SendMsg(nullptr, 6, 0x1C7, color, rect.left, rect.top); + g_windowMgr.LookupWindow(WID_MINIMAPZOOMWND)->SendMsg(nullptr, UM_COMMAND, 0x1C7, color, rect.left, rect.top); this->DrawTexture(rect, 0, 0.0999f, 0xFFFFFFFF, g_texMgr.Load(texture.c_str(), 0, false, true, false), region); } } @@ -893,8 +895,8 @@ void CGameMode::RefreshMiniMapTooltips() { switch (tooltipId) { case 10: g_windowMgr.CycleWindowVisibilityTwice(); - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); - window->SendMsg(nullptr, 0x22, 10, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 10, 0, 0, 0); x = g_renderer->viewport.centerX - window->geometry.width / 2; y = g_renderer->viewport.centerY - window->geometry.height / 2; break; @@ -907,17 +909,17 @@ void CGameMode::RefreshMiniMapTooltips() { x = 160; break; case 12: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = 0; y = g_renderer->viewport.height - window->geometry.height; break; case 13: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = g_renderer->viewport.centerX - window->geometry.width / 2; y = g_renderer->viewport.height - window->geometry.height; break; case 14: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = g_renderer->viewport.width - window->geometry.width; y = g_renderer->viewport.height - window->geometry.height; break; @@ -935,7 +937,7 @@ int CGameMode::UpdateMiniMapTooltip() { if (id > 9 || id == -1) { this->RefreshMiniMapTooltips(); if (tooltipId == -1 && g_windowMgr.unknown_0348 != nullptr) { - return g_windowMgr.CloseWindow(0x4E); + return g_windowMgr.CloseWindow(WID_ILLUSTWND); } return tooltipId; } @@ -946,7 +948,7 @@ int CGameMode::UpdateMiniMapTooltip() { UIWindow* window = g_windowMgr.unknown_0348; if (window == nullptr) { - window = g_windowMgr.EnsureWindow(0x4E); + window = g_windowMgr.EnsureWindow(WID_ILLUSTWND); g_miniMapTooltipId = tooltipId; } else { if (id == g_miniMapTooltipId && std::strcmp(g_miniMapTooltipText, tooltipText.c_str()) == 0) { @@ -956,36 +958,36 @@ int CGameMode::UpdateMiniMapTooltip() { } std::sprintf(g_miniMapTooltipText, tooltipText.c_str()); - window->SendMsg(nullptr, 0x22, -1, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, -1, 0, 0, 0); int x = 160; int y = 0; switch (tooltipId) { case 0: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = 200; y = g_renderer->viewport.height - window->geometry.height; break; case 1: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = g_renderer->viewport.centerX; y = g_renderer->viewport.height - window->geometry.height; break; case 2: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); x = g_renderer->viewport.width - 200; y = g_renderer->viewport.height - window->geometry.height; break; case 3: - window->SendMsg(nullptr, 0x22, -2, 0, 0, 0); - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); - window->SendMsg(nullptr, 0x22, 3, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, -2, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 3, 0, 0, 0); x = g_renderer->viewport.centerX; y = g_renderer->viewport.centerY - window->geometry.height / 2; break; case 4: - window->SendMsg(nullptr, 0x4E, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); - window->SendMsg(nullptr, 0x22, 4, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BITMAP, reinterpret_cast(tooltipText.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 4, 0, 0, 0); x = g_renderer->viewport.centerX; y = g_renderer->viewport.centerY - window->geometry.height / 2; break; diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index 75e05578d..dff691011 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -1,4 +1,8 @@ #include "UI/Chat/UINewChatWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Application/Launcher.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/CGameMode.h" @@ -354,7 +358,7 @@ void CGameMode::ReceiveStatus(const unsigned char* data) { g_session.InvalidateWindowFrames(); if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_01C4)) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } } @@ -401,7 +405,7 @@ void CGameMode::ReceiveStatusChange(const unsigned char* data) { break; default: if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_01C4)) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } return; } @@ -409,7 +413,7 @@ void CGameMode::ReceiveStatusChange(const unsigned char* data) { g_session.InvalidateWindowFrames(); if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_01C4)) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } } @@ -436,42 +440,42 @@ void CGameMode::ReceiveStatusChangeAck(const unsigned char* data) { g_session.m_standardStats[0] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_AGI: g_session.m_standardStats[1] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_VIT: g_session.m_standardStats[2] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_INT: g_session.m_standardStats[3] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_DEX: g_session.m_standardStats[4] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_LUK: g_session.m_standardStats[5] = packet->value; g_session.InvalidateWindowFrames(); if (window) { - window->SendMsg(nullptr, 35, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_ATK1: @@ -533,7 +537,7 @@ void CGameMode::ReceiveStatusChangeAck(const unsigned char* data) { case SP_JOBLEVEL: g_session.m_jobLevel = packet->value; g_session.InvalidateWindowFrames(); - g_windowMgr.EnsureWindow(49); + g_windowMgr.EnsureWindow(WID_NOTIFYJOBLEVELUPWND); break; } } @@ -554,7 +558,7 @@ void CGameMode::StopActorMove(std::uint32_t aid, std::int16_t x, std::int16_t y, const int posX = x; const int posY = y; const int value = flag; - actor->SendMsg(nullptr, 19, 0, posX, posX >> 31, posY, posY >> 31, 0, 0, value, value >> 31, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STOPMOVE, 0, posX, posX >> 31, posY, posY >> 31, 0, 0, value, value >> 31, 0, 0, 0, 0); } // OFFSET: 0x00D69140 @@ -562,13 +566,13 @@ void CGameMode::StopActorMove(std::uint32_t aid, std::int16_t x, std::int16_t y, void CGameMode::NotifyResult2877(int result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2877)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2877)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2878)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2878)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2879)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2879)), 0xFF, 0, 0, 0); break; } } @@ -602,9 +606,9 @@ void CGameMode::ReceiveRodexMailDeleted(const unsigned char* packet) { if (!mail->second.isRead) { --g_rodexMailStore->unknown_0018; if (g_rodexMailStore->unknown_0018 == 0) { - UIWindow* window = g_windowMgr.LookupWindow(307); + UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND); if (window) { - window->SendMsg(nullptr, 6, 286, 476, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 476, 0, 0); } } } @@ -621,19 +625,19 @@ refresh: void CGameMode::NotifyResult3562(const unsigned char* packet) { switch (reinterpret_cast(packet)->value) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3566)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3566)), 0xFFFF00, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3562)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3562)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3563)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3563)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3564)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3564)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3565)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3565)), 0xFF, 0, 0, 0); break; } } @@ -661,25 +665,25 @@ void CGameMode::ReceiveRouletteResult(const unsigned char* packet) { bonus = 1; break; case GENERATE_ROULETTE_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2634)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2634)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_0464) { g_windowMgr.EnableRouletteWnd(); } return; case GENERATE_ROULETTE_NO_ENOUGH_POINT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2635)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2635)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_0464) { g_windowMgr.EnableRouletteWnd(); } return; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2693)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2693)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_0464) { g_windowMgr.EnableRouletteWnd(); } return; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2700)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2700)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_0464) { g_windowMgr.EnableRouletteWnd(); } @@ -705,22 +709,22 @@ void CGameMode::NotifyResult4013(unsigned char result, unsigned short value) { case 0: std::memset(text, 0, sizeof(text)); StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(4013), value); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4014)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4014)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4015)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4015)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4016)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4016)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4017)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4017)), 0xFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4018)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4018)), 0xFF, 0, 0, 0); break; } } @@ -753,7 +757,7 @@ void CGameMode::NotifyWindow4F258(int result) { break; case 5: window->SendMsg(nullptr, 154, reinterpret_cast(LookupMessage(3352)), 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1923)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1923)), 0xFF, 0, 0, 0); break; } } @@ -763,10 +767,10 @@ void CGameMode::NotifyWindow4F258(int result) { void CGameMode::ReceiveNamedResult(std::uint32_t, std::string name, int result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4068)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4068)), 0x64FFFF, 0, 0, 0); break; case 1: { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(4069), name.c_str()).c_str()), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(4069), name.c_str()).c_str()), 0x64FFFF, 0, 0, 0); CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (scene) { @@ -775,22 +779,22 @@ void CGameMode::ReceiveNamedResult(std::uint32_t, std::string name, int result) break; } case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4070)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4070)), 0x64FFFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4071)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4071)), 0x64FFFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4072)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4072)), 0x64FFFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4073)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4073)), 0x64FFFF, 0, 0, 0); break; case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4096)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4096)), 0x64FFFF, 0, 0, 0); break; case 7: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4000)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4000)), 0x64FFFF, 0, 0, 0); break; } } @@ -801,15 +805,15 @@ void CGameMode::ReceiveBasicInfoResult(unsigned char result) { switch (result) { case 1: case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3956)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3956)), 0xFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 106, 575, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_SET_DISABLE, 575, 0, 0, 0); } break; } if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 106, 575, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_SET_DISABLE, 575, 0, 0, 0); } } @@ -820,28 +824,28 @@ void CGameMode::ReceiveUnknown0454Result(const unsigned char* data) { switch (packet->value) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2587)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2587)), 0x64FFFF, 0, 0, 0); break; case 1: - g_modeMgr.GetGameMode()->SendMsg(293, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2597)), 0x64FFFF, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_WRITE_RODEX, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2597)), 0x64FFFF, 0, 0, 0); break; case 2: - g_modeMgr.GetGameMode()->SendMsg(293, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2603)), 0x64FFFF, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_WRITE_RODEX, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2603)), 0x64FFFF, 0, 0, 0); break; case 3: - g_modeMgr.GetGameMode()->SendMsg(293, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2598)), 0x64FFFF, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_WRITE_RODEX, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2598)), 0x64FFFF, 0, 0, 0); break; case 4: - g_modeMgr.GetGameMode()->SendMsg(293, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2599)), 0x64FFFF, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_WRITE_RODEX, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2599)), 0x64FFFF, 0, 0, 0); break; } if (g_windowMgr.unknown_0454) { - reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, 60, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -850,28 +854,28 @@ void CGameMode::ReceiveUnknown0454Result(const unsigned char* data) { void CGameMode::ReceiveWindow154Result(std::int16_t value) { switch (value) { case 0: { - UIWindow* window = g_windowMgr.LookupWindow(340); + UIWindow* window = g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND); if (window) { - window->SendMsg(nullptr, 64, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_PARAM, 1, 0, 0, 0); } break; } case 1: { - UIWindow* window = g_windowMgr.LookupWindow(340); + UIWindow* window = g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND); if (window) { - window->SendMsg(nullptr, 64, 1, 1, 0, 0); + window->SendMsg(nullptr, UM_PARAM, 1, 1, 0, 0); } break; } case 3: { - UIWindow* window = g_windowMgr.LookupWindow(340); + UIWindow* window = g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND); if (window) { - window->SendMsg(nullptr, 64, 1, 3, 0, 0); + window->SendMsg(nullptr, UM_PARAM, 1, 3, 0, 0); } break; } case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2517)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2517)), 0xFF, 0, 0, 0); break; } } @@ -881,13 +885,13 @@ void CGameMode::ReceiveWindow154Result(std::int16_t value) { void CGameMode::ReceiveResultNotice(int result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4125)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4125)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4126)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4126)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4127)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4127)), 0xFF, 0, 0, 0); break; } } @@ -932,9 +936,9 @@ void CGameMode::ReceiveActorPairFreeze(const unsigned char* data) { // OFFSET: 0x00D6E100 // FUNCTION: fn_22096 void CGameMode::RefreshWindow16(const unsigned char*) { - UIWindow* window = g_windowMgr.LookupWindow(16); + UIWindow* window = g_windowMgr.LookupWindow(WID_SAYDIALOGWND); if (window) { - window->SendMsg(nullptr, 75, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); } } @@ -947,7 +951,7 @@ void CGameMode::ReceiveEffectRemove(const unsigned char* data) { if (actor) { while (static_cast(actor)->HasId(packet->effectId)) { const std::int64_t effectId = packet->effectId; - actor->SendMsg(nullptr, 109, 0, static_cast(effectId), static_cast(effectId >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, static_cast(effectId), static_cast(effectId >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -984,9 +988,9 @@ void CGameMode::ReceiveUnknown0294Text(const unsigned char* data) { // FUNCTION: fn_22110 void CGameMode::ReceiveWindow154Close(std::int16_t value) { if (value == 0) { - UIWindow* window = g_windowMgr.LookupWindow(340); + UIWindow* window = g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND); if (window) { - window->SendMsg(nullptr, 64, 2, 0, 0, 0); + window->SendMsg(nullptr, UM_PARAM, 2, 0, 0, 0); } } } @@ -994,7 +998,7 @@ void CGameMode::ReceiveWindow154Close(std::int16_t value) { // OFFSET: 0x00D6EA30 // FUNCTION: fn_22111 void CGameMode::SetWindow16Align(unsigned char align) { - UISayDialogWnd* window = static_cast(g_windowMgr.LookupWindow(16)); + UISayDialogWnd* window = static_cast(g_windowMgr.LookupWindow(WID_SAYDIALOGWND)); if (window) { static_cast(window->m_viewer)->SetAlign(align); } @@ -1003,7 +1007,7 @@ void CGameMode::SetWindow16Align(unsigned char align) { // OFFSET: 0x00D6EA60 // FUNCTION: fn_22112 void CGameMode::PlaceWindow16(unsigned int xPercent, unsigned int yPercent) { - UIWindow* window = g_windowMgr.LookupWindow(16); + UIWindow* window = g_windowMgr.LookupWindow(WID_SAYDIALOGWND); if (window) { window->Move(static_cast((g_renderer->viewport.width - window->geometry.width) * (xPercent * 0.01)), static_cast((g_renderer->viewport.height - window->geometry.height) * (yPercent * 0.01))); @@ -1013,7 +1017,7 @@ void CGameMode::PlaceWindow16(unsigned int xPercent, unsigned int yPercent) { // OFFSET: 0x00D6EB00 // FUNCTION: fn_22113 void CGameMode::MoveWindow16(int x, int y) { - UIWindow* window = g_windowMgr.LookupWindow(16); + UIWindow* window = g_windowMgr.LookupWindow(WID_SAYDIALOGWND); if (window) { window->Move(x, y); } @@ -1022,7 +1026,7 @@ void CGameMode::MoveWindow16(int x, int y) { // OFFSET: 0x00D6EB20 // FUNCTION: fn_22114 void CGameMode::ResizeWindow16(int width, int height) { - UIWindow* window = g_windowMgr.LookupWindow(16); + UIWindow* window = g_windowMgr.LookupWindow(WID_SAYDIALOGWND); if (window) { window->Resize(width, height); } @@ -1036,7 +1040,7 @@ void CGameMode::ReceiveUnknown7FBC(const unsigned char* data) { if (100 >= packet->value) { g_session.unknown_7FBC = packet->value; if (g_windowMgr.unknown_01D4) { - reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } } @@ -1044,7 +1048,7 @@ void CGameMode::ReceiveUnknown7FBC(const unsigned char* data) { // OFFSET: 0x00D6EC10 // FUNCTION: fn_22118 void CGameMode::ReceiveNotice1950(const unsigned char*) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1950)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1950)), 0xFF, 0, 0, 0); } // OFFSET: 0x00D6EC40 @@ -1061,7 +1065,7 @@ void CGameMode::ReceiveActorMessage144(const unsigned char* data) { if (actor) { const std::int64_t x = packet->x; const std::int64_t y = packet->y; - actor->SendMsg(nullptr, 144, 0, static_cast(x), static_cast(x >> 32), static_cast(y), static_cast(y >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_FALLEN_ANGEL, 0, static_cast(x), static_cast(x >> 32), static_cast(y), static_cast(y >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1070,19 +1074,19 @@ void CGameMode::ReceiveActorMessage144(const unsigned char* data) { void CGameMode::NotifyResult4138(int result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4138)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4138)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4139)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4139)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4140)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4140)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4187)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4187)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4141)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4141)), 0xFF, 0, 0, 0); break; } } @@ -1125,11 +1129,11 @@ void CGameMode::ReceiveGradeEnchantInfo(const unsigned char* data) { const auto* packet = reinterpret_cast(data); const int count = static_cast(packet->length - sizeof(GradeEnchantInfoPacket)) / sizeof(GradeEnchantMaterial); if (-1 == packet->index) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3720)), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3720)), 0x62B0FF, 0, 0, 0); return; } - auto* window = static_cast(g_windowMgr.LookupWindow(343)); + auto* window = static_cast(g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)); if (window) { window->SetEnchantInfo(packet->index, packet->value, count, packet->info, packet->value1A, packet->value1E, reinterpret_cast(data + sizeof(GradeEnchantInfoPacket))); @@ -1155,7 +1159,7 @@ void CGameMode::ReceivePartyItemPickup(const unsigned char* data) { item.unknown_0088 = packet->grade; std::string name = item.DisplayName(0); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(1276), member.name.c_str(), name.c_str()).c_str()), 0xFFFF00, 9, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(1276), member.name.c_str(), name.c_str()).c_str()), 0xFFFF00, 9, 0, 0); } } @@ -1164,22 +1168,22 @@ void CGameMode::ReceivePartyItemPickup(const unsigned char* data) { void CGameMode::NotifyResult3995(unsigned char result) { switch (result) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3995)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3995)), 0xFFFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3996)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3996)), 0xFFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3997)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3997)), 0xFFFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3998)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3998)), 0xFFFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3999)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3999)), 0xFFFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4000)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4000)), 0xFFFF, 0, 0, 0); break; } } @@ -1203,11 +1207,11 @@ void CGameMode::ReceiveActorEffect228(const unsigned char* data) { auto* gameActor = static_cast(actor); if (StateFlag01(gameActor->GetStateFlags()) == true || StateFlag02(gameActor->GetStateFlags()) == true) { - actor->SendMsg(nullptr, 109, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (packet->state == 0) { - actor->SendMsg(nullptr, 109, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (packet->state != 1 || static_cast(actor)->HasId(228)) { return; } @@ -1215,7 +1219,7 @@ void CGameMode::ReceiveActorEffect228(const unsigned char* data) { CRagEffect* effect = static_cast(actor)->LaunchEffect(228, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position{static_cast(packet->value), 0.0f, 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } @@ -1322,7 +1326,7 @@ __declspec(noinline) void ReceiveShortcutPage(int position, const ShortcutPagePa } if (g_windowMgr.window_01E8) { - g_windowMgr.window_01E8->SendMsg(nullptr, 143, position - base + 4, bank, 0, 0); + g_windowMgr.window_01E8->SendMsg(nullptr, UM_ROTATE_SHORTCUT_ROWS, position - base + 4, bank, 0, 0); } } @@ -1335,7 +1339,7 @@ void CGameMode::ResendMinimapMarkers() { continue; } - g_windowMgr.window_4F1CC->SendMsg(nullptr, 485, it->second.unknown_0004, it->second.unknown_0006, it->second.unknown_0000, it->second.unknown_0002); + g_windowMgr.window_4F1CC->SendMsg(nullptr, UM_MINIMAP_ADD_QUEST_MARK, it->second.unknown_0004, it->second.unknown_0006, it->second.unknown_0000, it->second.unknown_0002); } } } @@ -1352,9 +1356,9 @@ void CGameMode::ReceiveJobTitle(unsigned char result, int job) { CActorNameCard card = this->LookupNameCard(g_session.m_aid); this->nameCard.SetValue4(g_session.m_aid, title); - UIWindow* window = g_windowMgr.LookupWindow(10); + UIWindow* window = g_windowMgr.LookupWindow(WID_EQUIPWND); if (window) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -1366,7 +1370,7 @@ void CGameMode::ReceiveQuestStates(int count, const unsigned char* data) { const unsigned int questId = entry->questId; if (entry->state == 1) { g_renewQuestMgr->AddNewQuest(questId); - UIWindow* window = g_windowMgr.LookupWindow(10002); + UIWindow* window = g_windowMgr.LookupWindow(WID_ADVENTUREGUIDE); if (window) { static_cast(window)->MarkQuest(questId); } @@ -1399,7 +1403,7 @@ void CGameMode::ReceiveMessageBox(const unsigned char* data) { // OFFSET: 0x00D6E5F0 // FUNCTION: fn_22102 void CGameMode::NotifyCaptchaRegistered() { - UIWindow* window = g_windowMgr.LookupWindow(284); + UIWindow* window = g_windowMgr.LookupWindow(WID_CAPTCHAREGISTERWND); if (window) { static_cast(window)->SetRegisterDisabled(0); g_windowMgr.Confirm(LookupMessage(2880), 0, true, false, 0, "Message", 280, 120, 0); @@ -1439,9 +1443,9 @@ void CGameMode::ReceiveItem1784List(const unsigned char* data) { g_session.unknown_1784[9].push_back(item); } - UIWindow* window = g_windowMgr.LookupWindow(318); + UIWindow* window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND); if (window) { - window->SendMsg(nullptr, 23, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 1, 0, 0, 0); } } @@ -1458,7 +1462,7 @@ void CGameMode::ReceiveCardCompositionResult(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->result) { case ITEMCOMPOSITON_SUCCESS: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(493)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(493)), 0xFFFF00, 0, 0, 0); ITEM_INFO card = LookupClientItemByIdentity(g_session.m_inventoryItems, packet->cardIndex); ITEM_INFO equip = LookupClientItemByIdentity(g_session.m_inventoryItems, packet->equipIndex); if (equip.unknown_0000[1] != 0 && card.unknown_0000[1] != 0) { @@ -1476,7 +1480,7 @@ void CGameMode::ReceiveCardCompositionResult(const unsigned char* data) { break; } case ITEMCOMPOSITION_FAILURE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(494)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(494)), 0xFF, 0, 0, 0); break; } } @@ -1491,7 +1495,7 @@ void CGameMode::ReceiveRefineResult(const unsigned char* data) { g_session.UpdateInventoryItem(item, 1); } - UIRefiningWnd* window = static_cast(g_windowMgr.LookupWindow(295)); + UIRefiningWnd* window = static_cast(g_windowMgr.LookupWindow(WID_REFININGWND)); if (window) { switch (packet->result) { case ITEMREFINING_SUCCESS: @@ -1513,15 +1517,15 @@ void CGameMode::ReceiveRefineResult(const unsigned char* data) { switch (packet->result) { case ITEMREFINING_SUCCESS: static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(154, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(498)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(498)), 0xFFFF00, 0, 0, 0); break; case ITEMREFINING_FAILURE: static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(155, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(499)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(499)), 0xFFFF00, 0, 0, 0); break; case ITEMREFINING_DOWNGRADE: static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(155, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1537)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1537)), 0xFFFF00, 0, 0, 0); break; } @@ -1550,53 +1554,53 @@ void CGameMode::ReceiveItemEffectResult(const unsigned char* data) { break; case 2: if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(305)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(305, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(431), item.DisplayName(0).c_str()).c_str(); break; case 3: if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(306)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(306, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(430), item.DisplayName(0).c_str()).c_str(); break; case 4: if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(1015)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 1015, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1015, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(1015, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(431), item.DisplayName(0).c_str()).c_str(); break; case 5: if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(1016)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 1016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(1016, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(430), item.DisplayName(0).c_str()).c_str(); break; case 6: { if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(1017)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 1017, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1017, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(1017, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(430), item.DisplayName(0).c_str()).c_str(); - UIWindow* window = g_windowMgr.LookupWindow(344); + UIWindow* window = g_windowMgr.LookupWindow(WID_CHANGEMATERIALWND); if (window) { - window->SendMsg(nullptr, 6, 415, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, 415, 0, 0, 0); } break; } case 7: { if (static_cast(g_modeMgr.GetGameMode())->scene->player->HasId(1018)) { - static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, 109, 0, 1018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1018, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(1018, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); text = FormatOwnedString(LookupMessage(430), item.DisplayName(0).c_str()).c_str(); - UIWindow* window = g_windowMgr.LookupWindow(344); + UIWindow* window = g_windowMgr.LookupWindow(WID_CHANGEMATERIALWND); if (window) { - window->SendMsg(nullptr, 6, 415, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, 415, 0, 0, 0); } break; } @@ -1612,7 +1616,7 @@ void CGameMode::ReceiveCharacterRenameResult(const unsigned char* packet) { request.id = 0xA48; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(request.id), &request); g_windowMgr.Confirm(LookupMessage(2836), 0, true, false, 0, "Message", 280, 120, 0); - g_windowMgr.CloseWindow(281); + g_windowMgr.CloseWindow(WID_STYLINGSHOPWND); break; } case 1: @@ -1626,12 +1630,12 @@ void CGameMode::ReceiveCharacterRenameResult(const unsigned char* packet) { // FUNCTION: fn_22066 void CGameMode::ReceiveLapineUpgradeResult(std::int16_t result) { if (0 != result) { - UIWindow* window = g_windowMgr.LookupWindow(290); + UIWindow* window = g_windowMgr.LookupWindow(WID_LAPINEBOXWND); if (window) { static_cast(window)->SetWaiting(0); } - } else if (g_windowMgr.LookupWindow(302)) { - g_windowMgr.CloseWindow(302); + } else if (g_windowMgr.LookupWindow(WID_LAPINEUPGRADEBOXWND)) { + g_windowMgr.CloseWindow(WID_LAPINEUPGRADEBOXWND); } } @@ -1639,7 +1643,7 @@ void CGameMode::ReceiveLapineUpgradeResult(std::int16_t result) { // FUNCTION: fn_22067 void CGameMode::ReceiveLapineBoxResult(std::uint16_t result) { if (0 != result) { - UIWindow* window = g_windowMgr.LookupWindow(290); + UIWindow* window = g_windowMgr.LookupWindow(WID_LAPINEBOXWND); if (window) { static_cast(window)->SetWaiting(0); } @@ -1647,15 +1651,15 @@ void CGameMode::ReceiveLapineBoxResult(std::uint16_t result) { switch (result) { case 0: - if (g_windowMgr.LookupWindow(290)) { - g_windowMgr.CloseWindow(290); + if (g_windowMgr.LookupWindow(WID_LAPINEBOXWND)) { + g_windowMgr.CloseWindow(WID_LAPINEBOXWND); } break; case 5: case 7: { - UIWindow* window = g_windowMgr.LookupWindow(290); + UIWindow* window = g_windowMgr.LookupWindow(WID_LAPINEBOXWND); if (window) { - window->SendMsg(nullptr, 111, reinterpret_cast(LookupMessage(2897)), 0, 0, 0); + window->SendMsg(nullptr, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(2897)), 0, 0, 0); } break; } @@ -1681,18 +1685,18 @@ void CGameMode::ReceiveRouletteInfo(const unsigned char* packet) { } if (!g_windowMgr.unknown_0464) { - g_windowMgr.EnsureWindow(269); + g_windowMgr.EnsureWindow(WID_ROULLETTEWND); } } // OFFSET: 0x00D6D080 // FUNCTION: fn_22084 void CGameMode::BeginCaptchaImage(unsigned short size, const char* key) { - if (g_windowMgr.LookupWindow(285)) { + if (g_windowMgr.LookupWindow(WID_MACRODETECTORWND)) { return; } - UIMacroDetectorWnd* window = static_cast(g_windowMgr.EnsureWindow(285)); + UIMacroDetectorWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_MACRODETECTORWND)); if (window) { if (std::strncmp(window->m_captchaKey, key, 4) != 0) { window->ClearImageData(); @@ -1706,7 +1710,7 @@ void CGameMode::BeginCaptchaImage(unsigned short size, const char* key) { // OFFSET: 0x00D6D130 // FUNCTION: fn_22085 void CGameMode::ReceiveCaptchaImageData(const char* key, const void* data, unsigned short size) { - UIMacroDetectorWnd* window = static_cast(g_windowMgr.LookupWindow(285)); + UIMacroDetectorWnd* window = static_cast(g_windowMgr.LookupWindow(WID_MACRODETECTORWND)); if (window && std::strncmp(window->m_captchaKey, key, 4) == 0) { window->AddImageData(data, size); } @@ -1727,11 +1731,11 @@ void CGameMode::ReceiveWindow99Values(int count, const int* values) { } if (positive > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(99); + UIWindow* window = g_windowMgr.EnsureWindow(WID_SPELLLISTWND); if (window) { for (int i = 0; i < count; ++i) { if (values[i] > 0) { - window->SendMsg(nullptr, 31, values[i], 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, values[i], 0, 0, 0); } } } @@ -1741,7 +1745,7 @@ void CGameMode::ReceiveWindow99Values(int count, const int* values) { // OFFSET: 0x00D6E440 // FUNCTION: fn_22099 void CloseAccountLimitedTool() { - g_windowMgr.CloseWindow(0x154); + g_windowMgr.CloseWindow(WID_ACCOUNTLIMITEDTOOLWND); } // OFFSET: 0x00D6E450 @@ -1755,7 +1759,7 @@ void CGameMode::ReceiveMacroBlackListResult(int result) { g_windowMgr.Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); break; case MCD_GOOD: - g_windowMgr.CloseWindow(359); + g_windowMgr.CloseWindow(WID_MACROBLACKLISTCHECKWND); g_windowMgr.Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); return; default: @@ -1763,7 +1767,7 @@ void CGameMode::ReceiveMacroBlackListResult(int result) { } GetRagConnection().Close(); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } // OFFSET: 0x00D6E520 @@ -1777,7 +1781,7 @@ void CGameMode::ReceiveMacroDetectorResult(int result) { g_windowMgr.Confirm(LookupMessage(2870), 0, true, false, 0, "Message", 280, 120, 0); break; case MCD_GOOD: - g_windowMgr.CloseWindow(285); + g_windowMgr.CloseWindow(WID_MACRODETECTORWND); g_windowMgr.Confirm(LookupMessage(2871), 0, true, false, 0, "Message", 280, 120, 0); return; default: @@ -1785,13 +1789,13 @@ void CGameMode::ReceiveMacroDetectorResult(int result) { } GetRagConnection().Close(); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } // OFFSET: 0x00D71600 // FUNCTION: fn_22134 void CGameMode::ReceiveMacroBlackListCode(unsigned char state, const char* code) { - UIMacroBlackListCheckWnd* window = static_cast(g_windowMgr.EnsureWindow(359)); + UIMacroBlackListCheckWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_MACROBLACKLISTCHECKWND)); if (window) { window->SetCode(state, code); @@ -1818,7 +1822,7 @@ void CGameMode::ReceiveMacroReporterList(int count, const int* aids) { return; } - UIMacroReporterWnd* window = static_cast(g_windowMgr.LookupWindow(286)); + UIMacroReporterWnd* window = static_cast(g_windowMgr.LookupWindow(WID_MACROREPORTERWND)); if (!window) { return; } @@ -1848,15 +1852,15 @@ void CGameMode::ReceiveStorageClose(const AchievementStatePacket* packet) { if (packet->type == 2) { g_windowMgr.Confirm(LookupMessage(0x9F5), 0, true, true, 0, "Message", 280, 120, 0); - window = g_windowMgr.LookupWindow(0x21); + window = g_windowMgr.LookupWindow(WID_ITEMSTOREWND); } else { - window = g_windowMgr.LookupWindow(0x21); + window = g_windowMgr.LookupWindow(WID_ITEMSTOREWND); notify = window != nullptr; } if (notify) { - window->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); - g_windowMgr.CloseWindow(0x21); + window->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMSTOREWND); } g_session.ClearItems1738(); @@ -1880,9 +1884,9 @@ void CGameMode::ReceiveAchievementList(int count, int unknown01738784, short unk } } - UIWindow* window = g_windowMgr.LookupWindow(0x10E); + UIWindow* window = g_windowMgr.LookupWindow(WID_ACHIEVEMENTWND); if (window != nullptr) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -1899,21 +1903,21 @@ void CGameMode::OpenServiceWindow(unsigned char type) { } break; case 1: - if (g_windowMgr.LookupWindow(16)) { - this->SendMsg(89, 0, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_SAYDIALOGWND)) { + this->SendMsg(MM_CLOSE_DIALOG, 0, 0, 0, 0); } - if (!g_windowMgr.LookupWindow(281)) { - g_windowMgr.EnsureWindow(281); + if (!g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)) { + g_windowMgr.EnsureWindow(WID_STYLINGSHOPWND); } break; case 2: - g_windowMgr.EnsureWindow(284); + g_windowMgr.EnsureWindow(WID_CAPTCHAREGISTERWND); break; case 3: - g_windowMgr.EnsureWindow(286); + g_windowMgr.EnsureWindow(WID_MACROREPORTERWND); break; case 9: - g_windowMgr.EnsureWindow(344); + g_windowMgr.EnsureWindow(WID_CHANGEMATERIALWND); break; } } @@ -1922,13 +1926,13 @@ void CGameMode::OpenServiceWindow(unsigned char type) { // FUNCTION: fn_22047 void CGameMode::ReceiveWindow328Result(int result, int value) { if (result == 0) { - UIWindow* window = g_windowMgr.LookupWindow(328); + UIWindow* window = g_windowMgr.LookupWindow(WID_CHECKATTENDANCEWND); if (window) { - window->SendMsg(nullptr, 34, value * 10 + 1, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, value * 10 + 1, 0, 0, 0); } } else if (result == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3472)), 0xFF, 0, 0, 0); - g_windowMgr.CloseWindow(328); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3472)), 0xFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHECKATTENDANCEWND); } } @@ -1939,11 +1943,11 @@ void CGameMode::ReceiveRouletteClose(const unsigned char* packet) { case CLOSE_ROULETTE_SUCCESS: g_rouletteMgr->Reset(); if (g_windowMgr.unknown_0464) { - g_windowMgr.CloseWindow(269); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); } break; case CLOSE_ROULETTE_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2633)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2633)), 0x6464FF, 0, 0, 0); break; } } @@ -1957,22 +1961,22 @@ void CGameMode::ReceiveWindow227Result(const unsigned char* packet) { switch (result->result) { case MERGE_ITEM_SUCCESS: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2171)), 0x64FFFF, 0, 0, 0); - UIWindow* window = g_windowMgr.LookupWindow(227); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2171)), 0x64FFFF, 0, 0, 0); + UIWindow* window = g_windowMgr.LookupWindow(WID_MERGEITEMWND); if (window) { - window->SendMsg(nullptr, 60, first, second, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, first, second, 0, 0); } break; } case MERGE_ITEM_FAILED_NOT_MERGE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2172)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2172)), 0xFF, 0, 0, 0); break; case MERGE_ITEM_FAILED_MAX_COUNT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2173)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2173)), 0xFF, 0, 0, 0); break; } - g_windowMgr.CloseWindow(227); + g_windowMgr.CloseWindow(WID_MERGEITEMWND); } // OFFSET: 0x00D6AB60 @@ -1998,11 +2002,11 @@ void CGameMode::ReceiveRouletteOpen(const unsigned char* packet) { request.id = 0xA1B; GetRagConnection().Send(g_packetLengths.FixedLength(request.id), &request); } else if (!g_windowMgr.unknown_0464) { - g_windowMgr.EnsureWindow(269); + g_windowMgr.EnsureWindow(WID_ROULLETTEWND); } break; case OPEN_ROULETTE_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2632)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2632)), 0x6464FF, 0, 0, 0); break; } } @@ -2015,14 +2019,14 @@ void CGameMode::ReceiveRodexOpen(const unsigned char* packet) { if (!g_windowMgr.unknown_0458) { g_session.RestoreItems5C68(); g_session.ClearItemQuantities(); - g_windowMgr.EnsureWindow(264); + g_windowMgr.EnsureWindow(WID_RODEXCOMPOSEWND); const char* text = open->text; if (text) { reinterpret_cast(g_windowMgr.unknown_0458)->SetContentsText(text); } } } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2604)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2604)), 0x64FFFF, 0, 0, 0); } } @@ -2031,9 +2035,9 @@ void CGameMode::ReceiveRodexOpen(const unsigned char* packet) { void CGameMode::ReceiveCaptchaPreview(int result, unsigned short size, const char* key) { switch (result) { case 0: { - UICaptchaPreviewWnd* window = static_cast(g_windowMgr.LookupWindow(288)); + UICaptchaPreviewWnd* window = static_cast(g_windowMgr.LookupWindow(WID_CAPTCHAPREVIEWWND)); if (!window) { - window = static_cast(g_windowMgr.EnsureWindow(288)); + window = static_cast(g_windowMgr.EnsureWindow(WID_CAPTCHAPREVIEWWND)); if (!window) { return; } @@ -2048,7 +2052,7 @@ void CGameMode::ReceiveCaptchaPreview(int result, unsigned short size, const cha break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast("wrong captcha ID."), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("wrong captcha ID."), 0xFF, 0, 0, 0); break; } } @@ -2061,7 +2065,7 @@ void CGameMode::ReceiveStackedItemReturn(const unsigned char* packet) { g_session.ReturnStackedItem(result->index, result->count); g_session.unknown_6140 = result->value; } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2602)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2602)), 0x64FFFF, 0, 0, 0); } } @@ -2073,7 +2077,7 @@ void CGameMode::ReceiveRodexRecipient(int id, unsigned short job, unsigned short reinterpret_cast(g_windowMgr.unknown_0458)->SetRecipient(id, job, level, name); } } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2615)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2615)), 0x64FFFF, 0, 0, 0); } } @@ -2112,7 +2116,7 @@ void CGameMode::ReceiveBuyingStoreResult(const BuyingStoreResultPacket* packet) } std::sprintf(text, LookupMessage(message)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } // OFFSET: 0x00D18BA0 @@ -2149,7 +2153,7 @@ void CGameMode::IgnoreRemovedPacket16(const unsigned char*) { void CGameMode::ReceiveItemSlotAddOptions(const unsigned char* data) { const auto* packet = reinterpret_cast(data); if (packet->slot < 0) { - g_modeMgr.gameMode->SendMsg(0x35, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); } if (packet->itemId == 0) { @@ -2180,7 +2184,7 @@ void CGameMode::ReceiveItemSlotAddOptions(const unsigned char* data) { void CGameMode::ReceiveItemSlotAddGrade(const unsigned char* data) { const auto* packet = reinterpret_cast(data); if (packet->slot < 0) { - g_modeMgr.gameMode->SendMsg(0x35, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); } if (packet->itemId == 0) { @@ -2218,7 +2222,7 @@ void CGameMode::ReceiveGuildUnknown0114Change(unsigned char value, std::uint32_t } if (g_windowMgr.window_0320) { - g_windowMgr.window_0320->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.window_0320->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -2471,16 +2475,16 @@ void CGameMode::ReceiveTypedNotice(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->type) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(901), packet->first, packet->second).c_str()), 0xCDCDCD, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(901), packet->first, packet->second).c_str()), 0xCDCDCD, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(902), packet->first, packet->second).c_str()), 0xCDFFCD, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(902), packet->first, packet->second).c_str()), 0xCDFFCD, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(926), packet->first, packet->second).c_str()), 0xFFCDCD, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(926), packet->first, packet->second).c_str()), 0xFFCDCD, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(953), packet->first, packet->second).c_str()), 0xCDCDCD, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(953), packet->first, packet->second).c_str()), 0xCDCDCD, 0, 0, 0); break; } } @@ -2495,7 +2499,7 @@ void CGameMode::ReceiveRodexMailReturn(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->result) { case 0: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2591)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2591)), 0x64FFFF, 0, 0, 0); std::map::iterator mail; switch (packet->type) { @@ -2525,10 +2529,10 @@ void CGameMode::ReceiveRodexMailReturn(const unsigned char* data) { break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2592)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2592)), 0x64FFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2593)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2593)), 0x64FFFF, 0, 0, 0); break; } } @@ -2588,7 +2592,7 @@ void CGameMode::ReceivePartyMemberEffect(const unsigned char* data) { void CGameMode::ShowFormattedNotice(unsigned short messageId, std::uint32_t color, int argument) { std::string text = FormatOwnedString(LookupMessage(messageId), argument); if (!text.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), color, messageId == 2962 ? 22 : 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), color, messageId == 2962 ? 22 : 0, 0, 0); } } @@ -2597,12 +2601,12 @@ void CGameMode::ShowFormattedNotice(unsigned short messageId, std::uint32_t colo void CGameMode::ReceiveCaptchaUploadRequest(const std::uint32_t* sessionId, int result) { switch (result) { case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2882)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2882)), 0xFF, 0, 0, 0); break; case 0: { - auto* window = static_cast(g_windowMgr.LookupWindow(284)); + auto* window = static_cast(g_windowMgr.LookupWindow(WID_CAPTCHAREGISTERWND)); if (!window) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2881)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2881)), 0xFF, 0, 0, 0); break; } @@ -2625,9 +2629,9 @@ void CGameMode::ReceiveExtraInventoryResult(const unsigned char* data) { const int answer = g_windowMgr.Confirm( FormatOwnedString(LookupMessage(3561), name, slots, nextSlots).c_str(), 2, false, false, 0, "Message", 280, 120, 0); if (answer == 187) { - this->SendMsg(311, 0, 0, 0, 0); + this->SendMsg(MM_REQ_EXTEND_BODYITEM_SIZE, 0, 0, 0, 0); } else { - this->SendMsg(312, 0, 0, 0, 0); + this->SendMsg(MM_CLOSE_MSGBOX_EXTEND_BODYITEM_SIZE, 0, 0, 0, 0); } return; } @@ -2647,7 +2651,7 @@ void CGameMode::ReceiveExtraInventoryResult(const unsigned char* data) { return; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(message)), 0xFF, 0, 0, 0); } // OFFSET: 0x00D6FEA0 @@ -2655,22 +2659,22 @@ void CGameMode::ReceiveExtraInventoryResult(const unsigned char* data) { void CGameMode::ReceiveWindow348Result(unsigned char result, std::int16_t index) { switch (result) { case 0: { - g_windowMgr.CloseWindow(348); + g_windowMgr.CloseWindow(WID_ITEMREFORMWND); g_effectMgr->Spawn(g_session.m_aid, 1608, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, index); if (item.unknown_0000[1] <= 0) { return; } - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } break; } case 3: { - UIWindow* window = g_windowMgr.LookupWindow(348); + UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMREFORMWND); if (window) { - window->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3848)), 0, 0, 0); + window->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3848)), 0, 0, 0); } break; } @@ -2687,7 +2691,7 @@ void CGameMode::ReceiveRodexItemReturn(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->result) { case 0: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2588)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2588)), 0x64FFFF, 0, 0, 0); g_session.ClearItemQuantities(); std::map::iterator mail; @@ -2714,19 +2718,19 @@ void CGameMode::ReceiveRodexItemReturn(const unsigned char* data) { if (g_windowMgr.unknown_045C) { auto* contents = reinterpret_cast(g_windowMgr.unknown_045C); - contents->SendMsg(nullptr, 23, 0, 0, 0, 0); + contents->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); contents->DisableItemButton(); } if (g_windowMgr.unknown_0454) { - reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, 60, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2589)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2589)), 0x64FFFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2590)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2590)), 0x64FFFF, 0, 0, 0); break; } } @@ -2769,7 +2773,7 @@ void CGameMode::ReceiveExpGainNotice(const unsigned char* data) { } else { text += LookupMessage(1616); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), color, 18, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), color, 18, 0, 0); } #include "UI/Item/UIItemStoreWnd.h" @@ -2959,7 +2963,7 @@ void CGameMode::ReceiveBankDepositAck(const unsigned char* data) { std::memset(text, 0, 250); std::sprintf(text, LookupMessage(2454)); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } // OFFSET: 0x00D196E0 @@ -2985,7 +2989,7 @@ void CGameMode::ReceiveBankWithdrawAck(const unsigned char* data) { std::memset(text, 0, 250); std::sprintf(text, LookupMessage(2454)); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } // OFFSET: 0x00D197F0 @@ -2994,19 +2998,19 @@ void CGameMode::ReceiveBankCheck(const unsigned char* data) { const auto* packet = reinterpret_cast(data); if (packet->reason == 0) { g_session.m_bankBalance = packet->money; - if (!g_windowMgr.CloseWindow(275)) { - g_windowMgr.EnsureWindow(275); + if (!g_windowMgr.CloseWindow(WID_BANK_NEWWND)) { + g_windowMgr.EnsureWindow(WID_BANK_NEWWND); } return; } if (packet->reason == 2) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3031)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3031)), 0xFF, 0, 0, 0); } else { char text[256]; std::memset(text, 0, 250); std::sprintf(text, LookupMessage(2454)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } } @@ -3047,10 +3051,10 @@ void CGameMode::ReceiveTradeItemFilter(const unsigned char* data) { raw.unknown_0008 = 2; g_session.AddItem1718(raw, 1); } - UIWindow* window = g_windowMgr.EnsureWindow(160); - window->SendMsg(nullptr, 0x24, 1, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - g_windowMgr.EnsureWindow(161)->SendMsg(nullptr, 0x17, packet->type, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND2); + window->SendMsg(nullptr, UM_SETTITLE, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMSELLWND2)->SendMsg(nullptr, UM_REFRESHITEM, packet->type, 0, 0, 0); } // OFFSET: 0x00D1BE10 @@ -3074,16 +3078,16 @@ void CGameMode::ReceiveExchangeItemAddAck(const unsigned char* data) { } break; case EXITEM_ADD_FAILED_OVERWEIGHT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(73)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(73)), 0xFF, 0, 0, 0); break; case EXITEM_ADD_FAILED_OVERCOUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1938)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1938)), 0xFF, 0, 0, 0); break; case EXITEM_ADD_FAILED_EACHITEM_OVERCOUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1939)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1939)), 0xFF, 0, 0, 0); break; } } @@ -3095,37 +3099,37 @@ void CGameMode::ReceiveExchangeRequestAck2(const unsigned char* data) { const std::string& exchangeName = this->exchangeName; switch (packet->result) { case TRADE_ACK_ACCEPT: { - this->SendMsg(40, 0, 0, 0, 0); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); *reinterpret_cast(&this->unknown_0100[0x14]) = 1; g_session.ResetSlots(); g_session.ClearItemSlotQuantities(); - g_windowMgr.CloseWindow(10011); - UIWindow* window = g_windowMgr.EnsureWindow(10011); + g_windowMgr.CloseWindow(WID_EXCHANGEUI); + UIWindow* window = g_windowMgr.EnsureWindow(WID_EXCHANGEUI); if (window) { - window->SendMsg(nullptr, 50, reinterpret_cast(exchangeName.c_str()), packet->charId, packet->level, 0); + window->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(exchangeName.c_str()), packet->charId, packet->level, 0); } break; } case TRADE_ACK_CANCEL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(69)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(69)), 0xFF, 0, 0, 0); break; case TRADE_ACK_TOOFAR: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(70)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(70)), 0xFF, 0, 0, 0); break; case TRADE_ACK_CHARNOTEXIST: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(71)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(71)), 0xFF, 0, 0, 0); break; case TRADE_ACK_FAILED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(72)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(72)), 0xFF, 0, 0, 0); break; case TRADE_ACK_BUSY: { std::string text = FormatOwnedString(LookupMessage(1708), exchangeName.c_str()); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); break; } } @@ -3137,33 +3141,33 @@ void CGameMode::ReceiveExchangeRequestAck(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->result) { case TRADE_ACK_ACCEPT: { - this->SendMsg(40, 0, 0, 0, 0); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); *reinterpret_cast(&this->unknown_0100[0x14]) = 1; g_session.ResetSlots(); g_session.ClearItemSlotQuantities(); - g_windowMgr.CloseWindow(10011); - UIWindow* window = g_windowMgr.EnsureWindow(10011); + g_windowMgr.CloseWindow(WID_EXCHANGEUI); + UIWindow* window = g_windowMgr.EnsureWindow(WID_EXCHANGEUI); if (window) { const std::string& exchangeName = this->exchangeName; - window->SendMsg(nullptr, 50, reinterpret_cast(exchangeName.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(exchangeName.c_str()), 0, 0, 0); } break; } case TRADE_ACK_CANCEL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(69)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(69)), 0xFF, 0, 0, 0); break; case TRADE_ACK_TOOFAR: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(70)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(70)), 0xFF, 0, 0, 0); break; case TRADE_ACK_CHARNOTEXIST: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(71)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(71)), 0xFF, 0, 0, 0); break; case TRADE_ACK_FAILED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(72)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(72)), 0xFF, 0, 0, 0); break; } } @@ -3266,7 +3270,7 @@ void CGameMode::ReceiveGuildStorageLog(const unsigned char* data) { g_guildStorageLogs[2].push_back(*it); } } - g_windowMgr.EnsureWindow(253); + g_windowMgr.EnsureWindow(WID_GUILD_STORAGE_LOG); } else { char text[252]; if (packet->result == 2) { @@ -3276,7 +3280,7 @@ void CGameMode::ReceiveGuildStorageLog(const unsigned char* data) { std::memset(text, 0, 250); std::sprintf(text, LookupMessage(1816)); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); g_guildStorageLogs[0].clear(); g_guildStorageLogs[1].clear(); g_guildStorageLogs[2].clear(); @@ -3287,7 +3291,7 @@ void CGameMode::ReceiveGuildStorageLog(const unsigned char* data) { // FUNCTION: fn_21843 void CGameMode::ReceiveStorageEquipList(const unsigned char* data) { const auto* header = reinterpret_cast(data); - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = (header->length - sizeof(StorageListHeader)) / sizeof(StorageEquipRecord); const auto* record = reinterpret_cast(data + sizeof(StorageListHeader)); for (int i = 0; i < count; ++i, ++record) { @@ -3313,7 +3317,7 @@ void CGameMode::ReceiveStorageEquipList(const unsigned char* data) { // FUNCTION: fn_21844 void CGameMode::ReceiveStorageEquipList2(const unsigned char* data) { const auto* header = reinterpret_cast(data); - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = (header->length - sizeof(StorageListHeader)) / sizeof(StorageEquipRecord2); const auto* record = reinterpret_cast(data + sizeof(StorageListHeader)); for (int i = 0; i < count; ++i, ++record) { @@ -3341,7 +3345,7 @@ void CGameMode::ReceiveStorageEquipList2(const unsigned char* data) { // FUNCTION: fn_21845 void CGameMode::ReceiveStorageEquipList3(const unsigned char* data) { const auto* header = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (header->title[0] != '\0') { std::string title(header->title); window->title->SetTextFitted(title.c_str()); @@ -3375,7 +3379,7 @@ void CGameMode::ReceiveStorageEquipList3(const unsigned char* data) { // FUNCTION: fn_21846 void CGameMode::ReceiveStorageEquipList4(const unsigned char* data) { const auto* header = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (header->title[0] != '\0') { std::string title(header->title); window->title->SetTextFitted(title.c_str()); @@ -3420,7 +3424,7 @@ void CGameMode::ReceiveStorageEquipList4(const unsigned char* data) { // FUNCTION: fn_21847 void CGameMode::ReceiveStorageEquipList5(const unsigned char* data) { const auto* header = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (header->title[0] != '\0') { std::string title(header->title); window->title->SetTextFitted(title.c_str()); @@ -3465,7 +3469,7 @@ void CGameMode::ReceiveStorageEquipList5(const unsigned char* data) { // FUNCTION: fn_21848 void CGameMode::ReceiveStorageNormalList(const unsigned char* data) { const auto* header = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (header->title[0] != '\0') { std::string title(header->title); window->title->SetTextFitted(title.c_str()); @@ -3497,7 +3501,7 @@ void CGameMode::ReceiveStorageNormalList(const unsigned char* data) { // FUNCTION: fn_21849 void CGameMode::ReceiveStorageNormalList2(const unsigned char* data) { const auto* header = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (header->title[0] != '\0') { std::string title(header->title); window->title->SetTextFitted(title.c_str()); @@ -3536,8 +3540,8 @@ void CGameMode::ReceiveItemUpgrade(std::uint16_t index, std::uint16_t refine, It reinterpret_cast(item.unknown_009C)[i] = options.options[i]; } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -3545,12 +3549,12 @@ void CGameMode::ReceiveItemUpgrade(std::uint16_t index, std::uint16_t refine, It // FUNCTION: fn_22103 void CGameMode::ReceiveFeedConfig(unsigned char state, unsigned char option) { *reinterpret_cast(g_session.unknown_5974) = state; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } g_serviceOptions.Set(231, option); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettingOption(231); } @@ -3558,12 +3562,12 @@ void CGameMode::ReceiveFeedConfig(unsigned char state, unsigned char option) { // FUNCTION: fn_22104 void CGameMode::ReceiveFeedConfig2(unsigned char state, unsigned char option, bool petAutoFeed) { *reinterpret_cast(g_session.unknown_5974) = state; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } g_serviceOptions.Set(231, option); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettingOption(231); g_session.SetPetAutoFeed(petAutoFeed); } @@ -3572,12 +3576,12 @@ void CGameMode::ReceiveFeedConfig2(unsigned char state, unsigned char option, bo // FUNCTION: fn_22105 void CGameMode::ReceiveFeedConfig3(unsigned char state, unsigned char option, bool petAutoFeed, bool homunculusAutoFeed) { *reinterpret_cast(g_session.unknown_5974) = state; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } g_serviceOptions.Set(231, option); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettingOption(231); g_session.SetPetAutoFeed(petAutoFeed); g_session.SetHomunculusAutoFeed(homunculusAutoFeed); @@ -3587,12 +3591,12 @@ void CGameMode::ReceiveFeedConfig3(unsigned char state, unsigned char option, bo // FUNCTION: fn_22106 void CGameMode::ReceiveFeedConfig4(unsigned char state, unsigned char option, bool petAutoFeed, bool homunculusAutoFeed, int value) { *reinterpret_cast(g_session.unknown_5974) = state; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(state + 0x54E)), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } g_serviceOptions.Set(231, option); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(option + 0xBA2)), 0x64FFFF, 0, 0, 0); g_windowMgr.RefreshGameSettingOption(231); g_session.SetPetAutoFeed(petAutoFeed); g_session.SetHomunculusAutoFeed(homunculusAutoFeed); @@ -3619,7 +3623,7 @@ void CGameMode::ReceiveLongParChange(const unsigned char* data) { text, sizeof(text), static_cast(-1), "%lld : %lld/%lld More : %d", value - exp, value, nextExp, static_cast((nextExp - exp) / gained) ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xF51EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xF51EF5, 0, 0, 0); } } exp = packet->value; @@ -3832,12 +3836,12 @@ void CGameMode::ReceiveVendingItemList( g_session.AddItem1758(item); } - UIMerchantItemMyShopWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(176))); + UIMerchantItemMyShopWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1))); if (window) { window->OpenShop(); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 119, value, 0, 0, 0); - window->SendMsg(nullptr, 28, aid, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, value, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, aid, 0, 0, 0); window->SetDuration(duration); } } else { @@ -3857,22 +3861,22 @@ void CGameMode::ReceiveVendingItemList( g_session.AddItem1748(item); } - UIMerchantItemShopWnd* shop = static_cast(g_windowMgr.EnsureWindow(177)); - shop->SendMsg(nullptr, 23, 0, 0, 0, 0); - shop->SendMsg(nullptr, 28, aid, 0, 0, 0); - shop->SendMsg(nullptr, 119, value, 0, 0, 0); + UIMerchantItemShopWnd* shop = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND_MODE_1)); + shop->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + shop->SendMsg(nullptr, UM_SETNAID, aid, 0, 0, 0); + shop->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, value, 0, 0, 0); shop->StartTimer(duration); - UIWindow* window = g_windowMgr.EnsureWindow(178); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, aid, storeId, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, aid, storeId, 0, 0); UIWindow* list = reinterpret_cast(g_windowMgr.unknown_0420); if (list) { g_session.RefreshItems1750(); } else { - list = g_windowMgr.EnsureWindow(179); + list = g_windowMgr.EnsureWindow(WID_MERCHANTMIRRORITEMWND_MODE_2); } if (list) { - list->SendMsg(nullptr, 23, 0, 0, 0, 0); + list->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -3949,11 +3953,11 @@ void CGameMode::ReceiveVendingItemList2(int aid, int storeId, char own, int coun g_session.AddItem1758(item); } - UIMerchantItemMyShopWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(45))); + UIMerchantItemMyShopWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMMYSHOPWND))); if (window) { window->OpenShop(); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, aid, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, aid, 0, 0, 0); window->SetDuration(duration); } this->unknown_024C = 1; @@ -3967,13 +3971,13 @@ void CGameMode::ReceiveVendingItemList2(int aid, int storeId, char own, int coun g_session.AddItem1748(item); } - UIMerchantItemShopWnd* shop = static_cast(g_windowMgr.EnsureWindow(43)); - shop->SendMsg(nullptr, 23, 0, 0, 0, 0); - shop->SendMsg(nullptr, 28, aid, 0, 0, 0); + UIMerchantItemShopWnd* shop = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND)); + shop->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + shop->SendMsg(nullptr, UM_SETNAID, aid, 0, 0, 0); shop->StartTimer(duration); - UIWindow* window = g_windowMgr.EnsureWindow(44); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, aid, storeId, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, aid, storeId, 0, 0); this->unknown_024C = 1; } } @@ -4001,7 +4005,7 @@ void CGameMode::ReceiveNotifyGroundSkill(const unsigned char* packet) { if (*reinterpret_cast(packet + 4) == g_session.m_aid) { const std::int64_t value = reinterpret_cast(&message); - this->scene->player->SendMsg(nullptr, 0x26, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_GROUNDSKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor = this->scene->player; if (actor != nullptr) { job = actor->GetEffectiveJob(-1); @@ -4010,14 +4014,14 @@ void CGameMode::ReceiveNotifyGroundSkill(const unsigned char* packet) { CGameActor* gameActor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(packet + 4))); if (gameActor != nullptr) { const std::int64_t value = reinterpret_cast(&message); - gameActor->SendMsg(nullptr, 0x26, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + gameActor->SendMsg(nullptr, AM_GROUNDSKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor = gameActor; job = actor->GetEffectiveJob(-1); } } if (!g_session.IsMonsterActor(actor)) { - this->SendMsg(0x56, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 8), 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 8), 0); switch (*reinterpret_cast(packet + 2)) { case PA_GOSPEL: @@ -4223,7 +4227,7 @@ void CGameMode::ReceiveNotifyGroundSkill(const unsigned char* packet) { position.x = x; position.y = mode->scene->terrain->Height(x, z); position.z = z; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); break; } case WM_DOMINION_IMPULSE: { @@ -4239,8 +4243,8 @@ void CGameMode::ReceiveNotifyGroundSkill(const unsigned char* packet) { position.x = x; position.y = mode->scene->terrain->Height(x, z); position.z = z; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\invisibility.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; } @@ -4345,8 +4349,8 @@ void CGameMode::ReceiveAcceptEnter(const unsigned char* data) { const auto* packet = reinterpret_cast(data); if (Replay::Instance().state == 2) { Replay::Instance().SetState(3); - g_windowMgr.window_4F164->SendMsg(nullptr, 0x57, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0xC6); + g_windowMgr.window_4F164->SendMsg(nullptr, UM_SETPOS, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REPLAYRECCONTROLWND); } else if (Replay::Instance().state == 7) { Replay::Instance().SetState(8); } @@ -4434,9 +4438,9 @@ void CGameMode::ReceiveRodexMailList(const unsigned char* packet) { if (packet[4] == 1) { g_rodexMailStore->unknown_001C = true; - UIWindow* window = g_windowMgr.LookupWindow(0x107); + UIWindow* window = g_windowMgr.LookupWindow(WID_RODEXINBOXWND); if (window) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } } @@ -4522,9 +4526,9 @@ void CGameMode::ReceiveWindow227Entries(const unsigned char* data) { std::vector entries; entries.insert(entries.end(), packet->entries, packet->entries + count); - UIWindow* window = g_windowMgr.EnsureWindow(227); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERGEITEMWND); if (window) { - window->SendMsg(nullptr, 34, reinterpret_cast(entries.data()), count, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(entries.data()), count, 0, 0); } } @@ -4586,7 +4590,7 @@ void CGameMode::ReceiveItemDropEntry(const unsigned char* data) { } const std::int64_t entryAddress = reinterpret_cast(&entry); - item->SendMsg(nullptr, 4, 0, static_cast(entryAddress), static_cast(entryAddress >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + item->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(entryAddress), static_cast(entryAddress >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } #pragma pack(push, 1) struct SpriteChangePacket { @@ -4657,7 +4661,7 @@ void CGameMode::ReceiveSpriteChange(const unsigned char* data) { return; } if (packet->type == LOOK_BASE) { - skill->SendMsg(nullptr, 47, 0, packet->value, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETJOB, 0, packet->value, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } return; } @@ -4759,7 +4763,7 @@ void CGameMode::ReceiveSpriteChange2(const unsigned char* data) { case 14: g_session.SetFlag(static_cast(value)); actor->SetSex(value); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4137)), 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4137)), 0, 0, 0, 0); break; } if (!actor) { @@ -4773,7 +4777,7 @@ void CGameMode::ReceiveSpriteChange2(const unsigned char* data) { return; } if (packet->type == LOOK_BASE) { - skill->SendMsg(nullptr, 47, 0, value, static_cast(packet->value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETJOB, 0, value, static_cast(packet->value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } return; } @@ -4848,12 +4852,12 @@ void CGameMode::ReceiveSpriteChange2(const unsigned char* data) { case LOOK_BODY2: actor->SetBodyCostume(value, 1); if (StateFlag04(actor->GetStateFlags())) { - actor->SendMsg(nullptr, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(actor->GetStateFlags())) { - actor->SendMsg(nullptr, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case 14: @@ -4911,17 +4915,17 @@ void CGameMode::ReceiveMapProperty(const unsigned char* data) { } if (GetBaseJob(g_session.GetDisplayJob()) == 0xFCF && !g_mapPropertyMgr->GetValue(g_session.unknown_0000, 41)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); } if (GetBaseJob(g_session.GetDisplayJob()) == 0x1082 && !g_mapPropertyMgr->GetValue(g_session.unknown_0000, 41)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); } if ((g_session.GetDisplayJob() == 0x108F || g_session.GetDisplayJob() == 0x1091 || g_session.GetDisplayJob() == 0x10CE) && !g_mapPropertyMgr->GetValue(g_session.unknown_0000, 41)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2381)), 0xFFFF64, 0, 0, 0); } if (g_mapPropertyMgr->GetValue(packet->mapId, 20)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1772)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1772)), 0xFFFF64, 0, 0, 0); } PacketIdOnly request; @@ -4962,7 +4966,7 @@ void CGameMode::ReceiveStovePurchaseResult(const unsigned char* data) { FetchStoveTermsAgreement(); } else if (g_stoveMgr->unknown_0008 == 3) { g_stoveMgr->unknown_0008 = 0; - UICashShopWnd* window = static_cast(g_windowMgr.LookupWindow(318)); + UICashShopWnd* window = static_cast(g_windowMgr.LookupWindow(WID_CASHSHOP_WND)); g_stoveMgr->StartPurchase(window->m_cart->m_cartItems); } break; @@ -5258,7 +5262,7 @@ void CGameMode::ReceiveRefineStatus(const char* playerName, int itemId, unsigned message.lines.push_back(BroadcastBalloonLine{text, 0x62B0FF, 0}); balloon->AddMessage(0, message); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); } // OFFSET: 0x00D6F000 @@ -5308,7 +5312,7 @@ void CGameMode::ReceiveGradeEnchantBroadcast(const unsigned char* data) { message.lines.emplace_back(text, 0x62B0FF, 0); balloon->AddMessage(0, message); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); } #pragma pack(push, 1) @@ -5369,8 +5373,8 @@ void CGameMode::ReceiveRodexReadMail(const unsigned char* data) { RodexMail& mail = found->second; if (!mail.isRead && --g_rodexMailStore->unknown_0018 == 0) { - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 476, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 476, 0, 0); } } @@ -5404,9 +5408,9 @@ void CGameMode::ReceiveRodexReadMail(const unsigned char* data) { g_session.AddItemToFreeSlot(item); } - if (!g_windowMgr.CloseWindow(265)) { - g_windowMgr.EnsureWindow(265); - g_windowMgr.unknown_045C->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (!g_windowMgr.CloseWindow(WID_RODEXCONTENTSWND)) { + g_windowMgr.EnsureWindow(WID_RODEXCONTENTSWND); + g_windowMgr.unknown_045C->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -5612,7 +5616,7 @@ void CGameMode::ReceiveQuestHuntUpdate(const unsigned char* data) { name.assign(info.m_huntName[index]); } name = static_cast(FormatOwnedString(LookupMessage(1610), info.m_title.c_str(), name.c_str(), info.m_huntUnknown00E0[index], entry.maxCount)); - g_windowMgr.SendNotice(1, reinterpret_cast(name.c_str()), 0xFFFF, 19, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(name.c_str()), 0xFFFF, 19, 0, 0); g_renewQuestMgr->SetOngoingQuest(entry.questId, info); } } @@ -5658,7 +5662,7 @@ void CGameMode::ReceiveQuestHuntUpdate2(const unsigned char* data) { name.assign(info.m_huntName[index]); } name = static_cast(FormatOwnedString(LookupMessage(1610), info.m_title.c_str(), name.c_str(), info.m_huntUnknown00E0[index], entry.maxCount)); - g_windowMgr.SendNotice(1, reinterpret_cast(name.c_str()), 0xFFFF, 19, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(name.c_str()), 0xFFFF, 19, 0, 0); g_renewQuestMgr->SetOngoingQuest(entry.questId, info); } } @@ -5741,7 +5745,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { if (CRenderObject* actor = this->scene->GetGameActorByAID(packet->aid)) { const std::int64_t state = packet->state; const std::int64_t type = packet->type; - actor->SendMsg(nullptr, 110, 0, static_cast(type), static_cast(type >> 32), static_cast(state), static_cast(state >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STATUS_CHANGE, 0, static_cast(type), static_cast(type >> 32), static_cast(state), static_cast(state >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -6780,19 +6784,19 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { break; case EFST_SIREN: if (packet->aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 109, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; case EFST_DEEP_SLEEP: if (packet->aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; case EFST_NETHERWORLD: if (packet->aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 109, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; @@ -6800,7 +6804,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { if (packet->aid == g_session.m_aid) { CPlayer* player = this->scene->player; while (player->HasId(752)) { - player->SendMsg(nullptr, 109, 0, 752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } std::sprintf(message, ""); @@ -6856,14 +6860,14 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { break; case EFST_HANDICAPSTATE_ICEEXPLO: if (packet->aid == g_session.m_aid && this->scene->player) { - this->scene->player->SendMsg(nullptr, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_DARKCROW: if (packet->aid == g_session.m_aid) { CPlayer* player = this->scene->player; while (player->HasId(1040)) { - player->SendMsg(nullptr, 109, 0, 1040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -6871,7 +6875,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { if (packet->aid == g_session.m_aid) { CPlayer* player = this->scene->player; while (player->HasId(1061)) { - player->SendMsg(nullptr, 109, 0, 1061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -6910,7 +6914,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { if (packet->aid == g_session.m_aid) { g_session.unknown_8074 = 0; } - actor->SendMsg(nullptr, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case EFST_RELIEVE_DAMAGE: @@ -6927,7 +6931,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { actor = this->scene->GetGameActorByAID(packet->aid); } if (actor) { - actor->SendMsg(nullptr, 109, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -6940,7 +6944,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { actor = this->scene->GetGameActorByAID(packet->aid); } if (actor) { - actor->SendMsg(nullptr, 109, 0, 1610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1610, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -7040,14 +7044,14 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { if (std::strlen(message) > 1) { char text[512]; std::sprintf(text, "%s%s", name, message); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), color, std::strlen(name) > 1 ? 10 : 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), color, std::strlen(name) > 1 ? 10 : 8, 0, 0); } if (packet->aid == g_session.m_aid) { const std::int64_t state = packet->state; const std::int64_t type = packet->type; - this->scene->player->SendMsg(nullptr, 110, 0, static_cast(type), static_cast(type >> 32), static_cast(state), static_cast(state >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, static_cast(type), static_cast(type >> 32), static_cast(state), static_cast(state >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -7073,9 +7077,9 @@ void CGameMode::ReceiveGuildMemberExpelled(const unsigned char* data) { if (std::string(name) == g_session.DecodePlayerName()) { g_guildInfo.m_guildId = 0; - g_windowMgr.CloseWindow(59); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(490)), 0xFF, 4, 0, 0); - this->SendMsg(172, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(490)), 0xFF, 4, 0, 0); + this->SendMsg(MM_DELETEGUILDPOSALL, 0, 0, 0, 0); return; } @@ -7086,14 +7090,14 @@ void CGameMode::ReceiveGuildMemberExpelled(const unsigned char* data) { char message[1024]; std::memset(message, 0, sizeof(message)); std::sprintf(message, LookupMessage(370), name); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); std::memset(message, 0, sizeof(message)); sprintf_s(message, sizeof(message), LookupMessage(371), reason); if (g_forbiddenWords.Contains(message) == true) { std::string masked; g_forbiddenWords.Mask(message, &masked); } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); GuildInfo::Unknown00ECEntry entry; entry.name = name; @@ -7167,10 +7171,10 @@ void CGameMode::ReceiveGuildMemberLeft(const unsigned char* data) { if (std::string(name) == g_session.DecodePlayerName()) { guildInfo->Init(); - g_windowMgr.CloseWindow(59); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(489)), 0xFF, 4, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(489)), 0xFF, 4, 0, 0); this->scene->player->SetGuildInfo(0, 0); - this->SendMsg(172, 0, 0, 0, 0); + this->SendMsg(MM_DELETEGUILDPOSALL, 0, 0, 0, 0); return; } @@ -7180,13 +7184,13 @@ void CGameMode::ReceiveGuildMemberLeft(const unsigned char* data) { char message[1024]; std::sprintf(message, LookupMessage(364), name); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); sprintf_s(message, sizeof(message), LookupMessage(365), reason); if (g_forbiddenWords.Contains(message) == true) { std::string masked; g_forbiddenWords.Mask(message, &masked); } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); } #pragma pack(push, 1) @@ -7227,9 +7231,9 @@ void CGameMode::ReceiveGuildExpulsion2(const unsigned char* data) { if (packet->characterId == g_session.m_gid) { ClearGuildShortcutSkills(); g_guildInfo.m_guildId = 0; - g_windowMgr.CloseWindow(59); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(490)), 0xFF, 4, 0, 0); - this->SendMsg(172, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(490)), 0xFF, 4, 0, 0); + this->SendMsg(MM_DELETEGUILDPOSALL, 0, 0, 0, 0); if (this->scene != nullptr && this->scene->player != nullptr) { this->scene->player->SetGdid(0); } @@ -7249,14 +7253,14 @@ void CGameMode::ReceiveGuildExpulsion2(const unsigned char* data) { char message[1024]; std::memset(message, 0, sizeof(message)); std::sprintf(message, LookupMessage(0x172), name.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); std::memset(message, 0, sizeof(message)); sprintf_s(message, sizeof(message), LookupMessage(0x173), reason); if (g_forbiddenWords.Contains(message) == true) { std::string masked; g_forbiddenWords.Mask(message, &masked); } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); GuildInfo::Unknown00ECEntry entry; entry.name = name.c_str(); @@ -7275,10 +7279,10 @@ void CGameMode::ReceiveGuildLeave2(const unsigned char* data) { if (packet->characterId == g_session.m_gid) { ClearGuildShortcutSkills(); guildInfo->Init(); - g_windowMgr.CloseWindow(59); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(489)), 0xFF, 4, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(489)), 0xFF, 4, 0, 0); this->scene->player->SetGuildInfo(0, 0); - this->SendMsg(172, 0, 0, 0, 0); + this->SendMsg(MM_DELETEGUILDPOSALL, 0, 0, 0, 0); return; } @@ -7298,13 +7302,13 @@ void CGameMode::ReceiveGuildLeave2(const unsigned char* data) { char message[1024]; std::sprintf(message, LookupMessage(0x16C), name.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); sprintf_s(message, sizeof(message), LookupMessage(0x16D), reason); if (g_forbiddenWords.Contains(message) == true) { std::string masked; g_forbiddenWords.Mask(message, &masked); } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 4, 0, 0); if (CRenderObject* actor = this->scene->GetGameActorByAID(packet->characterId)) { static_cast(actor)->SetGuildInfo(0, 0); @@ -7395,8 +7399,8 @@ void CGameMode::RefreshInventoryOrEquipItem(std::uint16_t itemId, unsigned char g_session.SetEquipItem2B50(slot, item); } - if (UIWindow* window = g_windowMgr.LookupWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -7435,8 +7439,8 @@ void CGameMode::RefreshInventoryOrEquipItem2(const unsigned char* data) { g_session.SetEquipItem2B50(slot, item); } - if (UIWindow* window = g_windowMgr.LookupWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -7508,17 +7512,17 @@ void CGameMode::ReceiveRankingList(const unsigned char* data) { background = 0; color = 0; } - g_windowMgr.SendNotice(1, reinterpret_cast(title), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(title), color, 0, 0, 0); for (int index = 0; index < 10; ++index) { const std::string line = FormatOwnedString("[ %2d ] %-18s : %4d POINT", index + 1, packet->names[index], packet->points[index]); - g_windowMgr.SendNotice(1, reinterpret_cast(line.c_str()), background, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line.c_str()), background, 0, 0, 0); } - g_windowMgr.SendNotice(1, reinterpret_cast("==========================================="), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("==========================================="), color, 0, 0, 0); const std::string mine = FormatOwnedString("MY POINT : %4d POINT ", packet->myPoint); - g_windowMgr.SendNotice(1, reinterpret_cast(mine.c_str()), background, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("==========================================="), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(mine.c_str()), background, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("==========================================="), color, 0, 0, 0); } struct GuildStorageLogItem { @@ -7660,7 +7664,7 @@ void CGameMode::ProcessWhisper(int unknown_0004, std::string name, std::string t std::string reply(LookupMessage(941)); reply.append(reinterpret_cast(g_session.unknown_56B8[4]).c_str()); g_windowMgr.SetUnknown04DC(reply.c_str()); - g_modeMgr.gameMode->SendMsg(11, reinterpret_cast(name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(name.c_str()), 0, 0, 0); } } @@ -7716,11 +7720,11 @@ void CGameMode::ProcessWhisper(int unknown_0004, std::string name, std::string t } else { CSession& lists = g_session; if (lists.IsFriendNameDifferent(name.c_str())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); } else if (lists.IsGuildMemberNameDifferent(name.c_str())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); } prefix = "( From "; prefix.append(sender); @@ -7731,8 +7735,8 @@ void CGameMode::ProcessWhisper(int unknown_0004, std::string name, std::string t } if (std::strcmp(name.c_str(), g_session.DecodePlayerName()) != 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(prefix.c_str()), 0xFFFF, flag ? 25 : 2, reinterpret_cast(sender.c_str()), 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(prefix.c_str()), 0xFFFF, flag ? 25 : 2, reinterpret_cast(sender.c_str()), 0); g_windowMgr.AddWhisperName(name.c_str()); if (flag) { if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { @@ -7769,7 +7773,7 @@ void CGameMode::ProcessWhisper(int unknown_0004, std::string name, std::string t std::string reply(LookupMessage(941)); reply.append(reinterpret_cast(g_session.unknown_56B8[4]).c_str()); g_windowMgr.SetUnknown04DC(reply.c_str()); - g_modeMgr.gameMode->SendMsg(11, reinterpret_cast(name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(name.c_str()), 0, 0, 0); } } } @@ -7780,13 +7784,13 @@ void CGameMode::ReceiveStoreResult(unsigned char kind, unsigned char result) { if (kind == 100) { switch (result) { case 0: - g_windowMgr.CloseWindow(41); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); g_session.ClearItems1768(); break; case 1: case 2: case 3: { - UIWindow* window = g_windowMgr.LookupWindow(41); + UIWindow* window = g_windowMgr.LookupWindow(WID_MERCHANTSHOPMAKEWND); if (window) { static_cast(window)->SetSuspended(0); } @@ -7796,19 +7800,19 @@ void CGameMode::ReceiveStoreResult(unsigned char kind, unsigned char result) { case 6: case 7: g_session.ClearItems1768(); - g_windowMgr.CloseWindow(41); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); break; } } else if (kind == 101) { switch (result) { case 0: - g_windowMgr.CloseWindow(174); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); g_session.ClearItems1768(); break; case 1: case 2: case 3: { - UIWindow* window = g_windowMgr.LookupWindow(174); + UIWindow* window = g_windowMgr.LookupWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); if (window) { static_cast(window)->SetSuspended(0); } @@ -7819,32 +7823,32 @@ void CGameMode::ReceiveStoreResult(unsigned char kind, unsigned char result) { case 7: case 8: g_session.ClearItems1768(); - g_windowMgr.CloseWindow(174); - g_windowMgr.CloseWindow(175); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); break; } } switch (result) { case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2983)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2983)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1954)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1954)), 0xFF, 0, 0, 0); break; case 8: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); break; } if (result == 200) { g_session.ClearItems1768(); - g_windowMgr.CloseWindow(41); - g_windowMgr.CloseWindow(174); - g_windowMgr.CloseWindow(8); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); + g_windowMgr.CloseWindow(WID_ITEMWND); g_windowMgr.ShowWaitDBSaveWindow(); return; } - g_windowMgr.CloseWindow(10024); + g_windowMgr.CloseWindow(WID_WAITDBSAVEWND); } diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index 3fabe46b9..bedab9ff3 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -1,3 +1,7 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Effects/EffectTypes.h" #include "Contents/Items/ItemType.h" @@ -148,7 +152,7 @@ // FUNCTION: fn_22198 __declspec(noinline) void CGameMode::ReceiveItemDisappear(std::uint32_t itemAid) { if (this->scene->RemoveItem(itemAid) == true) { - this->SendMsg(13, static_cast(itemAid), 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, static_cast(itemAid), 0, 0, 0); } } @@ -539,9 +543,9 @@ void CGameMode::ReceiveUnknown05C4Result(const unsigned char* data) { switch (packet->result) { case BOSS_INFO_NOT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1223)), 0xFFFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(1223)), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1223)), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(1223)), 0xFFFFFF, 0, 0, 0); return; case BOSS_INFO_ALIVE: case BOSS_INFO_ALIVE_WITHMSG: @@ -563,9 +567,9 @@ void CGameMode::ReceiveUnknown05C4Result(const unsigned char* data) { return; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); } // OFFSET: 0x00D230E0 @@ -574,63 +578,63 @@ __declspec(noinline) void CGameMode::ReceiveColoredNotice(const unsigned char* p std::string text; text.assign(reinterpret_cast(packet + 9), *reinterpret_cast(packet + 2) - 9); if (!text.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), *reinterpret_cast(packet + 5), packet[4], 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), *reinterpret_cast(packet + 5), packet[4], 0, 0); } } // OFFSET: 0x00D1D690 // FUNCTION: fn_21630 void CGameMode::ReceiveNamedActionResult(const unsigned char* packet) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const std::string name = reinterpret_cast(packet + 2); const int result = *reinterpret_cast(packet + 0x1A); switch (result) { case PARTY_REPLY_JOIN_OTHER_PARTY: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x50)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x50)), 0xFF, 0, 0, 0); break; case PARTY_REPLY_REJECTED: { const std::string text = name + LookupMessage(0x80C); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); break; } case PARTY_REPLY_ACCEPTED: { const std::string text = name + LookupMessage(0x80D); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF00, 0, 0, 0); break; } case PARTY_REPLY_FULL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x53)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x53)), 0xFF, 0, 0, 0); break; case PARTY_REPLY_DUAL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x260)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x260)), 0xFF, 0, 0, 0); break; } switch (result) { case PARTY_REPLY_JOINMSG_REFUSE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x52C)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x52C)), 0xFF, 0, 0, 0); break; case PARTY_REPLY_OFFLINE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x47)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x47)), 0xFF, 0, 0, 0); break; case PARTY_REPLY_INVALID_MAPPROPERTY: { char text[256]; std::sprintf(text, LookupMessage(0x56C), reinterpret_cast(packet + 2)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); break; } case PARTY_REPLY_INVALID_MAPPROPERTY_ME: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x74F)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x74F)), 0xFF, 0, 0, 0); break; case PARTY_REPLY_MEMORIALDUNGEON: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBD3)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBD3)), 0xFF, 0, 0, 0); break; case 11: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xC9A)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xC9A)), 0xFF, 0, 0, 0); break; case 18: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xE32)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE32)), 0xFF, 0, 0, 0); break; } } @@ -644,21 +648,21 @@ void CGameMode::ReceiveStatDump(const unsigned char* packet) { std::sprintf( text, " STR=%3d AGI=%3d VIT=%3d INT=%3d DEX=%3d LUK=%d", packet[2], packet[4], packet[6], packet[8], packet[10], packet[12] ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); std::sprintf( text, "standard STR=%3d AGI=%3d VIT=%3d INT=%3d DEX=%3d LUK=%2d", packet[3], packet[5], packet[7], packet[9], packet[11], packet[13] ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF37, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF37, 0, 0, 0); std::sprintf( text, " attPower=%3d refiningPow=%3d MAXmatPow=%3d MINmatPower=%3d ASPD=%3d", values[7], values[8], values[9], values[10], values[19] ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); std::sprintf( text, "itemdefPow=%3d plusdefPow=%3d mdefPower=%3d plusmdefPow=%3d plusASPD=%3d", values[11], values[12], values[13], values[14], values[20] ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF37, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF37, 0, 0, 0); std::sprintf(text, "hitSuccessVal=%3d avoidSuccessVal=%3d plusAvoidSuccessValue=%3d", values[15], values[16], values[17]); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } // OFFSET: 0x00D24430 @@ -669,7 +673,7 @@ __declspec(noinline) void CGameMode::ReceiveActorText(const unsigned char* packe text[80] = '\0'; if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 2))) { const std::int64_t value = reinterpret_cast(text); - actor->SendMsg(nullptr, 141, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_BUYING_SHOP_TITLE, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -688,13 +692,13 @@ __declspec(noinline) void CGameMode::ReceiveRentalItemTime(const unsigned char* } else { std::sprintf(text, LookupMessage(1270), name, seconds); } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text), 0xFFFF, 0, 0, 0); if (minutes == 1) { std::sprintf(text, LookupMessage(1257), name); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } } @@ -702,25 +706,25 @@ __declspec(noinline) void CGameMode::ReceiveRentalItemTime(const unsigned char* // FUNCTION: fn_21679 void CGameMode::ReceiveUnknownD264E0(const unsigned char* packet) { if (UIWindow* window = g_windowMgr.unknown_01F0) { - window->SendMsg(nullptr, 32, 0, 0, 0, 0); - window->SendMsg(nullptr, 63, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DISABLENEXTBUTTON, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ENABLECLOSEBUTTON, 0, 0, 0, 0); } else { this->unknown_024C = 0; this->unknown_02DC = *reinterpret_cast(packet + 2); - g_windowMgr.CloseWindow(16); - g_windowMgr.CloseWindow(17); - g_windowMgr.CloseWindow(226); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND); + g_windowMgr.CloseWindow(WID_CHOOSEWND); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND_OVERLAY); } if (UIWindow* window = g_windowMgr.unknown_01F4) { - window->SendMsg(nullptr, 32, 0, 0, 0, 0); - window->SendMsg(nullptr, 63, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DISABLENEXTBUTTON, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ENABLECLOSEBUTTON, 0, 0, 0, 0); } else { this->unknown_024C = 0; this->unknown_02DC = *reinterpret_cast(packet + 2); - g_windowMgr.CloseWindow(226); - g_windowMgr.CloseWindow(17); - g_windowMgr.CloseWindow(226); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND_OVERLAY); + g_windowMgr.CloseWindow(WID_CHOOSEWND); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND_OVERLAY); } } @@ -756,7 +760,7 @@ void CGameMode::ReceiveDevotionList(const unsigned char* packet) { if (actor != nullptr) { for (int index = 0; index < 5; ++index) { - actor->SendMsg(nullptr, 109, 0, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -770,16 +774,16 @@ void CGameMode::ReceiveDevotionList(const unsigned char* packet) { if (actor != nullptr) { CRagEffect* effect = actor->LaunchEffect(232, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } } else { char message[256]; sprintf(message, "DEVOTION OVERFLOW : %d -- %d , %d , %d , %d , %d", list->aid, list->devotees[0], list->devotees[1], list->devotees[2], list->devotees[3], list->devotees[4]); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x3232FA, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x3232FA, 0, 0, 0); sprintf(message, "DEVOTION OVERFLOW : 그라비티에 메일로 문의해주십시요"); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x3232FA, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x3232FA, 0, 0, 0); } } } @@ -788,7 +792,7 @@ void CGameMode::ReceiveDevotionList(const unsigned char* packet) { // FUNCTION: fn_21686 __declspec(noinline) void CGameMode::ReceiveActorSignal(const unsigned char* packet) { if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 2))) { - actor->SendMsg(nullptr, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_BUYING_SHOP_TITLE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -838,7 +842,7 @@ __declspec(noinline) void CGameMode::ReceiveFormatStringMessage(const unsigned c return; } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFFFF, 0, 0, 0); } // OFFSET: 0x00D2AF90 @@ -850,7 +854,7 @@ void CGameMode::IgnorePacket(const unsigned char*) { // FUNCTION: fn_21710 void CGameMode::ReceiveItem1738EquipList(const unsigned char* data) { const ItemStoreListHeader* packet = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (packet->title[0] != '\0') { std::string title(packet->title); window->title->SetTextFitted(title.c_str()); @@ -890,7 +894,7 @@ void CGameMode::ReceiveItem1738EquipList(const unsigned char* data) { // FUNCTION: fn_21711 void CGameMode::ReceiveItem1738EquipListOptions(const unsigned char* data) { const ItemStoreListHeader* packet = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (packet->title[0] != '\0') { std::string title(packet->title); window->title->SetTextFitted(title.c_str()); @@ -930,7 +934,7 @@ void CGameMode::ReceiveItem1738EquipListOptions(const unsigned char* data) { // FUNCTION: fn_21712 void CGameMode::ReceiveItem1738NormalList(const unsigned char* data) { const ItemStoreListHeader* packet = reinterpret_cast(data); - UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(33)); + UIItemStoreWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)); if (packet->title[0] != '\0') { std::string title(packet->title); window->title->SetTextFitted(title.c_str()); @@ -1017,10 +1021,10 @@ __declspec(noinline) void CGameMode::ReceiveHuntingList(const unsigned char* pac std::memcpy(list, packet + 4, size); list[size] = '\0'; std::sprintf(text, "=========== HUNTING LIST ============="); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x9BCD9B, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(list), 0xCDFFCD, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x9BCD9B, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(list), 0xCDFFCD, 0, 0, 0); std::sprintf(text, "========================================"); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x9BCD9B, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x9BCD9B, 0, 0, 0); } // OFFSET: 0x00D2F150 @@ -1050,9 +1054,9 @@ bool CGameMode::NotifyItemResult(int result) { default: return false; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const char* text = LookupMessage(message); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); return true; } @@ -1061,16 +1065,16 @@ bool CGameMode::NotifyItemResult(int result) { void CGameMode::ReceiveEquipAck(const unsigned char* packet) { switch (*reinterpret_cast(packet + 2)) { case 0: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(242)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(242)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(243)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(243)), 0xFFFF64, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(244)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(244)), 0xFFFF64, 0, 0, 0); break; case 3: switch (g_session.GetDisplayJob()) { @@ -1081,16 +1085,16 @@ void CGameMode::ReceiveEquipAck(const unsigned char* packet) { case JT_GUILLOTINE_CROSS_H: case JT_GUILLOTINE_CROSS_B: case JT_SHADOW_CROSS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1040)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1040)), 0xFFFF64, 0, 0, 0); break; case JT_GUNSLINGER: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1175)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1175)), 0xFFFF64, 0, 0, 0); break; case JT_NINJA: case JT_NINJA_B: break; default: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(245)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(245)), 0xFFFF64, 0, 0, 0); break; } break; @@ -1102,7 +1106,7 @@ void CGameMode::ReceiveEquipAck(const unsigned char* packet) { std::string CGameMode::MakeSimulatorFolder(const std::string& folder) { std::string path = g_applicationDirectory + folder; if (_access(path.c_str(), 0) != 0 && _mkdir(path.c_str()) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("Create Folder Fail!!! %s", path.c_str()).c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("Create Folder Fail!!! %s", path.c_str()).c_str()), 0xFF, 0, 0, 0); return std::string(); } return path; @@ -1128,7 +1132,7 @@ std::FILE* CGameMode::OpenPackageSimulatorFile(const std::string& folder, int it } std::FILE* file = _wfopen(DecodeText(g_textCodePage, path).c_str(), L"w"); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("Simulator Result File Create %s %d!!!!!!!!!!!!", file ? "success" : "Fail", itemId).c_str()), + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("Simulator Result File Create %s %d!!!!!!!!!!!!", file ? "success" : "Fail", itemId).c_str()), file ? 0xFFFF : 0xFF, 0, 0, 0); return file; } @@ -1149,7 +1153,7 @@ std::FILE* CGameMode::OpenSimulatorFile(const std::string& folder, const std::st } std::FILE* file = _wfopen(DecodeText(g_textCodePage, path).c_str(), L"w"); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s Simulator File Create %s !!!!!!!!!!!!", name.c_str(), file ? "success" : "Fail").c_str()), + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s Simulator File Create %s !!!!!!!!!!!!", name.c_str(), file ? "success" : "Fail").c_str()), file ? 0xFFFF : 0xFF, 0, 0, 0); return file; } @@ -1281,13 +1285,13 @@ void CGameMode::ReceivePackageSimulation(const unsigned char* packet) { // OFFSET: 0x00D612A0 // FUNCTION: fn_21979 __declspec(noinline) void CGameMode::ReceiveUnknownD612A0(const unsigned char* packet) { - UIWindow* window = g_windowMgr.EnsureWindow(267); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MILEAGEWND); if (!window) { return; } window->SendMsg( - nullptr, 34, packet[2] != 0, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), static_cast(packet[3]) + nullptr, UM_SETINFO, packet[2] != 0, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), static_cast(packet[3]) ); } @@ -1296,16 +1300,16 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD612A0(const unsigned char* p __declspec(noinline) void CGameMode::ReceiveUnknownD77BF0(const unsigned char* packet) { if (packet[2] == 1) { if (!g_windowMgr.unknown_0450) { - g_windowMgr.EnsureWindow(262); + g_windowMgr.EnsureWindow(WID_OPENMAILBOXWND); } - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 476, 1, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 476, 1, 0); } return; } - g_windowMgr.CloseWindow(262); + g_windowMgr.CloseWindow(WID_OPENMAILBOXWND); } // OFFSET: 0x00D8A300 @@ -1333,7 +1337,7 @@ void CGameMode::ReceiveHpSpRecovery(const unsigned char* packet, int variant) { g_session.unknown_5568 = hp; g_session.RefreshHpSpWindows(); } - player->SendMsg(nullptr, 88, 0, amount, amount >> 31, static_cast(0xFF00FF00), 0, 114, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, amount >> 31, static_cast(0xFF00FF00), 0, 114, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(331, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } @@ -1345,7 +1349,7 @@ void CGameMode::ReceiveHpSpRecovery(const unsigned char* packet, int variant) { sp = value; g_session.RefreshHpSpWindows(); } - player->SendMsg(nullptr, 88, 0, amount, amount >> 31, static_cast(0xFF0000FF), 0, 114, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, amount >> 31, static_cast(0xFF0000FF), 0, 114, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(332, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } @@ -1406,15 +1410,15 @@ __declspec(noinline) void CGameMode::ReceiveCharViewResult(const unsigned char* CMode* mode = g_modeMgr.gameMode; CPlayer* player = static_cast(g_modeMgr.GetGameMode())->scene->player; if (player->render.unknown_0070 != 0 && mode != nullptr) { - mode->SendMsg(137, 3, player->unknown_051C, 0, 0); + mode->SendMsg(MM_REQUEST_ACT, 3, player->unknown_051C, 0, 0); } return; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3009)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3009)), 0xFF, 0, 0, 0); return; default: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3040)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3040)), 0xFF, 0, 0, 0); return; } } @@ -1449,8 +1453,8 @@ __declspec(noinline) void CGameMode::ReceiveMemorialDungeonInfo(const unsigned c const int previous = g_session.unknown_5948; g_session.unknown_5948 = state; if (previous != state || state != 2 || g_session.unknown_593C != 0) { - if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } } @@ -1464,21 +1468,21 @@ __declspec(noinline) void CGameMode::ReceiveMemorialDungeonNotify(const unsigned g_session.unknown_5948 = 0 != time ? 1 : 2; if (*reinterpret_cast(packet + 2) == 0) { if (previous != (time != 0 ? 1 : 2) || time != 0 || g_session.unknown_593C != 0) { - if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } return; } - g_windowMgr.CloseWindow(137); + g_windowMgr.CloseWindow(WID_MEMORIALDUNWND); const int type = *reinterpret_cast(packet + 2); if (type == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1346)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1346)), 0x64FFFF, 0, 0, 0); } else if (type == 2) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1347)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1347)), 0x64FFFF, 0, 0, 0); } else if (type == 3) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1348)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1348)), 0x64FFFF, 0, 0, 0); } } @@ -1488,8 +1492,8 @@ __declspec(noinline) void CGameMode::ReceiveMemorialDungeonSubscriptionInfo(cons g_session.unknown_5950 = reinterpret_cast(packet + 2); g_session.unknown_5968 = *reinterpret_cast(packet + 63); g_session.unknown_5948 = 0; - if (UIWindow* window = g_windowMgr.EnsureWindow(137)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -1497,40 +1501,40 @@ __declspec(noinline) void CGameMode::ReceiveMemorialDungeonSubscriptionInfo(cons // FUNCTION: fn_21739 __declspec(noinline) void CGameMode::ReceiveMemorialDungeonSubscriptionNotify(const unsigned char* packet) { g_session.unknown_5968 = *reinterpret_cast(packet + 2); - UIWindow* window = g_windowMgr.EnsureWindow(137); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND); if (!window) { return; } if (*reinterpret_cast(packet + 2) > -1) { g_session.unknown_5948 = 0; - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return; } - g_windowMgr.CloseWindow(137); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1345)), 0x64FFFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MEMORIALDUNWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1345)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00D320D0 // FUNCTION: fn_21740 void CGameMode::ReceiveWindow17Entries(const unsigned char* packet) { this->unknown_024C = 1; - g_windowMgr.CloseWindow(17); - if (UIWindow* window = g_windowMgr.EnsureWindow(17)) { + g_windowMgr.CloseWindow(WID_CHOOSEWND); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_CHOOSEWND)) { const int length = *reinterpret_cast(packet + 2) - 9; std::string text(reinterpret_cast(packet + 8), length); const std::vector entries = Split(text, ":"); for (const std::string& entry : entries) { if (!entry.empty()) { - window->SendMsg(nullptr, 27, reinterpret_cast(entry.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast(entry.c_str()), 0, 0, 0); } } - window->SendMsg(nullptr, 28, *reinterpret_cast(packet + 4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(packet + 4), 0, 0, 0); } if (g_windowMgr.unknown_01F0) { - g_windowMgr.unknown_01F0->SendMsg(nullptr, 32, 0, 0, 0, 0); + g_windowMgr.unknown_01F0->SendMsg(nullptr, UM_DISABLENEXTBUTTON, 0, 0, 0, 0); } } @@ -1575,7 +1579,7 @@ void CGameMode::Zc_Notify_Exp(const unsigned char* packet) { text += LookupMessage(1616); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), color, 18, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), color, 18, 0, 0); } // OFFSET: 0x00D61290 @@ -1624,7 +1628,7 @@ __declspec(noinline) void CGameMode::ReceiveActorStatusBlock(const unsigned char g_session.unknown_5BCC = *reinterpret_cast(packet + 0xA); g_session.unknown_5BD0 = *reinterpret_cast(packet + 0x12); if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 2))) { - actor->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1648,7 +1652,7 @@ __declspec(noinline) void CGameMode::ReceiveActorStatusUpdate(const unsigned cha break; } if (CRenderObject* actor = this->scene->GetGameActorByAID(g_session.unknown_5BC0)) { - actor->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -1661,7 +1665,7 @@ void CGameMode::ReceiveActorTitle(const unsigned char* packet) { text[80] = '\0'; if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 2))) { const std::int64_t value = reinterpret_cast(text); - actor->SendMsg(nullptr, 0x37, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_SHOP_TITLE, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1670,7 +1674,7 @@ void CGameMode::ReceiveActorTitle(const unsigned char* packet) { __declspec(noinline) void CGameMode::ReceiveActorInt8(const unsigned char* packet) { if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 2))) { const std::int64_t value = *reinterpret_cast(packet + 6); - actor->SendMsg(nullptr, 0x91, 0, static_cast(value), static_cast(value >> 32), 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(value), static_cast(value >> 32), 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1681,7 +1685,7 @@ __declspec(noinline) void CGameMode::ReceiveActorInt64Pair(const unsigned char* const std::int64_t first = *reinterpret_cast(packet + 6); const std::int64_t second = *reinterpret_cast(packet + 0xA); actor->SendMsg( - nullptr, 0x91, 0, static_cast(first), static_cast(first >> 32), static_cast(second), static_cast(second >> 32), 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(first), static_cast(first >> 32), static_cast(second), static_cast(second >> 32), 0, 0, 0, 0, 0, 0, 0, 0 ); } } @@ -1760,16 +1764,16 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD26800(const unsigned char* p const unsigned char value = packet[2]; *reinterpret_cast(g_session.unknown_5974) = value; const char* text = LookupMessage(value != 0 ? 0x54F : 0x54E); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } // OFFSET: 0x00D79660 // FUNCTION: fn_22172 __declspec(noinline) void CGameMode::ReceiveUnknownD79660(const unsigned char* packet) { - UIWindow* window = g_windowMgr.LookupWindow(10032); + UIWindow* window = g_windowMgr.LookupWindow(WID_DEBUFFREMOVEWND); if (!window) { return; } @@ -1778,14 +1782,14 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD79660(const unsigned char* p case 0: { window->Show(0); const char* text = LookupMessage(0x10E8); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); return; } case 1: - g_windowMgr.CloseWindow(10032); + g_windowMgr.CloseWindow(WID_DEBUFFREMOVEWND); return; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x79B)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x79B)), 0xFF, 0, 0, 0); return; case 3: window->Show(1); @@ -1798,12 +1802,12 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD79660(const unsigned char* p __declspec(noinline) void CGameMode::ReceiveUnknownD79E90(std::int16_t result, std::intptr_t value) { switch (result) { case 0: - if (UIWindow* window = g_windowMgr.LookupWindow(340)) { - window->SendMsg(nullptr, 0x40, 0, value, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND)) { + window->SendMsg(nullptr, UM_PARAM, 0, value, 0, 0); } break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x9D1)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x9D1)), 0xFF, 0, 0, 0); break; } } @@ -1821,13 +1825,13 @@ __declspec(noinline) void CGameMode::ReceiveRouletteSetResult(const unsigned cha } break; case GENERATE_ROULETTE_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA4C)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA4C)), 0x6464FF, 0, 0, 0); break; case GENERATE_ROULETTE_NO_ENOUGH_POINT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA4D)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA4D)), 0x6464FF, 0, 0, 0); break; case GENERATE_ROULETTE_LOSING: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA4E)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA4E)), 0x6464FF, 0, 0, 0); break; } } @@ -1858,7 +1862,7 @@ __declspec(noinline) void CGameMode::ReceiveDynamicNpcNotice(const unsigned char return; } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00D079A0 @@ -1886,8 +1890,8 @@ void CGameMode::ReceiveWhisperResult(unsigned char kind, int argument) { } if (g_pendingWhisperCount <= 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFFFF, 2, reinterpret_cast(copied.c_str()), 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFFFF, 2, reinterpret_cast(copied.c_str()), 0); } else { --g_pendingWhisperCount; } @@ -1902,22 +1906,22 @@ void CGameMode::ReceiveWhisperResult(unsigned char kind, int argument) { --g_pendingWhisperCount; return; } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); return; } case ACKWHISPER_IGNORED: { const std::string text = "(" + this->unknown_022C + ")" + LookupMessage(0x95); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); return; } case ACKWHISPER_ALL_IGNORED: { const std::string text = "(" + this->unknown_022C + ")" + LookupMessage(0x96); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); return; } default: { const std::string text = "(" + this->unknown_022C + ")" + LookupMessage(0x94); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 2, 0, 0); if (g_session.m_whisperRecord != 0) { this->WriteChatLog(text.c_str()); } @@ -1947,24 +1951,24 @@ void __stdcall ProcessVendingSale(int field8, int itemIdWord, int quantityWord, item.unknown_0000[1] = static_cast(itemId); item.quantity = quantity; item.unknown_0014[0] = static_cast(field14); - UIWindow* window = g_windowMgr.EnsureWindow(0x101); - window->SendMsg(nullptr, 0x17, reinterpret_cast(&item), field18, field8, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMLOGWND_MODE_0); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(&item), field18, field8, 0); g_session.RemoveItem1758(item); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0xE7), item.DisplayName(0).c_str(), quantity).c_str()), 0xFFFF64, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xE7), item.DisplayName(0).c_str(), quantity).c_str()), 0xFFFF64, 0, 0, 0 ); if (g_windowMgr.unknown_02F4 != nullptr) { - g_windowMgr.unknown_02F4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.unknown_02F4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_session.GetList9Size() == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x137)), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x137)), 0xFF00, 0, 0, 0); if (g_windowMgr.unknown_0304 != nullptr) { - g_windowMgr.unknown_0304->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - g_windowMgr.unknown_0304->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); + g_windowMgr.unknown_0304->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.unknown_0304->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } } else if (g_windowMgr.unknown_0304 != nullptr) { - g_windowMgr.unknown_0304->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.unknown_0304->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.unknown_0304 != nullptr && g_session.m_muteSellSound) { g_soundMgr->PlayWave("effect\\ef_steal.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -1978,20 +1982,20 @@ void __declspec(noinline) __stdcall ProcessBuyingStorePurchase(int field14, int item.SetItemId(itemId); item.quantity = quantity; item.unknown_0014[0] = static_cast(field8); - UIWindow* window = g_windowMgr.EnsureWindow(0x102); - window->SendMsg(nullptr, 0x17, reinterpret_cast(&item), field10, field14, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMLOGWND_MODE_1); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(&item), field10, field14, 0); g_session.RemoveItem1758ByItemId(item); if (g_windowMgr.unknown_01D4 != nullptr) { - g_windowMgr.unknown_01D4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.unknown_01D4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.unknown_0414 != nullptr) { - g_windowMgr.unknown_0414->SendMsg(nullptr, 0x77, fieldC, 0, 0, 0); - g_windowMgr.unknown_0414->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.unknown_0414->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, fieldC, 0, 0, 0); + g_windowMgr.unknown_0414->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); if (g_session.m_muteSellSound) { g_soundMgr->PlayWave("effect\\ef_steal.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } if (g_session.GetList9Size() == 0) { - g_windowMgr.unknown_0414->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); + g_windowMgr.unknown_0414->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } } } @@ -2147,10 +2151,10 @@ void CGameMode::ReceiveShopItemList( lists->AddItem1758(item); } - if (UIMerchantItemMyShopWnd* window = static_cast(g_windowMgr.EnsureWindow(45))) { + if (UIMerchantItemMyShopWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMMYSHOPWND))) { window->OpenShop(); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x1C, value, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, value, 0, 0, 0); window->SetDuration(duration); } } else { @@ -2160,15 +2164,15 @@ void CGameMode::ReceiveShopItemList( lists->AddItem1748(item); } - if (UIMerchantItemShopWnd* window = static_cast(g_windowMgr.EnsureWindow(43))) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x1C, value, 0, 0, 0); + if (UIMerchantItemShopWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND))) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, value, 0, 0, 0); window->StartTimer(duration); } - if (UIWindow* window = g_windowMgr.EnsureWindow(44)) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x1C, value, argument, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, value, argument, 0, 0); } } @@ -2180,10 +2184,10 @@ void CGameMode::ReceiveShopItemList( __declspec(noinline) void CGameMode::ReceivePacket0B2E(short result) { switch (result) { case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x442)), 0xff, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x442)), 0xff, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xe31)), 0xff, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xe31)), 0xff, 0, 0, 0); break; } } @@ -2193,17 +2197,17 @@ __declspec(noinline) void CGameMode::ReceivePacket0B2E(short result) { __declspec(noinline) void CGameMode::ReceiveUnknownD2A1F0(const unsigned char* packet) { switch (*reinterpret_cast(packet + 2)) { case 3: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6CF)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6CF)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6D0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6D0)), 0xFF, 0, 0, 0); break; } - this->SendMsg(0x28, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0xB0); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1); } // OFFSET: 0x00D7A0E0 @@ -2224,7 +2228,7 @@ __declspec(noinline) void CGameMode::ReceiveActorMessage7(const unsigned char* p std::memcpy(text, packet + 8, length); const std::int64_t value = reinterpret_cast(text); actor->SendMsg( - nullptr, 7, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, AM_CHAT, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } // OFFSET: 0x00D7AEB0 @@ -2278,11 +2282,11 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, if (actor->IsPlayerClass(actor->GetEffectiveJob(-1))) { if (StateFlag01(actor->GetStateFlags()) || StateFlag02(actor->GetStateFlags())) { - actor->SendMsg(nullptr, 109, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } @@ -2290,21 +2294,21 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, if (!actor->HasId(166)) { CRagEffect* effect = actor->LaunchEffect(166, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 130, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 130, 0, 0, 0); } } } else if (options & 0x2) { if (!actor->HasId(166)) { CRagEffect* effect = actor->LaunchEffect(166, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 128, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 128, 0, 0, 0); } } } else if (options & 0x4) { if (!actor->HasId(166)) { CRagEffect* effect = actor->LaunchEffect(166, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 169, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 169, 0, 0, 0); } } } else if (options & 0x4000) { @@ -2381,10 +2385,10 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } if (StateFlag01(actor->GetStateFlags()) || StateFlag02(actor->GetStateFlags())) { - actor->SendMsg(nullptr, 109, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } @@ -2400,7 +2404,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(420)) { - actor->SendMsg(nullptr, 109, 0, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->LaunchEffect(540, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } } @@ -2411,7 +2415,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(427)) { - actor->SendMsg(nullptr, 109, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -2422,8 +2426,8 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(254)) { - actor->SendMsg(nullptr, 109, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 109, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -2433,7 +2437,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(655)) { - actor->SendMsg(nullptr, 109, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->LaunchEffect(656, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } } @@ -2444,7 +2448,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(667)) { - actor->SendMsg(nullptr, 109, 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -2454,7 +2458,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(375)) { - actor->SendMsg(nullptr, 109, 0, 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -2464,7 +2468,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, } } else { while (actor->HasId(744) == 1) { - actor->SendMsg(nullptr, 109, 0, 744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 744, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -2472,7 +2476,7 @@ void CGameMode::ApplyActorStatusEffects(std::uint32_t aid, int state, int flag, // OFFSET: 0x00D7B350 // FUNCTION: fn_22201 __declspec(noinline) void CGameMode::ReceivePacket0AB8(const unsigned char*) { - this->scene->player->SendMsg(nullptr, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_CLEAR_ROUTE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D78010 @@ -2507,11 +2511,11 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD89C60(const unsigned char* p // OFFSET: 0x00D79390 // FUNCTION: fn_22165 __declspec(noinline) void CGameMode::ReceiveLapineBoxIngredient(const unsigned char* packet) { - if (g_windowMgr.LookupWindow(0x122) != nullptr) { + if (g_windowMgr.LookupWindow(WID_LAPINEBOXWND) != nullptr) { return; } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x122)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_LAPINEBOXWND)) { static_cast(window)->SetIngredient(static_cast(reinterpret_cast(packet))); } } @@ -2519,7 +2523,7 @@ __declspec(noinline) void CGameMode::ReceiveLapineBoxIngredient(const unsigned c // OFFSET: 0x00D79B40 // FUNCTION: fn_22178 __declspec(noinline) void CGameMode::ActivateMacroBlackListCheck(unsigned char state, int duration) { - if (UIWindow* window = g_windowMgr.LookupWindow(0x167)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MACROBLACKLISTCHECKWND)) { static_cast(window)->Activate(state, duration); } } @@ -2527,7 +2531,7 @@ __declspec(noinline) void CGameMode::ActivateMacroBlackListCheck(unsigned char s // OFFSET: 0x00D79B70 // FUNCTION: fn_22179 __declspec(noinline) void CGameMode::SetMacroDetectorCountdown(unsigned char count, std::uint32_t duration) { - if (UIWindow* window = g_windowMgr.LookupWindow(0x11D)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MACRODETECTORWND)) { window->Show(1); static_cast(window)->SetCountdown(count, duration); } @@ -2536,7 +2540,7 @@ __declspec(noinline) void CGameMode::SetMacroDetectorCountdown(unsigned char cou // OFFSET: 0x00D79340 // FUNCTION: fn_22164 __declspec(noinline) void CGameMode::ReceiveCaptchaPreviewImage(const char* key, const void* data, unsigned short size) { - UICaptchaPreviewWnd* window = static_cast(g_windowMgr.LookupWindow(0x120)); + UICaptchaPreviewWnd* window = static_cast(g_windowMgr.LookupWindow(WID_CAPTCHAPREVIEWWND)); if (window != nullptr && std::strncmp(window->m_captchaKey, key, 4) == 0) { window->AddImageData(data, size); } @@ -2545,16 +2549,16 @@ __declspec(noinline) void CGameMode::ReceiveCaptchaPreviewImage(const char* key, // OFFSET: 0x00D793D0 // FUNCTION: fn_22166 __declspec(noinline) void CGameMode::ReceiveLapineUpgradeBoxValue(int value) { - if (g_windowMgr.LookupWindow(0x12E) != nullptr) { + if (g_windowMgr.LookupWindow(WID_LAPINEUPGRADEBOXWND) != nullptr) { return; } - UIWindow* window = g_windowMgr.EnsureWindow(0x12E); + UIWindow* window = g_windowMgr.EnsureWindow(WID_LAPINEUPGRADEBOXWND); if (window == nullptr) { return; } - window->SendMsg(nullptr, 0x17, value, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, value, 0, 0, 0); } // OFFSET: 0x00D7B420 @@ -2563,11 +2567,11 @@ __declspec(noinline) void CGameMode::Zc_Trycapture_Monster(const unsigned char* UIWindow* window = reinterpret_cast(g_windowMgr.unknown_0394); if (packet[2] != 0) { if (window) { - window->SendMsg(nullptr, 0x50, 1, 7, 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 1, 7, 0, 0); } } else { if (window) { - window->SendMsg(nullptr, 0x50, 1, 3, 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 1, 3, 0, 0); } } } @@ -2575,11 +2579,11 @@ __declspec(noinline) void CGameMode::Zc_Trycapture_Monster(const unsigned char* // OFFSET: 0x00D7B470 // FUNCTION: fn_22204 __declspec(noinline) void CGameMode::Zc_Trycollection(const unsigned char* packet) { - if (UIWindow* window = g_windowMgr.LookupWindow(0xC4)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_COLLECTIONSYSTEMWND)) { if (packet[2] != 0) { - window->SendMsg(nullptr, 0x50, 1, 7, 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 1, 7, 0, 0); } else { - window->SendMsg(nullptr, 0x50, 1, 3, 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 1, 3, 0, 0); } } } @@ -2607,11 +2611,11 @@ __declspec(noinline) void CGameMode::Zc_Msg(const unsigned char* packet) { break; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const char* text = LookupMessage(message); - g_windowMgr.SendNotice(1, reinterpret_cast(text), color, type, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), color, type, 0, 0); const char* chatText = LookupMessage(message); - g_windowMgr.SendNotice(19, reinterpret_cast(chatText), color, type, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(chatText), color, type, 0, 0); } // OFFSET: 0x00D328E0 @@ -2629,9 +2633,9 @@ __declspec(noinline) void CGameMode::Zc_Msg_Color(const unsigned char* packet) { break; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(message)), color, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(message)), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(message)), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(message)), color, 0, 0, 0); } // OFFSET: 0x00D7B5E0 @@ -2684,12 +2688,12 @@ __declspec(noinline) void CGameMode::ReceivePacket0A29(int value) { // OFFSET: 0x00D79E10 // FUNCTION: fn_22182 __declspec(noinline) void CGameMode::ReceiveCashShopBanner(int value1, int value2, int value3) { - if (!g_windowMgr.CloseWindow(0x13e)) { - if (UIWindow* window = g_windowMgr.EnsureWindow(0x13e)) { - window->SendMsg(nullptr, 0xa4, value3, 0, 0, 0); - window->SendMsg(nullptr, 0x78, value1, value2, 0, 0); + if (!g_windowMgr.CloseWindow(WID_CASHSHOP_WND)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_CASHSHOP_WND)) { + window->SendMsg(nullptr, UM_SELECT_CASHSHOP_TAB, value3, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_CASHSHOP_BALANCE, value1, value2, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(0x143, value3, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQUEST_CASH_SHOP, value3, 0, 0, 0); } } } @@ -2698,13 +2702,13 @@ __declspec(noinline) void CGameMode::ReceiveCashShopBanner(int value1, int value // FUNCTION: fn_22188 __declspec(noinline) void CGameMode::ReceiveWindow308TextEntries(unsigned char* packet) { const int count = (*reinterpret_cast(packet + 2) - 4) / 16; - g_windowMgr.CloseWindow(0x134); - UIWindow* window = g_windowMgr.EnsureWindow(0x134); + g_windowMgr.CloseWindow(WID_SHOWWARPWND); + UIWindow* window = g_windowMgr.EnsureWindow(WID_SHOWWARPWND); for (int i = 0; i < count; ++i) { char* text = reinterpret_cast(packet + 4 + i * 16); text[15] = '\0'; if (std::strlen(text) != 0) { - window->SendMsg(nullptr, 0x22, reinterpret_cast(text), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(text), 0, 0, 0); } } } @@ -2736,17 +2740,17 @@ __declspec(noinline) void CGameMode::ReceiveActorStateValue(std::uint32_t aid, i __declspec(noinline) void CGameMode::ReceiveChatEntries(unsigned char* data) { ChatEntryListPacket* packet = reinterpret_cast(data); const int count = (packet->length - 6) / static_cast(sizeof(ChatTextEntry)); - g_windowMgr.CloseWindow(39); - UIWindow* window = g_windowMgr.EnsureWindow(39); - window->SendMsg(nullptr, 0x3B, packet->unknown_0004, 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWARPWND); + UIWindow* window = g_windowMgr.EnsureWindow(WID_CHOOSEWARPWND); + window->SendMsg(nullptr, UM_SETSKID, packet->unknown_0004, 0, 0, 0); for (int i = 0; i < count; ++i) { ChatTextEntry* entry = &packet->entries[i]; entry->text[15] = '\0'; if (std::strlen(entry->text) != 0) { - window->SendMsg(nullptr, 0x1B, reinterpret_cast(entry->text), 0, 0, 0); + window->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast(entry->text), 0, 0, 0); } } - window->SendMsg(nullptr, 0x1B, reinterpret_cast("cancel"), 0, 0, 0); + window->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast("cancel"), 0, 0, 0); } // OFFSET: 0x00D7A200 @@ -2788,9 +2792,9 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD25850(const unsigned char* p _itoa(*reinterpret_cast(packet + 4), number, 10); const ITEM_DESC& description = FindItemDescription(std::atoi(number)); std::sprintf(text, LookupMessage(1258), description.identifiedName); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } // OFFSET: 0x00D31A40 @@ -2806,8 +2810,8 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD31A40(const unsigned char* p } std::sprintf(text, LookupMessage(2087), text); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } // OFFSET: 0x00D61100 @@ -2838,8 +2842,8 @@ __declspec(noinline) void CGameMode::ReceiveInventoryItemUpdate(const unsigned c // OFFSET: 0x00D78030 // FUNCTION: fn_22157 __declspec(noinline) void CGameMode::OpenWindow154() { - if (g_windowMgr.LookupWindow(0x154) == nullptr) { - g_windowMgr.EnsureWindow(0x154); + if (g_windowMgr.LookupWindow(WID_ACCOUNTLIMITEDTOOLWND) == nullptr) { + g_windowMgr.EnsureWindow(WID_ACCOUNTLIMITEDTOOLWND); } } @@ -2847,10 +2851,10 @@ __declspec(noinline) void CGameMode::OpenWindow154() { // FUNCTION: fn_21722 __declspec(noinline) void CGameMode::ReceiveUnknownD2D990(const unsigned char*) { if (g_windowMgr.unknown_03F8) { - g_windowMgr.CloseWindow(137); + g_windowMgr.CloseWindow(WID_MEMORIALDUNWND); GetRagConnection().Close(); if (g_windowMgr.Confirm(LookupMessage(1349), 0, true, true, 0, "Message", 280, 120, 0) != 269) { - this->SendMsg(141, 0, 0, 0, 0); + this->SendMsg(MM_QUIT_TO_IDENTRY, 0, 0, 0, 0); } } } @@ -2859,37 +2863,37 @@ __declspec(noinline) void CGameMode::ReceiveUnknownD2D990(const unsigned char*) // FUNCTION: fn_21876 void CGameMode::ReceiveUnknownD4E3F0(const unsigned char* packet) { unsigned int count = *reinterpret_cast(packet + 2) - 4; - UIWindow* window = g_windowMgr.EnsureWindow(0x49); - window->SendMsg(nullptr, 0x4B, 0, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMIDENTIFYWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); count >>= 1; const std::int16_t* ids = reinterpret_cast(packet + 4); for (unsigned int index = count; index != 0; --index, ++ids) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *ids); if (item.unknown_0000[1] != 0) { - window->SendMsg(nullptr, 0x1F, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); } } - window->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x00D4E2A0 // FUNCTION: fn_21875 void CGameMode::ReceiveUnknownD4E2A0(const unsigned char* packet) { unsigned int count = *reinterpret_cast(packet + 2) - 4; - UIWindow* window = g_windowMgr.EnsureWindow(0x4A); - window->SendMsg(nullptr, 0x4B, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x4D, *reinterpret_cast(this->unknown_045C), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOMPOSITIONWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_CARD_ITEM_INDEX, *reinterpret_cast(this->unknown_045C), 0, 0, 0); count >>= 1; const std::int16_t* ids = reinterpret_cast(packet + 4); for (unsigned int index = count; index != 0; --index, ++ids) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *ids); if (item.unknown_0000[1] != 0) { - window->SendMsg(nullptr, 0x1F, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); } } - window->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x00D75960 @@ -2929,19 +2933,19 @@ void CGameMode::ReceiveNotifySkill(const unsigned char* packet) { if (sourceAid == g_session.m_aid) { const std::int64_t value = reinterpret_cast(&message); - this->scene->player->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source = this->scene->player; job = source->GetEffectiveJob(-1); } else { gameActor = static_cast(this->scene->GetGameActorByAID(sourceAid)); if (gameActor != nullptr) { const std::int64_t value = reinterpret_cast(&message); - gameActor->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + gameActor->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source = gameActor; job = source->GetEffectiveJob(-1); } else if (CRenderObject* skill = this->scene->GetSkillByAID(sourceAid)) { const std::int64_t value = reinterpret_cast(&message); - skill->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -3374,12 +3378,12 @@ void CGameMode::ReceiveNotifySkill(const unsigned char* packet) { if (source != nullptr) { if (g_session.IsMonsterActor(source) == 0) { - this->SendMsg(0x56, skillId, reinterpret_cast(source), *reinterpret_cast(packet + 0x1C), 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), *reinterpret_cast(packet + 0x1C), 0); return; } const unsigned char kind = source->unknown_0314; if (kind == 10 || kind == 13 || kind == 14) { - this->SendMsg(0x56, skillId, reinterpret_cast(source), *reinterpret_cast(packet + 0x1C), 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), *reinterpret_cast(packet + 0x1C), 0); } } @@ -3413,24 +3417,24 @@ void CGameMode::ReceiveActorSkillAction(const unsigned char* packet) { if (*reinterpret_cast(packet + 4) == g_session.m_aid) { const std::int64_t value = reinterpret_cast(&message); - this->scene->player->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor = this->scene->player; job = actor->GetEffectiveJob(-1); } else { gameActor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(packet + 4))); if (gameActor != nullptr) { const std::int64_t value = reinterpret_cast(&message); - gameActor->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + gameActor->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor = gameActor; job = actor->GetEffectiveJob(-1); } else if (CRenderObject* skill = this->scene->GetSkillByAID(*reinterpret_cast(packet + 4))) { const std::int64_t value = reinterpret_cast(&message); - skill->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } if (g_session.IsMonsterActor(actor) == 0) { - this->SendMsg(0x56, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 0x1A), 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 0x1A), 0); return; } @@ -3464,23 +3468,23 @@ void CGameMode::ReceiveActorSkillMessage(const unsigned char* packet) { if (*reinterpret_cast(packet + 4) == g_session.m_aid) { actor = this->scene->player; const std::int64_t value = reinterpret_cast(&message); - actor->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); job = actor->GetEffectiveJob(-1); } else { actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(packet + 4))); if (actor != nullptr) { const std::int64_t value = reinterpret_cast(&message); - actor->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); job = actor->GetEffectiveJob(-1); } else if (CRenderObject* skill = this->scene->GetSkillByAID(*reinterpret_cast(packet + 4))) { const std::int64_t value = reinterpret_cast(&message); - skill->SendMsg(nullptr, 0x25, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILL, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor = nullptr; } } if (g_session.IsMonsterActor(actor) == 0) { - this->SendMsg(0x56, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 0x1E), 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, *reinterpret_cast(packet + 2), reinterpret_cast(actor), *reinterpret_cast(packet + 0x1E), 0); return; } @@ -3521,9 +3525,9 @@ void CGameMode::ReceiveDispel(const unsigned char* packet) { const auto* dispel = reinterpret_cast(packet); if (dispel->aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_BEGIN_SPELL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); CPlayer* player = this->scene->player; if (player->render.unknown_0070 == 8) { player->SetState(0, 1); @@ -3536,9 +3540,9 @@ void CGameMode::ReceiveDispel(const unsigned char* packet) { return; } - actor->SendMsg(nullptr, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_BEGIN_SPELL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(dispel->aid, 1114); if (actor->render.unknown_0070 == 8) { actor->SetState(0, 1); @@ -3553,8 +3557,8 @@ __declspec(noinline) void CGameMode::ReceiveItem1758List(const unsigned char* pa } g_session.ClearItems1768(); - g_windowMgr.CloseWindow(0xAE); - g_windowMgr.CloseWindow(0xAF); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); g_session.ClearItems1758(); const int count = static_cast(static_cast(*reinterpret_cast(packet + 2)) - 12) / 11u; @@ -3572,9 +3576,9 @@ __declspec(noinline) void CGameMode::ReceiveItem1758List(const unsigned char* pa g_session.AddItem1758(item); } - UIWindow* window = g_windowMgr.EnsureWindow(0xB0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x77, *reinterpret_cast(packet + 8), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, *reinterpret_cast(packet + 8), 0, 0, 0); this->unknown_024C = 1; } @@ -3582,16 +3586,16 @@ __declspec(noinline) void CGameMode::ReceiveItem1758List(const unsigned char* pa // FUNCTION: fn_21886 void CGameMode::ReceiveUnknownD50810(const unsigned char* packet) { if (g_replayAnimationScaling != 0) { - g_modeMgr.GetGameMode()->SendMsg(82, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_OPENSTORE, 0, 0, 0, 0); } g_session.ClearItems1758(); const int count = (*reinterpret_cast(packet + 2) - 8) / sizeof(Item1758StoreRecord); if (count == 0) { - this->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(43); - g_windowMgr.CloseWindow(44); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); g_session.ClearItems1760And1748(); return; } @@ -3647,12 +3651,12 @@ void CGameMode::ReceiveItem1748List(const unsigned char* packet) { g_session.AddItem1748(item); } - UIWindow* window = g_windowMgr.EnsureWindow(43); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, *reinterpret_cast(packet + 4), 0, 0, 0); - UIWindow* optionsWindow = g_windowMgr.EnsureWindow(44); - optionsWindow->SendMsg(nullptr, 23, 0, 0, 0, 0); - optionsWindow->SendMsg(nullptr, 28, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(packet + 4), 0, 0, 0); + UIWindow* optionsWindow = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND); + optionsWindow->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + optionsWindow->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), 0, 0); this->unknown_024C = 1; } @@ -3679,7 +3683,7 @@ void CGameMode::ReceiveActorStatusValue(std::uint32_t aid, int status, int amoun g_session.RefreshHpSpWindows(); } } - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFF00FF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFF00FF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_SPTIME: if (aid == g_session.m_aid) { @@ -3691,31 +3695,31 @@ void CGameMode::ReceiveActorStatusValue(std::uint32_t aid, int status, int amoun g_session.RefreshHpSpWindows(); } } - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFF0000FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFF0000FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_GREEN_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFF00FF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFF00FF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_BLUE_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFF0000FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFF0000FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_RED_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFFFF0000, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFFFF0000, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_PURPLE_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFFFF00FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFFFF00FF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_BLACK_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFF000000, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFF000000, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_WHITE_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFFFFFFFF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFFFFFFFF, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_YELLOW_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFFFFFF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFFFFFF00, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; case EF_PINK_NUMBER: - actor->SendMsg(nullptr, 0x58, 0, amount, option, 0xFFFF55B1, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_NUMBER, 0, amount, option, 0xFFFF55B1, 0, 0x72, 0, 0, 0, 0, 0, 0, 0); break; default: break; @@ -3752,14 +3756,14 @@ void CGameMode::ReceiveItem1718List(const unsigned char* packet) { g_session.AddItem1718(item, entry.quantity, static_cast(entry.unknown_000D / 10)); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0xFE)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_PARAITEMSHOPWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0xFF)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_PARAITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -3787,13 +3791,13 @@ void ReceiveTradeItems(int count, const TradeItemRecord* records) { } } - if (UIWindow* window = g_windowMgr.EnsureWindow(0xfe)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_PARAITEMSHOPWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0xff)) { - window->SendMsg(nullptr, 0x24, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_PARAITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -3806,7 +3810,7 @@ void CGameMode::ShowSpecialPopup(int popupId) { PopupData* popup = g_specialPopupMgr->GetPopup(popupId); if (!popup) { - this->SendMsg(1, reinterpret_cast(FormatOwnedString("No GetPopupData : %d ", popupId).c_str()), 0xFFFF00FF, 0, 0); + this->SendMsg(MM_SOCKETERROR, reinterpret_cast(FormatOwnedString("No GetPopupData : %d ", popupId).c_str()), 0xFFFF00FF, 0, 0); return; } @@ -3816,21 +3820,21 @@ void CGameMode::ShowSpecialPopup(int popupId) { case 0: for (const std::string& description : popup->m_descriptions) { text = RemoveTextColors(description.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); } break; case 1: - if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(358)) { - popupWindow->SendMsg(nullptr, 6, 510, popupId, 0, 0); + if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(WID_BALLOONOPENBTN)) { + popupWindow->SendMsg(nullptr, UM_COMMAND, 510, popupId, 0, 0); } [[fallthrough]]; case 2: for (const std::string& description : popup->m_descriptions) { text = RemoveTextColors(description.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), popup->m_color, 0, 0, 0); } - if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(358)) { - popupWindow->SendMsg(nullptr, 6, 510, popupId, 0, 0); + if (UIWindow* popupWindow = g_windowMgr.EnsureWindow(WID_BALLOONOPENBTN)) { + popupWindow->SendMsg(nullptr, UM_COMMAND, 510, popupId, 0, 0); } break; } @@ -3873,7 +3877,7 @@ void CGameMode::Zc_Spirits2(const unsigned char* data) { break; } - actor->SendMsg(nullptr, 109, 0, effectId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, effectId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } @@ -3901,7 +3905,7 @@ void CGameMode::Zc_Spirits2(const unsigned char* data) { vector3d count{static_cast(packet->value), 0.0f, 0.0f}; if (effect) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&count), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&count), 0, 0, 0, 0); } } @@ -3931,13 +3935,13 @@ void CGameMode::UpdateActorSpiritCount(std::uint32_t aid, std::int16_t count) { break; case JT_GUNSLINGER: case JT_GUNSLINGER_B: - actor->SendMsg(nullptr, 109, 0, 629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (count == 0) { return; } break; case JT_MONK_B: - actor->SendMsg(nullptr, 109, 0, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (count == 0) { return; } @@ -3951,7 +3955,7 @@ void CGameMode::UpdateActorSpiritCount(std::uint32_t aid, std::int16_t count) { } break; default: - actor->SendMsg(nullptr, 109, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (count == 0) { return; } @@ -4035,7 +4039,7 @@ void CGameMode::UpdateActorSpiritCount(std::uint32_t aid, std::int16_t count) { if (effect && (effect->state.type == 228 || effect->state.type == 504 || effect->state.type == 629)) { vector3d value{static_cast(count), 0.0f, 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&value), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&value), 0, 0, 0, 0); } } @@ -4072,21 +4076,21 @@ void CGameMode::ReceiveBuyingStoreItemList(const unsigned char* packet) { ++record; } - UIWindow* window = g_windowMgr.EnsureWindow(0xB1); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x1C, *reinterpret_cast(packet + 4), 0, 0, 0); - window->SendMsg(nullptr, 0x77, *reinterpret_cast(packet + 12), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND_MODE_1); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(packet + 4), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, *reinterpret_cast(packet + 12), 0, 0, 0); - window = g_windowMgr.EnsureWindow(0xB2); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - window->SendMsg(nullptr, 0x1C, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), 0, 0); + window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 8), 0, 0); window = reinterpret_cast(g_windowMgr.unknown_0420); if (window) { g_session.RefreshItems1750(); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - } else if ((window = g_windowMgr.EnsureWindow(0xB3)) != nullptr) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + } else if ((window = g_windowMgr.EnsureWindow(WID_MERCHANTMIRRORITEMWND_MODE_2)) != nullptr) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->unknown_024C = 1; @@ -4489,7 +4493,7 @@ __declspec(noinline) void CGameMode::ReceiveOpenStore(const unsigned char* packe if (mode) { const ModeDragState* drag = &mode->drag; if (drag && drag->source) { - this->SendMsg(81, 0, 0, 0, 0); + this->SendMsg(MM_REQ_CLOSESTORE, 0, 0, 0, 0); return; } } @@ -4503,14 +4507,14 @@ __declspec(noinline) void CGameMode::ReceiveOpenStore(const unsigned char* packe } g_session.ClearItems1768(); if (!g_windowMgr.window_027C && !g_windowMgr.window_0274 && !g_windowMgr.unknown_02FC) { - if (UIWindow* window = g_windowMgr.EnsureWindow(174)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTSHOPMAKEWND_MODE_1)) { static_cast(window)->AddActionButton(); } return; } g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(270, 0, 0, 0, 0); + this->SendMsg(MM_REQ_CLOSE_BUYING_STORE, 0, 0, 0, 0); } struct ACTSTRUCT { @@ -4537,7 +4541,7 @@ ACTSTRUCT::~ACTSTRUCT() = default; __declspec(noinline) void CGameMode::ReceiveSearchStoreOpen(const unsigned char* packet) { g_session.unknown_5BE0 = packet[4]; reinterpret_cast(&g_session.unknown_5BE4)[1] = *reinterpret_cast(packet + 2); - g_windowMgr.EnsureWindow(181); + g_windowMgr.EnsureWindow(WID_SEARCH_STORE_INFO); } #pragma pack(push, 1) @@ -4574,18 +4578,18 @@ void CGameMode::ReceiveParChange(unsigned char* data) { if (packet->value < 0) { text = FormatOwnedString(LookupMessage(664), -packet->value); const int emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::ChatProhibit); - this->scene->player->SendMsg(nullptr, 160, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } else { text = LookupMessage(665); - this->scene->player->SendMsg(nullptr, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_PROHIBITEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); *reinterpret_cast(&g_session.unknown_16F4[4]) = packet->value; g_session.InvalidateWindowFrames(); break; case SP_UNBREAKABLE: if (packet->value < -60) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(858)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(858)), 0xFFFF, 0, 0, 0); } break; case SP_HP: @@ -4594,8 +4598,8 @@ void CGameMode::ReceiveParChange(unsigned char* data) { g_session.CheckInterval(5000)) { const int hungerLevel = g_session.GetPetHungryState(g_session.unknown_1044); const int friendlyLevel = g_session.GetPetFriendlyState(g_session.m_petFriendly); - this->SendMsg(148, g_session.GetPetEmotionNumber(g_session.unknown_103C, 2, hungerLevel), 0, 0, 0); - this->SendMsg(148, g_session.GetPetActionNumber(hungerLevel, friendlyLevel, 2), 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetEmotionNumber(g_session.unknown_103C, 2, hungerLevel), 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetActionNumber(hungerLevel, friendlyLevel, 2), 0, 0, 0); } if (g_session.unknown_5568 != packet->value) { g_session.unknown_5568 = packet->value; @@ -4608,7 +4612,7 @@ void CGameMode::ReceiveParChange(unsigned char* data) { g_session.RefreshHpSpWindows(); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, g_session.m_aid, 0, 0); + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, g_session.m_aid, 0, 0); } break; case SP_SP: @@ -4627,7 +4631,7 @@ void CGameMode::ReceiveParChange(unsigned char* data) { *reinterpret_cast(&g_session.unknown_1654[0]) = packet->value; g_session.InvalidateWindowFrames(); if (g_windowMgr.unknown_01C4) { - g_windowMgr.unknown_01C4->SendMsg(nullptr, 35, 0, 0, 0, 0); + g_windowMgr.unknown_01C4->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case SP_BASELEVEL: { @@ -4679,13 +4683,13 @@ void CGameMode::ReceiveParChange(unsigned char* data) { this->scene->player->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (g_replayAnimationScaling == 0) { - g_windowMgr.EnsureWindow(21); + g_windowMgr.EnsureWindow(WID_NOTIFYLEVELUPWND); } if (this->scene->GetGameActorByAID(g_session.unknown_1010)) { const int hungerLevel = g_session.GetPetHungryState(g_session.unknown_1044); const int friendlyLevel = g_session.GetPetFriendlyState(g_session.m_petFriendly); - this->SendMsg(148, g_session.GetPetEmotionNumber(g_session.unknown_103C, 6, hungerLevel), 0, 0, 0); - this->SendMsg(148, g_session.GetPetActionNumber(hungerLevel, friendlyLevel, 6), 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetEmotionNumber(g_session.unknown_103C, 6, hungerLevel), 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetActionNumber(hungerLevel, friendlyLevel, 6), 0, 0, 0); } if (g_replayAnimationScaling == 0) { if (g_windowMgr.unknown_01DC) { @@ -4693,8 +4697,8 @@ void CGameMode::ReceiveParChange(unsigned char* data) { } } this->RefreshActorJobEffects(true); - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 192, 1, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 192, 1, 0); } break; } @@ -4704,13 +4708,13 @@ void CGameMode::ReceiveParChange(unsigned char* data) { this->scene->player->LaunchEffect(packet->value < 51 ? 158 : 337, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (g_replayAnimationScaling == 0) { - g_windowMgr.EnsureWindow(49); + g_windowMgr.EnsureWindow(WID_NOTIFYJOBLEVELUPWND); if (g_windowMgr.unknown_01DC) { reinterpret_cast(g_windowMgr.unknown_01DC)->SetHeight(g_windowMgr.unknown_01DC->geometry.height); } } - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 196, 1, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 196, 1, 0); } break; case SP_SKILLPOINT: @@ -4755,13 +4759,13 @@ void CGameMode::ReceiveParChange(unsigned char* data) { const int percent = (g_session.m_weight * 100) / (g_session.m_maxWeight < 1 ? 1 : g_session.m_maxWeight); if (oldPercent < percent) { if (percent >= g_unknown173A5BC && oldPercent < g_unknown173A5BC) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); text = FormatOwnedString(LookupMessage(3311), g_unknown173A5BC); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 8, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 8, 0, 0); } if (percent > 89 && oldPercent < 90) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(307)), 0xFF, 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(307)), 0xFF, 8, 0, 0); } break; } @@ -4769,15 +4773,15 @@ void CGameMode::ReceiveParChange(unsigned char* data) { break; } if (percent < g_unknown173A5BC && g_unknown173A5BC <= oldPercent) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(308)), 0xFFFF00, 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(308)), 0xFFFF00, 8, 0, 0); } if (percent > 89) { break; } if (oldPercent >= 90) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(309)), 0xFFFF00, 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(309)), 0xFFFF00, 8, 0, 0); } break; } @@ -4798,15 +4802,15 @@ void CGameMode::ReceiveParChange(unsigned char* data) { const int percent = (g_session.m_weight * 100) / (g_session.m_maxWeight < 1 ? 1 : g_session.m_maxWeight); if (percent < 50) { if (oldPercent > 49) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(308)), 0xFFFF00, 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(308)), 0xFFFF00, 8, 0, 0); } } else if (percent > 89) { break; } if (oldPercent >= 90) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(309)), 0xFFFF00, 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(309)), 0xFFFF00, 8, 0, 0); } break; } @@ -4920,7 +4924,7 @@ void CGameMode::ApplyStatusChange( CRenderObject* actor = this->scene->GetGameActorByAID(aid); if (actor) { actor->SendMsg( - nullptr, 110, 0, type, type >> 31, on, 0, value1, value1 >> 31, value2, value2 >> 31, flag, 0, value3, value3 >> 31 + nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, on, 0, value1, value1 >> 31, value2, value2 >> 31, flag, 0, value3, value3 >> 31 ); } @@ -5180,7 +5184,7 @@ void CGameMode::ApplyStatusChange( case EFST_SIREN: if (aid == g_session.m_aid) { CPlayer* player = this->scene->player; - player->SendMsg(nullptr, 109, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(879, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); std::sprintf(message, ""); } @@ -5188,7 +5192,7 @@ void CGameMode::ApplyStatusChange( case EFST_SONG_OF_MANA: if (aid == g_session.m_aid) { CPlayer* player = this->scene->player; - player->SendMsg(nullptr, 109, 0, 865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(865, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); std::sprintf(message, ""); } @@ -5196,7 +5200,7 @@ void CGameMode::ApplyStatusChange( case EFST_DANCE_WITH_WUG: if (aid == g_session.m_aid) { CPlayer* player = this->scene->player; - player->SendMsg(nullptr, 109, 0, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(867, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); std::sprintf(message, ""); } @@ -5204,20 +5208,20 @@ void CGameMode::ApplyStatusChange( case EFST_LERADS_DEW: if (aid == g_session.m_aid) { CPlayer* player = this->scene->player; - player->SendMsg(nullptr, 109, 0, 871, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 871, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); player->LaunchEffect(871, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); std::sprintf(message, ""); } break; case EFST_DEEP_SLEEP: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_MAKE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); std::sprintf(message, ""); } break; case EFST_NETHERWORLD: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 109, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); std::sprintf(message, ""); } break; @@ -5686,7 +5690,7 @@ void CGameMode::ApplyStatusChange( case EFST_KYOUGAKU: case EFST_ACTIVE_MONSTER_TRANSFORM: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 110, 0, type, type >> 31, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); this->RefreshStatusStateEffect(aid); } return; @@ -5697,19 +5701,19 @@ void CGameMode::ApplyStatusChange( break; case EFST_FLOWER_LEAF: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 110, 0, 675, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 675, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); this->RefreshStatusStateEffect(aid); } return; case EFST_RAY_OF_PROTECTION: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 110, 0, 676, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 676, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); this->RefreshStatusStateEffect(aid); } break; case EFST_HANDICAPSTATE_ICEEXPLO: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 110, 0, 710, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 710, 0, on, 0, value1, value1 >> 31, 0, 0, 0, 0, 0, 0); this->RefreshStatusStateEffect(aid); } break; @@ -5770,7 +5774,7 @@ void CGameMode::ApplyStatusChange( g_session.unknown_8074 = 1; } } - actor->SendMsg(nullptr, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case EFST_SPELLFIST: @@ -5993,13 +5997,13 @@ void CGameMode::ApplyStatusChange( CPlayer* player = this->scene->player; const int stage = value1 & 3; if (stage == 0) { - player->SendMsg(nullptr, 109, 0, 735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 735, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (stage == 1) { - player->SendMsg(nullptr, 109, 0, 736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 736, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (stage == 2) { - player->SendMsg(nullptr, 109, 0, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (stage == 3) { - player->SendMsg(nullptr, 109, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } std::sprintf(message, ""); @@ -6294,19 +6298,19 @@ void CGameMode::ApplyStatusChange( break; case EFST_SIREN: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 109, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 879, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; case EFST_DEEP_SLEEP: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; case EFST_NETHERWORLD: if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 109, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); break; @@ -6314,7 +6318,7 @@ void CGameMode::ApplyStatusChange( if (aid == g_session.m_aid) { CPlayer* player = this->scene->player; while (player->HasId(752)) { - player->SendMsg(nullptr, 109, 0, 752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::sprintf(message, ""); } @@ -6478,13 +6482,13 @@ void CGameMode::ApplyStatusChange( if (std::strlen(message) > 1) { char text[512]; std::sprintf(text, "%s%s", name, message); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), color, std::strlen(name) > 1 ? 10 : 8, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), color, std::strlen(name) > 1 ? 10 : 8, 0, 0); } if (aid == g_session.m_aid) { this->scene->player->SendMsg( - nullptr, 110, 0, type, type >> 31, on, 0, value1, value1 >> 31, value2, value2 >> 31, flag, 0, value3, value3 >> 31 + nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, on, 0, value1, value1 >> 31, value2, value2 >> 31, flag, 0, value3, value3 >> 31 ); } } @@ -6501,7 +6505,7 @@ __declspec(noinline) void CGameMode::ReceiveObjectsDisappear(int count, const st for (int i = 0; i < count; ++i) { const std::uint32_t aid = aids[i]; if (this->scene->RemoveItem(aid) == true) { - this->SendMsg(13, aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, aid, 0, 0, 0); } else if (this->scene->RemoveGroundItem(aid) == true) { this->RemoveUnknown01A4(aid); } else { @@ -6519,12 +6523,12 @@ __declspec(noinline) void CGameMode::ReceiveWindow107List(const unsigned char* p return; } - g_windowMgr.CloseWindow(107); - UIWindow* window = g_windowMgr.EnsureWindow(107); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMREPAIRWND); const Window107Entry* entry = reinterpret_cast(packet + 4); if (count != 0 && window != nullptr) { for (int i = 0; i < count; ++i) { - window->SendMsg(nullptr, 31, reinterpret_cast(entry), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(entry), 0, 0, 0); ++entry; } } @@ -6536,12 +6540,12 @@ __declspec(noinline) void CGameMode::ReceiveActorColorChat(const unsigned char* char text[256]; std::memset(text, 0, sizeof(text)); std::memcpy(text, packet + 12, *reinterpret_cast(packet + 2) - 12); - g_windowMgr.SendNotice(1, reinterpret_cast(text), *reinterpret_cast(packet + 8), 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), *reinterpret_cast(packet + 8), 0, 0, 0); CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(packet + 4)); if (actor != nullptr) { const int color = *reinterpret_cast(packet + 8); - actor->SendMsg(nullptr, 7, 0, reinterpret_cast(text), reinterpret_cast(text) >> 31, color, color >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, reinterpret_cast(text), reinterpret_cast(text) >> 31, color, color >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.m_whisperRecord != 0) { @@ -6565,12 +6569,12 @@ __declspec(noinline) void CGameMode::ReceiveWearEquipAck(unsigned char result, s } case ITEM_EQUIP_ACK_FAILLEVEL: { const char* text = LookupMessage(1953); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 7, 0, 0); break; } case ITEM_EQUIP_ACK_FAIL: { const char* text = LookupMessage(372); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 7, 0, 0); break; } } @@ -6595,7 +6599,7 @@ __declspec(noinline) void CGameMode::ReceiveFormattedMessage(const unsigned char } if (std::strlen(text) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } } @@ -6613,7 +6617,7 @@ struct ParaResultEntry { // OFFSET: 0x00D77E70 // FUNCTION: fn_22155 __declspec(noinline) void CGameMode::ReceiveParaItemResult(unsigned char success, int count, const unsigned char* data) { - UIParaResultWnd* window = static_cast(g_windowMgr.EnsureWindow(256)); + UIParaResultWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_PARARESULTWND)); if (window == nullptr) { return; } @@ -6632,10 +6636,10 @@ __declspec(noinline) void CGameMode::ReceiveParaItemResult(unsigned char success window->AddItem(item); } - window->SendMsg(nullptr, 36, (count - 2 > 0 ? count : 0) * 32 + 120, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, (count - 2 > 0 ? count : 0) * 32 + 120, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); if (!success) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3043)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3043)), 0xFF, 0, 0, 0); } } @@ -6656,7 +6660,7 @@ void CGameMode::ReceiveResultNotice4327(const unsigned char* packet) { } if (!text.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); } } @@ -6667,7 +6671,7 @@ __declspec(noinline) void CGameMode::OpenBuyingStoreMake(unsigned char slotCount if (mode) { const ModeDragState* drag = &mode->drag; if (drag && drag->source) { - this->SendMsg(299, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_BUYING_STORE_MAKE, 0, 0, 0, 0); return; } } @@ -6680,7 +6684,7 @@ __declspec(noinline) void CGameMode::OpenBuyingStoreMake(unsigned char slotCount } g_session.ClearItems1768(); if (!g_windowMgr.window_027C && !g_windowMgr.window_0274 && !g_windowMgr.unknown_02FC) { - g_windowMgr.EnsureWindow(174); + g_windowMgr.EnsureWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); if (g_windowMgr.unknown_040C) { static_cast(g_windowMgr.unknown_040C)->SetItems(0, nullptr); } @@ -6688,7 +6692,7 @@ __declspec(noinline) void CGameMode::OpenBuyingStoreMake(unsigned char slotCount } g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(299, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_BUYING_STORE_MAKE, 0, 0, 0, 0); } // OFFSET: 0x00D78210 @@ -6698,7 +6702,7 @@ __declspec(noinline) void CGameMode::OpenVendingMake(unsigned char slotCount, in if (mode) { const ModeDragState* drag = &mode->drag; if (drag && drag->source) { - this->SendMsg(297, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_VENDING_MAKE, 0, 0, 0, 0); return; } } @@ -6711,7 +6715,7 @@ __declspec(noinline) void CGameMode::OpenVendingMake(unsigned char slotCount, in } g_session.ClearItems1768(); if (!g_windowMgr.window_027C && !g_windowMgr.window_0274) { - g_windowMgr.EnsureWindow(41); + g_windowMgr.EnsureWindow(WID_MERCHANTSHOPMAKEWND); if (g_windowMgr.unknown_02FC) { static_cast(g_windowMgr.unknown_02FC)->SetItems(itemCount, items); } @@ -6719,7 +6723,7 @@ __declspec(noinline) void CGameMode::OpenVendingMake(unsigned char slotCount, in } g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(297, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_VENDING_MAKE, 0, 0, 0, 0); } // OFFSET: 0x00D799C0 @@ -6774,7 +6778,7 @@ void CGameMode::ReceiveItemFallEntry(const unsigned char* packet) { } const int entryAddress = reinterpret_cast(&entry); - item->SendMsg(nullptr, 4, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + item->SendMsg(nullptr, AM_INITSTANDENTRY, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00D266C0 @@ -6784,16 +6788,16 @@ __declspec(noinline) void CGameMode::ReceiveFeedOption(const unsigned char* pack case CONFIG_OPEN_EQUIPMENT_WINDOW: { *reinterpret_cast(g_session.unknown_5974) = *reinterpret_cast(packet + 6); const char* text = LookupMessage((*reinterpret_cast(g_session.unknown_5974) != 0) + 0x54E); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } break; } case CONFIG_CALL: g_serviceOptions.Set(231, *reinterpret_cast(packet + 6) != 0); g_windowMgr.SendNotice( - 1, reinterpret_cast(LookupMessage((*reinterpret_cast(packet + 6) != 0) + 0xBA2)), 0x64FFFF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage((*reinterpret_cast(packet + 6) != 0) + 0xBA2)), 0x64FFFF, 0, 0, 0 ); g_windowMgr.RefreshGameSettingOption(231); break; @@ -6828,7 +6832,7 @@ __declspec(noinline) void CGameMode::ReceiveTakeOffEquipResult(unsigned char res break; case 1: { const char* text = LookupMessage(1953); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 7, 0, 0); break; } } @@ -6857,7 +6861,7 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { } if (g_session.IsAdminSubMode(3)) { std::sprintf(text, "%d", *reinterpret_cast(packet + 8)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xF5F5F5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xF5F5F5, 0, 0, 0); } break; case HO_FULLNESS_CHANGED: @@ -6871,7 +6875,7 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { } if (g_session.IsAdminSubMode(3)) { std::sprintf(text, "Full : %d", *reinterpret_cast(packet + 8)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x1EF5F5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x1EF5F5, 0, 0, 0); } break; case HO_ACCESSARY_CHANGED: @@ -6894,9 +6898,9 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { // FUNCTION: fn_21683 __declspec(noinline) void CGameMode::ReceiveItemConsumed(const unsigned char* packet) { if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2734)), 0x64FFFF, 0, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(293, 0, 0, 0, 0); - g_windowMgr.CloseWindow(264); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2734)), 0x64FFFF, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_WRITE_RODEX, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_RODEXCOMPOSEWND); } if (*reinterpret_cast(&this->unknown_0100[0x14])) { @@ -6928,10 +6932,10 @@ __declspec(noinline) void CGameMode::ReceivePartyLeaderChange(const unsigned cha g_session.SetPartyLeader(*reinterpret_cast(packet + 6), 0); g_session.unknown_5464 = *reinterpret_cast(packet + 6) == g_session.m_aid; std::sprintf(text, LookupMessage(1552), member.name.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 12, 0, 0); RefreshPartyWindows(&g_session); if (g_windowMgr.unknown_03F8) { - g_windowMgr.unknown_03F8->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.unknown_03F8->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } } @@ -6939,12 +6943,12 @@ __declspec(noinline) void CGameMode::ReceivePartyLeaderChange(const unsigned cha // OFFSET: 0x00D2DA10 // FUNCTION: fn_21723 __declspec(noinline) void CGameMode::ReceiveItemSellResult(const unsigned char* packet) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const int count = *reinterpret_cast(packet + 4); const int price = *reinterpret_cast(packet + 6); ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *reinterpret_cast(packet + 2)); g_windowMgr.SendNotice( - 1, + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(1746), item.DisplayName(0).c_str(), count, price * count).c_str()), 0xFFFF64, 0, 0, 0 ); @@ -6972,7 +6976,7 @@ std::FILE* CGameMode::OpenRandomOptionSimulatorFile(const std::string& folder, c } std::FILE* file = _wfopen(DecodeText(g_textCodePage, path).c_str(), L"w"); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("Simulator Result File Create %s %s!!!!!!!!!!!!", file ? "success" : "Fail", itemName.c_str()).c_str()), + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("Simulator Result File Create %s %s!!!!!!!!!!!!", file ? "success" : "Fail", itemName.c_str()).c_str()), file ? 0xFFFF : 0xFF, 0, 0, 0); return file; } @@ -7058,11 +7062,11 @@ void CGameMode::ReceiveBuyingStoreOpenResult(const unsigned char* packet) { char text[128]; switch (*reinterpret_cast(packet + 2)) { case 1: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1741)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1741)), 0xFF, 0, 0, 0); g_session.ClearItems1768(); - g_windowMgr.CloseWindow(174); - g_windowMgr.CloseWindow(175); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); break; case 2: std::sprintf( @@ -7074,15 +7078,15 @@ void CGameMode::ReceiveBuyingStoreOpenResult(const unsigned char* packet) { g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 280, 120, 0); break; case 9: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1797)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1797)), 0xFF, 0, 0, 0); break; case 10: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3229)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3229)), 0xFF, 0, 0, 0); g_session.ClearItems1768(); - g_windowMgr.CloseWindow(174); - g_windowMgr.CloseWindow(175); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); break; } } @@ -7097,22 +7101,22 @@ void CGameMode::ReceiveItemObtainNotice(const unsigned char* packet) { switch (*reinterpret_cast(packet + 2)) { case MSG_WEAPONREFINE_SUCCESS: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(911), item.DisplayName(0).c_str()).c_str()), 0xFFFF00, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(911), item.DisplayName(0).c_str()).c_str()), 0xFFFF00, 0, 0, 0 ); break; case MSG_WEAPONREFINE_FAIL: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(912), item.DisplayName(0).c_str()).c_str()), 0xCDCD00, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(912), item.DisplayName(0).c_str()).c_str()), 0xCDCD00, 0, 0, 0 ); break; case MSG_WEAPONREFINE_FAIL_LEVEL: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(913), item.DisplayName(0).c_str()).c_str()), 0xC8C8FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(913), item.DisplayName(0).c_str()).c_str()), 0xC8C8FF, 0, 0, 0 ); break; case MSG_WEAPONREFINE_FAIL_ITEM: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(914), item.DisplayName(0).c_str()).c_str()), 0xC8C8FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(914), item.DisplayName(0).c_str()).c_str()), 0xC8C8FF, 0, 0, 0 ); break; } @@ -7132,12 +7136,12 @@ __declspec(noinline) void CGameMode::ReceiveTakeOffEquipItemResult(const unsigne } const char* suffix = LookupMessage(3144); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), suffix).c_str()), 0xC8FF00, 7, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), suffix).c_str()), 0xC8FF00, 7, 0, 0 ); break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3009)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3009)), 0xFF, 0, 0, 0); if (g_session.IsCostumeLocation(*reinterpret_cast(packet + 4))) { g_session.UnequipItem6B68(item); } else { @@ -7152,26 +7156,26 @@ __declspec(noinline) void CGameMode::ReceiveTakeOffEquipItemResult(const unsigne void CGameMode::ReceiveBuyingStoreSellResult(const unsigned char* packet) { switch (*reinterpret_cast(packet + 2)) { case 5: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(57)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(57)), 0xFF, 0, 0, 0); break; case 6: { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); ITEM_INFO item = LookupClientItem(g_session.m_inventoryItems, *reinterpret_cast(packet + 4), 0); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(1747), item.DisplayName(0).c_str()).c_str()), 0xFF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(1747), item.DisplayName(0).c_str()).c_str()), 0xFF, 0, 0, 0 ); break; } case 7: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1745)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1745)), 0xFF, 0, 0, 0); break; } - g_windowMgr.CloseWindow(177); - g_windowMgr.CloseWindow(178); - g_windowMgr.CloseWindow(179); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_2); } struct ReputePointEntry { @@ -7182,16 +7186,16 @@ struct ReputePointEntry { // OFFSET: 0x00D78060 // FUNCTION: fn_22158 __declspec(noinline) void CGameMode::ReceiveItemReformOpen(int itemId) { - UIWindow* window = g_windowMgr.EnsureWindow(0x15C); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMREFORMWND); if (!g_itemReformMgr) { g_itemReformMgr = new (std::nothrow) CItemReformMgr; } if (g_itemReformMgr->HasItem(itemId) == true) { if (window) { - window->SendMsg(nullptr, 0x17, itemId, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, itemId, 0, 0, 0); } } else { - g_windowMgr.CloseWindow(0x15C); + g_windowMgr.CloseWindow(WID_ITEMREFORMWND); } } @@ -7278,7 +7282,7 @@ __declspec(noinline) void CGameMode::ReceivePartyItemPickupNotice(const unsigned item.unknown_0060 = packet[0x0C]; g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(1276), member.name.c_str(), item.DisplayName(0).c_str()).c_str()), + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(1276), member.name.c_str(), item.DisplayName(0).c_str()).c_str()), 0xFFFF00, 9, 0, 0 ); } @@ -7349,8 +7353,8 @@ void CGameMode::ReceiveEquipWindowMicroscope2(const unsigned char* packet) { std::memcpy(g_equipWindowLook.name, packet + 4, sizeof(g_equipWindowLook.name)); g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } @@ -7401,8 +7405,8 @@ void CGameMode::ReceiveEquipWindowMicroscope3(const unsigned char* packet) { memcpy_s(g_equipWindowLook.name, sizeof(g_equipWindowLook.name), packet + 4, sizeof(g_equipWindowLook.name)); g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } @@ -7540,8 +7544,8 @@ void CGameMode::ReceiveActorMessage34(const unsigned char* packet) { message.text.resize(60); } - UIWindow* window = g_windowMgr.EnsureWindow(0x1C); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&message), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_CHATROOMWND); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&message), 0, 0, 0); } #pragma pack(push, 1) @@ -7627,9 +7631,9 @@ void CGameMode::ReceiveAddQuest64(const unsigned char* data) { g_renewQuestMgr->AddOngoingQuest(packet->questId, info); g_renewQuestMgr->UpdateQuestWindows(); - g_windowMgr.EnsureWindow(0x8F); + g_windowMgr.EnsureWindow(WID_NOTIFYQUESTWND); const char* text = LookupMessage(0x55E); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0x13, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0x13, 0, 0); } // OFFSET: 0x00D20EF0 @@ -7680,9 +7684,9 @@ void CGameMode::ReceiveAddQuest(const unsigned char* data) { g_renewQuestMgr->AddOngoingQuest(packet->questId, info); g_renewQuestMgr->UpdateQuestWindows(); - g_windowMgr.EnsureWindow(0x8F); + g_windowMgr.EnsureWindow(WID_NOTIFYQUESTWND); const char* text = LookupMessage(0x55E); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0x13, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0x13, 0, 0); } #pragma pack(push, 1) @@ -7737,11 +7741,11 @@ void CGameMode::ReceiveBarterMarketItemList(const unsigned char* data) { g_barterMarketItemMgr->items.push_back(item); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x14E)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_BARTERMARKETWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x14F)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_BARTERITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -7799,7 +7803,7 @@ void CGameMode::ReceiveNotifyBan(const unsigned char* packet) { text = LookupMessage(0x718); } g_windowMgr.Confirm(text.c_str(), 0, true, true, 0, "Message", 280, 120, 0); - this->SendMsg(2, 0, 0, 0, 0); + this->SendMsg(MM_QUIT, 0, 0, 0, 0); } #pragma pack(push, 1) @@ -7830,7 +7834,7 @@ void CGameMode::ReceiveBroadcastText(const unsigned char* data) { g_forbiddenWords.Mask(text.data(), &masked); } if (!g_serviceOptions.Get(0x94)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xFF9DFF, 5, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xFF9DFF, 5, 0, 0); if (g_session.m_whisperRecord != 0) { this->WriteChatLog(text.data()); } @@ -7853,13 +7857,13 @@ void CGameMode::ReceiveActorBroadcastText(const unsigned char* data) { } const int aid = *reinterpret_cast(data + 4); if (MonsterJobColor(aid)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), MonsterJobColor(aid), 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), MonsterJobColor(aid), 0, 0, 0); } else if (!g_serviceOptions.Get(0x72) && !g_serviceOptions.Get(0x94)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0x9B00FF, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0x9B00FF, 1, 0, 0); } if (CRenderObject* actor = this->scene->GetGameActorByAID(aid)) { const std::int64_t value = reinterpret_cast(text.data()); - actor->SendMsg(nullptr, 7, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.m_whisperRecord != 0) { this->WriteChatLog(text.data()); @@ -8013,8 +8017,8 @@ void CGameMode::ReceiveEquipWindowMicroscope4(const unsigned char* packet) { memcpy_s(g_equipWindowLook.name, sizeof(g_equipWindowLook.name), packet + 4, sizeof(g_equipWindowLook.name)); g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } @@ -8048,8 +8052,8 @@ void CGameMode::ReceiveEquipWindowMicroscope5(const unsigned char* packet) { g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); g_equipWindowLook.unknown_0024 = *reinterpret_cast(packet + 0x2C); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } @@ -8083,8 +8087,8 @@ void CGameMode::ReceiveEquipWindowMicroscope6(const unsigned char* packet) { g_equipWindowLook.robe = *reinterpret_cast(packet + 0x26); g_equipWindowLook.unknown_0024 = *reinterpret_cast(packet + 0x2C); - if (!g_windowMgr.CloseWindow(0x8B)) { - g_windowMgr.EnsureWindow(0x8B); + if (!g_windowMgr.CloseWindow(WID_EQUIPWND_VIEWOTHER_1)) { + g_windowMgr.EnsureWindow(WID_EQUIPWND_VIEWOTHER_1); } } @@ -8291,13 +8295,13 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); break; } case RECEIVE_ITEM: { @@ -8340,12 +8344,12 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { if (current.unknown_0000[1] > 0) { amount -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&this->unknown_0100[0x14]) != 0) { *reinterpret_cast(&this->unknown_0100[0x14]) = 0; g_session.ResetSlots(); @@ -8390,15 +8394,15 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8443,19 +8447,19 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { if (current.unknown_0000[1] > 0) { amount -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&this->unknown_0100[0x14]) != 0) { *reinterpret_cast(&this->unknown_0100[0x14]) = 0; g_session.ResetSlots(); } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8493,13 +8497,13 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); break; } case RECEIVE_ITEM: { @@ -8546,12 +8550,12 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { text = FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount); amount = packet->amount; } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&this->unknown_0100[0x14]) != 0) { *reinterpret_cast(&this->unknown_0100[0x14]) = 0; g_session.ResetSlots(); @@ -8603,18 +8607,18 @@ void CGameMode::ReceiveItemPickupAck5( } g_session.AddItem1710(item, 1); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } } - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8665,19 +8669,19 @@ void CGameMode::ReceiveItemPickupAck5( if (current.unknown_0000[1] > 0) { count -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), count).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), count).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, count, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, count, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) != 0) { *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) = 0; g_session.ResetSlots(); } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8724,15 +8728,15 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8784,19 +8788,19 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { if (current.unknown_0000[1] > 0) { amount -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) != 0) { *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) = 0; g_session.ResetSlots(); } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -8843,8 +8847,8 @@ void CGameMode::ReceiveEquipItemDamaged(const unsigned char* packet) { } if (!text.empty()) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0xD, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0xD, 0, 0); } } @@ -8934,11 +8938,11 @@ void CGameMode::ReceiveExpandedBarterMarketItemList2(const unsigned char* data) g_expandedBarterMarketItemMgr->AddItem(entry); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x155)) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_EXPANDEDBARTERMARKETWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x156)) { - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_EXPANDEDBARTERITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -8973,8 +8977,8 @@ void CGameMode::ReceiveExpandedBarterMarketItemList(const unsigned char* data) { g_expandedBarterMarketItemMgr->AddItem(entry); } - g_windowMgr.EnsureWindow(0x155)->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - g_windowMgr.EnsureWindow(0x156)->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_EXPANDEDBARTERMARKETWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_EXPANDEDBARTERITEMPURCHASEWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } namespace { @@ -8999,8 +9003,8 @@ void CGameMode::ReceiveFeedResult(const unsigned char* data) { const int hungerLevel = g_session.GetPetHungryState(g_session.unknown_1054); const int emotion = g_session.GetPetEmotionNumber(g_session.unknown_103C, 0, hungerLevel); const int action = g_session.GetPetActionNumber(hungerLevel, friendlyLevel, 0); - this->SendMsg(148, emotion, 0, 0, 0); - this->SendMsg(148, action, 0, 0, 0); + this->SendMsg(MM_PET_ACT, emotion, 0, 0, 0); + this->SendMsg(MM_PET_ACT, action, 0, 0, 0); const int count = LookupClientItem(g_session.m_inventoryItems, packet->itemId, 0).quantity; char name[260]; @@ -9009,13 +9013,13 @@ void CGameMode::ReceiveFeedResult(const unsigned char* data) { item.SetItemId(packet->itemId); int capacity = sizeof(name); item.GetIdDisplayName(name, capacity, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0xA12), name, count).c_str()), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xA12), name, count).c_str()), 0xFFFF64, 0, 0, 0); } else { ITEM_INFO item; item.SetItemId(packet->itemId); const std::string text = FormatOwnedString(LookupMessage(0x24F), item.DisplayName(0).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); - g_windowMgr.SendNotice(0x13, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); } } else if (packet->packetType == 0x22F) { if (packet->result != 0) { @@ -9028,16 +9032,16 @@ void CGameMode::ReceiveFeedResult(const unsigned char* data) { item.SetItemId(packet->itemId); int capacity = sizeof(name); item.GetIdDisplayName(name, capacity, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0xCD1), name, count).c_str()), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xCD1), name, count).c_str()), 0xFFFF64, 0, 0, 0); } else { ITEM_INFO item; item.SetItemId(packet->itemId); const std::string text = FormatOwnedString(LookupMessage(0x24F), item.DisplayName(0).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); - g_windowMgr.SendNotice(0x13, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text.c_str()), 0x1E1EF5, 0, 0, 0); if (CRenderObject* actor = this->scene->GetGameActorByAID(*reinterpret_cast(&g_session.unknown_5570[8]))) { const int emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::Sweat); - actor->SendMsg(nullptr, 160, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -9066,7 +9070,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { g_session.unknown_1010 = packet->aid; if (actor) { g_session.unknown_103C = actor->GetEffectiveJob(-1); - actor->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->unknown_0314 = 7; } break; @@ -9081,7 +9085,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { window->UpdateFriendlyGauge(); } if (g_session.GetDisplayJob() >= 0xFD2 && g_session.GetDisplayJob() <= 0xFD4 && packet->value < 100 && g_session.unknown_1044 < 30) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x4A4)), 0x3232FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x4A4)), 0x3232FF, 0, 0, 0); } if (friendlyState != g_session.GetPetFriendlyState(g_session.m_petFriendly)) { EquipmentProperties::CEquipmentPropertiesMgr* properties = EquipmentProperties::CEquipmentPropertiesMgr::GetInstance(); @@ -9097,7 +9101,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { g_session.unknown_1044 = packet->value; if (actor) { g_session.unknown_103C = actor->GetEffectiveJob(-1); - actor->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_windowMgr.window_038C) { g_windowMgr.window_038C->Invalidate(); @@ -9128,22 +9132,22 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { case CHANGESTATEPET_UPDATE_EGG: if (packet->value == 0) { g_session.ResetUnknown1050(); - if (UIWindow* window = g_windowMgr.LookupWindow(8)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMWND)) { window->Invalidate(); } const int itemId = -1; const int kind = 0; EquipmentProperties::CEquipmentPropertiesMgr::GetInstance()->RemoveExpansion(kind, itemId); - g_windowMgr.CloseWindow(0x58); + g_windowMgr.CloseWindow(WID_PETINFOWND); } else if (packet->value == 1) { - if (UIItemIdentifyWnd* window = static_cast(g_windowMgr.LookupWindow(0x5A))) { + if (UIItemIdentifyWnd* window = static_cast(g_windowMgr.LookupWindow(WID_PETEGGLISTWND))) { int found = 0; ITEM_INFO item = window->GetSelectedItem(&found); if (found == 1) { item.unknown_005D = 1; g_session.UpdateInventoryItem(item, 1); g_session.unknown_1050 = item.unknown_0000[1]; - if (UIWindow* inventory = g_windowMgr.LookupWindow(8)) { + if (UIWindow* inventory = g_windowMgr.LookupWindow(WID_ITEMWND)) { inventory->Invalidate(); } EquipmentProperties::CEquipmentPropertiesMgr* properties = EquipmentProperties::CEquipmentPropertiesMgr::GetInstance(); @@ -9151,7 +9155,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { const int kind = 0; properties->AddExpansion(kind, itemId, true); } - g_windowMgr.CloseWindow(0x5A); + g_windowMgr.CloseWindow(WID_PETEGGLISTWND); } } break; @@ -9258,7 +9262,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { const char* notice; switch (packet->cause) { case USESKILL_FAIL_LEVEL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (packet->skillId == NV_BASIC) { switch (packet->value) { case ZCSK_ITEMEXCHANGE: @@ -9285,7 +9289,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { break; case ZCSK_MANNERPOINT: { const char* text = LookupMessage(0x17F); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0xB, 0, 0); } [[fallthrough]]; case ZCSK_JOINPARTY: @@ -9347,10 +9351,10 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { break; case USESKILL_FAIL: if (packet->skillId == WL_TETRAVORTEX || packet->skillId == WL_TETRAVORTEX_FIRE || packet->skillId == WL_TETRAVORTEX_WATER || packet->skillId == WL_TETRAVORTEX_WIND || packet->skillId == WL_TETRAVORTEX_GROUND) { - this->scene->player->SendMsg(nullptr, 0x8F, 0, 0x2DF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 0x8F, 0, 0x2E0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 0x8F, 0, 0x2E1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 0x8F, 0, 0x2E2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2DF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (!showMessage) { return; @@ -9469,7 +9473,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { ITEM_INFO item; item.SetItemId(packet->itemId); const std::string message = FormatOwnedString(LookupMessage(0x600), item.DisplayName(0).c_str(), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_EQUIPMENT: { @@ -9477,7 +9481,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { item.SetItemId(packet->itemId); item.identified = 1; const std::string message = FormatOwnedString(LookupMessage(0x602), item.DisplayName(0).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_COMBOSKILL: @@ -9562,17 +9566,17 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { break; case USESKILL_FAIL_NEED_BULLETS: { const std::string message = FormatOwnedString(LookupMessage(0xBB5), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_ARROWS: { const std::string message = FormatOwnedString(LookupMessage(0xBBE), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_PARTY: { const std::string message = FormatOwnedString(LookupMessage(0xD82), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_PARTY_LEADER: @@ -9592,7 +9596,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { break; case USESKILL_FAIL_MAX_TRAPS: { const std::string message = FormatOwnedString(LookupMessage(0xE00), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_MAGIC_SPELLBOOK: @@ -9603,7 +9607,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { break; case USESKILL_FAIL_NEED_SERVANT_WEAPON: { const std::string message = FormatOwnedString(LookupMessage(0xEBD), packet->value); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0xB, 0, 0); return; } case USESKILL_FAIL_NEED_TWINKLING_GALAXY: @@ -9656,7 +9660,7 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { return; } - g_windowMgr.SendNotice(1, reinterpret_cast(notice), 0xFF, 0xB, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice), 0xFF, 0xB, 0, 0); } // OFFSET: 0x00D27420 // FUNCTION: fn_21690 @@ -9679,7 +9683,7 @@ void CGameMode::ReceiveChatRoomMemberList(const unsigned char* data) { joined = true; } } - actor->SendMsg(nullptr, 0x21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_CHAT_TITLE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (joined) { const int count = static_cast(packet->length - sizeof(ChatRoomMemberListPacket)) / sizeof(ChatRoomMemberRecord); std::list> members; @@ -9694,12 +9698,12 @@ void CGameMode::ReceiveChatRoomMemberList(const unsigned char* data) { members.push_back(member); } - UIWindow* window = g_windowMgr.EnsureWindow(0x1C); - window->SendMsg(nullptr, 0x2B, 0, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_CHATROOMWND); + window->SendMsg(nullptr, UM_CLEARMEMBER, 0, 0, 0, 0); info.memberCount = static_cast(members.size()); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&info), 0, 0, 0); for (std::list>::iterator it = members.begin(); it != members.end(); ++it) { - window->SendMsg(nullptr, 0x2C, reinterpret_cast(it->first.c_str()), it->second, 0, 0); + window->SendMsg(nullptr, UM_ADDMEMBER, reinterpret_cast(it->first.c_str()), it->second, 0, 0); } this->unknown_03C8 = info.title; @@ -9801,15 +9805,15 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -9864,19 +9868,19 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { if (current.unknown_0000[1] > 0) { amount -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) != 0) { *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) = 0; g_session.ResetSlots(); } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } break; } @@ -9926,15 +9930,15 @@ void CGameMode::ReceiveItemPickupAck9(const unsigned char* data) { g_session.AddItem1710(item, 1); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), packet->amount).c_str()), 0xFFFF00, 6, 0, 0 ); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, packet->amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } } @@ -9997,19 +10001,19 @@ void CGameMode::ReceiveItemPickupAck9(const unsigned char* data) { if (current.unknown_0000[1] != 0) { amount -= current.quantity; } - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x99), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x3A); - window->SendMsg(nullptr, 0x4C, item.identified, 0, 0, 0); - window->SendMsg(nullptr, 0x24, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); - window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_NOTIFYITEMOBTAINWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, item.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, amount, reinterpret_cast(item.itemId.c_str()), 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&item), 0, 0, 0); if (*reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) != 0) { *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_0100[0x14]) = 0; g_session.ResetSlots(); } g_session.UpdateInventoryItem(item, 1); - if (UIWindow* quest = g_windowMgr.LookupWindow(0x133)) { - quest->SendMsg(nullptr, 6, 0x11E, 0xC2, 1, 0); + if (UIWindow* quest = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + quest->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 1, 0); } } else { this->NotifyItemResult(packet->result); @@ -10034,21 +10038,21 @@ void CGameMode::ReceiveActorChat(const unsigned char* data) { } if (g_windowMgr.window_027C) { - g_windowMgr.SendNotice(5, reinterpret_cast(text.data()), 0x222222, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(text.data()), 0x222222, 0, 0, 0); } else { if (IsMonsterJob(aid)) { if (g_serviceType == 5) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xFFFF00, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xFFFF00, 1, 0, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), g_serviceType == 10 ? 0x1D8DFF : 0xFFFF, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), g_serviceType == 10 ? 0x1D8DFF : 0xFFFF, 1, 0, 0); } } else if (MonsterJobColor(aid)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), MonsterJobColor(aid), 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), MonsterJobColor(aid), 0, 0, 0); } else if (!g_serviceOptions.Get(0x72) && !g_serviceOptions.Get(0x94)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xFFFFFF, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xFFFFFF, 1, 0, 0); } if (CRenderObject* actor = this->scene->GetGameActorByAID(aid)) { - actor->SendMsg(nullptr, 7, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } if (g_session.m_whisperRecord != 0) { @@ -10073,13 +10077,13 @@ void CGameMode::ReceivePartyChat(const unsigned char* data) { const std::uint32_t aid = *reinterpret_cast(data + 4); if (aid == g_session.m_aid) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xC8FF, 3, 0, 0); - this->scene->player->SendMsg(nullptr, 7, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xC8FF, 3, 0, 0); + this->scene->player->SendMsg(nullptr, AM_CHAT, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xC8C8FF, 3, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xC8C8FF, 3, 0, 0); if (CRenderObject* actor = this->scene->GetGameActorByAID(aid)) { - actor->SendMsg(nullptr, 7, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, reinterpret_cast(text.data()), reinterpret_cast(text.data()) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } if (g_session.m_whisperRecord != 0) { @@ -10124,12 +10128,12 @@ void CGameMode::ReceiveEffectNumber(const unsigned char* data) { if (count <= 10) { char text[260]; std::sprintf(text, LookupMessage(0x246), g_session.DecodePlayerName(), count); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } } else if (count > 10) { char text[260]; std::sprintf(text, LookupMessage(0x247), g_session.DecodePlayerName(), count); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); } CPlayer* player = this->scene->player; g_soundMgr->PlayWave("effect\\number_change.wav", player->render.position.x, 0.0f, player->render.position.z, 250, 40, 1.0f, 0); @@ -10145,11 +10149,11 @@ void CGameMode::ReceiveEffectNumber(const unsigned char* data) { } if (!IsAdminAccount(actor->render.accountId) || g_session.IsAdminSubMode(7)) { - actor->SendMsg(nullptr, 0x72, 0, packet->value, packet->value >> 31, packet->count, packet->count >> 31, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 0x6D, 0, 0x9F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHANGE_RANK, 0, packet->value, packet->value >> 31, packet->count, packet->count >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x9F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (packet->count <= 10) { if (CRagEffect* effect = actor->LaunchEffect(0x9F, deltaPos, 0.0f)) { - effect->SendMsg(nullptr, 0x2C, 0, packet->count, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, packet->count, 0, 0, 0, 0); } } } @@ -10281,7 +10285,7 @@ void CGameMode::ReceiveGuildChat(const unsigned char* data) { g_forbiddenWords.Mask(text.data(), &masked); } if (!g_serviceOptions.Get(0x94)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xB4FFB4, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xB4FFB4, 4, 0, 0); if (g_session.m_whisperRecord != 0) { this->WriteChatLog(text.data()); } @@ -10336,23 +10340,23 @@ void CGameMode::ReceiveActorAction( const int hungerLevel = g_session.GetPetHungryState(g_session.unknown_1044); const int action = g_session.GetPetActionNumber(hungerLevel, g_session.GetPetFriendlyState(g_session.m_petFriendly), 1); if (rand() % 100 < 25 && g_session.CheckInterval(60000) == true) { - this->SendMsg(148, g_session.GetPetEmotionNumber(g_session.unknown_103C, 1, hungerLevel), 0, 0, 0); - this->SendMsg(148, action, 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetEmotionNumber(g_session.unknown_103C, 1, hungerLevel), 0, 0, 0); + this->SendMsg(MM_PET_ACT, action, 0, 0, 0); } } } else { char text[256]; g_session.GetMonsterTalkText(static_cast(actor)->GetEffectiveJob(-1), 0, 0, text, sourceAid); if (std::strcmp(text, "") != 0) { - actor->SendMsg(nullptr, 7, 0, reinterpret_cast(text), reinterpret_cast(text) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CHAT, 0, reinterpret_cast(text), reinterpret_cast(text) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (!g_serviceOptions.Get(114) && !g_serviceOptions.Get(148)) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFAFAFA, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFAFAFA, 0, 0, 0); } } } } const std::int64_t value = reinterpret_cast(&act); - actor->SendMsg(nullptr, 11, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_ACTION, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } #pragma pack(push, 1) @@ -10378,14 +10382,14 @@ void CGameMode::ReceiveActorDisappear(const unsigned char* data) { switch (packet->type) { case CLR_OUTSIGHT: if (CRenderObject* actor = this->scene->GetGameActorByAID(packet->aid)) { - actor->SendMsg(nullptr, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(13, packet->aid, 0, 0, 0); + actor->SendMsg(nullptr, AM_OUTOFSIGHT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } if (this->scene->RemoveItem(packet->aid) == true) { - this->SendMsg(13, packet->aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, packet->aid, 0, 0); + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, packet->aid, 0, 0); } break; case CLR_DEAD: { @@ -10394,63 +10398,63 @@ void CGameMode::ReceiveActorDisappear(const unsigned char* data) { if (packet->aid == static_cast(player->unknown_051C)) { player->unknown_051C = 0; } - actor->SendMsg(nullptr, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_WILL_BE_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int job = actor->GetEffectiveJob(-1); if (g_session.IsMonsterClass(job) || actor->unknown_0314 == 9 || g_session.IsSkillIdInRange6001(job) || actor->GetEffectiveJob(-1) == 0x235) { - this->SendMsg(13, packet->aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } if (g_windowMgr.unknown_041C) { - g_windowMgr.unknown_041C->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_041C->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } if (g_windowMgr.unknown_0308) { - g_windowMgr.unknown_0308->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_0308->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } } if (packet->aid != g_session.m_aid) { break; } - this->scene->player->SendMsg(nullptr, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_WILL_BE_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_024C = 1; this->unknown_0250 = 1; - g_windowMgr.CloseWindow(0x30); - g_windowMgr.CloseWindow(0x10); - g_windowMgr.CloseWindow(0x11); - g_windowMgr.CloseWindow(0x19); - g_windowMgr.CloseWindow(0x16); - g_windowMgr.CloseWindow(0x17); - g_windowMgr.CloseWindow(0x18); - g_windowMgr.CloseWindow(0x169); + g_windowMgr.CloseWindow(WID_QUITWND); + g_windowMgr.CloseWindow(WID_SAYDIALOGWND); + g_windowMgr.CloseWindow(WID_CHOOSEWND); + g_windowMgr.CloseWindow(WID_CHOOSESELLBUYWND); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); + g_windowMgr.CloseWindow(WID_RUNESYSTEMWND); if (g_windowMgr.unknown_02FC) { - g_windowMgr.unknown_02FC->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_02FC->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } if (g_windowMgr.unknown_040C) { - g_windowMgr.unknown_040C->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_040C->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } if (g_windowMgr.unknown_0304) { - g_windowMgr.unknown_0304->SendMsg(nullptr, 6, 201, 0, 0, 0); + g_windowMgr.unknown_0304->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } if (g_windowMgr.unknown_0414) { - g_windowMgr.unknown_0414->SendMsg(nullptr, 6, 201, 0, 0, 0); + g_windowMgr.unknown_0414->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } if (g_windowMgr.unknown_0308) { - g_windowMgr.unknown_0308->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_0308->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } if (g_windowMgr.unknown_041C) { - g_windowMgr.unknown_041C->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.unknown_041C->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } if (this->scene->GetGameActorByAID(g_session.unknown_1010)) { const int hungerLevel = g_session.GetPetHungryState(g_session.unknown_1044); const int action = g_session.GetPetActionNumber(hungerLevel, g_session.GetPetFriendlyState(g_session.m_petFriendly), 3); - this->SendMsg(148, g_session.GetPetEmotionNumber(g_session.unknown_103C, 3, hungerLevel), 0, 0, 0); - this->SendMsg(148, action, 0, 0, 0); + this->SendMsg(MM_PET_ACT, g_session.GetPetEmotionNumber(g_session.unknown_103C, 3, hungerLevel), 0, 0, 0); + this->SendMsg(MM_PET_ACT, action, 0, 0, 0); } if (g_serviceType == 4) { g_windowMgr.Confirm(LookupMessage(0x2B7), 0, true, false, 0, "Message", 280, 120, 0); - } else if (!g_windowMgr.CloseWindow(0x9B)) { - g_windowMgr.EnsureWindow(0x9B); + } else if (!g_windowMgr.CloseWindow(WID_ESCOPTIONWND)) { + g_windowMgr.EnsureWindow(WID_ESCOPTIONWND); } RefreshPartyWindows(&g_session); break; @@ -10460,11 +10464,11 @@ void CGameMode::ReceiveActorDisappear(const unsigned char* data) { this->LaunchDummyEffect(&actor->render.position, 0x13A, 600, 0); } if (g_windowMgr.unknown_0300 && static_cast(g_windowMgr.unknown_0300)->unknown_0100 == static_cast(packet->aid)) { - this->SendMsg(245, 0, 0, 0, 0); + this->SendMsg(MM_RELEASE_QUEST_SH, 0, 0, 0, 0); g_session.ClearItems1760And1748(); } if (this->scene->RemoveItem(packet->aid) == true) { - this->SendMsg(13, packet->aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } break; case CLR_TELEPORT: @@ -10474,16 +10478,16 @@ void CGameMode::ReceiveActorDisappear(const unsigned char* data) { } } if (this->scene->RemoveItem(packet->aid) == true) { - this->SendMsg(13, packet->aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, packet->aid, 0, 0); + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, packet->aid, 0, 0); } break; default: this->scene->GetGameActorByAID(packet->aid); if (this->scene->RemoveItem(packet->aid) == true) { - this->SendMsg(13, packet->aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, packet->aid, 0, 0, 0); } break; } @@ -10712,7 +10716,7 @@ void CGameMode::ReceiveGuildNotice(unsigned char* data) { subjectLine += subject; subjectLine += " ]"; if (std::strlen(subject) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(subjectLine.c_str()), 0x80FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(subjectLine.c_str()), 0x80FFFF, 0, 0, 0); } char notice[120]; @@ -10726,7 +10730,7 @@ void CGameMode::ReceiveGuildNotice(unsigned char* data) { noticeLine += notice; noticeLine += " ]"; if (std::strlen(notice) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(noticeLine.c_str()), 0x80FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(noticeLine.c_str()), 0x80FFFF, 0, 0, 0); } guildInfo->unknown_0030 = subject; @@ -11058,8 +11062,8 @@ void CGameMode::ReceiveMapMove(const unsigned char* data) { if (Replay::Instance().state == 2) { Replay::Instance().SetState(3); - g_windowMgr.window_4F164->SendMsg(nullptr, 0x57, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0xC6); + g_windowMgr.window_4F164->SendMsg(nullptr, UM_SETPOS, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REPLAYRECCONTROLWND); } else if (Replay::Instance().state == 7) { Replay::Instance().SetState(8); } @@ -11075,7 +11079,7 @@ void CGameMode::ReceiveMapMove(const unsigned char* data) { g_session.m_loginTimeTicks = _Xtime_get_ticks(); mapName.append(".rsw", 4); g_modeMgr.Switch(1, mapName.c_str()); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(121), 17, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(121), 17, 1); g_windowMgr.unknown_0474 = 185; g_session.ClearEntryList5BD4(); sameMap = 0; @@ -11151,7 +11155,7 @@ void CGameMode::ApplyGuildStorageLog(std::uint16_t result, const std::vector(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); g_guildStorageLogs[0].clear(); g_guildStorageLogs[1].clear(); g_guildStorageLogs[2].clear(); @@ -11189,11 +11193,11 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ return; } - scope->SendMsg(nullptr, 0x16, 0, source->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - scope->SendMsg(nullptr, 0xE, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); - scope->SendMsg(nullptr, 0x73, 0, timeGetTime() + delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETMASTERGID, 0, source->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETPOS, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETTIME, 0, timeGetTime() + delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int id = skillId; - scope->SendMsg(nullptr, 0x75, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SET_SKILL, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); mode->scene->objects.push_back(scope); return; } @@ -11204,7 +11208,7 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ if (g_session.IsSkillIdInRange6018(target->GetEffectiveJob(-1)) || target->unknown_0314 == 9) { if (mode->scene->unknown_0048 != 0 || mode->scene->unknown_004C != 0 || !IsSupportSkill(skillId)) { - source->SendMsg(nullptr, 0x51, 0, target->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_SET_TARGET_AID, 0, target->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -11221,7 +11225,7 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ } const int delayFrames = delay / 16; - target->SendMsg(nullptr, 0x56, 0, 0x3C, 0, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_MAGIC_TARGET, 0, 0x3C, 0, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); switch (skillId) { case CR_ACIDDEMONSTRATION: @@ -11241,15 +11245,15 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ return; } case WL_JACKFROST: - target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - target->SendMsg(nullptr, 0x56, 0, 0x5A8, 0, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_MAGIC_TARGET, 0, 0x5A8, 0, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; case WL_CHAINLIGHTNING: - target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Spawn(target->render.accountId, 0x665, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); return; case RA_AIMEDBOLT: - target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); effect = g_effectMgr->Spawn(target->render.accountId, 0x673, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); if (effect) { effect->SetLifeTime(delay); @@ -11258,7 +11262,7 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ case NC_FLAMELAUNCHER: if (CRagEffect* ragEffect = source->LaunchEffect(0x313, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - ragEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + ragEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } return; default: @@ -11270,16 +11274,16 @@ void LaunchSkillCastEffect(CGameMode* mode, CGameActor* source, CGameActor* targ // FUNCTION: fn_21887 void CGameMode::ReceiveEquipItemNotice(const unsigned char* data) { const EquipItemNoticePacket* packet = reinterpret_cast(data); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (packet->result) { case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x69F)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x69F)), 0x6464FF, 0, 0, 0); return; case 7: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x705)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x705)), 0xFF, 0, 0, 0); return; case 15: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xE75)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE75)), 0xFF, 0, 0, 0); return; } @@ -11288,27 +11292,27 @@ void CGameMode::ReceiveEquipItemNotice(const unsigned char* data) { switch (packet->result) { case 1: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x37)).c_str()), 0x6464FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x37)).c_str()), 0x6464FF, 0, 0, 0 ); break; case 2: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x38)).c_str()), 0x6464FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x38)).c_str()), 0x6464FF, 0, 0, 0 ); break; case 4: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0xF0), item.DisplayName(0).c_str(), packet->value).c_str()), 0x6464FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xF0), item.DisplayName(0).c_str(), packet->value).c_str()), 0x6464FF, 0, 0, 0 ); break; case 5: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0x119), item.DisplayName(0).c_str(), packet->value).c_str()), 0x6464FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0x119), item.DisplayName(0).c_str(), packet->value).c_str()), 0x6464FF, 0, 0, 0 ); break; case 8: g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x756)).c_str()), 0x6464FF, 0, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(0xE5), item.DisplayName(0).c_str(), LookupMessage(0x756)).c_str()), 0x6464FF, 0, 0, 0 ); break; } @@ -11356,7 +11360,7 @@ void NoticeSkillUse(CGameActor* target, CGameActor* source, std::uint16_t skillI StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(1625), skillName.c_str()); message += text; if (!message.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFFFF, color, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFFFF, color, 0, 0); } } @@ -11382,10 +11386,10 @@ void ApplyActorSkillState(CGameActor* actor, std::uint16_t skillId, int duration actor->LaunchEffect(0x192, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case WL_TETRAVORTEX: - actor->SendMsg(nullptr, 0x8F, 0, 0x2DF, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 0x8F, 0, 0x2E1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 0x8F, 0, 0x2E0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); - actor->SendMsg(nullptr, 0x8F, 0, 0x2E2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2DF, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_EFFECT_LOOP_COUNT, 0, 0x2E2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case ABC_CHAIN_REACTION_SHOT: actor->SetFrameSequence(88, 0, 0, 88, 0, 0, 0, 0); @@ -11417,9 +11421,9 @@ void CGameMode::NotifySkillCasting( if (silent == 0 && skillId != 0x3E && skillId != 0x39 && !g_session.IsMonsterActor(source)) { if (skillId == 0x14E || skillId == 0x14F) { - g_modeMgr.GetGameMode()->SendMsg(0x56, skillId, reinterpret_cast(source), targetAid, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), targetAid, 0); } else { - g_modeMgr.GetGameMode()->SendMsg(0x56, skillId, reinterpret_cast(source), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), 0, 0); } } @@ -11428,7 +11432,7 @@ void CGameMode::NotifySkillCasting( if (target && source != target) { source->Face(target->render.position.x, target->render.position.z); } - g_modeMgr.GetGameMode()->SendMsg(0x56, 0x49, reinterpret_cast(source), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_MAKE_SKILL_USED_MSG, 0x49, reinterpret_cast(source), 0, 0); } else if (skillId == 0x1479) { g_effectMgr->Spawn(source->render.accountId, 0x7C4, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } @@ -11445,7 +11449,7 @@ void CGameMode::NotifySkillCasting( source->SetState(motion, 1); if (skillId != 0x3E && skillId != 0x39 && delay != 0) { - source->SendMsg(nullptr, 0x52, 0, delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_MAKE_SKILL_RECHARGEGAGE, 0, delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } LaunchSkillActorEffect(source, x, y, skillId, delay, effectId); @@ -11509,7 +11513,7 @@ void CGameMode::ReceiveExpChange(const unsigned char* packet) { StringFormat( text, sizeof(text), static_cast(-1), "%lld : %lld/%lld More : %lld", gained, value, nextExp, (nextExp - exp) / gained ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xF51EF5, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xF51EF5, 0, 0, 0); } } exp = *reinterpret_cast(packet + 4); @@ -11559,39 +11563,39 @@ void CGameMode::ReceiveParaResultList(const unsigned char* packet) { const int count = static_cast(*reinterpret_cast(packet + 2) - 6) / sizeof(ParaResultRecord); switch (*reinterpret_cast(packet + 4)) { case -1: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3043)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3043)), 0xFF, 0, 0, 0); break; case PURCHASE_SUCCEED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; case PURCHASE_FAIL_MONEY: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(55)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(55)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_WEIGHT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_COUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); break; case PURCHASE_FAIL_EACHITEM_COUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1940)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1940)), 0xFF, 0, 0, 0); break; } if (count <= 0) { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(292, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_CLOSE, 0, 0, 0, 0); } return; } - UIParaResultWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(256))); + UIParaResultWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_PARARESULTWND))); const ParaResultRecord* record = reinterpret_cast(packet + 6); for (int i = 0; i < count; ++i) { RawItemBasic item = {}; @@ -11604,8 +11608,8 @@ void CGameMode::ReceiveParaResultList(const unsigned char* packet) { ++record; } - window->SendMsg(nullptr, 36, (count - 2 > 0 ? count - 2 : 0) * 32 + 120, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, (count - 2 > 0 ? count - 2 : 0) * 32 + 120, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00D2C5D0 @@ -11742,7 +11746,7 @@ void CGameMode::ReceiveEquipItemList38(const unsigned char* packet) { // OFFSET: 0x00D79500 // FUNCTION: fn_22169 __declspec(noinline) void CGameMode::ApplyRefiningMaterial(short itemId, unsigned char count, const unsigned char* materials, unsigned char catalystCount) { - UIRefiningWnd* window = static_cast(g_windowMgr.LookupWindow(0x127)); + UIRefiningWnd* window = static_cast(g_windowMgr.LookupWindow(WID_REFININGWND)); if (window) { window->ApplyItem(itemId, count, reinterpret_cast(const_cast(materials)), catalystCount); } @@ -11777,7 +11781,7 @@ void CGameMode::ReceiveAddRelatedGuild(const unsigned char* data) { void CGameMode::ReceiveEquipItemResult(const unsigned char* packet) { const std::uint16_t result = *reinterpret_cast(packet + 8); if (result != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(result == 3 ? 3009 : 3033)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(result == 3 ? 3009 : 3033)), 0xFF, 0, 0, 0); return; } @@ -11793,7 +11797,7 @@ void CGameMode::ReceiveEquipItemResult(const unsigned char* packet) { const char* suffix = LookupMessage(3143); g_windowMgr.SendNotice( - 1, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), suffix).c_str()), 0xC8FF00, 7, 0, 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), suffix).c_str()), 0xC8FF00, 7, 0, 0 ); } @@ -11919,14 +11923,14 @@ void CGameMode::SpawnStandingPc( CGameActor* actor = static_cast(this->scene->GetGameActorByAID(aid)); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { CPc* pc = new CPc; this->scene->objects.push_back(pc); this->scene->actors.push_back(pc); actor = pc; const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } actor->unknown_03E0Low = 1; } @@ -11961,14 +11965,14 @@ void CGameMode::SpawnStandingPc2( CGameActor* actor = static_cast(this->scene->GetGameActorByAID(aid)); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { CPc* pc = new CPc; this->scene->objects.push_back(pc); this->scene->actors.push_back(pc); actor = pc; const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } actor->unknown_03E0Low = 1; } @@ -12018,7 +12022,7 @@ void CGameMode::SpawnMirrorActor(std::uint32_t aid, std::uint32_t owner, short x CPc* pc = new CPc; const std::int64_t value = reinterpret_cast(&entry); - pc->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + pc->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); pc->unknown_0314 = 7; pc->LaunchEffect(0x3C3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->scene->objects.push_back(pc); @@ -12040,7 +12044,7 @@ void CGameMode::SpawnMirrorActor(std::uint32_t aid, std::uint32_t owner, short x data.visible = 1; CSkill* skill = new CSkill(0); const std::int64_t value = reinterpret_cast(&data); - skill->SendMsg(nullptr, 0x2D, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILLSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); } @@ -12119,13 +12123,13 @@ void CGameMode::ReceiveItem1748List2(const unsigned char* packet) { g_session.AddItem1748(item); } - if (UIWindow* window = g_windowMgr.EnsureWindow(43)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, value4, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMSHOPWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, value4, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.EnsureWindow(44)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window->SendMsg(nullptr, 28, value4, value8, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETNAID, value4, value8, 0, 0); } this->unknown_024C = 1; } @@ -12151,16 +12155,16 @@ void CGameMode::ReceivePartyMemberLeft(const unsigned char* data) { switch (packet->type) { case GROUPMEMBER_DELETE_LEAVE: case GROUPMEMBER_DELETE_EXPEL: - this->SendMsg(0x40, g_session.GetPartyMemberAid(name), 0, 0, 0); + this->SendMsg(MM_DELETEPARTYPOS, g_session.GetPartyMemberAid(name), 0, 0, 0); g_session.RemovePartyMemberByName(name); break; case 2: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x750)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x750)), 0xFF, 0, 0, 0); return; case 3: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x751)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x751)), 0xFF, 0, 0, 0); return; } @@ -12168,12 +12172,12 @@ void CGameMode::ReceivePartyMemberLeft(const unsigned char* data) { g_session.unknown_5464 = 0; g_session.ClearPartyMembers(); g_session.unknown_54C4.assign("", 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x54)), 0xFFFF00, 0, 0, 0); - g_windowMgr.CloseWindow(0x35); - this->SendMsg(0x41, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x54)), 0xFFFF00, 0, 0, 0); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); + this->SendMsg(MM_DELETEPARTYPOSALL, 0, 0, 0, 0); if (g_windowMgr.unknown_03F8) { - g_windowMgr.CloseWindow(0x89); + g_windowMgr.CloseWindow(WID_MEMORIALDUNWND); } g_session.ClearRecords0734(); } @@ -12201,13 +12205,13 @@ void CGameMode::ReceiveBroadcast(const unsigned char* packet) { } if (g_windowMgr.window_027C == nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(text.data()), 0xFF00, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.data()), 0xFF00, 1, 0, 0); char* message = text.data(); this->scene->player->SendMsg( - nullptr, 7, 0, reinterpret_cast(message), reinterpret_cast(message) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, AM_CHAT, 0, reinterpret_cast(message), reinterpret_cast(message) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } else { - g_windowMgr.SendNotice(5, reinterpret_cast(text.data()), 0x7800, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(text.data()), 0x7800, 0, 0, 0); } if (g_session.m_whisperRecord != 0) { @@ -12244,14 +12248,14 @@ void CGameMode::ReceiveItem1758StoreList(const unsigned char* packet) { } if (g_replayAnimationScaling != 0) { - g_modeMgr.GetGameMode()->SendMsg(82, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_OPENSTORE, 0, 0, 0, 0); } g_session.ClearItems1758(); if (items.size() == 0) { - this->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(43); - g_windowMgr.CloseWindow(44); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); g_session.ClearItems1760And1748(); return; } @@ -12399,7 +12403,7 @@ void CGameMode::ReceiveActorStandEntry(const unsigned char* data) { } } const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12434,7 +12438,7 @@ void CGameMode::ReceiveActorStandEntry(const unsigned char* data) { this->scene->actors.push_back(actor); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12493,7 +12497,7 @@ void CGameMode::ReceiveActorStandEntryFont(const unsigned char* data) { } } const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12528,7 +12532,7 @@ void CGameMode::ReceiveActorStandEntryFont(const unsigned char* data) { this->scene->actors.push_back(actor); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12596,7 +12600,7 @@ void CGameMode::ReceiveActorTypedEntry(const unsigned char* data) { } } const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 3, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && packet->objectType != 7 && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12632,7 +12636,7 @@ void CGameMode::ReceiveActorTypedEntry(const unsigned char* data) { this->scene->actors.push_back(actor); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 4, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && packet->objectType != 7 && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -12687,7 +12691,7 @@ void CGameMode::ReceiveNpcStandEntry(const unsigned char* data) { this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 4, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int actorJob = actor->GetEffectiveJob(-1); if ((actorJob > JT_WARPNPC && actorJob < 1000) || (actorJob > 1000 && actorJob < 3999) || static_cast(actorJob - 20021) <= 11978) { const std::uint32_t guildId = (packet->accessory2 << 16) | packet->accessory3; @@ -12700,7 +12704,7 @@ void CGameMode::ReceiveNpcStandEntry(const unsigned char* data) { } const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 3, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int actorJob = actor->GetEffectiveJob(-1); if ((actorJob > JT_WARPNPC && actorJob < 1000) || (actorJob > 1000 && actorJob < 3999) || static_cast(actorJob - 20021) <= 11978) { const std::uint32_t guildId = (packet->accessory2 << 16) | packet->accessory3; @@ -12913,7 +12917,7 @@ void CGameMode::ReceiveActorMoveEntryLegacy(const unsigned char* data) { member->second.y = entry.dstY; } } - actor->SendMsg(nullptr, 0x7B, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { CGameActor* created; if (packet->objectType == 0) { @@ -12937,7 +12941,7 @@ void CGameMode::ReceiveActorMoveEntryLegacy(const unsigned char* data) { entry.unknown_0008 = 0; } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); - actor->SendMsg(nullptr, 0x7A, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } std::int64_t bossFlag = 0; @@ -12972,14 +12976,14 @@ void CGameMode::ReceiveActorMoveEntryLegacy(const unsigned char* data) { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -13047,7 +13051,7 @@ void CGameMode::SpawnMovingActor( member->second.y = entry.dstY; } } - actor->SendMsg(nullptr, 0x7B, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { CGameActor* created; if (objectType == 0) { @@ -13070,7 +13074,7 @@ void CGameMode::SpawnMovingActor( } else if (!((objectType == 1 || objectType == 6 || objectType == 12) && IsPlayerJob(job))) { entry.unknown_0008 = 0; } - actor->SendMsg(nullptr, 0x7A, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); @@ -13106,14 +13110,14 @@ void CGameMode::SpawnMovingActor( const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), static_cast(currentMaxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -13193,7 +13197,7 @@ void CGameMode::ReceiveActorMoveEntryOld(const unsigned char* data) { CGameActor* actor = static_cast(this->scene->GetGameActorByAID(packet->aid)); if (actor) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7B, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (entry.head == 0x2E) { if (g_session.unknown_1010 == packet->aid) { g_session.unknown_1038 = entry.accessory; @@ -13244,7 +13248,7 @@ void CGameMode::ReceiveActorMoveEntryOld(const unsigned char* data) { this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7A, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.head != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -13327,7 +13331,7 @@ void CGameMode::ReceiveActorMoveEntryOld2(const unsigned char* data) { if (actor) { actor->unknown_0210 = packet->level; const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7B, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (packet->objectType == 7) { if (g_session.unknown_1010 == packet->aid) { g_session.unknown_1038 = entry.accessory; @@ -13381,7 +13385,7 @@ void CGameMode::ReceiveActorMoveEntryOld2(const unsigned char* data) { this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7A, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && packet->objectType == 7 && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -13474,7 +13478,7 @@ void CGameMode::ReceiveActorMoveEntryNamed(const unsigned char* data) { if (actor) { actor->unknown_0210 = packet->level; *reinterpret_cast(actor->render.unknown_00FCBytes) = packet->font; - actor->SendMsg(nullptr, 0x7B, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (packet->objectType == 7) { if (g_session.unknown_1010 == packet->aid) { g_session.unknown_1038 = entry.accessory; @@ -13526,7 +13530,7 @@ void CGameMode::ReceiveActorMoveEntryNamed(const unsigned char* data) { actor->unknown_0314 = packet->objectType; this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 0x7A, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); *reinterpret_cast(actor->render.unknown_00FCBytes) = packet->font; actor->unknown_0210 = packet->level; if (g_session.GetSceneUnknown004C() && packet->objectType == 7 && actor->unknown_0188 == 0 && @@ -13609,7 +13613,7 @@ void CGameMode::ReceiveActorMoveEntryOld0(const unsigned char* data) { CGameActor* actor = static_cast(this->scene->GetGameActorByAID(packet->aid)); if (actor) { - actor->SendMsg(nullptr, 5, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVEENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int actorJob = actor->GetEffectiveJob(-1); if ((actorJob > 45 && actorJob < 1000) || (actorJob > 1000 && actorJob < 3999) || static_cast(actorJob - 20021) <= 11978) { const std::uint32_t emblem = (packet->accessory2 << 16) | packet->accessory3; @@ -13650,7 +13654,7 @@ void CGameMode::ReceiveActorMoveEntryOld0(const unsigned char* data) { } this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 6, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITMOVEENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int actorJob = actor->GetEffectiveJob(-1); if ((actorJob > 45 && actorJob < 1000) || (actorJob > 1000 && actorJob < 3999) || static_cast(actorJob - 20021) <= 11978) { const std::uint32_t emblem = (packet->accessory2 << 16) | packet->accessory3; @@ -13909,10 +13913,10 @@ void CGameMode::ReceiveActorStandEntryLegacy(const unsigned char* data) { if (actor) { if (packet->objectType == 0) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 3, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } else { CGameActor* created; @@ -13934,11 +13938,11 @@ void CGameMode::ReceiveActorStandEntryLegacy(const unsigned char* data) { actor->SetUnknown02E4(1); } const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { entry.unknown_0008 = 0; const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 4, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); } @@ -13975,14 +13979,14 @@ void CGameMode::ReceiveActorStandEntryLegacy(const unsigned char* data) { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -14094,7 +14098,7 @@ void CGameMode::ReceiveActorStandEntryNamedOld(const unsigned char* data) { *reinterpret_cast(actor->render.unknown_00FCBytes) = packet->font; if (created) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->unknown_01B4.find(packet->aid) != this->unknown_01B4.end() || this->unknown_01BC.find(packet->aid) != this->unknown_01BC.end()) { actor->SetUnknown02E4(1); } @@ -14102,7 +14106,7 @@ void CGameMode::ReceiveActorStandEntryNamedOld(const unsigned char* data) { this->scene->actors.push_back(actor); } else { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.GetSceneUnknown004C() && actor->unknown_0188 == 0) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14125,10 +14129,10 @@ void CGameMode::ReceiveActorStandEntryNamedOld(const unsigned char* data) { this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 4, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 3, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.IsGuardianJob(packet->job) && g_session.GetSceneUnknown004C() && actor->unknown_0188 == 0) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14223,7 +14227,7 @@ void CGameMode::ReceiveActorStandEntryOld(const unsigned char* data) { actor->SetActionName(ResourceMgr::Instance(), g_session.GetPetAccActName(entry.unknown_0030)); } } - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14255,7 +14259,7 @@ void CGameMode::ReceiveActorStandEntryOld(const unsigned char* data) { } this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (isPc && !IsAdminAccount(packet->aid) && !StateFlag06(packet->effectState)) { actor->LaunchEffect(0x158, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -14347,7 +14351,7 @@ void CGameMode::ReceiveActorStandEntryOld2(const unsigned char* data) { actor->SetActionName(ResourceMgr::Instance(), g_session.GetPetAccActName(entry.unknown_0030)); } } - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->unknown_0210 = packet->level; if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { @@ -14380,7 +14384,7 @@ void CGameMode::ReceiveActorStandEntryOld2(const unsigned char* data) { } this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->unknown_0210 = packet->level; if (isPc && !IsAdminAccount(packet->aid) && !StateFlag06(packet->effectState)) { actor->LaunchEffect(0x158, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -14476,7 +14480,7 @@ void CGameMode::ReceiveActorStandEntryOld3(const unsigned char* data) { actor->SetActionName(ResourceMgr::Instance(), g_session.GetPetAccActName(entry.unknown_0030)); } } - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14508,7 +14512,7 @@ void CGameMode::ReceiveActorStandEntryOld3(const unsigned char* data) { } this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); actor->unknown_0210 = packet->level; if (isPc) { *reinterpret_cast(actor->render.unknown_00FCBytes) = packet->font; @@ -14611,7 +14615,7 @@ void CGameMode::ReceiveActorStandEntryOld0(const unsigned char* data) { actor->SetActionName(ResourceMgr::Instance(), g_session.GetPetAccActName(entry.unknown_0030)); } } - actor->SendMsg(nullptr, 3, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { int isPc = 0; const short job = packet->job; @@ -14639,7 +14643,7 @@ void CGameMode::ReceiveActorStandEntryOld0(const unsigned char* data) { } this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); - actor->SendMsg(nullptr, 4, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int actorJob = actor->GetEffectiveJob(-1); if ((actorJob >= 45 && actorJob < 1000) || (actorJob > 1000 && actorJob < 3999) || static_cast(actorJob - 20021) <= 11978) { const std::uint32_t emblem = (packet->accessory2 << 16) | packet->accessory3; @@ -14759,13 +14763,13 @@ void CGameMode::ReceiveActorStateEntryNamedOld(const unsigned char* data) { actor->unknown_0210 = packet->level; if (created) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x79, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->unknown_01B4.find(packet->aid) != this->unknown_01B4.end() || this->unknown_01BC.find(packet->aid) != this->unknown_01BC.end()) { actor->SetUnknown02E4(1); } } else { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 0x7C, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.GetSceneUnknown004C() && actor->unknown_0188 == 0) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14786,10 +14790,10 @@ void CGameMode::ReceiveActorStateEntryNamedOld(const unsigned char* data) { if (created) { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 4, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { const std::int64_t value = reinterpret_cast(&entry); - actor->SendMsg(nullptr, 3, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_session.IsGuardianJob(packet->job) && g_session.GetSceneUnknown004C() && actor->unknown_0188 == 0) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14889,7 +14893,7 @@ void CGameMode::ReceiveActorStateEntryOld(const unsigned char* data) { actor->SetActionName(ResourceMgr::Instance(), g_session.GetPetAccActName(entry.unknown_0030)); } } - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14920,7 +14924,7 @@ void CGameMode::ReceiveActorStateEntryOld(const unsigned char* data) { this->scene->objects.push_back(actor); this->scene->actors.push_back(actor); if (actor) { - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_session.GetSceneUnknown004C() && entry.unknown_0024 != 0x2E && actor->unknown_0188 == 0 && (g_session.IsPlayerJobId(actor->GetEffectiveJob(-1)) || g_session.IsGuardianJob(actor->GetEffectiveJob(-1)))) { this->ShowGuildEmblem(actor, packet->guildId, packet->guildVersion); @@ -14988,9 +14992,9 @@ void CGameMode::SpawnStandingActor( CGameActor* actor = static_cast(this->scene->GetGameActorByAID(entry.aid)); if (actor) { if (objectType == 0) { - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - actor->SendMsg(nullptr, 3, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } else { CGameActor* created; @@ -15011,12 +15015,12 @@ void CGameMode::SpawnStandingActor( if (this->unknown_01B4.find(aid) != this->unknown_01B4.end() || this->unknown_01BC.find(aid) != this->unknown_01BC.end()) { actor->SetUnknown02E4(1); } - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { if (!((objectType == 1 || objectType == 6 || objectType == 5) && IsPlayerJob(job))) { entry.unknown_0008 = 0; } - actor->SendMsg(nullptr, 4, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); } @@ -15053,14 +15057,14 @@ void CGameMode::SpawnStandingActor( const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), static_cast(currentMaxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -15153,7 +15157,7 @@ void CGameMode::ReceiveRefineBroadcast(const unsigned char* data) { material.identified = 1; std::string text = FormatOwnedString(LookupMessage(0x65C), name.c_str(), material.DisplayName(0).c_str(), item.DisplayName(1).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { BroadcastBalloonMessage message{{}, {}, std::chrono::seconds(20), 12, 0x40000000, 0, 0}; message.start = std::chrono::system_clock::now(); @@ -15174,7 +15178,7 @@ void CGameMode::ReceiveTradeBroadcast(const unsigned char* data) { std::string otherName(packet->otherName, 24); std::string text = FormatOwnedString(LookupMessage(0x65C), name.c_str(), otherName.c_str(), item.DisplayName(1).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { BroadcastBalloonMessage message{{}, {}, std::chrono::seconds(20), 12, 0x40000000, 0, 0}; message.start = std::chrono::system_clock::now(); @@ -15194,7 +15198,7 @@ void CGameMode::ReceiveItemBroadcast(const unsigned char* data) { item.identified = 1; std::string text = FormatOwnedString(LookupMessage(0x74C), name.c_str(), item.DisplayName(0).c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { BroadcastBalloonMessage message{{}, {}, std::chrono::seconds(20), 12, 0x40000000, 0, 0}; message.start = std::chrono::system_clock::now(); @@ -15267,9 +15271,9 @@ void CGameMode::SpawnStateActor( CGameActor* actor = static_cast(this->scene->GetGameActorByAID(entry.aid)); if (actor) { if (objectType == 0) { - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - actor->SendMsg(nullptr, 3, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } else { CGameActor* created; @@ -15290,14 +15294,14 @@ void CGameMode::SpawnStateActor( if (this->unknown_01B4.find(aid) != this->unknown_01B4.end() || this->unknown_01BC.find(aid) != this->unknown_01BC.end()) { actor->SetUnknown02E4(1); } - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { if ((objectType == 1 || objectType == 6 || objectType == 12) && IsPlayerJob(job)) { entry.unknown_0078 = job; } else { entry.unknown_0008 = 0; } - actor->SendMsg(nullptr, 4, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); } @@ -15334,14 +15338,14 @@ void CGameMode::SpawnStateActor( const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(currentHp), static_cast(currentHp >> 32), static_cast(currentMaxHp), static_cast(currentMaxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, gid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -15411,11 +15415,11 @@ void CGameMode::ReceiveRateInfo(const unsigned char* packet) { balloon->AddMessage(0, message); } - g_windowMgr.SendNotice(1, reinterpret_cast("=================================================================="), 0x62B0FF, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(expLine.c_str()), 0x62B0FF, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(dropLine.c_str()), 0x62B0FF, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(deathLine.c_str()), 0x62B0FF, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("=================================================================="), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("=================================================================="), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(expLine.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(dropLine.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(deathLine.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("=================================================================="), 0x62B0FF, 0, 0, 0); } // OFFSET: 0x00D21EB0 @@ -15451,9 +15455,9 @@ void CGameMode::ReceiveColorBroadcast(const unsigned char* data) { message = static_cast(g_windowMgr.window_01C8)->ConvertChat(message); balloonMessage.lines.emplace_back(message, color); balloon->AddMessage(0, balloonMessage); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), color, 0x19, 0, 0); - g_windowMgr.SendNotice(0x13, reinterpret_cast(message.c_str()), color, 0x19, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), color, 0x19, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(message.c_str()), color, 0x19, 0, 0); } } @@ -15551,13 +15555,13 @@ void CGameMode::ReceiveTaggedBroadcast(const unsigned char* data) { } } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); g_windowMgr.SendNotice( - 1, reinterpret_cast(message.c_str()), color, fontType, reinterpret_cast(senderName), 0 + UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), color, fontType, reinterpret_cast(senderName), 0 ); if (!systemMessage) { g_windowMgr.SendNotice( - 0x13, reinterpret_cast(message.c_str()), color, fontType, reinterpret_cast(senderName), 0 + UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(message.c_str()), color, fontType, reinterpret_cast(senderName), 0 ); } @@ -15634,7 +15638,7 @@ void CGameMode::ReceiveRefineStatusGraded(const char* playerName, int itemId, un std::string itemName = item.DisplayName(1); std::string text = FormatOwnedString(LookupMessage(!success + 0x1108), playerName, itemName.c_str()); std::string line = text; - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x62B0FF, 0, 0, 0); if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { BroadcastBalloonMessage message{{}, {}, std::chrono::seconds(20), 12, 0x40000000, 0, 0}; message.start = std::chrono::system_clock::now(); @@ -15677,7 +15681,7 @@ void CGameMode::ReceiveItemObtainBroadcast(const unsigned char* data, bool packa text = static_cast(FormatOwnedString(LookupMessage(0x65C), name.c_str(), source.c_str(), item.DisplayName(0).c_str())); } - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); if (UIBroadcastBalloon* balloon = this->EnsureBroadcastBalloon()) { BroadcastBalloonMessage message{{}, {}, std::chrono::seconds(20), 12, 0x40000000, 0, 0}; message.start = std::chrono::system_clock::now(); @@ -15733,9 +15737,9 @@ void CGameMode::ReceiveActorStateEntryLegacy(const unsigned char* data) { CGameActor* actor = static_cast(this->scene->GetGameActorByAID(entry.aid)); if (actor) { if (packet->objectType == 0) { - actor->SendMsg(nullptr, 0x7C, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - actor->SendMsg(nullptr, 3, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_STANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } else { CGameActor* created; @@ -15756,10 +15760,10 @@ void CGameMode::ReceiveActorStateEntryLegacy(const unsigned char* data) { if (this->unknown_01B4.find(packet->aid) != this->unknown_01B4.end() || this->unknown_01BC.find(packet->aid) != this->unknown_01BC.end()) { actor->SetUnknown02E4(1); } - actor->SendMsg(nullptr, 0x79, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY2, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { entry.unknown_0008 = 0; - actor->SendMsg(nullptr, 4, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_INITSTANDENTRY, 0, reinterpret_cast(&entry), reinterpret_cast(&entry) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_championMonsterMgr->ApplyEffects(entry.job, actor, entry.aid); } @@ -15796,14 +15800,14 @@ void CGameMode::ReceiveActorStateEntryLegacy(const unsigned char* data) { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( - nullptr, 0x91, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), + nullptr, AM_UPDATE_MONSTER_GAGE, 0, static_cast(hp), static_cast(hp >> 32), static_cast(maxHp), static_cast(maxHp >> 32), static_cast(bossFlag), static_cast(bossFlag >> 32), 0, 0, 0, 0, 0, 0 ); break; } case NPC_ABR_TYPE: case NPC_BIONIC_TYPE: - actor->SendMsg(nullptr, 0x22, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, packet->aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -15880,7 +15884,7 @@ void CGameMode::ReceivePartyMemberInfo(const unsigned char* data) { g_session.unknown_5464 = 1; } } else if (member.offline == 1) { - this->SendMsg(0x40, member.accountId, 0, 0, 0); + this->SendMsg(MM_DELETEPARTYPOS, member.accountId, 0, 0, 0); } else { std::string memberMap = member.map; std::string currentMap = this->mapName; @@ -15891,7 +15895,7 @@ void CGameMode::ReceivePartyMemberInfo(const unsigned char* data) { currentMap.resize(currentMap.size() - 3); } if (memberMap != currentMap) { - this->SendMsg(0x40, member.accountId, 0, 0, 0); + this->SendMsg(MM_DELETEPARTYPOS, member.accountId, 0, 0, 0); } } @@ -16010,7 +16014,7 @@ void CGameMode::UpdatePartyMemberInfo( g_session.unknown_5464 = 1; } } else if (member.offline == 1) { - this->SendMsg(0x40, accountId, 0, 0, 0); + this->SendMsg(MM_DELETEPARTYPOS, accountId, 0, 0, 0); this->SetActorUnknown02E4(accountId, 0); } else { std::string memberMap = member.map; @@ -16023,7 +16027,7 @@ void CGameMode::UpdatePartyMemberInfo( } const bool sameMap = memberMap == currentMap; if (!sameMap) { - this->SendMsg(0x40, accountId, 0, 0, 0); + this->SendMsg(MM_DELETEPARTYPOS, accountId, 0, 0, 0); } this->SetActorUnknown02E4(accountId, sameMap); } @@ -16047,7 +16051,7 @@ void LaunchSkillActorEffect(CGameActor* actor, short x, short y, std::uint16_t s g_effectMgr->Spawn(actor->render.accountId, effectId, actor->render.position.x, actor->render.position.y, actor->render.position.z, 0, -1, 0, 0); } else { const int delayFrames = delay / 16; - actor->SendMsg(nullptr, 0x55, 0, effectId, effectId >> 31, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_BEGIN_SPELL, 0, effectId, effectId >> 31, delayFrames, delayFrames >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } const vector3d origin{0.0f, 0.0f, 0.0f}; @@ -16264,7 +16268,7 @@ void LaunchSkillActorEffect(CGameActor* actor, short x, short y, std::uint16_t s CRagEffect* ragEffect = actor->LaunchEffect(0xD8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (ragEffect) { vector3d position = actor->render.position; - ragEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + ragEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } return; } @@ -16612,11 +16616,11 @@ void LaunchSkillActorEffect(CGameActor* actor, short x, short y, std::uint16_t s int column; int row; static_cast(g_modeMgr.GetGameMode())->WorldCell(actor->render.position.x, actor->render.position.z, column, row); - scope->SendMsg(nullptr, 0x16, 0, actor->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - scope->SendMsg(nullptr, 0xE, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); - scope->SendMsg(nullptr, 0x73, 0, timeGetTime() + delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETMASTERGID, 0, actor->render.accountId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETPOS, 0, column, column >> 31, row, row >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SETTIME, 0, timeGetTime() + delay, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int id = skillId; - scope->SendMsg(nullptr, 0x75, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + scope->SendMsg(nullptr, AM_SET_SKILL, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); static_cast(g_modeMgr.GetGameMode())->scene->objects.push_back(scope); return; } @@ -16835,9 +16839,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t } if (g_session.IsMonsterActor(source) == 0 && skillId != MG_SRECOVERY) { if (skillId == WE_MALE || skillId == WE_FEMALE) { - this->SendMsg(0x56, skillId, reinterpret_cast(source), targetAid, 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), targetAid, 0); } else { - this->SendMsg(0x56, skillId, reinterpret_cast(source), level, 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), level, 0); } } else { int loopType; @@ -16847,7 +16851,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t } } if (g_session.IsMonsterActor(source) == 1) { - this->SendMsg(0x56, skillId, reinterpret_cast(source), level, 0); + this->SendMsg(MM_MAKE_SKILL_USED_MSG, skillId, reinterpret_cast(source), level, 0); } if (action == -1) { switch (skillId) { @@ -16871,7 +16875,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t source->SetState(7, motion); } else { if (motion == 2 || motion == 9) { - source->SendMsg(nullptr, 0x51, 0, targetAid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_SET_TARGET_AID, 0, targetAid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (CSkillActionMgr::GetInstance()->SuppressSupportSkillArrow(skillId)) { source->SetArrowEffectSuppressed(true); } @@ -16903,10 +16907,10 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case AM_REST: if (sourceAid == g_session.m_aid) { if (g_windowMgr.window_03C0 != nullptr) { - g_windowMgr.CloseWindow(0x71); + g_windowMgr.CloseWindow(WID_HOMUNINFOWND); } if (g_windowMgr.window_03C4 != nullptr) { - g_windowMgr.CloseWindow(0x72); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_0); } g_session.ClearHomunStatus(); g_session.unknown_5614 = 0; @@ -16915,14 +16919,14 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case NPC_RANDOMBREAK: if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x985, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } break; case NPC_STRIP_SHADOW: if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x984, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } break; @@ -17002,16 +17006,16 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case KN_TWOHANDQUICKEN: case KN_ONEHAND: if (source != nullptr) { - source->SendMsg(nullptr, 109, 0, 0x82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x82, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case KN_AUTOCOUNTER: if (source != nullptr) { - source->SendMsg(nullptr, 0x52, 0, level * 400, (level * 400) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_MAKE_SKILL_RECHARGEGAGE, 0, level * 400, (level * 400) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->SetState(13, 1); if (sourceAid != g_session.m_aid) { - source->SendMsg(nullptr, 0x53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -17063,7 +17067,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t static_cast(skill)->LaunchEffect(0x6F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (source->unknown_037C[0] != 0) { const int address = reinterpret_cast(&skill->render.position); - reinterpret_cast(source->unknown_037C[0])->SendMsg(nullptr, 0x1D, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(source->unknown_037C[0])->SendMsg(nullptr, AM_REQ_ATTACK, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -17180,7 +17184,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case NPC_SUICIDE: if (source != nullptr) { if (CRagEffect* effect = this->scene->player->LaunchEffect(0xB9, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); } } break; @@ -17214,11 +17218,11 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (sourceAid == g_session.m_aid) { char notice[512]; std::sprintf(notice, LookupMessage(0x651), static_cast(g_modeMgr.GetGameMode())->ActorName(target->render.accountId).c_str(), level); - g_windowMgr.SendNotice(1, reinterpret_cast(notice), 0xC8C8FF, 0x10, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice), 0xC8C8FF, 0x10, 0, 0); } if (CRagEffect* effect = target->LaunchEffect(0x112, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x10C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17256,7 +17260,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case MG_SRECOVERY: if (target != nullptr) { - target->SendMsg(nullptr, 0x58, 0, effectLevel, effectLevel >> 31, static_cast(0xFF0000FF), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_NUMBER, 0, effectLevel, effectLevel >> 31, static_cast(0xFF0000FF), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); } break; case CR_DEVOTION: @@ -17287,7 +17291,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case CR_SPEARQUICKEN: if (source != nullptr) { - source->SendMsg(nullptr, 109, 0, 0xFA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xFA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0xFA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; @@ -17303,9 +17307,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case MO_EXPLOSIONSPIRITS: if (source != nullptr) { - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\mon_폭기.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - source->SendMsg(nullptr, 109, 0, 0xCB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xCB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0xCB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->LaunchEffect(0x105, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->SetSequenceInterval(30); @@ -17315,7 +17319,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case MO_STEELBODY: if (source != nullptr) { g_soundMgr->PlayWave("effect\\mon_맹룡과강.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); source->LaunchEffect(0x105, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->SetFrameSequence(0x60, 0, 0, 0x60, 0, 1, 20, 0); } @@ -17329,7 +17333,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case BS_OVERTHRUST: case WS_OVERTHRUSTMAX: if (source != nullptr) { - source->SendMsg(nullptr, 109, 0, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x80, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; @@ -17341,7 +17345,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case WE_FEMALE: if (target != nullptr) { target->LaunchEffect(0xFD, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - target->SendMsg(nullptr, 0x58, 0, level, level >> 31, static_cast(0xFF0000FF), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_NUMBER, 0, level, level >> 31, static_cast(0xFF0000FF), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); } break; case WE_BABY: @@ -17351,9 +17355,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case LK_AURABLADE: if (source != nullptr) { - source->SendMsg(nullptr, 109, 0, 0x16F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x16F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x16F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - source->SendMsg(nullptr, 109, 0, 0x1DA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1DA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x1DA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->SetFrameSequence(0x20, 0, 5, 0x20, 5, 1, 1000, 0); g_soundMgr->PlayWave("effect\\오라 블레이드.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -17361,7 +17365,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case LK_CONCENTRATION: if (source != nullptr) { - source->SendMsg(nullptr, 109, 0, 0x171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x171, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; @@ -17369,7 +17373,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x1EF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -17522,14 +17526,14 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t source->SetFrameSequence(0x58, 0, 3, 0x58, 3, 1, 1000, 0); if (CRagEffect* effect = source->LaunchEffect(0x17A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x17B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case HW_MAGICPOWER: if (target != nullptr) { - target->SendMsg(nullptr, 0x6D, 0, 0x17E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x17E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x17E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("effect\\마법력 증폭.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } @@ -17543,7 +17547,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr && target != nullptr) { vector3d offset{0.0f, static_cast(target->render.accountId), 0.0f}; if (CRagEffect* effect = source->LaunchEffect(0x180, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&offset), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&offset), 0, 0, 0, 0); } source->LaunchEffect(0x181, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x181, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -17585,7 +17589,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case ST_CHASEWALK: if (source != nullptr) { - source->SendMsg(nullptr, 0x3F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case ST_REJECTSWORD: @@ -17603,7 +17607,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr && target != nullptr) { vector3d offset{0.0f, static_cast(target->render.accountId), 0.0f}; if (CRagEffect* effect = source->LaunchEffect(0x18B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&offset), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&offset), 0, 0, 0, 0); } source->LaunchEffect(0x18C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x18C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -17646,12 +17650,12 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr) { g_soundMgr->PlayWave("effect\\T_바람방출.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); while (source->HasId(0x1CD)) { - source->SendMsg(nullptr, 0x6D, 0, 0x1CD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1CD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } source->LaunchEffect(0x1CD, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); const int effectId = effectLevel + 0x1D2; while (source->HasId(effectId)) { - source->SendMsg(nullptr, 0x6D, 0, effectId, effectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, effectId, effectId >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } source->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17659,11 +17663,11 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case TK_HIGHJUMP: if (source != nullptr) { if (source->HasId(0x1BE)) { - source->SendMsg(nullptr, 0x6D, 0, 0x1BE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } source->LaunchEffect(0x1BE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); while (source->HasId(0x1BD)) { - source->SendMsg(nullptr, 0x6D, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -17671,9 +17675,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SG_MOON_WARM: case SG_STAR_WARM: if (source != nullptr && target != nullptr) { - source->SendMsg(nullptr, 0x6D, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x1A2, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - source->SendMsg(nullptr, 0x6D, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x220, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->LaunchEffect(0x23C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17682,7 +17686,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SG_MOON_COMFORT: case SG_STAR_COMFORT: if (source != nullptr) { - source->SendMsg(nullptr, 0x6D, 0, 0x1E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x1E8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); source->LaunchEffect(0x21F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17690,14 +17694,14 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SG_HATE: if (target != nullptr) { g_soundMgr->PlayWave("effect\\T_등록.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - target->SendMsg(nullptr, 0x6D, 0, 0x21F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x21F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x21F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case SG_FUSION: if (source != nullptr) { g_soundMgr->PlayWave("effect\\T_변신.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } break; case AM_BERSERKPITCHER: @@ -17728,7 +17732,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SL_KAITE: if (target != nullptr) { g_soundMgr->PlayWave("effect\\T_마법반사.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - target->SendMsg(nullptr, 0x6D, 0, 0x1A3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x1A3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x21E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17736,7 +17740,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SL_SWOO: if (target != nullptr) { g_soundMgr->PlayWave("effect\\T_슈웃.wav", 0.0f, -50.0f, 0.0f, 250, 40, 1.0f, 0); - target->SendMsg(nullptr, 0x6D, 0, 0x1A4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x1A4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x24D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -17744,16 +17748,16 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case SL_SKE: if (target != nullptr) { g_soundMgr->PlayWave("effect\\T_공격력.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - target->SendMsg(nullptr, 0x6D, 0, 0x1AB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1AB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x1AB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case SL_SKA: if (target != nullptr) { g_soundMgr->PlayWave("effect\\T_방어형.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); - target->SendMsg(nullptr, 0x6D, 0, 0xFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - target->SendMsg(nullptr, 0x6D, 0, 0x46C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x46C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0xFE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x46C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x105, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -17801,7 +17805,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x273, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -17830,10 +17834,10 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case MB_M_TELEPORT: if (source != nullptr) { - source->SendMsg(nullptr, 0x3F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (target != nullptr) { - target->SendMsg(nullptr, 0x3F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x158, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; @@ -17903,9 +17907,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (target != nullptr) { vector3d offset{0.0f, static_cast(target->render.accountId), 0.0f}; if (CRagEffect* effect = target->LaunchEffect(0x1F7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&offset), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&offset), 0, 0, 0, 0); } - target->SendMsg(nullptr, 109, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x1A8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; @@ -17965,7 +17969,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr && target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x41C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -17978,7 +17982,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case NPC_MANDRAGORA: if (source != nullptr) { source->LaunchEffect(0x376, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\G하울링오브만드라고라.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } break; @@ -18034,18 +18038,18 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t g_soundMgr->PlayWave("amon_ra_die01.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); if (CRagEffect* effect = source->LaunchEffect(0x25E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; case DC_WINKCHARM: if (source != nullptr && target != nullptr) { const std::int64_t emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::Chup); - source->SendMsg(nullptr, 160, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\vallentine.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); if (CRagEffect* effect = source->LaunchEffect(0x25F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18079,7 +18083,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case GC_COUNTERSLASH: if (source != nullptr) { - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\mon_맹룡과강.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); g_effectMgr->Spawn(source->render.accountId, 0x570, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); if (!g_serviceOptions.Get(0xE5)) { @@ -18238,7 +18242,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr && target != nullptr) { if (CRagEffect* effect = source->LaunchEffect(0x2EF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18282,7 +18286,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t const short index = static_cast(std::max(std::rand() % 36, 0) + count * 36); position.x += g_cosTable[index] * 80.0f; position.z += g_sinTable[index] * 80.0f; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } g_soundMgr->PlayWave("jack_frost.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -18331,7 +18335,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t break; case RK_DRAGONHOWLING: if (source != nullptr) { - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); source->LaunchEffect(0x2DB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("dragon_h.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } @@ -18360,7 +18364,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t source->LaunchEffect(0x11, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } if (target != nullptr) { - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\mon_맹룡과강.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); target->LaunchEffect(0x107, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x14A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -18419,7 +18423,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t CRagEffect* effect = target->LaunchEffect(0x341, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); vector3d scale{2.0f, 0.0f, 0.0f}; if (effect) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&scale), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&scale), 0, 0, 0, 0); } } } @@ -18506,7 +18510,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t g_soundMgr->PlayWave("effect\\S포이즌버스터.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); vector3d position{0.0f, static_cast(target->render.accountId), 0.0f}; if (CRagEffect* effect = target->LaunchEffect(0x3A3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18542,7 +18546,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t g_soundMgr->PlayWave("effect\\S바큠익스트림.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); if (CRagEffect* effect = target->LaunchEffect(0xD8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18556,7 +18560,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr) { g_effectMgr->Spawn(source->render.accountId, 0x667, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); g_effectMgr->Spawn(source->render.accountId, 0x668, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\G하울링오브만드라고라.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } break; @@ -18565,7 +18569,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t source->LaunchEffect(0x376, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (CRagEffect* effect = source->LaunchEffect(0x1B7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\G스포어익스플로젼.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } } @@ -18649,7 +18653,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t CRagEffect* effect = source->LaunchEffect(0x37C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\SR_CRESCENTELBOW.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } } @@ -18701,12 +18705,12 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t position.y = static_cast(target->render.accountId); CRagEffect* targetEffect = target->LaunchEffect(0x351, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (targetEffect != nullptr) { - targetEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + targetEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } position.y = static_cast(source->render.accountId); CRagEffect* sourceEffect = source->LaunchEffect(0x351, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (sourceEffect != nullptr) { - sourceEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + sourceEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } g_soundMgr->PlayWave("effect\\하모나이즈.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } @@ -18786,7 +18790,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t CRagEffect* effect = target->LaunchEffect(0x334, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18799,7 +18803,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (position.y != 0.0f && position.x != 0.0f && source != nullptr) { CRagEffect* effect = source->LaunchEffect(0x333, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -18986,7 +18990,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr) { source->LaunchEffect(0x1BE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); while (source->HasId(0x430)) { - source->SendMsg(nullptr, 0x6D, 0, 0x430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -19011,7 +19015,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t source->LaunchEffect(0x1BE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_effectMgr->Spawn(source->render.accountId, 0x4B3, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); while (source->HasId(0x1BD)) { - source->SendMsg(nullptr, 0x6D, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -19032,7 +19036,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr) { vector3d data{0.0f, static_cast(source->render.accountId), 0.0f}; if (CRagEffect* effect = target->LaunchEffect(0x4BA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&data), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&data), 0, 0, 0, 0); } } target->LaunchEffect(0x197, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -19045,9 +19049,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x1F7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { vector3d data{0.0f, static_cast(target->render.accountId), 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&data), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&data), 0, 0, 0, 0); } - target->SendMsg(nullptr, 0x6D, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); target->LaunchEffect(0x1A8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); switch (skillId) { case SP_SOULGOLEM: @@ -19117,7 +19121,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t vector3d position = source->render.position; if (CRagEffect* effect = source->LaunchEffect(0x439, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { const std::int64_t value = reinterpret_cast(&position); - effect->SendMsg(nullptr, 0x2C, 0, 0xFFFF, 0x422, 0, static_cast(value), static_cast(value >> 32)); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x422, 0, static_cast(value), static_cast(value >> 32)); } } break; @@ -19197,7 +19201,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t if (source != nullptr) { source->LaunchEffect(0x1BE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); while (source->HasId(0x1BD)) { - source->SendMsg(nullptr, 0x6D, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } source->LaunchEffect(0x19B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -19802,7 +19806,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case ABC_STRIP_SHADOW: if (target != nullptr) { if (CRagEffect* effect = target->LaunchEffect(0x1EF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } break; @@ -19847,7 +19851,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t effectId = 7; } target->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - target->SendMsg(nullptr, 0x58, 0, level, level >> 31, static_cast(0xFF00FF00), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_NUMBER, 0, level, level >> 31, static_cast(0xFF00FF00), 0, 0x72, 0, 0, 0, 0, 0, 0, 0); } break; case MH_SILENT_BREEZE: @@ -19891,7 +19895,7 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case MS_PARRYING: case ML_AUTOGUARD: if (source != nullptr) { - source->SendMsg(nullptr, 0x7E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_MAKE_GUARD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case CR_DEFENDER: @@ -19904,9 +19908,9 @@ void CGameMode::ReceiveSkillUse(std::uint16_t skillId, int level, std::uint32_t case LK_FURY: case MS_BERSERK: if (source != nullptr) { - source->SendMsg(nullptr, 0x6D, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + source->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); source->LaunchEffect(0x170, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\버서크.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } break; @@ -20120,13 +20124,13 @@ static_assert(offsetof(CameraInfoPacket, pitch) == 0x0B); void CGameMode::HandleCameraInfo(const unsigned char* data) { const CameraInfoPacket* packet = reinterpret_cast(data); if (packet->action == 1) { - UIWindow* window = g_windowMgr.LookupWindow(289); + UIWindow* window = g_windowMgr.LookupWindow(WID_VIEWCAMERAINFOWND); if (window == nullptr) { - window = g_windowMgr.EnsureWindow(289); + window = g_windowMgr.EnsureWindow(WID_VIEWCAMERAINFOWND); } g_session.unknown_61B1 = g_session.unknown_61B1 == 0; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(g_session.unknown_61B1 == 1 ? "Camera Info On" : "Camera Info Off"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_session.unknown_61B1 == 1 ? "Camera Info On" : "Camera Info Off"), 0x64FFFF, 0, 0, 0); window->Show(g_session.unknown_61B1); } else if (this->camera != nullptr) { this->camera->camera.desiredDistance = packet->distance; @@ -20308,7 +20312,7 @@ void CGameMode::ProcessIncomingPackets() { if (!g_replayAnimationScaling) { const std::uint32_t elapsedHours = (timeGetTime() - g_loginAcceptTime) / 3600000; if (!GetRagConnection().Update()) { - g_modeMgr.gameMode->SendMsg(1, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SOCKETERROR, 0, 0, 0, 0); } if (g_charServerAccountIdPending == 1) { @@ -20322,11 +20326,11 @@ void CGameMode::ProcessIncomingPackets() { const int replayState = Replay::Instance().state; if (replayState == 7) { - g_windowMgr.window_4F168->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.window_4F168->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } else if (replayState == 2) { Replay::Instance().WriteHeader(12); if (g_windowMgr.window_4F164) { - g_windowMgr.window_4F164->SendMsg(nullptr, 116, 0, 0, 0, 0); + g_windowMgr.window_4F164->SendMsg(nullptr, UM_UPDATE_RECORD_TIME, 0, 0, 0, 0); } } @@ -21588,7 +21592,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.SyncServerTime(path.tick); if (actor) { const int pathAddress = reinterpret_cast(&path); - actor->SendMsg(nullptr, 0, 0, pathAddress, pathAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MOVE, 0, pathAddress, pathAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -21598,7 +21602,7 @@ void CGameMode::ProcessIncomingPackets() { DecodeSrcDst(g_gameModePacketBuffer + 6, &path.srcX, &path.srcY, &path.dstX, &path.dstY, &path.subX, &path.subY); g_session.SyncServerTime(path.tick); const int pathAddress = reinterpret_cast(&path); - this->scene->player->SendMsg(nullptr, 0, 0, pathAddress, pathAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_MOVE, 0, pathAddress, pathAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_STOPMOVE: { @@ -21639,7 +21643,7 @@ void CGameMode::ProcessIncomingPackets() { } } const int actAddress = reinterpret_cast(&act); - actor->SendMsg(nullptr, 11, 0, actAddress, actAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_ACTION, 0, actAddress, actAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case 0x93: @@ -21671,7 +21675,7 @@ void CGameMode::ProcessIncomingPackets() { } } actor->render.angle = static_cast(45 * (packet->direction + 4)); - actor->SendMsg(nullptr, 100, 0, packet->headDirection, packet->headDirection >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_SET_HEAD_DIR, 0, packet->headDirection, packet->headDirection >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_ITEM_ENTRY: @@ -21698,7 +21702,7 @@ void CGameMode::ProcessIncomingPackets() { } const int entryAddress = reinterpret_cast(&entry); - item->SendMsg(nullptr, 4, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + item->SendMsg(nullptr, AM_INITSTANDENTRY, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_ITEM_DISAPPEAR: { @@ -21761,7 +21765,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0xa5: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(NormalItemRecord); const NormalItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); for (int i = 0; i < count; ++i, ++record) { @@ -21782,7 +21786,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0xa6: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(EquipItemRecord); const EquipItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); for (int i = 0; i < count; ++i, ++record) { @@ -21809,7 +21813,7 @@ void CGameMode::ProcessIncomingPackets() { if (item.unknown_0000[1]) { g_session.RemoveItem1710(packet->index, item.quantity - packet->amount); if (item.IsAboveItemId600()) { - this->scene->player->SendMsg(nullptr, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_USEITEM_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -21822,7 +21826,7 @@ void CGameMode::ProcessIncomingPackets() { switch (packet[8]) { case ACK_REQ_EQUIP_FAILURE: case ACK_REQ_EQUIP_FAILURE_LEVEL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(372)), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(372)), 0xFF, 7, 0, 0); break; case ACK_REQ_EQUIP_SUCCESS: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *reinterpret_cast(packet + 2)); @@ -21860,7 +21864,7 @@ void CGameMode::ProcessIncomingPackets() { const std::int16_t amount = *reinterpret_cast(packet + 4); ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, index); if (item.unknown_0000[1] && amount > 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(1609), item.DisplayName(0).c_str(), amount).c_str()), + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(1609), item.DisplayName(0).c_str(), amount).c_str()), 0xFFFF00, 6, 0, 0); } g_session.RemoveItem1710(index, amount); @@ -21886,7 +21890,7 @@ void CGameMode::ProcessIncomingPackets() { this->unknown_024C = 1; this->unknown_02DC = *reinterpret_cast(packet + 4); unsigned int length = *reinterpret_cast(packet + 2) - 8; - UIWindow *window = g_windowMgr.EnsureWindow(16); + UIWindow *window = g_windowMgr.EnsureWindow(WID_SAYDIALOGWND); char text[0x803]; if (g_serviceType == 10) { sprintf(text, "|%02x", LanguageCharset(31)); @@ -21896,13 +21900,13 @@ void CGameMode::ProcessIncomingPackets() { memcpy(text, packet + 8, length); } text[length] = 0; - window->SendMsg(nullptr, 26, reinterpret_cast(text), *reinterpret_cast(packet + 4), 0, 0); + window->SendMsg(nullptr, UM_SETSAYDIALOG, reinterpret_cast(text), *reinterpret_cast(packet + 4), 0, 0); break; } case ID_ZC_WAIT_DIALOG: this->unknown_024C = 1; this->unknown_02DC = *reinterpret_cast(g_gameModePacketBuffer + 2); - g_windowMgr.EnsureWindow(16)->SendMsg(nullptr, 25, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SAYDIALOGWND)->SendMsg(nullptr, UM_ENABLENEXTBUTTON, 0, 0, 0, 0); break; case ID_ZC_EMOTION: { const std::uint32_t aid = *reinterpret_cast(g_gameModePacketBuffer + 2); @@ -21916,7 +21920,7 @@ void CGameMode::ProcessIncomingPackets() { } } const int emotion = g_gameModePacketBuffer[6]; - actor->SendMsg(nullptr, 160, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, emotion, emotion >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_USER_COUNT: { @@ -21926,16 +21930,16 @@ void CGameMode::ProcessIncomingPackets() { } else { sprintf(text, LookupMessage(178), *reinterpret_cast(g_gameModePacketBuffer + 2)); } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); break; } case ID_ZC_SELECT_DEALTYPE: this->unknown_024C = 1; - g_windowMgr.EnsureWindow(25)->SendMsg(nullptr, 28, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(23); - g_windowMgr.CloseWindow(24); + g_windowMgr.EnsureWindow(WID_CHOOSESELLBUYWND)->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); break; case ID_ZC_PC_PURCHASE_ITEMLIST_00c6: { g_session.ClearTradeItems(); @@ -21953,74 +21957,74 @@ void CGameMode::ProcessIncomingPackets() { g_session.AddItem1718(item, 0); } - UIWindow *buyWindow = g_windowMgr.EnsureWindow(22); - buyWindow->SendMsg(nullptr, 36, 0, 0, 0, 0); - buyWindow->SendMsg(nullptr, 23, 0, 0, 0, 0); - UIWindow *sellWindow = g_windowMgr.EnsureWindow(23); - sellWindow->SendMsg(nullptr, 36, 0, 0, 0, 0); - sellWindow->SendMsg(nullptr, 23, 0, 0, 0, 0); + UIWindow *buyWindow = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); + buyWindow->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + buyWindow->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + UIWindow *sellWindow = g_windowMgr.EnsureWindow(WID_ITEMPURCHASEWND); + sellWindow->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + sellWindow->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } case ID_ZC_PC_SELL_RESULT: switch (g_gameModePacketBuffer[2]) { case SELL_SUCCEED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; case SELL_FAIL: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(57)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(57)), 0xFF, 0, 0, 0); break; } g_session.ClearTradeItems(); - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(24); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); break; case ID_ZC_ACK_DISCONNECT_CHARACTER: { char text[80]; sprintf(text, LookupMessage(g_gameModePacketBuffer[2] == 0 ? 152 : 151)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x32FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x32FF, 0, 0, 0); break; } case ID_ZC_SETTING_WHISPER_STATE: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { case WT_EXCLUDE_WHISPER: switch (g_gameModePacketBuffer[3]) { case WHISPER_SETTING_SUCCEED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3427)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3427)), 0xFFFF, 0, 0, 0); break; case WHIPSER_SETTING_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3428)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3428)), 0xFFFF, 0, 0, 0); break; } break; case WT_INCLUDE_WHISPER: switch (g_gameModePacketBuffer[3]) { case WHISPER_SETTING_SUCCEED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3429)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3429)), 0xFFFF, 0, 0, 0); break; case WHIPSER_SETTING_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3430)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3430)), 0xFFFF, 0, 0, 0); break; } break; } break; case ID_ZC_WHISPER_LIST: { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const int length = *reinterpret_cast(g_gameModePacketBuffer + 2); const int count = (length - 4) / 24; char name[25]; name[24] = '\0'; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(count != 0 ? 3396 : 3395)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(count != 0 ? 3396 : 3395)), 0xFFFF00, 0, 0, 0); for (int i = 0; i < count; ++i) { if (i * 24 + 4 > length) { break; } std::memcpy(name, g_gameModePacketBuffer + 4 + i * 24, 24); - g_windowMgr.SendNotice(1, reinterpret_cast(name), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(name), 0xFFFF00, 0, 0, 0); } break; } @@ -22028,33 +22032,33 @@ void CGameMode::ProcessIncomingPackets() { this->unknown_00FC = 0; switch (g_gameModePacketBuffer[2]) { case ENTERROOM_FULL: { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(64)), 0xFFFF00, 0, 0, 0); - UIWindow *window = g_windowMgr.EnsureWindow(28); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(64)), 0xFFFF00, 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_CHATROOMWND); this->unknown_03FC = 1; - window->SendMsg(nullptr, 34, reinterpret_cast(&this->unknown_03C8), 0, 0, 0); - window->SendMsg(nullptr, 43, 0, 0, 0, 0); - window->SendMsg(nullptr, 44, reinterpret_cast(g_session.DecodePlayerName()), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&this->unknown_03C8), 0, 0, 0); + window->SendMsg(nullptr, UM_CLEARMEMBER, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDMEMBER, reinterpret_cast(g_session.DecodePlayerName()), 0, 0, 0); break; } case ENTERROOM_WRONG_PASSWORD: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(65)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(65)), 0xFF, 0, 0, 0); break; case ENTERROOM_KICKED: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(66)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(66)), 0xFF, 0, 0, 0); break; } break; case ID_ZC_DESTROY_ROOM: { const std::uint32_t roomId = *reinterpret_cast(g_gameModePacketBuffer + 2); if (CRenderObject *actor = this->scene->GetGameActorByAID(this->unknown_01AC[roomId])) { - actor->SendMsg(nullptr, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_CHAT_TITLE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_windowMgr.window_027C && static_cast(g_windowMgr.window_027C)->roomStatus.roomId == static_cast(roomId)) { - g_windowMgr.CloseWindow(28); - g_windowMgr.CloseWindow(30); + g_windowMgr.CloseWindow(WID_CHATROOMWND); + g_windowMgr.CloseWindow(WID_CHATROOMCHANGEWND); } break; } @@ -22063,15 +22067,15 @@ void CGameMode::ProcessIncomingPackets() { std::memcpy(name, g_gameModePacketBuffer + 4, 24); name[24] = '\0'; g_session.DecodePlayerName(); - UIChatRoomWnd *window = static_cast(g_windowMgr.EnsureWindow(28)); + UIChatRoomWnd *window = static_cast(g_windowMgr.EnsureWindow(WID_CHATROOMWND)); ChatRoomMemberUpdateInfo info{window->title, window->unknown_00CC, window->roomStatus.roomType, window->roomStatus.memberCount, window->roomStatus.memberLimit, window->roomStatus.roomId}; info.memberCount = *reinterpret_cast(g_gameModePacketBuffer + 2); - window->SendMsg(nullptr, 34, reinterpret_cast(&info), 0, 0, 0); - window->SendMsg(nullptr, 44, reinterpret_cast(name), 1, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDMEMBER, reinterpret_cast(name), 1, 0, 0); char text[128]; sprintf(text, LookupMessage(179), name); - g_windowMgr.SendNotice(5, reinterpret_cast(text), 0x808000, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(text), 0x808000, 0, 0, 0); break; } case ID_ZC_MEMBER_EXIT: { @@ -22079,85 +22083,85 @@ void CGameMode::ProcessIncomingPackets() { std::memcpy(name, g_gameModePacketBuffer + 4, 24); name[24] = '\0'; if (strcmp(g_session.DecodePlayerName(), name) == 0) { - g_windowMgr.CloseWindow(28); - g_windowMgr.CloseWindow(30); + g_windowMgr.CloseWindow(WID_CHATROOMWND); + g_windowMgr.CloseWindow(WID_CHATROOMCHANGEWND); break; } - UIChatRoomWnd *window = static_cast(g_windowMgr.EnsureWindow(28)); + UIChatRoomWnd *window = static_cast(g_windowMgr.EnsureWindow(WID_CHATROOMWND)); ChatRoomMemberUpdateInfo info{window->title, window->unknown_00CC, window->roomStatus.roomType, window->roomStatus.memberCount, window->roomStatus.memberLimit, window->roomStatus.roomId}; info.memberCount = *reinterpret_cast(g_gameModePacketBuffer + 2); - window->SendMsg(nullptr, 34, reinterpret_cast(&info), 0, 0, 0); - window->SendMsg(nullptr, 45, reinterpret_cast(name), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_MEMBER_EXIT, reinterpret_cast(name), 0, 0, 0); char text[128]; switch (g_gameModePacketBuffer[0x1C]) { case ROOMEXITTYPE_EXIT: sprintf(text, LookupMessage(180), name); - g_windowMgr.SendNotice(5, reinterpret_cast(text), 0x80, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(text), 0x80, 0, 0, 0); break; case ROOMEXITTYPE_EXPEL: sprintf(text, LookupMessage(181), name); - g_windowMgr.SendNotice(5, reinterpret_cast(text), 0x80, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(text), 0x80, 0, 0, 0); break; } break; } case ID_ZC_ROLE_CHANGE: { - UIWindow *window = g_windowMgr.EnsureWindow(28); + UIWindow *window = g_windowMgr.EnsureWindow(WID_CHATROOMWND); char name[25]; std::memcpy(name, g_gameModePacketBuffer + 6, 24); name[24] = '\0'; - window->SendMsg(nullptr, 46, reinterpret_cast(name), *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0); + window->SendMsg(nullptr, UM_ROLE_CHANGE, reinterpret_cast(name), *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0); break; } case ID_ZC_REQ_EXCHANGE_ITEM_00e5: { if (g_serviceOptions.Get(136)) { - g_modeMgr.gameMode->SendMsg(50, 4, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ACK_EXCHANGE_ITEM, 4, 0, 0, 0); break; } char name[25]; std::memcpy(name, g_gameModePacketBuffer + 2, 24); name[24] = '\0'; - g_windowMgr.EnsureWindow(32)->SendMsg(nullptr, 50, reinterpret_cast(name), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_EXCHANGEACCEPTWND)->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(name), 0, 0, 0); this->exchangeName.assign(name, strlen(name)); break; } case ID_ZC_CONCLUDE_EXCHANGE_ITEM: - if (UIWindow *window = g_windowMgr.LookupWindow(10011)) { + if (UIWindow *window = g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { switch (g_gameModePacketBuffer[2]) { case EXI_CONCLUDE_ME: - window->SendMsg(nullptr, 51, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_MYDRAGCLOSED, 0, 0, 0, 0); break; case EXI_CONCLUDE_OTHER: - window->SendMsg(nullptr, 52, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_OTHERDRAGCLOSED, 0, 0, 0, 0); break; } } break; case ID_ZC_CANCEL_EXCHANGE_ITEM: *reinterpret_cast(&this->unknown_0100[0x00]) = 0; - this->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.CloseWindow(10011); - g_windowMgr.CloseWindow(32); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_EXCHANGEUI); + g_windowMgr.CloseWindow(WID_EXCHANGEACCEPTWND); *reinterpret_cast(&this->unknown_0100[0x14]) = 0; g_session.ResetSlots(); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(74)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(74)), 0xFF, 0, 0, 0); break; case ID_ZC_EXEC_EXCHANGE_ITEM: - this->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.CloseWindow(10011); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + this->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_EXCHANGEUI); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { case EXITEM_EXCHANGE_SUCCEED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(75)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(75)), 0xFFFF00, 0, 0, 0); break; case EXITEM_EXCHANGE_FAILED: *reinterpret_cast(&this->unknown_0100[0x14]) = 0; g_session.ResetSlots(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(76)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(76)), 0xFF, 0, 0, 0); break; } break; @@ -22166,7 +22170,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.ResetSlots(); break; case ID_ZC_NOTIFY_STOREITEM_COUNTINFO: - g_windowMgr.EnsureWindow(33)->SendMsg(nullptr, 55, *reinterpret_cast(g_gameModePacketBuffer + 2), + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND)->SendMsg(nullptr, UM_SETCOUNTINFO, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0); break; case ID_ZC_DELETE_ITEM_FROM_STORE: { @@ -22178,24 +22182,24 @@ void CGameMode::ProcessIncomingPackets() { break; } case ID_ZC_CLOSE_STORE: - g_windowMgr.CloseWindow(33); + g_windowMgr.CloseWindow(WID_ITEMSTOREWND); g_session.ClearItems1738(); break; case ID_ZC_ACK_MAKE_GROUP: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { case GROUP_MAKE_SUCCEED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(77)), 0xFFFF00, 0, 0, 0); - g_windowMgr.EnsureWindow(34); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(77)), 0xFFFF00, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_MESSENGERGROUPWND); break; case GROUP_MAKE_FAILED_SAMENAME: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(78)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(78)), 0xFF, 0, 0, 0); break; case GROUP_MAKE_FAILED_ALEADY_GROUP_MEMBER: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(79)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(79)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1387)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1387)), 0xFF, 0, 0, 0); break; } break; @@ -22209,16 +22213,16 @@ void CGameMode::ProcessIncomingPackets() { g_forbiddenWords.Mask(name, &masked); } g_session.unknown_54C4.assign(name, strlen(name)); - g_windowMgr.EnsureWindow(35)->SendMsg(nullptr, 56, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); + g_windowMgr.EnsureWindow(WID_JOINPARTYACCEPTWND)->SendMsg(nullptr, UM_SET_JOIN_PARTY_MSG, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); break; } case ID_ZC_GROUPINFO_CHANGE: { char text[128]; g_session.unknown_54A0 = *reinterpret_cast(g_gameModePacketBuffer + 2); if (g_windowMgr.unknown_030C) { - g_windowMgr.unknown_030C->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.unknown_030C->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (g_session.unknown_54A0 == 0 || g_session.unknown_54A0 == 1) { sprintf(text, "%s - %s : %s", LookupMessage(291), LookupMessage(292), LookupMessage(g_session.unknown_54A0 == 0 ? 287 : 288)); } else if (g_session.unknown_54A0 == 2) { @@ -22226,7 +22230,7 @@ void CGameMode::ProcessIncomingPackets() { } else { break; } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 12, 0, 0); break; } case ID_ZC_NOTIFY_HP_TO_GROUPM_0106: { @@ -22237,17 +22241,17 @@ void CGameMode::ProcessIncomingPackets() { const int hp = *reinterpret_cast(g_gameModePacketBuffer + 6); const int maxHp = *reinterpret_cast(g_gameModePacketBuffer + 8); if (CRenderObject *actor = this->scene->GetGameActorByAID(aid)) { - actor->SendMsg(nullptr, 34, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, aid, hp, maxHp); + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, aid, hp, maxHp); } g_windowMgr.NotifyItemWindows(aid, hp, maxHp); break; } case ID_ZC_NOTIFY_POSITION_TO_GROUPM: { const unsigned char *packet = g_gameModePacketBuffer; - this->SendMsg(63, *reinterpret_cast(packet + 2), *reinterpret_cast(packet + 6), + this->SendMsg(MM_ADDPARTYPOS, *reinterpret_cast(packet + 2), *reinterpret_cast(packet + 6), *reinterpret_cast(packet + 8), 0); break; } @@ -22259,9 +22263,9 @@ void CGameMode::ProcessIncomingPackets() { item.itemId.assign(itemId, strlen(itemId)); item.unknown_0060 = 0; item.identified = 0; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const char *suffix = LookupMessage(144); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s%s", LookupMessage(143), item.DisplayName(0).c_str(), suffix).c_str()), + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", LookupMessage(143), item.DisplayName(0).c_str(), suffix).c_str()), 0xFFFF00, 0, 0, 0); break; } @@ -22269,22 +22273,22 @@ void CGameMode::ProcessIncomingPackets() { char text[256]; memset(text, 0, sizeof(text)); StringFormat(text, 256, static_cast(-1), "%s%s", LookupMessage(145), LookupMessage(146)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); break; } case ID_ZC_MVP: { const std::uint32_t aid = *reinterpret_cast(g_gameModePacketBuffer + 2); if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_MVP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (CRenderObject *actor = this->scene->GetGameActorByAID(aid)) { - actor->SendMsg(nullptr, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MVP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } case ID_ZC_THROW_MVPITEM: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(147)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(147)), 0xFF, 0, 0, 0); break; case ID_ZC_SKILLINFO_LIST: case ID_ZC_HOSKILLINFO_LIST: @@ -22331,18 +22335,18 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(&g_session.unknown_0F0C[0x04]) = state[2]; g_session.m_jobFlags = state[1]; if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (g_session.unknown_5C1C <= 0) { g_session.ClearItems1740(); - g_windowMgr.CloseWindow(40); + g_windowMgr.CloseWindow(WID_MERCHANTITEMWND); } } else { actor = this->scene->GetGameActorByAID(aid); } if (actor) { const int stateAddress = reinterpret_cast(state); - actor->SendMsg(nullptr, 43, 0, stateAddress, stateAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_ATTR_STATE_CHANGE, 0, stateAddress, stateAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -22353,35 +22357,35 @@ void CGameMode::ProcessIncomingPackets() { break; } case ID_ZC_WARPLIST_011c: { - g_windowMgr.CloseWindow(39); - UIWindow *window = g_windowMgr.EnsureWindow(39); - window->SendMsg(nullptr, 59, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWARPWND); + UIWindow *window = g_windowMgr.EnsureWindow(WID_CHOOSEWARPWND); + window->SendMsg(nullptr, UM_SETSKID, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); const char *name = reinterpret_cast(g_gameModePacketBuffer + 4); for (unsigned int i = 0; i < 4; ++i, name += 16) { if (strlen(name)) { - window->SendMsg(nullptr, 27, reinterpret_cast(name), 0, 0, 0); + window->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast(name), 0, 0, 0); } } - window->SendMsg(nullptr, 27, reinterpret_cast("cancel"), 0, 0, 0); + window->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast("cancel"), 0, 0, 0); break; } case ID_ZC_ACK_REMEMBER_WARPPOINT: switch (g_gameModePacketBuffer[2]) { case WARPPOINT_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(217)), 0xFFFF00, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(217)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(217)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(217)), 0xFFFF00, 0, 0, 0); break; case WARPPOINT_LOW_LEVEL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(214)), 0xFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(214)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(214)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(214)), 0xFF, 0, 0, 0); break; case WARPPOINT_NOT_LEARNED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(216)), 0xFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(216)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(216)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(216)), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2535)), 0xFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(2535)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2535)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(2535)), 0xFF, 0, 0, 0); break; } break; @@ -22394,7 +22398,7 @@ void CGameMode::ProcessIncomingPackets() { if (it == this->spriteMirrorActorIds.end()) { this->scene->RemoveSkill(aid); } else if (this->scene->RemoveItem(aid) == true) { - this->SendMsg(13, aid, 0, 0, 0); + this->SendMsg(MM_DELETEREGISTERPOS, aid, 0, 0, 0); this->spriteMirrorActorIds.erase(it); } break; @@ -22406,7 +22410,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.cartWeight = *reinterpret_cast(packet + 6) / 10; g_session.cartMaxWeight = *reinterpret_cast(packet + 0x0A) / 10; if (g_windowMgr.unknown_02F4) { - g_windowMgr.unknown_02F4->SendMsg(nullptr, 55, 0, 0, 0, 0); + g_windowMgr.unknown_02F4->SendMsg(nullptr, UM_SETCOUNTINFO, 0, 0, 0, 0); } break; } @@ -22473,24 +22477,24 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_CARTOFF: g_session.ClearItems1740(); - g_windowMgr.CloseWindow(40); + g_windowMgr.CloseWindow(WID_MERCHANTITEMWND); break; case ID_ZC_ACK_ADDITEM_TO_CART: switch (g_gameModePacketBuffer[2]) { case ADDITEM_TO_CART_FAIL_WEIGHT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 0xFF, 0, 0, 0); break; case ADDITEM_TO_CART_FAIL_COUNT: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(221)), 0xFF, 0, 0, 0); break; } break; case ID_ZC_OPENSTORE: { CGameMode *mode = static_cast(g_modeMgr.GetGameMode()); if (mode && mode->drag.source != 0) { - this->SendMsg(81, 0, 0, 0, 0); + this->SendMsg(MM_REQ_CLOSESTORE, 0, 0, 0, 0); break; } @@ -22503,8 +22507,8 @@ void CGameMode::ProcessIncomingPackets() { g_session.ClearItems1768(); if (g_windowMgr.window_027C || g_windowMgr.window_0274) { g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(81, 0, 0, 0, 0); - } else if (UIMerchantShopMakeWnd *window = static_cast(g_windowMgr.EnsureWindow(41))) { + this->SendMsg(MM_REQ_CLOSESTORE, 0, 0, 0, 0); + } else if (UIMerchantShopMakeWnd *window = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTSHOPMAKEWND))) { window->AddActionButton(); } break; @@ -22515,13 +22519,13 @@ void CGameMode::ProcessIncomingPackets() { title[80] = 0; if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { const int titleAddress = reinterpret_cast(title); - actor->SendMsg(nullptr, 55, 0, titleAddress, titleAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_SHOP_TITLE, 0, titleAddress, titleAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } case ID_ZC_DISAPPEAR_ENTRY: if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { - actor->SendMsg(nullptr, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_SHOP_TITLE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case ID_ZC_DELETEITEM_FROM_MCSTORE_0137: @@ -22535,12 +22539,12 @@ void CGameMode::ProcessIncomingPackets() { if (CRenderObject *actor = this->scene->GetGameActorByAID(aid)) { const int x = *reinterpret_cast(packet + 6); const int y = *reinterpret_cast(packet + 8); - actor->SendMsg(nullptr, 61, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CORRECT_POS, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } const int playerX = *reinterpret_cast(packet + 0x0A); const int playerY = *reinterpret_cast(packet + 0x0C); - this->scene->player->SendMsg(nullptr, 61, 0, playerX, playerX >> 31, playerY, playerY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); - this->scene->player->SendMsg(nullptr, 60, 0, aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_CORRECT_POS, 0, playerX, playerX >> 31, playerY, playerY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_RESUMEPROCEEDATTACK, 0, aid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_ATTACK_RANGE: @@ -22568,7 +22572,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_OPEN_EDITDLG: { const std::uint32_t aid = *reinterpret_cast(g_gameModePacketBuffer + 2); if (this->scene->GetGameActorByAID(aid)) { - g_windowMgr.EnsureWindow(56)->SendMsg(nullptr, 28, aid, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_NPCEDITDIALOGWND)->SendMsg(nullptr, UM_SETNAID, aid, 0, 0, 0); } break; } @@ -22595,7 +22599,7 @@ void CGameMode::ProcessIncomingPackets() { if (index == 0xFF) { index = -1; } - this->SendMsg(100, reinterpret_cast(name), index, 0, 0); + this->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(name), index, 0, 0); break; } case ID_ZC_AUTORUN_SKILL: { @@ -22610,16 +22614,16 @@ void CGameMode::ProcessIncomingPackets() { skill.unknown_001C = *reinterpret_cast(packet + 0x0C); skill.unknown_0034 = skill.UseApAmount(*g_session.m_hotkeyScript, *reinterpret_cast(packet + 8)); g_session.m_skillBundle.UpdatePending(skill); - this->SendMsg(113, reinterpret_cast(&skill), skill.level, 1, -1); + this->SendMsg(MM_USING_SKILL, reinterpret_cast(&skill), skill.level, 1, -1); break; } case ID_ZC_RESURRECTION: { const std::uint32_t aid = *reinterpret_cast(g_gameModePacketBuffer + 2); if (CRenderObject *actor = this->scene->GetGameActorByAID(aid)) { - actor->SendMsg(nullptr, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_RESURRECTION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (aid == g_session.m_aid) { - this->scene->player->SendMsg(nullptr, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->scene->player->SendMsg(nullptr, AM_RESURRECTION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_024C = 0; this->unknown_0250 = 0; } @@ -22633,13 +22637,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_GIVE_MANNER_POINT: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case MP_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(854)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(854)), 0xFFFF00, 0, 0, 0); break; case MP_SUCCESS_BY_ADMIN: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(830)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(830)), 0xFFFF, 0, 0, 0); break; case MP_BYSELF: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(833)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(833)), 0xFFFF, 0, 0, 0); break; } break; @@ -22650,7 +22654,7 @@ void CGameMode::ProcessIncomingPackets() { if (g_gameModePacketBuffer[2] == 0) { char text[128]; sprintf(text, LookupMessage(387), name); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF00, 0, 0, 0); } break; } @@ -22665,7 +22669,7 @@ void CGameMode::ProcessIncomingPackets() { if (g_guildInfo.m_guildId == guildId) { this->scene->player->SetGuildInfo(guildId, version); if (g_windowMgr.window_0320) { - g_windowMgr.window_0320->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.window_0320->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } break; @@ -22679,8 +22683,8 @@ void CGameMode::ProcessIncomingPackets() { g_guildInfo.SetMasterCharacterId(record[1]); } } - if (UIWindow *window = g_windowMgr.LookupWindow(61)) { - window->SendMsg(nullptr, 106, 0, 0, 0, 0); + if (UIWindow *window = g_windowMgr.LookupWindow(WID_GUILDMEMBERMANAGEWND)) { + window->SendMsg(nullptr, UM_SET_DISABLE, 0, 0, 0, 0); } g_windowMgr.RefreshGuildWindows(); break; @@ -22690,14 +22694,14 @@ void CGameMode::ProcessIncomingPackets() { case DISRESULT_SUCCESS: g_session.ClearAdditionalShortcutSkills(); g_guildInfo.Init(); - g_windowMgr.CloseWindow(59); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(400)), 0xFFFF, 4, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(400)), 0xFFFF, 4, 0, 0); break; case DISRESULT_INVALIDKEY: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(401)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(401)), 0xFFFF, 0, 0, 0); break; case DISRESULT_MEMBEREXIST: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(402)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(402)), 0xFFFF, 4, 0, 0); break; } break; @@ -22707,7 +22711,7 @@ void CGameMode::ProcessIncomingPackets() { reason[40] = 0; char text[1024]; sprintf(text, LookupMessage(367), reason); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 4, 0, 0); break; } case ID_ZC_GUILD_SKILLINFO: @@ -22716,42 +22720,42 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_RESULT_MAKE_GUILD: switch (g_gameModePacketBuffer[2]) { case GM_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(374)), 0xFFFF00, 4, 0, 0); - g_windowMgr.CloseWindow(214); - g_windowMgr.CloseWindow(213); - g_windowMgr.CloseWindow(212); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(374)), 0xFFFF00, 4, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDTIPWND); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_0); + g_windowMgr.CloseWindow(WID_GUILDHELPERWND); break; case GM_ALREADY_MEMBER: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(375)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(375)), 0xFFFF, 4, 0, 0); break; case GM_GUILD_EXIST: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(376)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(376)), 0xFFFF, 4, 0, 0); break; case GM_NONE_ITEM: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(405)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(405)), 0xFFFF, 4, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2687)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2687)), 0xFFFF, 4, 0, 0); break; } break; case ID_ZC_ACK_REQ_JOIN_GUILD: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { case REQJOINGUILD_ALREADY_OTHERGUILDM: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(378)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(378)), 0xFF, 4, 0, 0); break; case REQJOINGUILD_REJECT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(379)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(379)), 0xFF, 4, 0, 0); break; case REQJOINGUILD_ACCEPT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(380)), 0xFFFF00, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(380)), 0xFFFF00, 4, 0, 0); break; case REQJOINGUILD_OVERSIZE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(381)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(381)), 0xFF, 4, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2090)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2090)), 0xFF, 4, 0, 0); break; } break; @@ -22763,7 +22767,7 @@ void CGameMode::ProcessIncomingPackets() { std::string masked(""); g_forbiddenWords.Mask(name, &masked); } - g_windowMgr.EnsureWindow(70)->SendMsg(nullptr, 73, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); + g_windowMgr.EnsureWindow(WID_JOINGUILDACCEPTWND)->SendMsg(nullptr, UM_SET_JOIN_GUILD_MSG, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); break; } case ID_ZC_UPDATE_GDID_016c: { @@ -22777,11 +22781,11 @@ void CGameMode::ProcessIncomingPackets() { this->scene->player->SetGuildInfo(guildId, *reinterpret_cast(packet + 6)); if (g_guildInfo.unknown_00C8 == 0) { g_guildInfo.unknown_00C8 = 1; - g_modeMgr.gameMode->SendMsg(107, 3, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 3, 0, 0, 0); } if (g_guildInfo.unknown_00C0 == 0) { g_guildInfo.unknown_00C0 = 1; - g_modeMgr.gameMode->SendMsg(107, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 1, 0, 0, 0); } break; } @@ -22791,10 +22795,10 @@ void CGameMode::ProcessIncomingPackets() { g_guildInfo.SetMemberOnline(*reinterpret_cast(packet + 2), online); std::string name = LookupPlayerName(*reinterpret_cast(packet + 6)); if (name.size()) { - this->SendMsg(140, reinterpret_cast(name.c_str()), online, 0, 0); + this->SendMsg(MM_GUILD_MEMBER_STATUS_CHANGE, reinterpret_cast(name.c_str()), online, 0, 0); } if (online == 0) { - this->SendMsg(171, *reinterpret_cast(packet + 2), 0, 0, 0); + this->SendMsg(MM_DELETEGUILDPOS, *reinterpret_cast(packet + 2), 0, 0, 0); } break; } @@ -22806,87 +22810,87 @@ void CGameMode::ProcessIncomingPackets() { std::string masked(""); g_forbiddenWords.Mask(name, &masked); } - g_windowMgr.EnsureWindow(72)->SendMsg(nullptr, 74, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); + g_windowMgr.EnsureWindow(WID_ALLYGUILDACCEPTWND)->SendMsg(nullptr, UM_SET_ALLY_GUILD_MSG, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); break; } case ID_ZC_ACK_REQ_ALLY_GUILD: switch (g_gameModePacketBuffer[2]) { case REQALLYGUILD_ALREADY_ALLIED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(394)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(394)), 0xFFFF, 4, 0, 0); break; case REQALLYGUILD_REJECT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(395)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(395)), 0xFFFF, 4, 0, 0); break; case REQALLYGUILD_ACCEPT: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(396)), 0xFFFF00, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(396)), 0xFFFF00, 4, 0, 0); break; case REQALLYGUILD_OVERSIZE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(397)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(397)), 0xFFFF, 4, 0, 0); break; case REQMYGUILD_OVERSIZE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(398)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(398)), 0xFFFF, 4, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1717)), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1717)), 0xFFFF, 4, 0, 0); break; } break; case ID_ZC_ITEMIDENTIFY_LIST: { unsigned int count = (*reinterpret_cast(g_gameModePacketBuffer + 2) - 4u) >> 1; - UIWindow *window = g_windowMgr.EnsureWindow(73); - window->SendMsg(nullptr, 75, 0, 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_ITEMIDENTIFYWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); const std::int16_t *index = reinterpret_cast(g_gameModePacketBuffer + 4); for (; count != 0; --count, ++index) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *index); if (item.unknown_0000[1]) { - window->SendMsg(nullptr, 31, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); } } - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); break; } case ID_ZC_ACK_ITEMIDENTIFY: switch (g_gameModePacketBuffer[4]) { case ITEMIDENTIFY_SUCCESS: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(491)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(491)), 0xFFFF00, 0, 0, 0); ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *reinterpret_cast(g_gameModePacketBuffer + 2)); item.identified = 1; g_session.UpdateInventoryItem(item, 1); break; } case ITEMIDENTIFY_FAIL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(492)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(492)), 0xFF, 0, 0, 0); break; } break; case ID_ZC_ITEMCOMPOSITION_LIST: { unsigned int count = (*reinterpret_cast(g_gameModePacketBuffer + 2) - 4u) >> 1; - UIWindow *window = g_windowMgr.EnsureWindow(74); - window->SendMsg(nullptr, 75, 0, 0, 0, 0); - window->SendMsg(nullptr, 77, *reinterpret_cast(this->unknown_045C), 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_ITEMCOMPOSITIONWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SET_CARD_ITEM_INDEX, *reinterpret_cast(this->unknown_045C), 0, 0, 0); const std::int16_t *index = reinterpret_cast(g_gameModePacketBuffer + 4); for (; count != 0; --count, ++index) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *index); if (item.unknown_0000[1]) { - window->SendMsg(nullptr, 31, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); } } - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); break; } case ID_ZC_ACK_REQ_HOSTILE_GUILD: switch (g_gameModePacketBuffer[2]) { case RESULT_HOSTILE_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(495)), 0xFFFF00, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(495)), 0xFFFF00, 4, 0, 0); break; case RESULT_HOSTILE_OVERSIZE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(496)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(496)), 0xFF, 4, 0, 0); break; case RESULT_HOSTILE_ALREADY_HOSTILE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(497)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(497)), 0xFF, 4, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1718)), 0xFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1718)), 0xFF, 4, 0, 0); break; } break; @@ -22898,21 +22902,21 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_NOTIFY_MAPINFO: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case TELEPORT_IMPOSSIBLE_AREA: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(500)), 0xFF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(500)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(500)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(500)), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); break; case IMPOSSIBLE_AREA_SKILL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1334)), 0xFFFF00, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(1334)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1334)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(1334)), 0xFFFF00, 0, 0, 0); break; case IMPOSSIBLE_AREA_USEITEM: this->unknown_02CC = 0; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1335)), 0xFFFF00, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(1335)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1335)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(LookupMessage(1335)), 0xFFFF00, 0, 0, 0); break; } break; @@ -22920,17 +22924,17 @@ void CGameMode::ProcessIncomingPackets() { switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case DISCONNECTABLE_STATE: GetRagConnection().Close(); - this->SendMsg(2, 0, 0, 0, 0); + this->SendMsg(MM_QUIT, 0, 0, 0, 0); break; case NOTDISCONNECTABLE_STATE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(502)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(502)), 0xFF, 0, 0, 0); break; } break; case ID_ZC_MONSTER_INFO: { const std::uint16_t id = *reinterpret_cast(g_gameModePacketBuffer + 2); if (id != 1285 && id != 1286 && id != 1287 && id != 1829 && id != 1830) { - g_windowMgr.EnsureWindow(77)->SendMsg(nullptr, 79, reinterpret_cast(g_gameModePacketBuffer), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_MONSTERINFOWND)->SendMsg(nullptr, UM_SET_MONSTER_INFO, reinterpret_cast(g_gameModePacketBuffer), 0, 0, 0); } break; } @@ -22940,18 +22944,18 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); break; } - g_windowMgr.CloseWindow(79); - UIWindow *window = g_windowMgr.EnsureWindow(79); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); + UIWindow *window = g_windowMgr.EnsureWindow(WID_MAKETARGETLISTWND); const int *record = reinterpret_cast(g_gameModePacketBuffer + 4); for (; count != 0; --count, record += 4) { - window->SendMsg(nullptr, 31, *record, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, *record, 0, 0, 0); } break; } case ID_ZC_TALKBOX_CHATCONTENTS: if (CRenderObject *skill = this->scene->GetSkillByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { const int textAddress = reinterpret_cast(g_gameModePacketBuffer + 6); - skill->SendMsg(nullptr, 7, 0, textAddress, textAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_CHAT, 0, textAddress, textAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case ID_ZC_UPDATE_MAPINFO: { @@ -22981,7 +22985,7 @@ void CGameMode::ProcessIncomingPackets() { g_serviceOptions.Set(229, 1); break; case MAPPROPERTY_PKSERVERZONE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(855)), 0x9B9BFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(855)), 0x9B9BFF, 0, 0, 0); break; } if (g_session.GetMapProperty0F()) { @@ -22997,14 +23001,14 @@ void CGameMode::ProcessIncomingPackets() { std::int16_t &value = *reinterpret_cast(packet + 0x1B); if (value >= 10000) { value -= 10000; - if (UIItemCollectionWnd *window = static_cast(g_windowMgr.EnsureWindow(12))) { + if (UIItemCollectionWnd *window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND))) { window->unknown_0218 = value; window->unknown_021A = *reinterpret_cast(packet + 0x1D); window->unknown_021C = *reinterpret_cast(packet + 0x1F); window->unknown_0236 = *reinterpret_cast(packet + 0x21); window->unknown_0238 = packet[0x1A]; sprintf(reinterpret_cast(window->unknown_021E), reinterpret_cast(packet + 2)); - window->SendMsg(nullptr, 29, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTEXT, 0, 0, 0, 0); } break; } @@ -23025,16 +23029,16 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_PETEGG_LIST: { const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) >> 1; - UIWindow *window = g_windowMgr.EnsureWindow(90); - window->SendMsg(nullptr, 75, 0, 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_PETEGGLISTWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); const std::int16_t *index = reinterpret_cast(g_gameModePacketBuffer + 4); for (int i = 0; i < count; ++i, ++index) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *index); if (item.unknown_0000[1]) { - window->SendMsg(nullptr, 31, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(item.itemId.c_str()), item.unknown_0000[1], 0, 0); } } - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); break; } case ID_ZC_PAR_CHANGE_USER: @@ -23047,27 +23051,27 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_SKILL_UPDATE: if (CGameActor *skill = static_cast(this->scene->GetSkillByAID(*reinterpret_cast(g_gameModePacketBuffer + 2)))) { if (skill->GetEffectiveJob(-1) > 138 && skill->GetEffectiveJob(-1) <= 153) { - skill->SendMsg(nullptr, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILL_UPDATE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } switch (skill->GetEffectiveJob(-1)) { case UNT_DEEPBLINDTRAP: case UNT_SOLIDTRAP: case UNT_SWIFTTRAP: case UNT_FLAMETRAP: - skill->SendMsg(nullptr, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SKILL_UPDATE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } } break; case ID_ZC_MAKINGARROW_LIST: { const unsigned int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) >> 2; - UIWindow *window = g_windowMgr.EnsureWindow(94); - window->SendMsg(nullptr, 75, 0, 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_MAKINGARROWLISTWND); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); const unsigned char *entry = g_gameModePacketBuffer + 4; for (unsigned int i = count; i != 0; --i, entry += 4) { - window->SendMsg(nullptr, 31, reinterpret_cast(entry), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(entry), 0, 0, 0); } - window->SendMsg(nullptr, 34, 2, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 2, 0, 0, 0); break; } case ID_ZC_NPCSPRITE_CHANGE: @@ -23112,7 +23116,7 @@ void CGameMode::ProcessIncomingPackets() { if (position == 255) { position = -1; } - this->SendMsg(100, reinterpret_cast(name), position, 0, 0); + this->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(name), position, 0, 0); break; } case ID_ZC_CHANGE_GUILD_01b4: @@ -23138,10 +23142,10 @@ void CGameMode::ProcessIncomingPackets() { remaining / 60, remaining % 60); break; } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); } else if (g_serviceType == 6) { sprintf(message, "Sisa waktu voucher kamu adalah %d menit.", remaining / 60); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFFFF, 0, 0, 0); } break; } @@ -23167,7 +23171,7 @@ void CGameMode::ProcessIncomingPackets() { if (*reinterpret_cast(g_gameModePacketBuffer + 4) != 103061) { break; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4209)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4209)), 0xFF, 0, 0, 0); } } if (g_gameModePacketBuffer[0xE]) { @@ -23187,11 +23191,11 @@ void CGameMode::ProcessIncomingPackets() { if (count <= 0) { break; } - if (UIWindow *window = g_windowMgr.EnsureWindow(99)) { + if (UIWindow *window = g_windowMgr.EnsureWindow(WID_SPELLLISTWND)) { for (const int *skill = reinterpret_cast(g_gameModePacketBuffer + 2); skill < reinterpret_cast(g_gameModePacketBuffer + 0x1E); ++skill) { if (*skill) { - window->SendMsg(nullptr, 31, *skill, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, *skill, 0, 0, 0); } } } @@ -23204,7 +23208,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_OPEN_EDITDLGSTR: if (this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2)) || *reinterpret_cast(g_gameModePacketBuffer + 2) == 0) { - g_windowMgr.EnsureWindow(100)->SendMsg(nullptr, 28, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_NPCTEXTEDITDIALOGWND)->SendMsg(nullptr, UM_SETNAID, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); } break; case ID_ZC_NOTIFY_MAPPROPERTY2: { @@ -23255,19 +23259,19 @@ void CGameMode::ProcessIncomingPackets() { name[24] = 0; *reinterpret_cast(this->unknown_028C) = *reinterpret_cast(g_gameModePacketBuffer + 2); *reinterpret_cast(this->unknown_028C + 4) = *reinterpret_cast(g_gameModePacketBuffer + 6); - g_windowMgr.EnsureWindow(104)->SendMsg(nullptr, 90, *reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(name), 0, + g_windowMgr.EnsureWindow(WID_COUPLEACCEPTWND)->SendMsg(nullptr, UM_SET_COUPLE_MSG, *reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(name), 0, 0); break; } case ID_ZC_NOTIFY_POSITION_TO_GUILDM: if (*reinterpret_cast(g_gameModePacketBuffer + 2) != g_session.m_aid) { - this->SendMsg(170, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), + this->SendMsg(MM_ADDGUILDPOS, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), *reinterpret_cast(g_gameModePacketBuffer + 8), 0); } break; case 0x1EC: if (strcmp(g_session.m_navigationPlayerMap, reinterpret_cast(g_gameModePacketBuffer + 0xA))) { - this->SendMsg(171, *reinterpret_cast(g_gameModePacketBuffer + 6), 0, 0, 0); + this->SendMsg(MM_DELETEGUILDPOS, *reinterpret_cast(g_gameModePacketBuffer + 6), 0, 0, 0); if (CGameActor *actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 6)))) { actor->SetUnknown02E4(0); @@ -23323,7 +23327,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0x1F0: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(CardItemRecord); const CardItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); for (int i = 0; i < count; ++i, ++record) { @@ -23352,23 +23356,23 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_gameModePacketBuffer + 0x10), *reinterpret_cast(g_gameModePacketBuffer + 0x12)); std::string name = LookupPlayerName(*reinterpret_cast(g_gameModePacketBuffer + 6)); if (name.size()) { - this->SendMsg(140, reinterpret_cast(name.c_str()), *reinterpret_cast(g_gameModePacketBuffer + 0xA), 0, 0); + this->SendMsg(MM_GUILD_MEMBER_STATUS_CHANGE, reinterpret_cast(name.c_str()), *reinterpret_cast(g_gameModePacketBuffer + 0xA), 0, 0); } if (*reinterpret_cast(g_gameModePacketBuffer + 0xA) == 0) { - this->SendMsg(171, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); + this->SendMsg(MM_DELETEGUILDPOS, *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0, 0); } break; } case ID_ZC_REQ_EXCHANGE_ITEM: { if (g_serviceOptions.Get(136)) { - g_modeMgr.gameMode->SendMsg(50, 4, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ACK_EXCHANGE_ITEM, 4, 0, 0, 0); break; } char name[25]; std::memcpy(name, g_gameModePacketBuffer + 2, 24); name[24] = '\0'; - g_windowMgr.EnsureWindow(32)->SendMsg(nullptr, 50, reinterpret_cast(name), *reinterpret_cast(g_gameModePacketBuffer + 0x1A), + g_windowMgr.EnsureWindow(WID_EXCHANGEACCEPTWND)->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(name), *reinterpret_cast(g_gameModePacketBuffer + 0x1A), *reinterpret_cast(g_gameModePacketBuffer + 0x1E), 0); this->exchangeName.assign(name, strlen(name)); break; @@ -23379,7 +23383,7 @@ void CGameMode::ProcessIncomingPackets() { name[24] = 0; *reinterpret_cast(this->unknown_028C) = *reinterpret_cast(g_gameModePacketBuffer + 2); *reinterpret_cast(this->unknown_028C + 4) = *reinterpret_cast(g_gameModePacketBuffer + 6); - g_windowMgr.EnsureWindow(105)->SendMsg(nullptr, 91, *reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(name), 0, + g_windowMgr.EnsureWindow(WID_BABYACCEPTWND)->SendMsg(nullptr, UM_SET_BABY_MSG, *reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(name), 0, 0); break; } @@ -23389,21 +23393,21 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); break; } - g_windowMgr.CloseWindow(107); - UIWindow *window = g_windowMgr.EnsureWindow(107); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); + UIWindow *window = g_windowMgr.EnsureWindow(WID_ITEMREPAIRWND); const unsigned char *record = g_gameModePacketBuffer + 4; for (int i = 0; i < count; ++i, record += 23) { - window->SendMsg(nullptr, 31, reinterpret_cast(record), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(record), 0, 0, 0); } break; } case ID_ZC_ACK_ITEMREPAIR: switch (g_gameModePacketBuffer[4]) { case ITEMREPAIR_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(813)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(813)), 0xFFFF00, 0, 0, 0); break; case ITEMREPAIR_FAIL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(814)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(814)), 0xFF, 0, 0, 0); break; } break; @@ -23428,8 +23432,8 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_DIVORCE: { char message[1024]; sprintf(message, LookupMessage(836), g_session.DecodePlayerName(), reinterpret_cast(g_gameModePacketBuffer + 2)); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 0, 0, 0); break; } case ID_ZC_FRIENDS_STATE: @@ -23446,10 +23450,10 @@ void CGameMode::ProcessIncomingPackets() { name[24] = 0; const unsigned char option = g_serviceOptions.Get(136); if (IsMonsterJob(g_session.m_aid) || option) { - g_modeMgr.gameMode->SendMsg(175, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), + g_modeMgr.gameMode->SendMsg(MM_JOIN_FRIEND, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), 0, 0); } else { - g_windowMgr.EnsureWindow(109)->SendMsg(nullptr, 95, *reinterpret_cast(g_gameModePacketBuffer + 2), + g_windowMgr.EnsureWindow(WID_JOINFRIENDACCEPTWND)->SendMsg(nullptr, UM_SET_JOIN_FRIEND_MSG, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(name), 0); } break; @@ -23465,13 +23469,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_BABYMSG: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(899)), 0x9B9BFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(899)), 0x9B9BFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(900)), 0x9B9BFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(900)), 0x9B9BFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(916)), 0x9B9BFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(916)), 0x9B9BFF, 0, 0, 0); break; } break; @@ -23481,13 +23485,13 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); break; } - if (g_windowMgr.LookupWindow(111)) { - g_windowMgr.CloseWindow(111); + if (g_windowMgr.LookupWindow(WID_WEAPONREFINEWND)) { + g_windowMgr.CloseWindow(WID_WEAPONREFINEWND); } - UIWindow *window = g_windowMgr.EnsureWindow(111); + UIWindow *window = g_windowMgr.EnsureWindow(WID_WEAPONREFINEWND); const unsigned char *record = g_gameModePacketBuffer + 4; for (int i = 0; i < count; ++i, record += 23) { - window->SendMsg(nullptr, 31, *reinterpret_cast(record + 2), *reinterpret_cast(record), 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, *reinterpret_cast(record + 2), *reinterpret_cast(record), 0, 0); } break; } @@ -23505,35 +23509,35 @@ void CGameMode::ProcessIncomingPackets() { reinterpret_cast(g_session.unknown_0F0C)[1] = state[2]; g_session.m_jobFlags = state[1]; if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (g_session.unknown_5C1C <= 0) { g_session.ClearItems1740(); - g_windowMgr.CloseWindow(40); + g_windowMgr.CloseWindow(WID_MERCHANTITEMWND); } } else { actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2)); } if (actor) { const int stateAddress = reinterpret_cast(state); - actor->SendMsg(nullptr, 43, 0, stateAddress, stateAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_ATTR_STATE_CHANGE, 0, stateAddress, stateAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } case ID_ZC_STARPLACE: - g_windowMgr.EnsureWindow(119)->SendMsg(nullptr, 91, static_cast(g_gameModePacketBuffer[2]), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_STARPLACEACCEPTWND)->SendMsg(nullptr, UM_SET_BABY_MSG, static_cast(g_gameModePacketBuffer[2]), 0, 0, 0); break; case ID_ZC_MAKINGITEM_LIST: { const unsigned int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 6) >> 2; - UIWindow *window = g_windowMgr.EnsureWindow(94); + UIWindow *window = g_windowMgr.EnsureWindow(WID_MAKINGARROWLISTWND); if (!window) { break; } - window->SendMsg(nullptr, 75, 0, 0, 0, 0); - window->SendMsg(nullptr, 34, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); + window->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); const unsigned char *entry = g_gameModePacketBuffer + 6; for (unsigned int i = count; i != 0; --i, entry += 4) { - window->SendMsg(nullptr, 31, reinterpret_cast(entry), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(entry), 0, 0, 0); } break; } @@ -23544,7 +23548,7 @@ void CGameMode::ProcessIncomingPackets() { manager->m_ongoingQuests.erase(id); manager->UpdateQuestWindows(); std::string message = FormatOwnedString(LookupMessage(1611), title.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFFFF, 19, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFFFF, 19, 0, 0); break; } case ID_ZC_ACTIVE_QUEST: @@ -23556,7 +23560,7 @@ void CGameMode::ProcessIncomingPackets() { if (item.unknown_0000[1]) { std::string name = item.DisplayName(0); std::string message = FormatOwnedString(LookupMessage(1328), name.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0x6EFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0x6EFFFF, 0, 0, 0); } break; } @@ -23582,7 +23586,7 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_BATTLEFIELD_NOTIFY_POSITION: if (*reinterpret_cast(g_gameModePacketBuffer + 2) != g_session.m_aid) { - this->SendMsg(63, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 0x20), + this->SendMsg(MM_ADDPARTYPOS, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 0x20), *reinterpret_cast(g_gameModePacketBuffer + 0x22), 0); } break; @@ -23593,7 +23597,7 @@ void CGameMode::ProcessIncomingPackets() { if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { const int x = *reinterpret_cast(g_gameModePacketBuffer + 0x1E); const int y = *reinterpret_cast(g_gameModePacketBuffer + 0x20); - actor->SendMsg(nullptr, 34, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } break; case ID_ZC_NOTIFY_ACT2: @@ -23654,7 +23658,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0x2ea: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(CardItemExpiryRecord); const CardItemExpiryRecord *entry = reinterpret_cast(g_gameModePacketBuffer + 4); for (int i = 0; i < count; ++i, ++entry) { @@ -23687,13 +23691,13 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_PROGRESS: if (CPlayer *player = this->scene->player) { - player->SendMsg(nullptr, 82, 0, *reinterpret_cast(g_gameModePacketBuffer + 6) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_MAKE_SKILL_RECHARGEGAGE, 0, *reinterpret_cast(g_gameModePacketBuffer + 6) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_session.unknown_555C[0x0A] = true; } break; case 0x2F2: if (CPlayer *player = this->scene->player) { - player->SendMsg(nullptr, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (*reinterpret_cast(&player->render.unknown_0060) == 8) { player->SetState(0, 1); } @@ -23709,11 +23713,11 @@ void CGameMode::ProcessIncomingPackets() { this->scene->player->SetGuildInfo(*reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6)); if (!g_guildInfo.unknown_00C8) { g_guildInfo.unknown_00C8 = 1; - g_modeMgr.gameMode->SendMsg(107, 3, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 3, 0, 0, 0); } if (!g_guildInfo.unknown_00C0) { g_guildInfo.unknown_00C0 = 1; - g_modeMgr.gameMode->SendMsg(107, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 1, 0, 0, 0); } break; } @@ -23725,11 +23729,11 @@ void CGameMode::ProcessIncomingPackets() { if (count == 0) { break; } - if (UIWindow *window = g_windowMgr.EnsureWindow(99)) { - window->SendMsg(nullptr, 27, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); + if (UIWindow *window = g_windowMgr.EnsureWindow(WID_SPELLLISTWND)) { + window->SendMsg(nullptr, UM_SETCHOOSE, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); const std::uint16_t *skills = reinterpret_cast(g_gameModePacketBuffer + 8); for (int i = 0; i < count; ++i) { - window->SendMsg(nullptr, 31, skills[i], 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, skills[i], 0, 0, 0); } } break; @@ -23741,9 +23745,9 @@ void CGameMode::ProcessIncomingPackets() { sprintf(message, LookupMessage(1930), *reinterpret_cast(g_gameModePacketBuffer + 0x1E), reinterpret_cast(g_gameModePacketBuffer + 2), job); if (g_windowMgr.window_027C) { - g_windowMgr.SendNotice(5, reinterpret_cast(message), 0x222222, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSH_INTO_CHATROOM, reinterpret_cast(message), 0x222222, 0, 0, 0); } else if (!g_serviceOptions.Get(114) && !g_serviceOptions.Get(148)) { - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 1, 0, 0); } if (g_session.m_whisperRecord) { this->WriteChatLog(message); @@ -23763,7 +23767,7 @@ void CGameMode::ProcessIncomingPackets() { char message[256]; sprintf(message, "[%s] %s", CSkillInfo::DisplayName(*g_session.m_hotkeyScript, *reinterpret_cast(g_gameModePacketBuffer + 2)), text); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFCDCD, 11, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFCDCD, 11, 0, 0); break; } case ID_ZC_USESKILL_ACK2: @@ -24159,10 +24163,10 @@ void CGameMode::ProcessIncomingPackets() { if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { const int hp = *reinterpret_cast(g_gameModePacketBuffer + 6); const int maxHp = *reinterpret_cast(g_gameModePacketBuffer + 0xA); - actor->SendMsg(nullptr, 34, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, *reinterpret_cast(g_gameModePacketBuffer + 2), + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), *reinterpret_cast(g_gameModePacketBuffer + 0xA)); } @@ -24180,9 +24184,9 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_SE_CASHSHOP_OPEN_0845: case ID_ZC_SE_CASHSHOP_OPEN_0a2b: - if (!g_windowMgr.CloseWindow(318)) { - if (UIWindow *window = g_windowMgr.EnsureWindow(318)) { - window->SendMsg(nullptr, 120, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), + if (!g_windowMgr.CloseWindow(WID_CASHSHOP_WND)) { + if (UIWindow *window = g_windowMgr.EnsureWindow(WID_CASHSHOP_WND)) { + window->SendMsg(nullptr, UM_SET_CASHSHOP_BALANCE, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), 0, 0); } else { std::int16_t packetType = 0x844; @@ -24213,7 +24217,7 @@ void CGameMode::ProcessIncomingPackets() { } const int entryAddress = reinterpret_cast(&entry); - item->SendMsg(nullptr, 4, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + item->SendMsg(nullptr, AM_INITSTANDENTRY, 0, entryAddress, entryAddress >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case ID_ZC_NOTIFY_ACT: @@ -24243,7 +24247,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case ITEM_EQUIP_ACK_FAILLEVEL: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1953)), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1953)), 0xFF, 7, 0, 0); break; } break; @@ -24264,14 +24268,14 @@ void CGameMode::ProcessIncomingPackets() { break; } case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1953)), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1953)), 0xFF, 7, 0, 0); break; } break; } case 0x8D3: - if (UIWindow *window = g_windowMgr.LookupWindow(318)) { - window->SendMsg(nullptr, 122, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), 0, + if (UIWindow *window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND)) { + window->SendMsg(nullptr, UM_UPDATE_CASHSHOP_BALANCE, *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), 0, 0); } break; @@ -24411,7 +24415,7 @@ void CGameMode::ProcessIncomingPackets() { this->ReceiveFeedConfig(g_gameModePacketBuffer[0x2], g_gameModePacketBuffer[0x3]); break; case ID_ZC_OPEN_REFINING_UI: - g_windowMgr.EnsureWindow(295); + g_windowMgr.EnsureWindow(WID_REFININGWND); break; case ID_ZC_RANDOM_UPGRADE_ITEM_UI_OPEN: this->ReceiveLapineUpgradeBoxValue(*reinterpret_cast(g_gameModePacketBuffer + 0x2)); @@ -24720,33 +24724,33 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_WAIT_DIALOG2: this->unknown_024C = 1; this->unknown_02DC = *reinterpret_cast(g_gameModePacketBuffer + 2); - g_windowMgr.EnsureWindow(226)->SendMsg(nullptr, 25, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SAYDIALOGWND_OVERLAY)->SendMsg(nullptr, UM_ENABLENEXTBUTTON, 0, 0, 0, 0); break; case 0xBEE: switch (g_gameModePacketBuffer[4]) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_NYANGVINE")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_NYANGVINE")), 0xFF, 0, 0, 0); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_DATE")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_DATE")), 0xFF, 0, 0, 0); this->RefreshEmotionSaleSchedule(); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_ALREADY_BUY")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_ALREADY_BUY")), 0xFF, 0, 0, 0); break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_ANOTHER_SALE_BUY")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_ANOTHER_SALE_BUY")), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 0xFF, 0, + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 0xFF, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_NOT_YET_SALE_START_TIME")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_NOT_YET_SALE_START_TIME")), 0xFF, 0, 0, 0); this->RefreshEmotionSaleSchedule(); break; default: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_UNKNOWN")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_FAIL_UNKNOWN")), 0xFF, 0, 0, 0); break; } break; @@ -24800,7 +24804,7 @@ void CGameMode::ProcessIncomingPackets() { break; case progressbarunit: if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { - actor->SendMsg(nullptr, 82, 0, *reinterpret_cast(g_gameModePacketBuffer + 0xA) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_MAKE_SKILL_RECHARGEGAGE, 0, *reinterpret_cast(g_gameModePacketBuffer + 0xA) * 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case ID_ZC_ADVENTURER_AGENCY_JOIN_REQ: { @@ -24826,7 +24830,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xBED: g_cashEmotionMgr->AcquirePack(*reinterpret_cast(g_gameModePacketBuffer + 2), g_gameModePacketBuffer[4] ? *reinterpret_cast(g_gameModePacketBuffer + 5) : 0); - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_BUY_SUCCESS")), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_BUY_SUCCESS")), 0xFFFF, 0, 0, 0); this->RefreshEmotionPurchaseSchedule(); break; case ID_ZC_BATTLEFIELD_NOTIFY_HP: @@ -24834,7 +24838,7 @@ void CGameMode::ProcessIncomingPackets() { if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { const int hp = *reinterpret_cast(g_gameModePacketBuffer + 6); const int maxHp = *reinterpret_cast(g_gameModePacketBuffer + 0xA); - actor->SendMsg(nullptr, 34, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_UPDATEGAGE, 0, hp, hp >> 31, maxHp, maxHp >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -24850,7 +24854,7 @@ void CGameMode::ProcessIncomingPackets() { this->ReceiveUnknownD264E0(g_gameModePacketBuffer); this->miniMapTooltipId = -1; this->miniMapTooltipText.assign("", 0); - g_windowMgr.CloseWindow(78); + g_windowMgr.CloseWindow(WID_ILLUSTWND); g_windowMgr.RestoreHiddenWindows(); this->miniMapTooltipWindows.clear(); break; @@ -24867,24 +24871,24 @@ void CGameMode::ProcessIncomingPackets() { } const int first = *reinterpret_cast(g_gameModePacketBuffer + 6); const int second = *reinterpret_cast(g_gameModePacketBuffer + 8); - actor->SendMsg(nullptr, 160, 0, first, first >> 31, second, second >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_CASH_EMOTION, 0, first, first >> 31, second, second >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; } case 0xBEB: switch (g_gameModePacketBuffer[6]) { case 0: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_DATE")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_DATE")), 0xFF, 0, 0, 0); g_cashEmotionMgr->RemoveOwnedPack(*reinterpret_cast(g_gameModePacketBuffer + 2), true, true); this->RefreshEmotionPurchaseSchedule(); break; case 1: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNPURCHASED")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNPURCHASED")), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_USE_FAIL_SKILL_LEVEL")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_USE_FAIL_SKILL_LEVEL")), 0xFF, 0, 0, 0); break; default: - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNKNOWN")), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_USE_FAIL_UNKNOWN")), 0xFF, 0, 0, 0); break; } this->unknown_026E[0x16] = 0; @@ -24903,7 +24907,7 @@ void CGameMode::ProcessIncomingPackets() { memcpy(text, packet + 9, length); } text[length] = 0; - g_windowMgr.EnsureWindow(226)->SendMsg(nullptr, 26, reinterpret_cast(text), *reinterpret_cast(packet + 4), 0, 0); + g_windowMgr.EnsureWindow(WID_SAYDIALOGWND_OVERLAY)->SendMsg(nullptr, UM_SETSAYDIALOG, reinterpret_cast(text), *reinterpret_cast(packet + 4), 0, 0); break; } case 0xBF6: { @@ -24956,13 +24960,13 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_VIEW_CAMERAINFO: if (g_gameModePacketBuffer[2] == 1) { - UIWindow *window = g_windowMgr.LookupWindow(289); + UIWindow *window = g_windowMgr.LookupWindow(WID_VIEWCAMERAINFOWND); if (!window) { - window = g_windowMgr.EnsureWindow(289); + window = g_windowMgr.EnsureWindow(WID_VIEWCAMERAINFOWND); } g_session.unknown_61B1 = !g_session.unknown_61B1; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(g_session.unknown_61B1 == true ? "Camera Info On" : "Camera Info Off"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_session.unknown_61B1 == true ? "Camera Info On" : "Camera Info Off"), 0x64FFFF, 0, 0, 0); window->Show(g_session.unknown_61B1); } else if (CView *camera = this->camera) { camera->camera.desiredDistance = *reinterpret_cast(g_gameModePacketBuffer + 3); @@ -24981,11 +24985,11 @@ void CGameMode::ProcessIncomingPackets() { } if (*reinterpret_cast(g_gameModePacketBuffer + 2) - 27 > 0) { CGraffiSkill *skill = new CGraffiSkill; - skill->SendMsg(nullptr, 22, 0, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SETMASTERGID, 0, *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const int address = reinterpret_cast(g_gameModePacketBuffer + 0x1B); const int x = *reinterpret_cast(g_gameModePacketBuffer + 0x10); const int y = *reinterpret_cast(g_gameModePacketBuffer + 0x12); - skill->SendMsg(nullptr, 117, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_SET_SKILL, 0, address, address >> 31, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0); this->scene->objects.push_back(skill); this->scene->unknown_0020.push_back(skill); } @@ -24993,46 +24997,46 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_DEBUGMSG: { std::string text(reinterpret_cast(g_gameModePacketBuffer + 8), reinterpret_cast(g_gameModePacketBuffer + *reinterpret_cast(g_gameModePacketBuffer + 2))); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0, 0); break; } case ID_ZC_ACK_OPENSTORE2: switch (g_gameModePacketBuffer[2]) { case OPENSTORE2_SUCCESS: - if (UIWindow *window = g_windowMgr.EnsureWindow(45)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow *window = g_windowMgr.EnsureWindow(WID_MERCHANTITEMMYSHOPWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIMerchantShopMakeWnd *window = static_cast(g_windowMgr.EnsureWindow(41))) { + if (UIMerchantShopMakeWnd *window = static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTSHOPMAKEWND))) { window->PrintSellList(); } - g_windowMgr.CloseWindow(41); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); this->unknown_024C = 1; break; case OPENSTORE2_FAILED: - this->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(43); - g_windowMgr.CloseWindow(44); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); g_session.ClearItems1760And1748(); g_session.ClearItems1758(); g_windowMgr.Confirm(LookupMessage(2639), 0, true, false, 0, "Message", 280, 120, 0); - g_windowMgr.CloseWindow(41); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); break; case OPENSTORE2_NOVENDING: - this->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(43); - g_windowMgr.CloseWindow(44); + this->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); g_session.ClearItems1760And1748(); g_session.ClearItems1758(); - g_windowMgr.CloseWindow(41); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3229)), 0xFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3229)), 0xFF, 0, 0, 0); break; } break; case 0xB55: { std::string text(reinterpret_cast(g_gameModePacketBuffer + 4), reinterpret_cast(g_gameModePacketBuffer + *reinterpret_cast(g_gameModePacketBuffer + 2))); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 0, 0, 0); break; } case questUpdateType2: { @@ -25110,7 +25114,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0x904: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(FlaggedItemRecord); for (int i = 0; i < count; ++i) { const FlaggedItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4) + i; @@ -25161,7 +25165,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case 0x905: { - g_windowMgr.EnsureWindow(33); + g_windowMgr.EnsureWindow(WID_ITEMSTOREWND); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(FlaggedEquipRecord); for (int i = 0; i < count; ++i) { const FlaggedEquipRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4) + i; @@ -25199,7 +25203,7 @@ void CGameMode::ProcessIncomingPackets() { case 5: case 10: if (*reinterpret_cast(g_session.unknown_5620) != *reinterpret_cast(g_gameModePacketBuffer + 0x1D)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1018)), 0xFF, 0, 0, 0); *reinterpret_cast(g_session.unknown_5620) = *reinterpret_cast(g_gameModePacketBuffer + 0x1D); } break; @@ -25228,7 +25232,7 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_session.unknown_1664) = *reinterpret_cast(g_gameModePacketBuffer + 0x49); g_session.InvalidateWindowFrames(); if (g_windowMgr.window_03C4) { - g_windowMgr.window_03C4->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_03C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } reinterpret_cast(g_session.unknown_5620)[1] = *reinterpret_cast(g_gameModePacketBuffer + 0x4B); break; @@ -25251,8 +25255,8 @@ void CGameMode::ProcessIncomingPackets() { item.id = *reinterpret_cast(record + 0x15); g_barterMarketItemMgr->items.push_back(item); } - g_windowMgr.EnsureWindow(334)->SendMsg(nullptr, 23, 0, 0, 0, 0); - g_windowMgr.EnsureWindow(335)->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_BARTERMARKETWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_BARTERITEMPURCHASEWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } case ID_ZC_NPC_MARKET_OPEN_09d5: { @@ -25272,12 +25276,12 @@ void CGameMode::ProcessIncomingPackets() { g_session.AddItem1718(item, *reinterpret_cast(entry + 9), static_cast(*reinterpret_cast(entry + 0xD) / 10)); } - UIWindow *window = g_windowMgr.EnsureWindow(254); - window->SendMsg(nullptr, 36, 0, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); - window = g_windowMgr.EnsureWindow(255); - window->SendMsg(nullptr, 36, 0, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + UIWindow *window = g_windowMgr.EnsureWindow(WID_PARAITEMSHOPWND); + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + window = g_windowMgr.EnsureWindow(WID_PARAITEMPURCHASEWND); + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } default: diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index 500fae273..9185f4d33 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -1,5 +1,8 @@ #include "Client/Mode/CLoginMode.h" #include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "Contents/Configuration/ServiceEnums.h" #include "Network/Packets/PacketId.h" #include "Network/Packets/ModeResultEnums.h" @@ -404,12 +407,12 @@ void CLoginMode::SubD8D500(const char* packet) { case 0: g_windowMgr.Confirm(LookupMessage(0x4BE), 0, true, false, 0, "Message", 280, 120, 0); if (window) { - window->SendMsg(nullptr, 6, 0x160, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME_SUCCESS, 0, 0, 0); } return; case 1: if (g_windowMgr.Confirm(LookupMessage(0x4C2), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } return; case 2: @@ -417,12 +420,12 @@ void CLoginMode::SubD8D500(const char* packet) { return; } if (window) { - window->SendMsg(nullptr, 6, 0xB9, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } return; case 3: if (g_windowMgr.Confirm(LookupMessage(0x4BF), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } return; case 4: @@ -430,17 +433,17 @@ void CLoginMode::SubD8D500(const char* packet) { return; } if (window) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 5: if (g_windowMgr.Confirm(LookupMessage(0x7E6), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } return; case 6: if (g_windowMgr.Confirm(LookupMessage(0x7E7), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } return; case 7: @@ -448,7 +451,7 @@ void CLoginMode::SubD8D500(const char* packet) { return; } if (window) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 8: @@ -456,7 +459,7 @@ void CLoginMode::SubD8D500(const char* packet) { return; } if (window) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 9: @@ -464,12 +467,12 @@ void CLoginMode::SubD8D500(const char* packet) { return; } if (window) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 10: if (g_windowMgr.Confirm(LookupMessage(0x7E8), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8 && g_windowMgr.window_03DC) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } return; default: @@ -709,7 +712,7 @@ void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet) { case 0: g_windowMgr.Confirm(LookupMessage(1214), 0, true, false, 0, "Message", 280, 120, 0); if (window) { - window->SendMsg(nullptr, 6, 352, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME_SUCCESS, 0, 0, 0); } return; case 1: @@ -720,12 +723,12 @@ void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet) { break; case 3: if (g_windowMgr.Confirm(LookupMessage(1215), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { - window->SendMsg(nullptr, 6, 351, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 4: if (g_windowMgr.Confirm(LookupMessage(1220), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { - window->SendMsg(nullptr, 6, 351, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return; case 5: @@ -742,7 +745,7 @@ void CLoginMode::ReceiveCharacterResult(const CharacterResultPacket* packet) { } if (g_windowMgr.Confirm(LookupMessage(message), 0, true, true, 0, "Message", 280, 120, 0) == 184 && window) { - window->SendMsg(nullptr, 6, 185, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } } @@ -1049,17 +1052,17 @@ void CLoginMode::SubD97780(int value) { switch (value) { case 4: if (static_cast(timeGetTime()) > this->otpStarted + timeout) { - this->SendMsg(0x2725, 0, 0, 0, 0); + this->SendMsg(LMM_DISCONNECT_ACSVR, 0, 0, 0, 0); } if (g_serviceType == 5 || g_serviceType == 7) { if (static_cast(timeGetTime()) > this->otpStarted + 0x3A98) { if (this->window_6F14 == nullptr) { - this->window_6F14 = g_windowMgr.EnsureWindow(6); + this->window_6F14 = g_windowMgr.EnsureWindow(WID_WAITWND); if (this->window_6F14 == nullptr) { break; } } - this->window_6F14->SendMsg(nullptr, 0x58, 0, 0, 0, 0); + this->window_6F14->SendMsg(nullptr, UM_ENABLE_CANCEL, 0, 0, 0, 0); this->window_6F14->Invalidate(); } } @@ -1368,13 +1371,13 @@ void CLoginMode::ReceiveLoginErrorDetail(const LoginErrorDetailPacket* packet) { memcpy_s(g_session.m_loginErrorText, sizeof(g_session.m_loginErrorText), packet->text, std::min(packet->length - 28, sizeof(g_session.m_loginErrorText))); GetRagConnection().Close(); - g_modeMgr.gameMode->SendMsg(10000, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_CONNECT_TO_ACSVR, 0, 0, 0, 0); break; case 400: - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } - g_windowMgr.EnsureWindow(180); + g_windowMgr.EnsureWindow(WID_LOGINOTPWND); this->unknown_6F75 = true; this->otpStarted = timeGetTime(); break; @@ -1397,7 +1400,7 @@ void CLoginMode::ReceiveLoginErrorDetail(const LoginErrorDetailPacket* packet) { const char* fileText = DecryptName<0x1767DDE18D779D8BULL>(fileSource); const char operationSource[] = {'\xAE', '\xD3', '\x94', '\xA3', '\x11'}; ShellExecuteA(nullptr, DecryptName<0xC1BB8111EDD183E1ULL>(operationSource), fileText, parametersText, nullptr, SW_SHOW); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); return; } case 1200: @@ -1418,13 +1421,13 @@ void CLoginMode::ReceiveLoginErrorDetail(const LoginErrorDetailPacket* packet) { if (this->unknown_6F76 != true) { if (error == 500) { this->otpStarted = timeGetTime(); - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } - g_windowMgr.EnsureWindow(180); + g_windowMgr.EnsureWindow(WID_LOGINOTPWND); } else { - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } this->unknown_6F74 = false; this->unknown_6F75 = false; @@ -1447,13 +1450,13 @@ void CLoginMode::ReceiveLoginError(const LoginErrorPacket* packet) { memcpy_s(g_session.m_loginErrorText, sizeof(g_session.m_loginErrorText), packet->text, std::min(packet->length - 8, sizeof(g_session.m_loginErrorText))); GetRagConnection().Close(); - g_modeMgr.gameMode->SendMsg(10000, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_CONNECT_TO_ACSVR, 0, 0, 0, 0); break; case 400: - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } - g_windowMgr.EnsureWindow(180); + g_windowMgr.EnsureWindow(WID_LOGINOTPWND); this->unknown_6F75 = true; this->otpStarted = timeGetTime(); break; @@ -1492,13 +1495,13 @@ void CLoginMode::ReceiveLoginError(const LoginErrorPacket* packet) { if (this->unknown_6F76 != true) { if (error == 500) { this->otpStarted = timeGetTime(); - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } - g_windowMgr.EnsureWindow(180); + g_windowMgr.EnsureWindow(WID_LOGINOTPWND); } else { - if (g_windowMgr.LookupWindow(180)) { - g_windowMgr.CloseWindow(180); + if (g_windowMgr.LookupWindow(WID_LOGINOTPWND)) { + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } this->unknown_6F74 = false; this->unknown_6F75 = false; @@ -1580,7 +1583,7 @@ ConnectionEndpoint g_zoneServerEndpoint; // FUNCTION: fn_22290 void CLoginMode::ConnectZoneServer(std::uint32_t gid, std::string mapName, std::uint32_t ip, int port, std::string host) { g_session.m_gid = gid; - g_modeMgr.gameMode->SendMsg(10009, static_cast(g_selectedSlotIndex), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SELECT_CHARACTER, static_cast(g_selectedSlotIndex), 0, 0, 0); if (g_windowMgr.window_03D4) { g_windowMgr.Schedule(g_windowMgr.window_03D4); } @@ -1630,7 +1633,7 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { g_session.m_loginAccountId = packet->accountId; switch (packet->mode) { case PINCODE_OK: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_session.m_passwordWndMode = 0; this->pendingCursorType = 7; break; @@ -1656,12 +1659,12 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { this->pendingCursorType = 7; break; case PINCODE_ILLEGAL: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); this->pendingCursorType = 7; g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); break; case PINCODE_KSSN: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); this->pendingCursorType = 7; g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -1670,14 +1673,14 @@ void CLoginMode::SubD90C90(const PasswordModePacket* packet) { this->pendingCursorType = 7; break; case PINCODE_WRONG: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); if (packet->count != 0) { this->pendingCursorType = 7; std::string message = FormatOwnedString(LookupMessage(0x764), packet->count); g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } else { g_windowMgr.Confirm(LookupMessage(0xD7E), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(2, 0, 0, 0, 0); + this->SendMsg(MM_QUIT, 0, 0, 0, 0); } break; case 9: { @@ -1710,7 +1713,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { g_session.m_loginAccountId = packet->accountId; switch (packet->mode) { case PINCODE_OK: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_session.m_passwordWndMode = 0; this->pendingCursorType = 7; break; @@ -1736,12 +1739,12 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { this->pendingCursorType = 7; break; case PINCODE_ILLEGAL: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); this->pendingCursorType = 7; g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); break; case PINCODE_KSSN: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); this->pendingCursorType = 7; g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -1750,7 +1753,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { this->pendingCursorType = 7; break; case PINCODE_WRONG: { - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); ++this->passwordRetryCount; const int remaining = 3 - this->passwordRetryCount; this->pendingCursorType = 7; @@ -1759,7 +1762,7 @@ void CLoginMode::SubD911C0(const PasswordModePacket* packet) { g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); } else { g_windowMgr.Confirm(LookupMessage(0x773), 0, true, false, 0, "Message", 280, 120, 0); - this->SendMsg(2, 0, 0, 0, 0); + this->SendMsg(MM_QUIT, 0, 0, 0, 0); } break; } @@ -1869,7 +1872,7 @@ void CLoginMode::Zc_Accept_Enter3(const AcceptEnterPositionPacket* packet) { char mapName[36]; sprintf(mapName, "%s.rsw", g_session.m_navigationPlayerMap); g_modeMgr.Switch(1, mapName); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(121), 17, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(121), 17, 1); GetRagConnection().SetBlock(0); g_session.SetOption(17, 0, 0); @@ -1911,7 +1914,7 @@ void CLoginMode::Zc_Accept_Enter2(const AcceptEnterPositionPacket* packet) { char mapName[36]; sprintf(mapName, "%s.rsw", g_session.m_navigationPlayerMap); g_modeMgr.Switch(1, mapName); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(121), 17, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(121), 17, 1); GetRagConnection().SetBlock(0); if (g_pingLogEnabled) { @@ -2211,7 +2214,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { if (!message.empty()) { g_windowMgr.Confirm(message.c_str(), 0, true, false, 0, "Message", 280, 120, 0); if (code == 5 || code == 99) { - this->SendMsg(2, 0, 0, 0, 0); + this->SendMsg(MM_QUIT, 0, 0, 0, 0); } } @@ -2253,9 +2256,9 @@ bool CLoginMode::ShowNotice(int notice, bool append) { } else { this->unknown_6F1C.clear(); if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } - window = g_windowMgr.EnsureWindow(18); + window = g_windowMgr.EnsureWindow(WID_MENUWND); } if (!window) { @@ -2264,18 +2267,18 @@ bool CLoginMode::ShowNotice(int notice, bool append) { switch (notice) { case 45: - window->SendMsg(nullptr, 31, reinterpret_cast(LookupMessage(2163)), 0, 0, 0); - window->SendMsg(nullptr, 30, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(2163)), 0, 0, 0); + window->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); this->unknown_6F1C.push_back(45); break; case 46: - window->SendMsg(nullptr, 31, reinterpret_cast(LookupMessage(2164)), 0, 0, 0); - window->SendMsg(nullptr, 30, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(2164)), 0, 0, 0); + window->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); this->unknown_6F1C.push_back(46); break; case 47: - window->SendMsg(nullptr, 31, reinterpret_cast(LookupMessage(2165)), 0, 0, 0); - window->SendMsg(nullptr, 30, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(2165)), 0, 0, 0); + window->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); this->unknown_6F1C.push_back(47); break; } @@ -2405,7 +2408,7 @@ void CLoginMode::PollNetworkStatus() { memset(g_gameModePacketBuffer, 0, sizeof(g_gameModePacketBuffer)); if (!GetRagConnection().Update()) { - g_modeMgr.gameMode->SendMsg(1, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SOCKETERROR, 0, 0, 0, 0); } if (g_charServerAccountIdPending == 1) { @@ -2623,7 +2626,7 @@ void CLoginMode::PollNetworkStatus() { } if (UIWindow* window = g_windowMgr.window_03D4) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } break; } @@ -2691,26 +2694,26 @@ void CLoginMode::PollNetworkStatus() { g_session.m_loginAccountId = packet->accountId; switch (packet->result) { case 0: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x761), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x76A), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 2: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 3: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 4: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x765), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; @@ -2722,11 +2725,11 @@ void CLoginMode::PollNetworkStatus() { g_session.m_loginAccountId = packet->accountId; switch (packet->result) { case 0: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x762), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - g_windowMgr.CloseWindow(200); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDEDITWND); g_windowMgr.Confirm(LookupMessage(0x766), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; @@ -2738,21 +2741,21 @@ void CLoginMode::PollNetworkStatus() { g_session.m_loginAccountId = packet->accountId; switch (packet->result) { case 0: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x763), 0, true, false, 0, "Message", 280, 120, 0); break; case 1: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x767), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 2: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x768), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; case 3: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x769), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; @@ -2764,13 +2767,13 @@ void CLoginMode::PollNetworkStatus() { g_session.m_loginAccountId = packet->accountId; switch (packet->result) { case 0: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x76D), 0, true, false, 0, "Message", 280, 120, 0); static_cast(g_windowMgr.window_03D4)->EnableButtonById(0x1A2); g_session.m_passwordWndMode = 1; break; case 1: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x76E), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; @@ -2780,12 +2783,12 @@ void CLoginMode::PollNetworkStatus() { case 0x8C6: switch (reinterpret_cast(g_gameModePacketBuffer)->result) { case 0: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x76F), 0, true, false, 0, "Message", 280, 120, 0); static_cast(g_windowMgr.window_03D4)->DisableButtonById(0x1A2); break; case 1: - g_windowMgr.CloseWindow(199); + g_windowMgr.CloseWindow(WID_SECONDPASSWORDINPUTWND); g_windowMgr.Confirm(LookupMessage(0x770), 0, true, false, 0, "Message", 280, 120, 0); this->pendingCursorType = 7; break; @@ -2932,7 +2935,7 @@ void CLoginMode::PollNetworkStatus() { } case 0xB71: { const CharacterInfoPacket* packet = reinterpret_cast(g_gameModePacketBuffer); - CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, packet->info.slot, 0, 0, 0)); + CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, packet->info.slot, 0, 0, 0)); if (character && character->gid == *reinterpret_cast(&g_session.unknown_5913[1])) { *character = packet->info; StringFormat(character->mapName, sizeof(character->mapName), static_cast(-1), "%s", g_session.GatName2RswName(character->mapName)); @@ -3009,7 +3012,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } } return 0; - case 23: { + case LMM_SEND_CHARACTER_AUTH_CODE: { unsigned char* buffer = static_cast( _MallocaComputeSize(0x14) != 0 ? (_MallocaComputeSize(0x14) <= _ALLOCA_S_THRESHOLD @@ -3023,37 +3026,37 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, StringFormat(reinterpret_cast(buffer + 8), 10, static_cast(-1), reinterpret_cast(&this->unknown_0138[0x80])); *reinterpret_cast(buffer + 2) = 14; GetRagConnection().Send(*reinterpret_cast(buffer + 2), buffer); - this->window_6F14 = g_windowMgr.EnsureWindow(6); + this->window_6F14 = g_windowMgr.EnsureWindow(WID_WAITWND); static_cast(this->window_6F14)->SetMessage(LookupMessage(122), 16, 1); _freea(buffer); } return 0; } - case 24: + case LMM_DISPATCH_CHARACTER_SLOT_ACTION: switch (this->unknown_6F1C[argument1]) { case 45: - if (UIWindow* window = g_windowMgr.LookupWindow(0x115)) { - window->SendMsg(nullptr, 6, 0x1B0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NEWSELECTCHARWND)) { + window->SendMsg(nullptr, UM_COMMAND, 0x1B0, 0, 0, 0); } return 0; case 46: - if (UIWindow* window = g_windowMgr.LookupWindow(0x115)) { - window->SendMsg(nullptr, 6, 0x1B1, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NEWSELECTCHARWND)) { + window->SendMsg(nullptr, UM_COMMAND, 0x1B1, 0, 0, 0); } return 0; case 47: - if (UIWindow* window = g_windowMgr.LookupWindow(0x115)) { - window->SendMsg(nullptr, 6, 0x15F, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NEWSELECTCHARWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_NAME, 0, 0, 0); } return 0; default: return 0; } - case 28: + case LMM_RESET_TO_LOGIN: g_charServerAccountIdPending = 0; this->pendingCursorType = 3; return 0; - case 39: { + case LMM_SEND_LOGIN_AUTH_CODE: { struct PacketAD0 { /* 0000 */ std::int16_t id; /* 0002 */ char code[9]; @@ -3062,11 +3065,11 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, packet.id = 0xAD0; memcpy_s(packet.code, sizeof(packet.code), &this->unknown_0138[0x80], sizeof(packet.code)); GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); - this->window_6F14 = g_windowMgr.EnsureWindow(6); + this->window_6F14 = g_windowMgr.EnsureWindow(WID_WAITWND); static_cast(this->window_6F14)->SetMessage(LookupMessage(122), 16, 1); return 0; } - case 258: + case LMM_QUERY_LAST_CHARACTER_INFO: if (this->characterCount == 0) { return 0; } @@ -3240,7 +3243,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } case LMM_GOTOSELECTACCOUNT: if (argument2 == 201) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); return 0; } this->pendingCursorType = 2; @@ -3328,24 +3331,24 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, TraceSelectionRange(this->unknown_6F48, this->unknown_6F4C); this->pendingCursorType = 3; return 0; - case 10024: + case LMM_SET_AUTH_CODE: strcpy(reinterpret_cast(&this->unknown_0138[0x80]), reinterpret_cast(argument1)); return 0; - case 10025: + case LMM_REPLAY_SELECT_SERVER: reinterpret_cast(&GetRagConnection())[0x6C] = 0; g_session.m_aid = ReplayFileList::Instance().unknown_011C; g_session.SetFlag(static_cast(ReplayFileList::Instance().unknown_0120)); this->pendingCursorType = 6; return 0; - case 10026: + case LMM_SELECT_REPLAY_DATA: reinterpret_cast(&GetRagConnection())[0x6C] = 1; this->pendingCursorType = 27; return 0; - case 10027: + case LMM_START_REPLAY: g_session.SetFlag(static_cast(Replay::Instance().header.unknown_0014)); this->pendingCursorType = 28; return 0; - case 10028: + case LMM_SELECT_MAP: if (argument1 != -1) { MapStateEntry entry; entry.index = this->mapStates[argument1].index; @@ -3354,10 +3357,10 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, this->pendingCursorType = 31; } return 0; - case 10037: + case LMM_SET_STATE_GET_EMAIL_ADDRESS: this->pendingCursorType = argument1; return reinterpret_cast(this->billingInfo); - case 10038: + case LMM_SET_LOGIN_EXTRA: strcpy(reinterpret_cast(this->unknown_01D0), reinterpret_cast(argument1)); return 0; default: @@ -3653,7 +3656,7 @@ void CLoginMode::OnChangeState(int value) { case 0: case 1: case 13: - this->SendMsg(28, 0, 0, 0, 0); + this->SendMsg(LMM_RESET_TO_LOGIN, 0, 0, 0, 0); break; case 38: { CharServerEndpoint endpoint; @@ -3705,7 +3708,7 @@ void CLoginMode::OnChangeState(int value) { StringFormat(packet.extra, sizeof(packet.extra), static_cast(-1), extraFormat.Text(), reinterpret_cast(this->unknown_01D0)); GetRagConnection().Send(sizeof(packet), &packet); this->otpStarted = timeGetTime(); - this->window_6F14 = g_windowMgr.EnsureWindow(6); + this->window_6F14 = g_windowMgr.EnsureWindow(WID_WAITWND); static_cast(this->window_6F14)->SetMessage(LookupMessage(122), 16, 1); break; } @@ -3729,8 +3732,8 @@ void CLoginMode::OnChangeState(int value) { if (std::strcmp(g_session.m_loginErrorText, "") == 0) { g_session.m_loginModeFlag = true; - if (!g_windowMgr.LookupWindow(3)) { - g_windowMgr.EnsureWindow(3); + if (!g_windowMgr.LookupWindow(WID_LOGINWND)) { + g_windowMgr.EnsureWindow(WID_LOGINWND); } break; } @@ -3747,10 +3750,10 @@ void CLoginMode::OnChangeState(int value) { Replay::Instance().SetState(1); this->wallpaperName = g_loginWallpaperName; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - UISelectServerWnd* window = static_cast(g_windowMgr.EnsureWindow(2)); + UISelectServerWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_SELECTSERVERWND)); const std::uint8_t countNameSource[] = {0x39, 0xC2, 0xCA, 0x4E, 0x66, 0x01, 0xB7, 0x2A, 0x25, 0x97}; thread_local EncryptedName countName(countNameSource); - window->SendMsg(nullptr, 80, 10003, reinterpret_cast(countName.Text()), 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 10003, reinterpret_cast(countName.Text()), 0, 0); if (g_loginCancelRequested == 1) { g_loginCancelRequested = 0; @@ -3823,7 +3826,7 @@ void CLoginMode::OnChangeState(int value) { } } - window->SendMsg(nullptr, 40, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); break; } case 7: @@ -3841,13 +3844,13 @@ void CLoginMode::OnChangeState(int value) { this->wallpaperName = g_loginWallpaperName; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); g_rodexMailStore->Clear(); - if (UINewSelectCharWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(0x115)))) { + if (UINewSelectCharWnd* window = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_NEWSELECTCHARWND)))) { window->m_unknown13C = false; } g_session.ClearEntryList5BD4(); g_session.ClearPairValues(1, 1, 1); - g_windowMgr.CloseWindow(198); - g_windowMgr.CloseWindow(269); + g_windowMgr.CloseWindow(WID_REPLAYRECCONTROLWND); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); g_session.RestoreItems5C68(); g_session.ClearItemQuantities(); g_session.ClearInventory(); @@ -3860,32 +3863,32 @@ void CLoginMode::OnChangeState(int value) { case 2: g_session.m_passwordInputAlternate = false; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(199); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDINPUTWND); break; case 3: g_session.m_passwordInputAlternate = false; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(199); - g_windowMgr.unknown_03B8->SendMsg(nullptr, 6, 0x124, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDINPUTWND); + g_windowMgr.unknown_03B8->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_STORE_PASSWORD, 0, 0, 0); break; case 4: g_session.m_passwordInputAlternate = true; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(200); - g_windowMgr.unknown_03BC->SendMsg(nullptr, 6, 0x124, 0, 0, 0); - g_windowMgr.unknown_03BC->SendMsg(nullptr, 6, 0xB8, 1, 0, 0); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDEDITWND); + g_windowMgr.unknown_03BC->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_STORE_PASSWORD, 0, 0, 0); + g_windowMgr.unknown_03BC->SendMsg(nullptr, UM_COMMAND, ID_OK, 1, 0, 0); break; case 5: g_session.m_passwordInputAlternate = true; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(200); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDEDITWND); break; } break; case 8: this->wallpaperName = g_loginWallpaperName; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(0x116); + g_windowMgr.EnsureWindow(WID_NEWMAKECHARWND); break; case 4: { g_playerNameDictionary->Clear(); @@ -3953,11 +3956,11 @@ void CLoginMode::OnChangeState(int value) { } packet.clientType = static_cast(GetClientType()); GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(122), 16, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(122), 16, 1); break; } case 24: - g_windowMgr.EnsureWindow(180); + g_windowMgr.EnsureWindow(WID_LOGINOTPWND); break; case 5: { this->wallpaperName = g_loginWallpaperName; @@ -3984,7 +3987,7 @@ void CLoginMode::OnChangeState(int value) { packet.userLevel = account.userLevel; packet.sex = static_cast(account.sex); GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(122), 16, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(122), 16, 1); g_accountLinkedUserDataMgr->Load(g_session.m_aid, g_session.m_accountName); break; } @@ -4000,7 +4003,7 @@ void CLoginMode::OnChangeState(int value) { packet.job = g_charInfo.job; packet.sex = g_charInfo.sex; GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); - if (UIWaitWnd* wait = static_cast(g_windowMgr.EnsureWindow(6))) { + if (UIWaitWnd* wait = static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))) { wait->SetMessage(LookupMessage(123), 17, 1); } break; @@ -4011,7 +4014,7 @@ void CLoginMode::OnChangeState(int value) { DeleteCharacterPacket packet; packet.id = 0x829; std::strncpy(packet.code, reinterpret_cast(this->billingInfo), sizeof(packet.code)); - const CharacterInfo* character = reinterpret_cast(this->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + const CharacterInfo* character = reinterpret_cast(this->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); packet.gid = character->gid; if (g_serviceType == 0) { if (this->billingInfo[5] == '\0') { @@ -4028,7 +4031,7 @@ void CLoginMode::OnChangeState(int value) { } else { GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); } - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(124), 17, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(124), 17, 1); break; } case 9: { @@ -4039,7 +4042,7 @@ void CLoginMode::OnChangeState(int value) { packet.slot = static_cast(g_selectedSlotIndex); g_cashEmotionMgr->ClearOwnedPacks(); GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.id), &packet); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(122), 16, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(122), 16, 1); break; } case 12: { @@ -4085,7 +4088,7 @@ void CLoginMode::OnChangeState(int value) { GetRagConnection().Send(reinterpret_cast(&GetRagConnection())->FixedLength(packet.packetType), &packet); g_session.SetOption(17, 1, 0); GetRagConnection().SetBlock(1); - static_cast(g_windowMgr.EnsureWindow(6))->SetMessage(LookupMessage(122), 16, 1); + static_cast(g_windowMgr.EnsureWindow(WID_WAITWND))->SetMessage(LookupMessage(122), 16, 1); break; } case 19: @@ -4096,7 +4099,7 @@ void CLoginMode::OnChangeState(int value) { g_session.SetUnknown16EC(0); this->wallpaperName = g_loginWallpaperName; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(127); + g_windowMgr.EnsureWindow(WID_SELCHARFORUSERVERWND); break; case 29: { if (g_serviceType == 6 || g_serviceType == 10 || g_serviceType == 12) { @@ -4111,7 +4114,7 @@ void CLoginMode::OnChangeState(int value) { thread_local EncryptedName wallpaper(wallpaperSource); this->wallpaperName = std::string(wallpaper.Text()); g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - g_windowMgr.EnsureWindow(20)->SendMsg(nullptr, 80, 10026, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_NOTICECONFIRMWND)->SendMsg(nullptr, UM_SET_TARGET, 10026, 0, 0, 0); break; } case 25: @@ -4131,17 +4134,17 @@ void CLoginMode::OnChangeState(int value) { for (int i = 0; i < this->unknown_01C4; ++i) { std::memcpy(&servers[i], &reinterpret_cast(ReplayFileList::Instance().buffer)[i], sizeof(ServerAddress2)); } - this->SendMsg(10026, 0, 0, 0, 0); + this->SendMsg(LMM_SELECT_REPLAY_DATA, 0, 0, 0, 0); case 27: { this->wallpaperName = g_loginWallpaperName; g_windowMgr.SetSurface0478(reinterpret_cast(ResourceMgr::Instance().Load(Resolve(this->wallpaperName.c_str())))); - UISelectReplayDataWnd* window = static_cast(g_windowMgr.EnsureWindow(186)); + UISelectReplayDataWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_SELECTREPLAYDATAWND)); ReplayFileList::Instance().Refresh(); const int count = static_cast(ReplayFileList::Instance().files.size()); for (int i = 0; i < count; ++i) { window->m_list->AddLine(ReplayFileList::Instance().FileName(i)); } - window->SendMsg(nullptr, 40, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); ReplayFileList::Instance().unknown_0124 = this->unknown_01C4; if (this->unknown_01C4 > 100) { this->unknown_01C4 = 0; @@ -4159,7 +4162,7 @@ void CLoginMode::OnChangeState(int value) { ComputeLoginDigest(digest, key.data(), static_cast(key.size())); g_pakRegistry.ApplyAuxiliary(digest, sizeof(digest)); SecureZeroMemory(digest, sizeof(digest)); - g_windowMgr.CloseWindow(269); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); g_session.RestoreItems5C68(); g_session.ClearItemQuantities(); g_session.ClearInventory(); @@ -4185,16 +4188,16 @@ void CLoginMode::OnChangeState(int value) { break; } case 30: { - UISelectServerWnd* window = static_cast(g_windowMgr.EnsureWindow(2)); + UISelectServerWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_SELECTSERVERWND)); const std::uint8_t countNameSource[] = {0xB9, 0x9C, 0x2E, 0x33, 0x32, 0xD7, 0x34, 0x91}; thread_local EncryptedName countName(countNameSource); - window->SendMsg(nullptr, 80, 10028, reinterpret_cast(countName.Text()), 0, 0); + window->SendMsg(nullptr, UM_SET_TARGET, 10028, reinterpret_cast(countName.Text()), 0, 0); for (unsigned int i = 0; i < this->mapStates.size(); ++i) { char mapName[16]; std::strncpy(mapName, g_session.GatName2RswName(reinterpret_cast(&this->mapStates[i].data)), sizeof(mapName)); window->m_serverList->AddLine(g_session.GetMapDisplayName(mapName)); } - window->SendMsg(nullptr, 40, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); break; } case 31: { diff --git a/Source/Client/Mode/LoginModeNotices.cpp b/Source/Client/Mode/LoginModeNotices.cpp index 2e71a0934..e92d007a8 100644 --- a/Source/Client/Mode/LoginModeNotices.cpp +++ b/Source/Client/Mode/LoginModeNotices.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CLoginMode.h" +#include "Client/Mode/ModeMessage.h" #include "Network/Packets/NoticeEnums.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" @@ -271,6 +272,6 @@ void CLoginMode::ReceiveNotifyBan(const unsigned char* data) { if (g_session.m_loginModeFlag == true) { this->pendingCursorType = 3; } else { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } } diff --git a/Source/Client/Mode/ModeDragState.cpp b/Source/Client/Mode/ModeDragState.cpp index a1e5322aa..b7127e597 100644 --- a/Source/Client/Mode/ModeDragState.cpp +++ b/Source/Client/Mode/ModeDragState.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/ModeDragState.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Contents/Items/BarterMarketItemMgr.h" #include "Contents/Items/ItemDescription.h" @@ -33,7 +34,7 @@ void ModeDragState::Clear() { void ModeDragState::BeginItem( WindowManagerWindows& windows, int sourceValue, const ITEM_INFO& item, int quantityValue, int slotValue ) { - windows.ShowWindowById(15, 0); + windows.ShowWindowById(WID_ITEMDROPCNTWND, 0); this->Clear(); if (item.unknown_0000[1] == 0) { @@ -70,7 +71,7 @@ void ModeDragState::BeginItem( void ModeDragState::BeginSkill( WindowManagerWindows& windows, ResourceMgr& resources, int sourceValue, std::uint32_t idValue, const char* nameValue, int level, int slotValue ) { - UIWindow* window = windows.EnsureWindow(15); + UIWindow* window = windows.EnsureWindow(WID_ITEMDROPCNTWND); if (window->geometry.visible != 0) { window->Show(0); } @@ -90,7 +91,7 @@ void ModeDragState::BeginSkill( // OFFSET: 0x00CFDF90 // FUNCTION: fn_21427 void ModeDragState::BeginBarterItem(int sourceValue, const BarterMarketItem& item, int quantityValue, int slotValue) { - g_windowMgr.ShowWindowById(15, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 0); this->Clear(); this->source = sourceValue; this->quantity = quantityValue; @@ -107,7 +108,7 @@ void ModeDragState::BeginBarterItem(int sourceValue, const BarterMarketItem& ite // OFFSET: 0x00CFE060 // FUNCTION: fn_21428 void ModeDragState::BeginBarterEntry(int sourceValue, const BarterMarketEntry& entry, int quantityValue, int slotValue) { - g_windowMgr.ShowWindowById(15, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 0); this->Clear(); this->source = sourceValue; this->quantity = quantityValue; diff --git a/Source/Client/Mode/ModeMessage.h b/Source/Client/Mode/ModeMessage.h index a11e07711..a954c49b4 100644 --- a/Source/Client/Mode/ModeMessage.h +++ b/Source/Client/Mode/ModeMessage.h @@ -169,6 +169,100 @@ enum MODEMESSAGE : int { MM_GROUP_CHANGE_MASTER = 260, MM_WHISPER_FILTER = 285, MM_SHORTCUT_KEY_CHANGE = 313, + MM_QUIT = 2, + MM_SETLOCKONMOUSE = 26, + MM_PLAYER_EMOTION_END = 33, + MM_RELEASE_QUEST = 40, + MM_CLOSE_STORE = 57, + MM_MAKE_GROUP = 58, + MM_SCREENSHOT = 68, + MM_REQ_CARTOFF = 80, + MM_WEAR_EQUIP_ARROW = 87, + MM_QUIT_GAME = 88, + MM_INITWHISPERMENU = 101, + MM_USING_SKILL = 113, + MM_TESTPACKET = 116, + MM_GUILD_MEMBER_STATUS_CHANGE = 140, + MM_REQ_GIVE_MANNER_POINT_PLUS = 151, + MM_REQ_GIVE_MANNER_POINT_MINUS = 152, + MM_SONG_TALK = 165, + MM_CHECK_ID = 177, + MM_RC_ID = 178, + MM_COMMAND_HOMUN = 184, + MM_HOMUN_WAIT = 189, + MM_SEND_MAIL = 192, + MM_OPEN_MAIL = 194, + MM_ADD_MAIL_ITEM = 195, + MM_DELETE_MAIL = 196, + MM_ITEM_FROM_LIST = 207, + MM_RELEASE_QUEST_SH = 245, + MM_OPEN_EQUIPEDITEM_CHANGE = 253, + MM_SKILL_SELECT_RESPONSE = 256, + MM_GROUPINFO_CHANGE_V2 = 259, + MM_OPEN_SEEKPARTY_MEMBER = 261, + MM_NPC_MARKET_PURCHASE = 262, + MM_NPC_MARKET_PURCHASE_V2 = 263, + MM_PARTY_REQ_ACK_MASTER_TO_JOIN = 264, + MM_PARTY_REQ_MASTER_TO_JOIN = 265, + MM_ITEMLISTWIN_RES = 266, + MM_CANCEL_ITEMLISTWIN = 267, + MM_OPEN_WRITE_RODEX = 268, + MM_OPEN_SEEKPARTY_LIST = 269, + MM_REQ_CLOSE_BUYING_STORE = 270, + MM_REQ_OPEN_BUYING_STORE = 271, + MM_REQ_CLICK_TO_BUYING_STORE = 272, + MM_REQ_TRADE_BUYING_STORE = 273, + MM_START_REPLAY_RECORDING = 274, + MM_STOP_REPLAY_RECORDING = 275, + MM_PAUSE_REPLAY = 276, + MM_RESUME_REPLAY = 277, + MM_RESTART_REPLAY = 278, + MM_INCREASE_REPLAY_SPEED = 279, + MM_DECREASE_REPLAY_SPEED = 280, + MM_EXIT_REPLAY = 281, + MM_TRYCOLLECTION = 282, + MM_REQ_JOIN_GUILD2 = 286, + MM_REQ_RANKING = 287, + MM_CHAT_CLAN = 289, + MM_NPC_TRADE_QUIT = 291, + MM_NPC_MARKET_CLOSE = 292, + MM_CANCEL_WRITE_RODEX = 293, + MM_REMOVE_RODEX_ITEM = 294, + MM_OFFLINE_STORE_CREATE = 296, + MM_CANCEL_VENDING_MAKE = 297, + MM_OPEN_BUYING_STORE_EXTENDED = 298, + MM_CANCEL_BUYING_STORE_MAKE = 299, + MM_CLOSE_OFFLINE_STORE = 301, + MM_WEAR_SWAP_EQUIP = 302, + MM_TAKE_OFF_SWAP_EQUIP = 303, + MM_SWAP_EQUIPMENT = 304, + MM_SWAP_EQUIPMENT_BY_INDEX = 305, + MM_MEMORIALDUNGEON_COMMAND = 306, + MM_NPC_BARTER_MARKET_PURCHASE = 308, + MM_NPC_BARTER_MARKET_CLOSE = 309, + MM_REQ_OPEN_MSGBOX_EXTEND_BODYITEM_SIZE = 310, + MM_REQ_EXTEND_BODYITEM_SIZE = 311, + MM_CLOSE_MSGBOX_EXTEND_BODYITEM_SIZE = 312, + MM_ADVANCED_STATUS_CHANGE = 314, + MM_REQ_MOVE_GUILD_AGIT = 315, + MM_REQ_AGIT_INVESTMENT = 316, + MM_PRISON_USER = 317, + MM_OPEN_ACCOUNT_LIMITED_TOOL = 318, + MM_CLOSE_ACCOUNT_LIMITED_TOOL = 319, + MM_GET_ACCOUNT_LIMITED_SALE_LIST = 320, + MM_NPC_EXPANDED_BARTER_MARKET_PURCHASE = 321, + MM_NPC_EXPANDED_BARTER_MARKET_CLOSE = 322, + MM_REQUEST_CASH_SHOP = 323, + MM_REFRESH_PLAYERGAGE = 324, + MM_USE_PACKAGEITEM = 325, + MM_RESET_SKILL = 326, + MM_CONFIG_CALL = 328, + MM_CASH_EMOTION = 329, + MM_CHAT_ALLY = 330, + MM_STOVE_AUTHENTICATION = 331, + MM_MOVE_ITEM_TO_PERSONAL = 333, + MM_INVENTORY_TAB = 334, + MM_MOVE_ITEM_TO_PERSONAL_FROM_STORAGE = 335, }; enum LOGINMODEMESSAGE : int { @@ -195,6 +289,18 @@ enum LOGINMODEMESSAGE : int { LMM_GET_BILLING_INFO = 10020, LMM_DISCONNECT_ACSVR = 10021, LMM_SELECTACCOUNT2 = 10022, + LMM_SEND_CHARACTER_AUTH_CODE = 23, + LMM_DISPATCH_CHARACTER_SLOT_ACTION = 24, + LMM_RESET_TO_LOGIN = 28, + LMM_SEND_LOGIN_AUTH_CODE = 39, + LMM_QUERY_LAST_CHARACTER_INFO = 258, + LMM_SET_AUTH_CODE = 10024, + LMM_REPLAY_SELECT_SERVER = 10025, + LMM_SELECT_REPLAY_DATA = 10026, + LMM_START_REPLAY = 10027, + LMM_SELECT_MAP = 10028, + LMM_SET_STATE_GET_EMAIL_ADDRESS = 10037, + LMM_SET_LOGIN_EXTRA = 10038, }; #endif diff --git a/Source/Client/ModeScreenshot.cpp b/Source/Client/ModeScreenshot.cpp index 8e8033fa6..a0bd89801 100644 --- a/Source/Client/ModeScreenshot.cpp +++ b/Source/Client/ModeScreenshot.cpp @@ -1,4 +1,5 @@ #include "Client/ModeScreenshot.h" +#include "UI/Window/UIEnums.h" #include "Client/Application/Launcher.h" #include "Client/Mode/CMode.h" @@ -126,7 +127,7 @@ void CMode::TakeScreenshot() { g_renderer->SaveLogo(path); path += " is Saved."; - g_windowMgr.SendNotice(1, reinterpret_cast(path.c_str()), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(path.c_str()), 0xFF00, 0, 0, 0); this->screenshotName = ""; } } diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index 73b206f9e..7cc687391 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -1,4 +1,5 @@ #include "Client/Replay.h" +#include "UI/Window/WindowId.h" #include "Network/Packets/PacketId.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Skills/SkillInfo.h" @@ -118,11 +119,11 @@ std::vector BuildEntryQueueReplayRecords() { if (text.size() != 0) { AppendRecord(records, BuildReplayTaggedRecord(6514, text.c_str(), text.size())); } - if (UIEntryQueueWnd* window = dynamic_cast(g_windowMgr.LookupWindow(157))) { + if (UIEntryQueueWnd* window = dynamic_cast(g_windowMgr.LookupWindow(WID_JOINTO_BATTLEFIELDWND))) { const int selected = window->SelectedIndex(); AppendRecord(records, MakeReplayRecord(6515, &selected, sizeof(selected))); } - if (UIEntryQueueStandByWnd* window = dynamic_cast(g_windowMgr.LookupWindow(209))) { + if (UIEntryQueueStandByWnd* window = dynamic_cast(g_windowMgr.LookupWindow(WID_ENTRYQUEUESTANDBYWND))) { AppendRecord(records, MakeReplayRecord(6517, &window->m_waiting, sizeof(window->m_waiting))); AppendRecord(records, MakeReplayRecord(6518, &window->m_ranking, sizeof(window->m_ranking))); AppendRecord(records, BuildReplayTaggedRecord(6516, window->m_queueName.c_str(), window->m_queueName.size())); diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index 3f4884309..2d4f3004d 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -1,4 +1,8 @@ #include "Client/Session.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Combat/CombatTypes.h" #include "Utility/EncryptedName.h" #include "Client/Mode/CGameMode.h" @@ -1255,62 +1259,62 @@ int CSession::GetTalkType(const char* text, int* talkType, std::string* parts) { } if (tokenizer[0] == "/str+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0xD, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0xD, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/agi+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0xE, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0xE, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/luk+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0x12, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0x12, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/int+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0x10, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0x10, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/vit+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0xF, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0xF, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/dex+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x1E, 0x11, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STATUS_CHANGE, 0x11, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/pow+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xDB, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xDB, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/sta+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xDC, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xDC, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/wis+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xDD, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xDD, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/spl+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xDE, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xDE, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/con+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xDF, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xDF, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/crt+" && count > 1) { *talkType = 0x89; - g_modeMgr.GetGameMode()->SendMsg(0x13A, 0xE0, std::atoi(tokenizer[1].c_str()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADVANCED_STATUS_CHANGE, 0xE0, std::atoi(tokenizer[1].c_str()), 0, 0); return *talkType == 0 ? 0 : skipSpaces(0); } if (tokenizer[0] == "/hi") { @@ -1868,7 +1872,7 @@ void CSession::RemovePartyMemberByName(const char* name) { CRenderObject* actor = mode->scene->GetGameActorByAidIncludeMe(it->accountId); if (actor != nullptr && static_cast(actor)->HasId(160)) { - actor->SendMsg(nullptr, 109, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->m_partyMembers.erase(it); @@ -1994,7 +1998,7 @@ int CSession::GetUnknown8148() const { // FUNCTION: fn_23606 void CSession::RefreshWindow02C8() { if (UIWindow* window = g_windowMgr.window_02C8) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2002,7 +2006,7 @@ void CSession::RefreshWindow02C8() { // FUNCTION: fn_23607 void CSession::RefreshItem1740Window() { if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2017,7 +2021,7 @@ void CSession::RefreshItem1750Window(int type) { } if (window) { - reinterpret_cast(window)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(window)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2031,7 +2035,7 @@ void CSession::UpdateUnknown1708(int enabled) { // FUNCTION: fn_23611 void __fastcall RefreshPartyWindows(CSession*) { if (UIWindow* window = g_windowMgr.window_02C8) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } g_windowMgr.RebuildMiniPartyWindows(); } @@ -2040,7 +2044,7 @@ void __fastcall RefreshPartyWindows(CSession*) { // FUNCTION: fn_23612 void CSession::RefreshItem1738Window() { if (UIWindow* window = g_windowMgr.window_0288) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2098,7 +2102,7 @@ void CSession::SetItem1768Quantity(int index, int quantity) { void CSession::SetUnknown5C1C(int value) { this->unknown_5C1C = value; if (UIWindow* window = g_windowMgr.unknown_01E0) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -2108,7 +2112,7 @@ void CSession::UpdateFriendName(std::uint32_t characterId, const char* name) { for (auto it = this->m_friends.begin(); it != this->m_friends.end(); ++it) { if (it->characterId == characterId) { if (std::strlen(name) == 0) { - g_modeMgr.gameMode->SendMsg(176, it->accountId, it->characterId, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_DELETE_FRIEND, it->accountId, it->characterId, 0, 0); this->m_friends.erase(it); } else { it->name = name; @@ -2117,7 +2121,7 @@ void CSession::UpdateFriendName(std::uint32_t characterId, const char* name) { } } - if (UIWindow* window = g_windowMgr.LookupWindow(34)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MESSENGERGROUPWND)) { window->Invalidate(); } } @@ -2173,7 +2177,7 @@ void CSession::SetUnknown16EC(std::uint32_t value) { } if (mode->scene && mode->scene->player && mode->scene->player->unknown_0544) { - mode->scene->player->unknown_0544->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + mode->scene->player->unknown_0544->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } } @@ -2203,7 +2207,7 @@ int CSession::SetFriendOffline(std::uint32_t accountId, std::uint32_t characterI } else { std::sprintf(message, LookupMessage(1042), member.name.c_str()); } - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 0, 0, 0); } return 1; } @@ -2279,8 +2283,8 @@ void CSession::AddRecord0734(int id, std::uint32_t value) { // FUNCTION: fn_23632 void CSession::SetUnknown5210(int value) { this->unknown_5210 = value; - if (UIWindow* window = g_windowMgr.LookupWindow(10011)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2288,8 +2292,8 @@ void CSession::SetUnknown5210(int value) { // FUNCTION: fn_23634 void CSession::SetUnknown5214(int value) { this->unknown_5214 = value; - if (UIWindow* window = g_windowMgr.LookupWindow(10011)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2616,7 +2620,7 @@ int CSession::CountItems17F0() const { void CSession::RefreshSkillTree() { this->InitializeSkillTree(); if (g_windowMgr.window_02C4) { - g_windowMgr.window_02C4->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.window_02C4->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (g_windowMgr.unknown_01DC) { @@ -2691,7 +2695,7 @@ void CSession::HiFriends(char* text) { for (const MessengerMember& member : this->m_friends) { g_windowMgr.unknown_04DC = greeting.c_str(); - g_modeMgr.gameMode->SendMsg(0xB, reinterpret_cast(member.name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(member.name.c_str()), 0, 0, 0); if (++g_pendingWhisperCount > 40) { g_pendingWhisperCount = 40; } @@ -3239,7 +3243,7 @@ void CSession::ClearItemContainers() { for (std::list::iterator it = this->m_partyMembers.begin(); it != this->m_partyMembers.end(); ++it) { CRenderObject* actor = mode->scene->GetGameActorByAidIncludeMe(it->accountId); if (actor != nullptr && static_cast(actor)->HasId(160)) { - actor->SendMsg(nullptr, 109, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } diff --git a/Source/Client/SessionAchievements.cpp b/Source/Client/SessionAchievements.cpp index 757209701..fe9e5e07b 100644 --- a/Source/Client/SessionAchievements.cpp +++ b/Source/Client/SessionAchievements.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Contents/AchievementMgr.h" #include "Contents/Jobs/JobInheritance.h" @@ -39,8 +41,8 @@ int CSession::AddUnknown6160(int id) { this->unknown_6160.push_back(value); std::sort(this->unknown_6160.begin(), this->unknown_6160.end(), JobTitleLess()); - if (UIWindow* window = g_windowMgr.LookupWindow(10)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_EQUIPWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } return value; @@ -73,7 +75,7 @@ bool CSession::ToggleTrackedAchievement(int id) { tracked.erase(found); } else { if (tracked.size() >= 3) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA78)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA78)), 0x64FFFF, 0, 0, 0); return false; } @@ -116,7 +118,7 @@ bool CSession::ToggleTrackedAchievement(int id) { } if (tracked.size() == 0) { - g_windowMgr.CloseWindow(0x10F); + g_windowMgr.CloseWindow(WID_ACHTRACINGWND); return false; } diff --git a/Source/Client/SessionState.cpp b/Source/Client/SessionState.cpp index bde0bd1d9..1ca9d4474 100644 --- a/Source/Client/SessionState.cpp +++ b/Source/Client/SessionState.cpp @@ -1,3 +1,6 @@ +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/CGameMode.h" @@ -260,7 +263,7 @@ void CSession::UnequipItem61B8(const ITEM_INFO& item) { const char* message = LookupMessage(0xAB); const std::string name = equipped.DisplayName(0); const std::string text = FormatOwnedString("%s%s", name.c_str(), message); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 7, 0, 0); } this->SetUnknown7EC8(0); } else { @@ -296,7 +299,7 @@ void CSession::SetJob(int job) { } if (g_modeMgr.GetGameMode()) { - g_modeMgr.GetGameMode()->SendMsg(0x144, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REFRESH_PLAYERGAGE, 0, 0, 0, 0); } } @@ -326,7 +329,7 @@ void CSession::SetUnknown7EC8(std::uint32_t value) { g_activeSkillEffects.erase(it); } - mode->scene->player->unknown_0544->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + mode->scene->player->unknown_0544->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } // OFFSET: 0x00E49930 @@ -345,8 +348,8 @@ void CSession::NotifyUnknown7F94Name(std::uint32_t id, const char* name) { return; } - chat->SendMsg(nullptr, 0x9A, reinterpret_cast(name), 0, 0, 0); - g_windowMgr.SendNotice(0x9A, reinterpret_cast(name), 0, 0, 0, 0); + chat->SendMsg(nullptr, UM_RESOLVE_PLAYER_TAGS, reinterpret_cast(name), 0, 0, 0); + g_windowMgr.SendNotice(UIM_RESOLVE_PLAYER_TAGS, reinterpret_cast(name), 0, 0, 0, 0); this->unknown_7F94.erase(id); } diff --git a/Source/Client/Stove/StoveMgr.cpp b/Source/Client/Stove/StoveMgr.cpp index 40de704a6..2a89100de 100644 --- a/Source/Client/Stove/StoveMgr.cpp +++ b/Source/Client/Stove/StoveMgr.cpp @@ -1,4 +1,7 @@ #include "Client/Application/ApplicationWindow.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Utility/EncryptedName.h" #include "Client/Application/Launcher.h" #include "Client/Mode/CGameMode.h" @@ -223,7 +226,7 @@ void ShutdownCallback::operator()(Stove::PCSDK::CallbackResult callbackResult, S const char captionSource[] = {'\x27', '\x1D', '\xFA', '\x7E', '\x2A', '\xB1', '\xE1'}; const char* caption = DecryptName<0x91E147EBBD47C39FULL>(captionSource); MessageBoxA(hWnd, message.c_str(), caption, MB_OK); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } else if (g_modeMgr.state == 0) { g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0); } else { @@ -234,9 +237,9 @@ void ShutdownCallback::operator()(Stove::PCSDK::CallbackResult callbackResult, S balloon.lines.push_back(BroadcastBalloonLine{message, 0x62B0FF, 0}); balloonWindow->AddMessage(0, balloon); } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0x62B0FF, 0, 0, 0); - g_windowMgr.SendNotice(19, reinterpret_cast(message.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(message.c_str()), 0x62B0FF, 0, 0, 0); } } else { const char captionSource[] = {'\x6B', '\x33', '\x2A', '\xD6', '\x8C', '\xAD', '\xA5'}; @@ -472,18 +475,18 @@ void ConfirmPurchaseCallback::operator()(Stove::PCSDK::CallbackResult callbackRe g_stoveWaitingCallback = false; if (callbackResult.GetResult().IsSuccessful()) { if (count != 0 && purchased == true) { - g_modeMgr.GetGameMode()->SendMsg(331, 4, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STOVE_AUTHENTICATION, 4, 0, 0, 0); g_stoveMgr->FetchAllProducts(); - UIWindow* window = g_windowMgr.LookupWindow(318); + UIWindow* window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND); if (window != nullptr) { - window->SendMsg(nullptr, 122, 0, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_UPDATE_CASHSHOP_BALANCE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const char noticeSource[] = {'\x50', '\x23', '\x4B', '\xBE', '\x58', '\x4F', '\xDF', '\xDF', '\x27', '\x5B', '\x3F', '\xBE', '\x36', '\x47', '\x33', '\x41', '\x5F', '\x63', '\x4E', '\xBB', '\x59', '\x48', '\x4B', '\xB8', '\xCF', '\x9B'}; const char* notice = DecryptName<0x61FF87ED7BF39BE1ULL>(noticeSource); - g_windowMgr.SendNotice(1, reinterpret_cast(notice), 0xFFE6E6, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice), 0xFFE6E6, 0, 0, 0); } } else { const char captionSource[] = {'\x8B', '\xF9', '\x8E', '\xCC', '\x7C', '\xBB', '\x39'}; @@ -658,7 +661,7 @@ void CStoveMgr::WaitForCallback() { void TermsAgreementCallback::operator()(Stove::PCSDK::CallbackResult callbackResult, int unused, const wchar_t* url) const { g_stoveWaitingCallback = false; if (callbackResult.GetResult().IsSuccessful()) { - g_modeMgr.GetGameMode()->SendMsg(323, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQUEST_CASH_SHOP, 0, 0, 0, 0); } else { std::string path = EncodeText(CP_ACP, std::wstring(url)); const char source[] = {'\x68', '\x51', '\x42', '\x23', '\x03'}; diff --git a/Source/Contents/Actors/ActorEnums.h b/Source/Contents/Actors/ActorEnums.h index ba97f15df..d9c7ef692 100644 --- a/Source/Contents/Actors/ActorEnums.h +++ b/Source/Contents/Actors/ActorEnums.h @@ -150,6 +150,72 @@ enum ACTORMESSAGE : int { AM_INITMOVEENTRY2 = 122, AM_MOVEENTRY2 = 123, AM_STANDENTRY2 = 124, + AM_SETPOSMOUSE = 1, + AM_HIDEMOUSE = 2, + AM_STOPMOVE = 19, + AM_USEITEM_EFFECT = 20, + AM_WILL_BE_DEAD = 28, + AM_MVP = 36, + AM_MSGEFFECT_DEAD = 48, + AM_MAKE_CART = 51, + AM_DELETE_CART = 52, + AM_MAKE_PKEFFECT = 56, + AM_DELETE_PKEFFECT = 57, + AM_MAKE_ICEEFFECT = 58, + AM_DELETE_ICEEFFECT = 59, + AM_RESUMEPROCEEDATTACK = 60, + AM_MAKE_ICEBREAKE_FFECT = 62, + AM_MAKE_SMOKE_FFECT = 63, + AM_MAKE_CURSE_EFFECT = 67, + AM_DELETE_CURSE_EFFECT = 68, + AM_MAKE_SLEEP_EFFECT = 69, + AM_DELETE_SLEEP_EFFECT = 70, + AM_MAKE_STUN_EFFECT = 71, + AM_DELETE_STUN_EFFECT = 72, + AM_MAKE_SILENCE_EFFECT = 73, + AM_DELETE_SILENCE_EFFECT = 74, + AM_MAKE_ANGELUS_EFFECT = 75, + AM_DELETE_ANGELUS_EFFECT = 76, + AM_MAKE_CRUCIS_EFFECT = 78, + AM_DELETE_CRUCIS_EFFECT = 79, + AM_DELETE_BEGIN_SPELL = 84, + AM_MAKE_BEGIN_SPELL = 85, + AM_MAKE_MAGIC_TARGET = 86, + AM_DELETE_MAGIC_TARGET = 87, + AM_MAKE_CRITICAL_EFFECT = 92, + AM_MAKE_CHICKEN = 105, + AM_DELETE_CHICKEN = 106, + AM_ATTACKED_MANYTIMES = 111, + AM_CHANGE_RANK = 114, + AM_DELETE_PROHIBITEFFECT = 118, + AM_MAKE_LEVEL99_EFFECT = 125, + AM_MAKE_GUARD = 126, + AM_CHANGE_COLOR = 127, + AM_RETURN_COLOR = 128, + AM_ATTACKED_MANYTIMES2 = 129, + AM_WILL_BE_ATTACKED2 = 130, + AM_ATTACKED_MANYTIMES2DASH = 132, + AM_WILL_BE_ATTACKED2DASH = 133, + AM_MAKE_WOLF = 137, + AM_DELETE_WOLF = 138, + AM_MAKE_BURNING_EFFECT = 139, + AM_DELETE_BURNING_EFFECT = 140, + AM_MAKE_BUYING_SHOP_TITLE = 141, + AM_DELETE_BUYING_SHOP_TITLE = 142, + AM_EFFECT_LOOP_COUNT = 143, + AM_FALLEN_ANGEL = 144, + AM_UPDATE_MONSTER_GAGE = 145, + AM_MAKE_LEVEL160_EFFECT = 146, + AM_CLEAR_ROUTE = 149, + AM_MAKE_LEVEL4TH_EFFECT = 151, + AM_MAKE_LASSITUDE_EFFECT = 152, + AM_DELETE_LASSITUDE_EFFECT = 153, + AM_MAKE_MISFORTUNE_EFFECT = 154, + AM_DELETE_MISFORTUNE_EFFECT = 155, + AM_MAKE_DEEPSILENCE_EFFECT = 156, + AM_DELETE_DEEPSILENCE_EFFECT = 157, + AM_DELETE_TAGGED_EFFECT = 159, + AM_CASH_EMOTION = 160, }; enum PROCEEDTYPE : int { diff --git a/Source/Contents/Actors/GameActor.cpp b/Source/Contents/Actors/GameActor.cpp index 0e1e8a351..99ed737f6 100644 --- a/Source/Contents/Actors/GameActor.cpp +++ b/Source/Contents/Actors/GameActor.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "Contents/Actors/GameActor.h" #include "Contents/Actors/ActorEnums.h" #include "Contents/Jobs/JobId.h" @@ -96,11 +98,11 @@ void CGameActor::ProcessDamageMessages() { } if (std::strlen(notice) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(notice), 0xFFFF, 16, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice), 0xFFFF, 16, 0, 0); } if (std::strlen(partyNotice) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(partyNotice), 0xC8C8FF, 17, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(partyNotice), 0xC8C8FF, 17, 0, 0); } } @@ -119,7 +121,7 @@ void CGameActor::RegisterPos() { int column; int row; mode->WorldCell(this->render.position.x, this->render.position.z, column, row); - mode->SendMsg(0xC, this->render.accountId, column, row, 0); + mode->SendMsg(MM_ADDREGISTERPOS, this->render.accountId, column, row, 0); } // OFFSET: 0x00CB0FD0 @@ -163,7 +165,7 @@ bool CGameActor::ProcessState() { this->unknown_0178 = 0; this->render.isMotionFreezed = false; this->SetState(0, 1); - this->SendMsg(nullptr, 0x53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->ProcessMotion(); this->unknown_0244 = timeGetTime(); @@ -180,8 +182,8 @@ bool CGameActor::ProcessState() { const int friendly = g_session.GetPetFriendlyState(g_session.m_petFriendly); const int action = g_session.GetPetActionNumber(hungry, friendly, 4); const int emotion = g_session.GetPetEmotionNumber(g_session.unknown_103C, 4, hungry); - mode->SendMsg(0x94, emotion, 0, 0, 0); - mode->SendMsg(0x94, action, 0, 0, 0); + mode->SendMsg(MM_PET_ACT, emotion, 0, 0, 0); + mode->SendMsg(MM_PET_ACT, action, 0, 0, 0); } this->unknown_027C = 0; } @@ -351,7 +353,7 @@ bool CGameActor::ProcessState() { this->unknown_0178 = 0; this->ProcessMotion(); if (this->render.isMotionFinished && this->unknown_02A8.size() == 0) { - mode->SendMsg(0xD, static_cast(this->render.accountId), 0, 0, 0); + mode->SendMsg(MM_DELETEREGISTERPOS, static_cast(this->render.accountId), 0, 0, 0); const int job = this->GetEffectiveJob(-1); if ((job > 31 && job < 1000) || g_session.IsMonsterClass(job) || this->unknown_0314 == 9 || g_session.IsSkillIdInRange6001(job)) { @@ -586,7 +588,7 @@ void CGameActor::UpdateGaugePositions() { if (this->unknown_0264[3] != 0) { if (timeGetTime() > this->unknown_0280) { - this->SendMsg(nullptr, 0x53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_SKILL_RECHARGEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->render.unknown_0070 == 8) { this->SetState(0, 1); } @@ -646,7 +648,7 @@ void CGameActor::ReleaseAttachments() { } for (CGameObject* object : this->unknown_03B0) { - object->SendMsg(nullptr, 0x31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + object->SendMsg(nullptr, AM_MSGMASTER_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->unknown_03B0.clear(); @@ -680,7 +682,7 @@ void CGameActor::UpdateStateEffects() { this->unknown_02D8 = 0; CRagEffect* effect = this->LaunchEffect(22, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, static_cast((static_cast(now) >> 4) % 10 + 1), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, static_cast((static_cast(now) >> 4) % 10 + 1), 0, 0, 0, 0); } } @@ -688,7 +690,7 @@ void CGameActor::UpdateStateEffects() { this->unknown_02D8 = 0; CRagEffect* effect = this->LaunchEffect(33, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, static_cast((static_cast(now) >> 4) % 10 + 1), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, static_cast((static_cast(now) >> 4) % 10 + 1), 0, 0, 0, 0); } } diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index 57f383e25..ccf6e1f0b 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -1,3 +1,6 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Actors/GameObject.h" #include "Contents/Actors/ActorEnums.h" #include "Network/Packets/NoticeEnums.h" @@ -906,7 +909,7 @@ void CRenderObject::SendValueMessage(int value, CGameObject* target) { if (target) { const std::int64_t wide = value; target->SendMsg( - nullptr, 29, 0, static_cast(wide), static_cast(wide >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + nullptr, AM_REQ_ATTACK, 0, static_cast(wide), static_cast(wide >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } } @@ -945,13 +948,13 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, switch (static_cast(a) << 32 | static_cast(message)) { case AM_MASTER_DEAD: for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { - (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + (*it)->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); } this->state.effects.clear(); break; - case 86: + case AM_MAKE_MAGIC_TARGET: if (!this->state.second) { this->state.second = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (!this->state.second) { @@ -960,16 +963,16 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } this->state.second->SendMsg( - nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0 + nullptr, AM_SET_DURATION, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0 ); break; - case 87: + case AM_DELETE_MAGIC_TARGET: if (this->state.second) { const auto end = this->state.effects.end(); const auto it = std::find(this->state.effects.begin(), end, this->state.second); if (it != end) { - (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + (*it)->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); this->state.effects.erase(it); } @@ -977,7 +980,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 85: + case AM_MAKE_BEGIN_SPELL: if (!this->state.first) { this->state.first = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (!this->state.first) { @@ -986,22 +989,22 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } if ((static_cast(c) << 32 | static_cast(b)) > 0) { - this->SendMsg(nullptr, 109, 0, b, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, b, c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->state.first = this->LaunchEffect(b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (!this->state.first) { return; } } - this->state.first->SendMsg(nullptr, 80, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0); + this->state.first->SendMsg(nullptr, AM_SET_DURATION, 0, static_cast(e) << 32 | static_cast(d), 0, 0, 0, 0); break; - case 84: + case AM_DELETE_BEGIN_SPELL: if (this->state.first) { const auto end = this->state.effects.end(); const auto it = std::find(this->state.effects.begin(), end, this->state.first); if (it != end) { - (*it)->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + (*it)->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); this->state.effects.erase(it); } @@ -1039,14 +1042,14 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (!effect) { this->state.effects.erase(it); } else if (effect->state.type == (static_cast(c) << 32 | static_cast(b))) { - effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); this->state.effects.erase(it); return; } } break; - case 159: + case AM_DELETE_TAGGED_EFFECT: if (g_effectMgr->HasAllocator(d) && sender) { g_effectMgr->Retire(static_cast(sender)->render.accountId, b, d); return; @@ -1058,20 +1061,20 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->state.effects.erase(it); } else if (static_cast(effect->state.tag) == (static_cast(c) << 32 | static_cast(b)) && effect->state.type == (static_cast(e) << 32 | static_cast(d))) { - effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); this->state.effects.erase(it); return; } } break; - case 143: + case AM_EFFECT_LOOP_COUNT: for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { CRagEffect* const effect = *it; if (!effect) { this->state.effects.erase(it); } else if (effect->state.type == (static_cast(c) << 32 | static_cast(b))) { - effect->SendMsg(this, 143, 0, static_cast(c) << 32 | static_cast(b), d, e, 0, 0); + effect->SendMsg(this, AM_EFFECT_LOOP_COUNT, 0, static_cast(c) << 32 | static_cast(b), d, e, 0, 0); } } break; @@ -1182,12 +1185,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, switch (static_cast(a) << 32 | static_cast(message)) { case 21: break; - case 118: + case AM_DELETE_PROHIBITEFFECT: if (this->unknown_037C[10] != 0) { static_cast(g_modeMgr.GetGameMode())->scene->RemoveObject(reinterpret_cast(this->unknown_037C[10])); } break; - case 48: + case AM_MSGEFFECT_DEAD: for (auto it = this->unknown_03B0.begin(); it != this->unknown_03B0.end(); ++it) { if (*it == sender) { const int effect = reinterpret_cast(*it); @@ -1240,10 +1243,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->SpawnDamageDigits(reinterpret_cast(sender), damage, d, f); break; } - case 36: { + case AM_MVP: { CRagEffect* effect = this->LaunchEffect(0x44, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0); } break; } @@ -1253,20 +1256,20 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } CMsgEffect* effect = mode->SpawnDamageMsgEffect(&this->render.position, b, this->render.accountId); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ++this->unknown_02F0; break; } - case 126: + case AM_MAKE_GUARD: this->LaunchEffect(0x150, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case AM_MAKE_LUCKY: { CMsgEffect* effect = mode->SpawnMsgEffect(0xD, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } - case 160: { + case AM_CASH_EMOTION: { if (mode == nullptr) { break; } @@ -1274,7 +1277,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, CMsgEffect* effect = mode->SpawnCashEmotion(reinterpret_cast(&this->render.position), b, d, this->render.accountId); if (effect != nullptr) { this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } } else { @@ -1285,14 +1288,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, *slot = mode->SpawnCashEmotion(reinterpret_cast(&this->render.position), b, d, this->render.accountId); if (*slot != nullptr) { this->unknown_03B0.push_back(*slot); - (*slot)->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + (*slot)->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } } - mode->SendMsg(0x21, 0, 0, 0, 0); + mode->SendMsg(MM_PLAYER_EMOTION_END, 0, 0, 0, 0); break; } - case 51: { + case AM_MAKE_CART: { if (StateFlag01(this->stateFlags) || StateFlag02(this->stateFlags) || this->unknown_037C[1] != 0) { break; } @@ -1310,14 +1313,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } CMsgEffect* effect = mode->SpawnMsgEffect(effectIds[row][baby], &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[1] = reinterpret_cast(effect); break; } - case 52: - case 138: + case AM_DELETE_CART: + case AM_DELETE_WOLF: if (this->unknown_037C[1] != 0) { - reinterpret_cast(this->unknown_037C[1])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[1])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[1] = 0; } break; @@ -1357,19 +1360,19 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } CMsgEffect* effect = mode->SpawnMsgEffect(effectId, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); effect->SetAnimationSpeed(6.0f); this->unknown_037C[0] = reinterpret_cast(effect); break; } case AM_DELETE_BIRD: if (this->unknown_037C[0] != 0) { - reinterpret_cast(this->unknown_037C[0])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[0])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); reinterpret_cast(this->unknown_037C[0])->m_visible = false; this->unknown_037C[0] = 0; } break; - case 137: { + case AM_MAKE_WOLF: { if (this->unknown_037C[1] != 0) { break; } @@ -1394,191 +1397,191 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } CMsgEffect* effect = mode->SpawnMsgEffect(effectId, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[1] = reinterpret_cast(effect); break; } - case 56: { + case AM_MAKE_PKEFFECT: { if (this->unknown_037C[2] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(2, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[2] = reinterpret_cast(effect); break; } - case 57: + case AM_DELETE_PKEFFECT: if (this->unknown_037C[2] != 0) { - reinterpret_cast(this->unknown_037C[2])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[2])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[2] = 0; } break; - case 58: { + case AM_MAKE_ICEEFFECT: { if (this->unknown_037C[3] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(3, &this->render.position, this->render.accountId, visible); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[3] = reinterpret_cast(effect); break; } - case 59: + case AM_DELETE_ICEEFFECT: case 107: if (this->unknown_037C[3] != 0) { - reinterpret_cast(this->unknown_037C[3])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[3])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[3] = 0; } break; - case 67: { + case AM_MAKE_CURSE_EFFECT: { if (this->unknown_037C[4] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(6, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[4] = reinterpret_cast(effect); break; } - case 68: + case AM_DELETE_CURSE_EFFECT: if (this->unknown_037C[4] != 0) { - reinterpret_cast(this->unknown_037C[4])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[4])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[4] = 0; } break; - case 69: { + case AM_MAKE_SLEEP_EFFECT: { if (this->unknown_037C[5] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(7, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[5] = reinterpret_cast(effect); this->SetState(10, 1); break; } - case 70: + case AM_DELETE_SLEEP_EFFECT: if (this->unknown_037C[5] != 0) { - reinterpret_cast(this->unknown_037C[5])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[5])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[5] = 0; this->SetState(this->render.unknown_0074, 1); } break; - case 71: { + case AM_MAKE_STUN_EFFECT: { if (this->unknown_037C[6] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(8, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[6] = reinterpret_cast(effect); break; } - case 72: + case AM_DELETE_STUN_EFFECT: if (this->unknown_037C[6] != 0) { - reinterpret_cast(this->unknown_037C[6])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[6])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[6] = 0; } break; - case 139: + case AM_MAKE_BURNING_EFFECT: this->LaunchEffect(0x316, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 140: - this->SendMsg(nullptr, 0x6D, 0, 0x316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case AM_DELETE_BURNING_EFFECT: + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; - case 73: { + case AM_MAKE_SILENCE_EFFECT: { if (this->unknown_037C[7] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(9, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[7] = reinterpret_cast(effect); break; } - case 74: + case AM_DELETE_SILENCE_EFFECT: if (this->unknown_037C[7] != 0) { - reinterpret_cast(this->unknown_037C[7])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[7])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[7] = 0; } break; - case 75: { + case AM_MAKE_ANGELUS_EFFECT: { if (this->unknown_037C[8] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(0xA, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[8] = reinterpret_cast(effect); break; } - case 76: + case AM_DELETE_ANGELUS_EFFECT: if (this->unknown_037C[8] != 0) { - reinterpret_cast(this->unknown_037C[8])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[8])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[8] = 0; } break; - case 78: { + case AM_MAKE_CRUCIS_EFFECT: { if (this->unknown_037C[9] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(0xB, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[9] = reinterpret_cast(effect); break; } - case 79: + case AM_DELETE_CRUCIS_EFFECT: if (this->unknown_037C[9] != 0) { - reinterpret_cast(this->unknown_037C[9])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[9])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[9] = 0; } break; - case 63: { + case AM_MAKE_SMOKE_FFECT: { CMsgEffect* effect = mode->SpawnMsgEffect(5, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } - case 62: { + case AM_MAKE_ICEBREAKE_FFECT: { CMsgEffect* effect = mode->SpawnMsgEffect(4, &this->render.position, this->render.accountId, visible); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } - case 92: { + case AM_MAKE_CRITICAL_EFFECT: { CMsgEffect* effect = mode->SpawnMsgEffect(0xC, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case 131: { CMsgEffect* effect = mode->SpawnMsgEffect(0x16, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } - case 20: + case AM_USEITEM_EFFECT: this->LaunchEffect(7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 28: + case AM_WILL_BE_DEAD: if (g_session.IsHomunAid(this->render.accountId)) { if (g_windowMgr.window_03C0 != nullptr) { - g_windowMgr.CloseWindow(0x71); + g_windowMgr.CloseWindow(WID_HOMUNINFOWND); } if (g_windowMgr.window_03C4 != nullptr) { - g_windowMgr.CloseWindow(0x72); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_0); } g_session.ClearHomunStatus(); g_session.unknown_5614 = 0; } if (g_session.IsMercenaryAid(this->render.accountId)) { if (g_windowMgr.window_03C8 != nullptr) { - g_windowMgr.CloseWindow(0x7D); + g_windowMgr.CloseWindow(WID_MERINFOWND); } if (g_windowMgr.window_03CC != nullptr) { - g_windowMgr.CloseWindow(0x7E); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_1); } g_session.ResetMercenaryStats(); g_session.unknown_56B0 = 0; @@ -1596,29 +1599,29 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } CMsgEffect* effect = mode->SpawnMsgEffect(0x1F, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[11] = reinterpret_cast(effect); break; } case 135: if (this->unknown_037C[11] != 0) { - reinterpret_cast(this->unknown_037C[11])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[11])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[11] = 0; } break; - case 152: { + case AM_MAKE_LASSITUDE_EFFECT: { if (this->unknown_037C[12] != 0) { break; } CMsgEffect* effect = mode->SpawnMsgEffect(0x43, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[12] = reinterpret_cast(effect); break; } - case 153: + case AM_DELETE_LASSITUDE_EFFECT: if (this->unknown_037C[12] != 0) { - reinterpret_cast(this->unknown_037C[12])->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[12])->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_037C[12] = 0; } break; @@ -1642,9 +1645,9 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case AM_ATTACKEDNOMOTION: case AM_ATTACKED_CRITICAL: case AM_ATTACKED_LUCKY: - case 111: - case 129: - case 132: + case AM_ATTACKED_MANYTIMES: + case AM_ATTACKED_MANYTIMES2: + case AM_ATTACKED_MANYTIMES2DASH: case 148: { const std::int64_t id = static_cast(a) << 32 | static_cast(message); const ActorDamageMessage* damageMessage = reinterpret_cast(b); @@ -1675,7 +1678,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } if (id == 94) { - this->SendMsg(nullptr, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LUCKY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { bool negative = false; if (damage < 0 && damage != -29999) { @@ -1688,12 +1691,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if ((job >= 45 && job < 1000) || g_session.IsMonsterClass(job)) { if ((this->render.accountId == g_session.m_aid && g_session.HasActiveSkillEffect(19)) || (this->render.accountId == g_session.m_aid && g_session.HasActiveSkillEffect(104))) { - this->SendMsg(nullptr, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_GUARD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - attacker->SendMsg(nullptr, 89, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + attacker->SendMsg(nullptr, AM_MAKE_MISS, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } else { - attacker->SendMsg(nullptr, 89, 0, static_cast(0xFFFF0000), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + attacker->SendMsg(nullptr, AM_MAKE_MISS, 0, static_cast(0xFFFF0000), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } else { @@ -1784,7 +1787,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } else if (g_effectMgr->Spawn(this->render.accountId, hitEffect, offset.x, offset.y, offset.z, 0, -1, 0, 0) == nullptr) { CRagEffect* effect = this->LaunchEffect(hitEffect, offset, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } } @@ -1797,9 +1800,9 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (g_effectMgr->Spawn(this->render.accountId, skillEffect, offset.x, offset.y, offset.z, 0, -1, 0, 0) == nullptr) { CRagEffect* effect = this->LaunchEffect(skillEffect, offset, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); if ((skillEffect == 216 || skillEffect == 217) && attacker != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&attacker->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&attacker->render.position), 0, 0, 0, 0); } } } @@ -1829,12 +1832,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, preMessage = 0; if (id == 132) { } else if (id == 111) { - this->SendMsg(nullptr, 88, 0, damage, damage >> 31, damageMessage->unknown_002C != 0 ? static_cast(0xFF1E90FF) : -1, 0, 21, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_NUMBER, 0, damage, damage >> 31, damageMessage->unknown_002C != 0 ? static_cast(0xFF1E90FF) : -1, 0, 21, 0, 0, 0, 0, 0, 0, 0); kind = 22; color = 0xFFFFFF00; } else if (id == 148) { - this->SendMsg(nullptr, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 88, 0, damage, damage >> 31, static_cast(0xFFFFFF00), 0, 16, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CRITICAL_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_NUMBER, 0, damage, damage >> 31, static_cast(0xFFFFFF00), 0, 16, 0, 0, 0, 0, 0, 0, 0); kind = 22; color = 0xFFFFFF00; } else { @@ -1855,7 +1858,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (preMessage != 0) { this->SendMsg(nullptr, static_cast(preMessage), static_cast(preMessage >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - this->SendMsg(nullptr, 88, 0, value, value >> 31, static_cast(color), 0, static_cast(kind), static_cast(kind >> 32), 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_NUMBER, 0, value, value >> 31, static_cast(color), 0, static_cast(kind), static_cast(kind >> 32), 0, 0, 0, 0, 0, 0); if (!negative) { const auto isPlayer = IsPlayerJob(this->GetEffectiveJob(-1)); @@ -1885,7 +1888,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } if (this->unknown_02B0 != 0 && this->unknown_02A8.size() <= 1) { - this->SendMsg(nullptr, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -1898,7 +1901,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->SetAnimationSpeed(1.0f); this->render.previousAnimation += this->Get8Dir(this->render.angle); if (this->unknown_02B0 != 0 && this->unknown_02A8.size() <= 1) { - this->SendMsg(nullptr, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case AM_WILL_BE_ATTACKED: { @@ -1912,7 +1915,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_02A8.push_back(*damage); break; } - case 130: { + case AM_WILL_BE_ATTACKED2: { ActorDamageMessage* damage = reinterpret_cast(b); if ((static_cast(e) << 32 | static_cast(d)) != 0) { damage->unknown_0024 = d; @@ -1921,7 +1924,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_02A8.push_back(*damage); break; } - case 133: { + case AM_WILL_BE_ATTACKED2DASH: { ActorDamageMessage* damage = reinterpret_cast(b); if ((static_cast(e) << 32 | static_cast(d)) != 0) { damage->unknown_0024 = d; @@ -2127,8 +2130,8 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, title->SetSize(140, 34); g_windowMgr.AddRenderedFront(reinterpret_cast(this->unknown_0264[2])); } - reinterpret_cast(this->unknown_0264[2])->SendMsg(nullptr, 0x22, b, static_cast(this->render.unknown_00FC), 0, 0); - reinterpret_cast(this->unknown_0264[2])->SendMsg(nullptr, 0x1C, this->render.accountId, 0, 0, 0); + reinterpret_cast(this->unknown_0264[2])->SendMsg(nullptr, UM_SETINFO, b, static_cast(this->render.unknown_00FC), 0, 0); + reinterpret_cast(this->unknown_0264[2])->SendMsg(nullptr, UM_SETNAID, this->render.accountId, 0, 0, 0); reinterpret_cast(this->unknown_0264[2])->Move(this->render.screenX - 70, this->render.screenY - ScaleByScreenHeight(110)); if (!g_serviceOptions.Get(0xFA)) { reinterpret_cast(this->unknown_0264[2])->Show(0); @@ -2141,7 +2144,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, title->SetSize(140, 34); g_windowMgr.AddRenderedFront(reinterpret_cast(this->unknown_0264[1])); } - reinterpret_cast(this->unknown_0264[1])->SendMsg(nullptr, 0x22, b, static_cast(this->render.unknown_00FC), 0, 0); + reinterpret_cast(this->unknown_0264[1])->SendMsg(nullptr, UM_SETINFO, b, static_cast(this->render.unknown_00FC), 0, 0); reinterpret_cast(this->unknown_0264[1])->Move(this->render.screenX - 70, this->render.screenY - ScaleByScreenHeight(110)); break; case AM_MAKE_SKILL_RECHARGEGAGE: @@ -2213,7 +2216,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 19: { + case AM_STOPMOVE: { this->routeStartTick = g_session.GetServerTime(); int column; int row; @@ -2286,7 +2289,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_02DC = 1; } break; - case 125: { + case AM_MAKE_LEVEL99_EFFECT: { this->unknown_02B4 = 1; const unsigned char showFirst = g_serviceOptions.Get(0x6A); if (*reinterpret_cast(g_session.unknown_7EE8) == static_cast(this->unknown_02B8)) { @@ -2351,7 +2354,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 146: + case AM_MAKE_LEVEL160_EFFECT: case 147: { this->unknown_02B4 = 1; const unsigned char showFirst = g_serviceOptions.Get(0x6A); @@ -2433,7 +2436,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 151: { + case AM_MAKE_LEVEL4TH_EFFECT: { this->unknown_02B4 = 1; const unsigned char showFirst = g_serviceOptions.Get(0x6A); if (*reinterpret_cast(g_session.unknown_7EE8) == static_cast(this->unknown_02B8)) { @@ -2506,31 +2509,31 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_TWOHANDQUICKEN: case EFST_ONEHANDQUICKEN: { while (this->HasId(0xA6)) { - this->SendMsg(nullptr, 109, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x82, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x82, 0, 0, 0); } } break; } case EFST_SPEARQUICKEN: { while (this->HasId(0xA6)) { - this->SendMsg(nullptr, 109, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0xFA, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0xFA, 0, 0, 0); } } break; } case EFST_NJ_BUNSINJYUTSU: while (this->HasId(0x269)) { - this->SendMsg(nullptr, 109, 0, 0x269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x269, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2548,12 +2551,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } for (int id = 0x1DB; id < 0x1E5; ++id) { if (this->HasId(id) == true) { - this->SendMsg(nullptr, 109, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } this->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } - this->SendMsg(nullptr, 109, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); CPlayer* player = static_cast(g_modeMgr.GetGameMode())->scene->player; if (player) { player->unknown_0544 = this->LaunchEffect(0xA4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2565,7 +2568,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (this->HasId(0x28F)) { vector3d position{0.0f, 0.0f, 0.0f}; do { - this->SendMsg(nullptr, 109, 0, 0x28F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x28F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x290, position, 0.0f); } while (this->HasId(0x28F)); } @@ -2589,18 +2592,18 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_EXPLOSIONSPIRITS: { while (this->HasId(0xCB)) { - this->SendMsg(nullptr, 109, 0, 0xCB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xCB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0xCB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } while (this->HasId(0xA6)) { - this->SendMsg(nullptr, 109, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFE, 0x80, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFE, 0x80, 0, 0, 0); } } break; @@ -2608,8 +2611,8 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_STEELBODY: case EFST_DBARRIER: { while (this->HasId(0xFE)) { - this->SendMsg(nullptr, 109, 0, 0xFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 0x46C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xFE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x46C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->render.accountId == g_session.m_gid || IsPlayerJob(this->GetEffectiveJob(-1))) { CPc* pc = static_cast(this); @@ -2628,10 +2631,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_SG_MOON_WARM: case EFST_SG_STAR_WARM: while (this->HasId(0x1A2)) { - this->SendMsg(nullptr, 109, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } while (this->HasId(0x220)) { - this->SendMsg(nullptr, 109, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x1A2, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2640,10 +2643,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_DAURA: while (this->HasId(0x1A2)) { - this->SendMsg(nullptr, 109, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } while (this->HasId(0x220)) { - this->SendMsg(nullptr, 109, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x1A2, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2652,7 +2655,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_KAITE: while (this->HasId(0x1A3)) { - this->SendMsg(nullptr, 109, 0, 0x1A3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x1A3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2660,10 +2663,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_AURABLADE: while (this->HasId(0x16F)) { - this->SendMsg(nullptr, 109, 0, 0x16F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x16F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } while (this->HasId(0x1DA)) { - this->SendMsg(nullptr, 109, 0, 0x1DA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1DA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x16F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2672,12 +2675,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_STOP: while (this->HasId(0x1C5)) { - this->SendMsg(nullptr, 109, 0, 0x1C5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1C5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_MOON: { while (this->HasId(0x18A)) { - this->SendMsg(nullptr, 109, 0, 0x18A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x18A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2685,9 +2688,9 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; } case EFST_MARIONETTE_MASTER: { - this->SendMsg(nullptr, 109, 0, 0x18B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); while (this->HasId(0x18C)) { - this->SendMsg(nullptr, 109, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x18C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2696,7 +2699,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_MARIONETTE: { while (this->HasId(0x18C)) { - this->SendMsg(nullptr, 109, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x18C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2704,7 +2707,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; } case EFST_LKCONCENTRATION: { - this->SendMsg(nullptr, 109, 0, 0x171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (on) { this->LaunchEffect(0x171, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -2712,7 +2715,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_BERSERK: { while (this->HasId(0x170)) { - this->SendMsg(nullptr, 109, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x170, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2722,7 +2725,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_RG_CCONFINE_M: case EFST_RG_CCONFINE_S: { while (this->HasId(0x25C)) { - this->SendMsg(nullptr, 109, 0, 0x25C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x25C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x25C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2731,7 +2734,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_WZ_SIGHTBLASTER: { while (this->HasId(0x259)) { - this->SendMsg(nullptr, 109, 0, 0x259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x259, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2740,7 +2743,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_POWERUP: { while (this->HasId(0x1C7)) { - this->SendMsg(nullptr, 109, 0, 0x1C7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1C7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x1C7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2751,7 +2754,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (this->HasId(0x1BA)) { this->LaunchEffect(0x1BB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } - this->SendMsg(nullptr, 109, 0, 0x1BA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } case EFST_TING: { @@ -2759,13 +2762,13 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, g_soundMgr->PlayWave("effect\\T_벽튕김.wav", this->render.position.x - player.x, 0.0f, this->render.position.z - player.z, 250, 40, 1.0f, 0); this->LaunchEffect(0x1AA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (this->HasId(0x1BA)) { - this->SendMsg(nullptr, 109, 0, 0x1BA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1BA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } case EFST_MAGICPOWER: { while (this->HasId(0x17E)) { - this->SendMsg(nullptr, 109, 0, 0x17E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x17E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x17E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2775,24 +2778,24 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_OVERTHRUST: case EFST_OVERTHRUSTMAX: { while (this->HasId(0xA6)) { - this->SendMsg(nullptr, 109, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x80, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x80, 0, 0, 0); } } break; } case EFST_ENERGYCOAT: { while (this->HasId(0xA6)) { - this->SendMsg(nullptr, 109, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0xA9, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0xA9, 0, 0, 0); } } break; @@ -2839,7 +2842,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_RICHMANKIM: { if (this->HasId(0x363) == true) { - this->SendMsg(nullptr, 109, 0, 0x363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x363, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2850,7 +2853,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_HUMMING: case EFST_INTOABYSS: { if (this->HasId(0x361) == true) { - this->SendMsg(nullptr, 109, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x361, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2860,7 +2863,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_RINGNIBELUNGEN: case EFST_SIEGFRIED: { if (this->HasId(0x36B) == true) { - this->SendMsg(nullptr, 109, 0, 0x36B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x36B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x36B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2869,7 +2872,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_APPLEIDUN: { if (this->HasId(0x35D) == true) { - this->SendMsg(nullptr, 109, 0, 0x35D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x35D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x35D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2879,7 +2882,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_ETERNALCHAOS: case EFST_ROKISWEIL: { if (this->HasId(0x360) == true) { - this->SendMsg(nullptr, 109, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x360, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2889,7 +2892,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_ASSASSINCROSS: case EFST_SERVICEFORYOU: { if (this->HasId(0x369) == true) { - this->SendMsg(nullptr, 109, 0, 0x369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x369, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x369, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2899,7 +2902,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_FORTUNEKISS: case EFST_DRUMBATTLEFIELD: { if (this->HasId(0x367) == true) { - this->SendMsg(nullptr, 109, 0, 0x367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x367, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2908,7 +2911,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_DONTFORGETME: { if (this->HasId(0x26) == true) { - this->SendMsg(nullptr, 109, 0, 0x26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x26, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2917,7 +2920,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_POEMBRAGI: { if (this->HasId(0x36D) == true) { - this->SendMsg(nullptr, 109, 0, 0x36D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x36D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x36D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2926,7 +2929,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_DA_CONTRACT: { while (this->HasId(0x24A)) { - this->SendMsg(nullptr, 109, 0, 0x24A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x24A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x24A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2935,20 +2938,20 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } case EFST_DUPLELIGHT: { while (this->HasId(0x341)) { - this->SendMsg(nullptr, 109, 0, 0x341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0x341, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); vector3d scale{2.0f, 0.0f, 0.0f}; if (effect) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&scale), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&scale), 0, 0, 0, 0); } } break; } case EFST_ORATIO: while (this->HasId(0x2F3)) { - this->SendMsg(nullptr, 109, 0, 0x2F3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x2F3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x2F3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2956,7 +2959,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_BLOOD_SUCKER: while (this->HasId(0x170)) { - this->SendMsg(nullptr, 109, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x170, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2991,19 +2994,19 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_STRIKING: if (IsPlayerJob(this->GetEffectiveJob(-1))) { while (this->HasId(0x39D)) { - this->SendMsg(nullptr, 109, 0, 0x39D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x39D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { CRagEffect* effect = this->LaunchEffect(0x39D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x39D, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x39D, 0, 0, 0); } } } break; case EFST_VENOMIMPRESS: while (this->HasId(0x314)) { - this->SendMsg(nullptr, 109, 0, 0x314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x314, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3011,7 +3014,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_FROSTMISTY: while (this->HasId(0x315)) { - this->SendMsg(nullptr, 109, 0, 0x315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x315, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3019,7 +3022,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_COLD: while (this->HasId(0x3AC)) { - this->SendMsg(nullptr, 109, 0, 0x3AC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3AC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x3AC, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3063,40 +3066,40 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_SIREN: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 109, 0, 0x36F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x36F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x36F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } else { - this->SendMsg(nullptr, 109, 0, 0x36F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x36F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_SONG_OF_MANA: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 109, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x361, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case EFST_DANCE_WITH_WUG: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 109, 0, 0x363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x363, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case EFST_LERADS_DEW: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 109, 0, 0x367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x367, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case EFST_DEEP_SLEEP: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_NETHERWORLD: while (this->HasId(0x1C5)) { - this->SendMsg(nullptr, 109, 0, 0x1C5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1C5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x1C5, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3104,7 +3107,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_CAMOUFLAGE: while (this->HasId(0x2E8)) { - this->SendMsg(nullptr, 109, 0, 0x2E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x2E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x2E8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3119,7 +3122,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_MANHOLE: while (this->HasId(0x337)) { - this->SendMsg(nullptr, 109, 0, 0x337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { g_soundMgr->PlayWave("effect\\manhole.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -3130,8 +3133,8 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_SHADOWFORM: while (this->HasId(0x329)) { - this->SendMsg(nullptr, 109, 0, 0x329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 0x333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x329, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3139,7 +3142,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_STEALTHFIELD: while (this->HasId(0x2E8)) { - this->SendMsg(nullptr, 109, 0, 0x2E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x2E8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x2E8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3147,7 +3150,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_WUGDASH: while (this->HasId(0x2F0)) { - this->SendMsg(nullptr, 109, 0, 0x2F0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x2F0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x2F0, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3161,37 +3164,37 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_MER_FLEE: { const int text = reinterpret_cast("FLEE UP!"); - this->SendMsg(nullptr, 7, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHAT, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x1C8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } case EFST_MER_ATK: { const int text = reinterpret_cast("ATK UP!"); - this->SendMsg(nullptr, 7, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHAT, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x1C8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } case EFST_MER_HIT: { const int text = reinterpret_cast("DEX UP!"); - this->SendMsg(nullptr, 7, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHAT, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x1C8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } case EFST_MER_HP: { const int text = reinterpret_cast("HP UP!"); - this->SendMsg(nullptr, 7, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHAT, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x1C8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } case EFST_MER_SP: { const int text = reinterpret_cast("SP UP!"); - this->SendMsg(nullptr, 7, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHAT, 0, text, text >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->LaunchEffect(0x1C8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } case EFST_UNLIMITED_HUMMING_VOICE: if (this->HasId(0x361) == true) { - this->SendMsg(nullptr, 109, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x361, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3199,7 +3202,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_MELODYOFSINK: if (this->HasId(0x57) == true) { - this->SendMsg(nullptr, 109, 0, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x57, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3207,7 +3210,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_BEYOND_OF_WARCRY: if (this->HasId(0x31F) == true) { - this->SendMsg(nullptr, 109, 0, 0x31F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x31F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x31F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3215,7 +3218,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_SATURDAY_NIGHT_FEVER: if (this->HasId(0x360) == true) { - this->SendMsg(nullptr, 109, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { this->LaunchEffect(0x360, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3237,7 +3240,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_GRANITIC_ARMOR: while (this->HasId(0x3C3)) { - this->SendMsg(nullptr, 109, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3C3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3296,7 +3299,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_KYOMU: while (this->HasId(0x3C3)) { - this->SendMsg(nullptr, 109, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3C3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3304,7 +3307,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_KAGEMUSYA: while (this->HasId(0x3EC)) { - this->SendMsg(nullptr, 109, 0, 0x3EC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3EC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3EC, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3312,7 +3315,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_MEIKYOUSISUI: while (this->HasId(0x18A)) { - this->SendMsg(nullptr, 109, 0, 0x18A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { CRagEffect* effect = this->LaunchEffect(0x18A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3325,7 +3328,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_ZANGETSU: while (this->HasId(0x3EB)) { - this->SendMsg(nullptr, 109, 0, 0x3EB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3EB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3EB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3340,7 +3343,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } } while (this->HasId(0x3C3)) { - this->SendMsg(nullptr, 109, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3C3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3348,7 +3351,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_AKAITSUKI: while (this->HasId(0x220)) { - this->SendMsg(nullptr, 109, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x220, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3381,11 +3384,11 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (StateFlag01(this->stateFlags) || StateFlag02(this->stateFlags) || StateFlag06(this->stateFlags)) { break; } - this->SendMsg(nullptr, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { this->unknown_02FC = 0; - this->SendMsg(nullptr, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_FLOWER_LEAF: @@ -3397,7 +3400,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_RAY_OF_PROTECTION: while (this->HasId(0x3FB)) { - this->SendMsg(nullptr, 109, 0, 0x3FB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3FB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x3FB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3409,12 +3412,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_HANDICAPSTATE_ICEEXPLO: if ((static_cast(e) << 32 | static_cast(d)) != 0) { - this->SendMsg(nullptr, 127, 0, 50, 0, 150, 0, 255, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 50, 0, 150, 0, 255, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_MAXPAIN: while (this->HasId(0x40D)) { - this->SendMsg(nullptr, 109, 0, 0x40D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x40D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x40D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3422,7 +3425,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_DARKCROW: while (this->HasId(0x410)) { - this->SendMsg(nullptr, 109, 0, 0x410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x410, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3432,7 +3435,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_TELEKINESIS_INTENSE: while (this->HasId(0x418)) { - this->SendMsg(nullptr, 109, 0, 0x418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x418, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3440,7 +3443,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_ILLUSIONDOPING: while (this->HasId(0x419)) { - this->SendMsg(nullptr, 109, 0, 0x419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x419, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3448,7 +3451,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_WIDEWEB: while (this->HasId(0x194)) { - this->SendMsg(nullptr, 109, 0, 0x194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x194, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3456,7 +3459,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_BURNT: while (this->HasId(0x41E)) { - this->SendMsg(nullptr, 109, 0, 0x41E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x41E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x41E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3464,7 +3467,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_CHILL: while (this->HasId(0x41F)) { - this->SendMsg(nullptr, 109, 0, 0x41F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x41F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x41F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3472,14 +3475,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_OFFERTORIUM: while (this->HasId(0x421)) { - this->SendMsg(nullptr, 109, 0, 0x421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on) { this->LaunchEffect(0x421, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; case EFST_C_MARKER: - this->SendMsg(this, 109, 0, 0x433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (on) { if (g_session.unknown_5C28.find(static_cast(this->render.accountId)) == g_session.unknown_5C28.end() && g_effectMgr->HasAllocator(0x425)) { g_effectMgr->Spawn(this->render.accountId, 0x425, this->render.position.x, this->render.position.y, this->render.position.z, 0, -1, 0, 0); @@ -3508,7 +3511,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_H_MINE_SPLASH: if (on) { - this->SendMsg(nullptr, 109, 0, 0x425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Spawn(0, 0x432, this->render.position.x, this->render.position.y, this->render.position.z, 0, -1, 0, 0); } break; @@ -3518,7 +3521,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_HALLUCINATIONWALK: case EFST_NPC_HALLUCINATIONWALK: { while (this->HasId(0x318)) { - this->SendMsg(nullptr, 109, 0, 0x318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) == 0) { break; @@ -3527,7 +3530,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (!effect) { break; } - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x318, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x318, 0, 0, 0); break; } case EFST_SOULLINK: @@ -3545,7 +3548,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; } while (this->HasId(0x1A8)) { - this->SendMsg(nullptr, 109, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1A8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_HAPPINESS_STAR: @@ -3769,7 +3772,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case EFST_ASSUMPTIO2: case EFST_ASSUMPTIO_BUFF: while (this->HasId(0x177)) { - this->SendMsg(nullptr, 109, 0, 0x177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if ((static_cast(e) << 32 | static_cast(d)) != 0) { this->LaunchEffect(0x177, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3809,7 +3812,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, actor = static_cast(mode->scene->GetGameActorByAID(actor->render.accountId)); } if (actor->HasId(0x576)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x576, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3822,7 +3825,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, actor = static_cast(mode->scene->GetGameActorByAID(actor->render.accountId)); } if (actor->HasId(0x18C)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x18C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x18C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3835,7 +3838,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, actor = static_cast(mode->scene->GetGameActorByAID(actor->render.accountId)); } if (actor->HasId(0x58C)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x58C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x58C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x58C, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3848,7 +3851,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, actor = static_cast(mode->scene->GetGameActorByAID(actor->render.accountId)); } if (actor->HasId(0x5F5)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x5F5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x5F5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x5F5, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3875,13 +3878,13 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, g_session.unknown_8074 = 1; } } - target->SendMsg(nullptr, 0x69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { target->SetMadogearType(0); if (this->render.accountId == g_session.m_aid) { g_session.unknown_8074 = 0; } - target->SendMsg(nullptr, 0x6A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -3908,7 +3911,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; } if (actor->HasId(0x641)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x641, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3924,7 +3927,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; } if (actor->HasId(0x64A)) { - actor->SendMsg(nullptr, 0x6D, 0, 0x64A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x64A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (on == true) { actor->LaunchEffect(0x64A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3940,14 +3943,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->LaunchEffect(0x14E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } g_overrideColor = 1; - this->SendMsg(nullptr, 0x6D, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); CPlayer* const player = static_cast(g_modeMgr.GetGameMode())->scene->player; if (player) { player->unknown_0544 = this->LaunchEffect(0xA4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } } else { if (this->HasId(0x14E) == true) { - this->SendMsg(nullptr, 0x6D, 0, 0x14E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x14E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_overrideColor = 0; } @@ -3955,27 +3958,27 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_HANDICAPSTATE_DEEPSILENCE: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 0x9C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_DEEPSILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 0x9D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_DEEPSILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_HANDICAPSTATE_SWOONING: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 0x9C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_DEEPSILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8C5); g_effectMgr->Spawn(this->render.accountId, 0x8C5, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - this->SendMsg(nullptr, 0x9D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_DEEPSILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8C5); } break; case EFST_HANDICAPSTATE_LASSITUDE: if ((static_cast(e) << 32 | static_cast(d)) == 1) { - this->SendMsg(nullptr, 0x98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LASSITUDE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Spawn(this->render.accountId, 0x8C4, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - this->SendMsg(nullptr, 0x99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_LASSITUDE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_HANDICAPSTATE_FROSTBITE: @@ -4008,46 +4011,46 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_HANDICAPSTATE_HOLYFLAME: if (on == true) { - this->SendMsg(nullptr, 0x7F, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Spawn(this->render.accountId, 0x8C6, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - this->SendMsg(nullptr, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->SetInstantValue(0xC, on); break; case EFST_HANDICAPSTATE_CONFLAGRATION: if (on == true) { - this->SendMsg(nullptr, 0x7F, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8DD); g_effectMgr->Spawn(this->render.accountId, 0x8DD, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - this->SendMsg(nullptr, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8DD); } this->SetInstantValue(0xD, on); break; case EFST_HANDICAPSTATE_MISFORTUNE: if (on == true) { - this->SendMsg(nullptr, 0x9A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_MISFORTUNE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 0x9B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_MISFORTUNE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_HANDICAPSTATE_DEADLYPOISON: if (on == true) { - this->SendMsg(nullptr, 0x7F, 0, 0xAA, 0, 0, 0, 0xAA, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 0xAA, 0, 0, 0, 0xAA, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Spawn(this->render.accountId, 0x8E2, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - this->SendMsg(nullptr, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8E2); } this->SetInstantValue(0xE, on); break; case EFST_HANDICAPSTATE_DEPRESSION: if (on == true) { - this->SendMsg(nullptr, 0x7F, 0, 0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 0, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->SetInstantValue(0xF, on); break; @@ -4232,7 +4235,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (on == true) { this->LaunchEffect(0x2e8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } else if (this->HasId(0x2e8) == true) { - this->SendMsg(nullptr, 109, 0, 0x2e8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x2e8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_BO_HELL_DUSTY: @@ -4244,14 +4247,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, if (on == true) { this->LaunchEffect(0x8e5, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } else if (this->HasId(0x8e5) == true) { - this->SendMsg(nullptr, 109, 0, 0x8e5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x8e5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_SPORE_EXPLOSION_DEBUFF: if (on == true) { this->LaunchEffect(0x8e6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } else if (this->HasId(0x8e6) == true) { - this->SendMsg(nullptr, 109, 0, 0x8e6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x8e6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EFST_FIRM_FAITH: @@ -4299,9 +4302,9 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, break; case EFST_BLOCK: if (on == true) { - g_windowMgr.EnsureWindow(0x2730); + g_windowMgr.EnsureWindow(WID_DEBUFFREMOVEWND); } else { - g_windowMgr.CloseWindow(0x2730); + g_windowMgr.CloseWindow(WID_DEBUFFREMOVEWND); } break; default: @@ -4314,7 +4317,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 127: { + case AM_CHANGE_COLOR: { this->render.unknown_00A3 = 1; unsigned char* const saved = reinterpret_cast(&this->render.unknown_0090); if (saved[0] == 0 && saved[1] == 0 && saved[2] == 0 && saved[3] == 0) { @@ -4334,26 +4337,26 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->render.color = static_cast(red << 16 | green << 8 | f | 0xFF000000); break; } - case 128: + case AM_RETURN_COLOR: this->render.unknown_0090 = 0; this->render.unknown_00A3 = 0; break; - case 142: + case AM_DELETE_BUYING_SHOP_TITLE: if (this->unknown_0264[4] == 0) { break; } g_windowMgr.Schedule(reinterpret_cast(this->unknown_0264[4])); this->unknown_0264[4] = 0; break; - case 141: { + case AM_MAKE_BUYING_SHOP_TITLE: { if (this->unknown_0264[4] == 0) { UIMerchantShopTitle* const title = new UIMerchantShopTitle(1); this->unknown_0264[4] = reinterpret_cast(title); title->SetSize(140, 34); g_windowMgr.AddRenderedFront(reinterpret_cast(this->unknown_0264[4])); } - reinterpret_cast(this->unknown_0264[4])->SendMsg(nullptr, 34, b, static_cast(this->render.unknown_00FC), 0, 0); - reinterpret_cast(this->unknown_0264[4])->SendMsg(nullptr, 28, this->render.accountId, 0, 0, 0); + reinterpret_cast(this->unknown_0264[4])->SendMsg(nullptr, UM_SETINFO, b, static_cast(this->render.unknown_00FC), 0, 0); + reinterpret_cast(this->unknown_0264[4])->SendMsg(nullptr, UM_SETNAID, this->render.accountId, 0, 0, 0); reinterpret_cast(this->unknown_0264[4])->Move(this->render.screenX - 70, this->render.screenY - ScaleByScreenHeight(110)); if (g_serviceOptions.Get(0xFA)) { break; @@ -4361,10 +4364,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, reinterpret_cast(this->unknown_0264[4])->Show(0); break; } - case 144: + case AM_FALLEN_ANGEL: if (g_session.IsPlayerJobId(this->GetEffectiveJob(-1))) { if (CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0xF3, 0, 100, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0xF3, 0, 100, 0); } if (CEffect* fallenAngel = g_effectMgr->Find(this->render.accountId, 0x474)) { vector3d position{0.0f, 0.0f, 0.0f}; @@ -4373,12 +4376,12 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, static_cast(fallenAngel)->SetPosition(position); } } - this->SendMsg(nullptr, 19, 0, b, b >> 31, d, d >> 31, 15, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STOPMOVE, 0, b, b >> 31, d, d >> 31, 15, 0, 0, 0, 0, 0, 0, 0); this->SetAction(this->render.animation, 6, 1); this->render.curMotion = 7; this->render.isMotionFreezed = true; break; - case 145: + case AM_UPDATE_MONSTER_GAGE: if ((static_cast(c) << 32 | static_cast(b)) == -1 || (static_cast(e) << 32 | static_cast(d)) == -1) { if (this->unknown_0300 == 0) { @@ -4404,31 +4407,31 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, static_cast(static_cast(ScaleByScreenHeight(12)) * this->render.unknown_005C + static_cast(this->render.screenY)) ); break; - case 154: + case AM_MAKE_MISFORTUNE_EFFECT: if (this->unknown_03D4 == 0) { CGameObject* effect = mode->SpawnMsgEffect(68, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_03D4 = reinterpret_cast(effect); } break; - case 155: + case AM_DELETE_MISFORTUNE_EFFECT: if (this->unknown_03D4 != 0) { - reinterpret_cast(this->unknown_03D4)->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_03D4)->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_03D4 = 0; } break; - case 156: + case AM_MAKE_DEEPSILENCE_EFFECT: if (this->unknown_03D8 == 0) { CGameObject* effect = mode->SpawnMsgEffect(9, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_03D8 = reinterpret_cast(effect); } break; - case 157: + case AM_DELETE_DEEPSILENCE_EFFECT: if (this->unknown_03D8 != 0) { - reinterpret_cast(this->unknown_03D8)->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_03D8)->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_03D8 = 0; } break; diff --git a/Source/Contents/Actors/MercenaryAI.cpp b/Source/Contents/Actors/MercenaryAI.cpp index c8c88a7a4..ad963c0f8 100644 --- a/Source/Contents/Actors/MercenaryAI.cpp +++ b/Source/Contents/Actors/MercenaryAI.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" #include "Contents/Actors/MercenaryAI.h" #include "Contents/Actors/ActorEnums.h" @@ -813,7 +815,7 @@ int AiTraceAI(lua_State* state) { // FUNCTION: fn_22350 int AiTraceValue(lua_State* state) { std::string text = luaL_checkstring(state, 1); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF, 4, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF, 4, 0, 0); return 1; } @@ -1089,9 +1091,9 @@ int AiSkillGround(lua_State* state) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); CGameActor* actor = static_cast(mode->scene->GetGameActorByAID(aid)); if (actor->render.unknown_0070 == 1 || actor->render.unknown_0070 == 0 || actor->render.unknown_0070 == 4) { - mode->SendMsg(0x46, reinterpret_cast(skillArgs), 0, 0, 0); + mode->SendMsg(MM_USE_SKILL_TOGROUND, reinterpret_cast(skillArgs), 0, 0, 0); } - mode->SendMsg(0x1a, 0, 0, 0, 0); + mode->SendMsg(MM_SETLOCKONMOUSE, 0, 0, 0, 0); return 0; } @@ -1131,9 +1133,9 @@ int AiSkillObject(lua_State* state) { CGameActor* actor = static_cast(mode->scene->GetGameActorByAID(aid)); if (targetActor && (actor->render.unknown_0070 == 1 || actor->render.unknown_0070 == 0 || actor->render.unknown_0070 == 4)) { - mode->SendMsg(0x45, skillId, target, level, 0); + mode->SendMsg(MM_USE_SKILL, skillId, target, level, 0); } - mode->SendMsg(0x1a, 0, 0, 0, 0); + mode->SendMsg(MM_SETLOCKONMOUSE, 0, 0, 0, 0); if (IsSupportSkill(skillId)) { lua_pushnumber(state, 1.0); diff --git a/Source/Contents/Actors/Player.cpp b/Source/Contents/Actors/Player.cpp index 0cecde1ae..e7e306346 100644 --- a/Source/Contents/Actors/Player.cpp +++ b/Source/Contents/Actors/Player.cpp @@ -1,3 +1,6 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Actors/Pc.h" #include "Contents/Actors/ActorEnums.h" #include "Network/Packets/NoticeEnums.h" @@ -270,9 +273,9 @@ void CPc::SetHeadPalette(int value) { void CGrannyPc::SetHonor(int value) { if (value < 0) { const std::int64_t emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::ChatProhibit); - this->SendMsg(nullptr, 160, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_PROHIBITEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->unknown_0428 = value; } @@ -282,9 +285,9 @@ void CGrannyPc::SetHonor(int value) { void CPc::SetHonor(int value) { if (value < 0) { const std::int64_t emotion = g_cashEmotionMgr->GetSpecialEmotion(CashEmotionSpecial::ChatProhibit); - this->SendMsg(nullptr, 160, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CASH_EMOTION, 0, 0, 0, static_cast(emotion), static_cast(emotion >> 32), 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_PROHIBITEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->unknown_0430 = value; } @@ -1496,9 +1499,9 @@ void CPc::SetSprAccessory2(int value) { ); if (this->HasId(678)) { - this->SendMsg(nullptr, 109, 0, 678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -2144,7 +2147,7 @@ void CPc::RenderOverlaySprite(const float* matrix, int) { } int effectId; - this->SendMsg(nullptr, 120, 0, reinterpret_cast(&effectId), reinterpret_cast(&effectId) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_IS_HAVE_EFFECT, 0, reinterpret_cast(&effectId), reinterpret_cast(&effectId) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->DrawQuad(quad, palette, 0x101, 0.0f, 0.0f, 0); } @@ -2264,7 +2267,7 @@ bool CPc::OnProcess() { if (!this->msgEffect) { CMsgEffect* effect = static_cast(g_modeMgr.GetGameMode())->SpawnMsgEffect(44, &this->render.position, this->render.accountId, true); this->AddMsgEffect(effect); - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->msgEffect = effect; } return result; @@ -2272,7 +2275,7 @@ bool CPc::OnProcess() { } if (this->msgEffect) { - this->msgEffect->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->msgEffect->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->msgEffect = nullptr; } @@ -2600,7 +2603,7 @@ __declspec(noinline) void CPlayer::UpdateMsgEffect(bool show) { if (!this->msgEffect) { CMsgEffect* effect = static_cast(g_modeMgr.GetGameMode())->SpawnMsgEffect(44, &this->render.position, this->render.accountId, true); this->AddMsgEffect(effect); - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->msgEffect = effect; } return; @@ -2608,7 +2611,7 @@ __declspec(noinline) void CPlayer::UpdateMsgEffect(bool show) { } if (this->msgEffect) { - this->msgEffect->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->msgEffect->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->msgEffect = nullptr; } } @@ -2861,7 +2864,7 @@ bool CPlayer::OnProcess() { request.destinationX = reinterpret_cast(this->unknown_04F8); request.destinationY = this->unknown_04FC; const int address = reinterpret_cast(&request); - this->SendMsg(nullptr, 0, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MOVE, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->UpdatePendingAction(); @@ -2883,7 +2886,7 @@ bool CPlayer::OnProcess() { this->UpdateMsgEffect(this->GetMonsterTransformJob() > 0); if (g_session.unknown_61B1) { - UIWindow* window = g_windowMgr.LookupWindow(289); + UIWindow* window = g_windowMgr.LookupWindow(WID_VIEWCAMERAINFOWND); if (window != nullptr) { window->Invalidate(); } @@ -2953,13 +2956,13 @@ void CPlayer::UpdatePendingAction() { reinterpret_cast(this->unknown_04F8) = cellX; this->unknown_04FC = cellY; this->unknown_0524 = timeGetTime(); - this->SendMsg(nullptr, 91, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } return; } if (this->unknown_0510 == 2) { - this->SendMsg(nullptr, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->unknown_0514 != 0 || timeGetTime() <= this->unknown_0500 + 1200) { return; @@ -2968,9 +2971,9 @@ void CPlayer::UpdatePendingAction() { this->unknown_0500 = timeGetTime(); this->unknown_0514 = 1; if (this->unknown_0510 != 2) { - this->SendMsg(nullptr, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_ATTACK_REPEAT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_ATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } return; } @@ -3004,7 +3007,7 @@ void CPlayer::UpdatePendingAction() { ); const bool inRange = static_cast(range * 5) + 5.5f >= distance; if ((reinterpret_cast(this->unknown_04F8) == column && this->unknown_04FC == row) || inRange) { - this->SendMsg(nullptr, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_SKILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -3017,7 +3020,7 @@ void CPlayer::UpdatePendingAction() { this->unknown_04FC = cellY; reinterpret_cast(this->unknown_04F8) = cellX; this->ApplyFollowOffset(target, x, z, &cellY, &cellX); - this->SendMsg(nullptr, 91, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } case PT_GROUNDSKILL: { @@ -3039,7 +3042,7 @@ void CPlayer::UpdatePendingAction() { const float distance = this->CalcDist(x, this->render.position.y, z); const bool inRange = static_cast(range * 5) + 5.5f >= distance; if ((reinterpret_cast(this->unknown_04F8) == column && this->unknown_04FC == row) || inRange) { - this->SendMsg(nullptr, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_GROUND_SKILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } @@ -3051,7 +3054,7 @@ void CPlayer::UpdatePendingAction() { } this->unknown_04FC = groundY; reinterpret_cast(this->unknown_04F8) = groundX; - this->SendMsg(nullptr, 91, 0, groundX, groundX >> 31, groundY, groundY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, groundX, groundX >> 31, groundY, groundY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } case PT_PICKUPITEM: { @@ -3075,10 +3078,10 @@ void CPlayer::UpdatePendingAction() { } if (mode->IsWithinRange(column, row, targetX, targetY, 1)) { - this->SendMsg(nullptr, 16, 0, targetX, targetX >> 31, targetY, targetY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_CHANGE_DIR, 0, targetX, targetX >> 31, targetY, targetY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); if (!mode->HasUnknown01A4(this->unknown_051C)) { mode->PushUnknown01A4(this->unknown_051C); - mode->SendMsg(136, this->unknown_051C, 0, 0, 0); + mode->SendMsg(MM_ITEMPICKUP, this->unknown_051C, 0, 0, 0); } break; } @@ -3088,7 +3091,7 @@ void CPlayer::UpdatePendingAction() { } this->unknown_04FC = itemY; reinterpret_cast(this->unknown_04F8) = itemX; - this->SendMsg(nullptr, 91, 0, itemX, itemX >> 31, itemY, itemY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, itemX, itemX >> 31, itemY, itemY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } case PT_TOUCH_SKILL: { @@ -3104,7 +3107,7 @@ void CPlayer::UpdatePendingAction() { int cellY; mode->WorldCell(skill->render.position.x, skill->render.position.z, cellX, cellY); int range = mode->GetSkillAttackRange(this->unknown_052C, this->unknown_0530); - if (mode->SendMsg(95, 0, 0, 0, 0) == 0 && range < 5 && this->unknown_052C != 124) { + if (mode->SendMsg(MM_GET_SKILL_USE_TYPE, 0, 0, 0, 0) == 0 && range < 5 && this->unknown_052C != 124) { range = g_session.unknown_0F4C > 5 ? g_session.unknown_0F4C : 5; } float x; @@ -3128,7 +3131,7 @@ void CPlayer::UpdatePendingAction() { } this->unknown_04FC = cellY; reinterpret_cast(this->unknown_04F8) = cellX; - this->SendMsg(nullptr, 91, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } @@ -3145,7 +3148,7 @@ void CPlayer::UpdatePendingAction() { case UNT_FLAMETRAP: if (this->unknown_052C == 0) { if (this->unknown_0510 == 2) { - this->SendMsg(nullptr, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->unknown_0514 != 0 || timeGetTime() <= this->unknown_0500 + 1200) { return; @@ -3154,22 +3157,22 @@ void CPlayer::UpdatePendingAction() { this->unknown_0500 = timeGetTime(); this->unknown_0514 = 1; if (this->unknown_0510 != 2) { - this->SendMsg(nullptr, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_ATTACK_REPEAT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_ATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } return; } break; } - this->SendMsg(nullptr, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_SKILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; } default: return; } - this->SendMsg(nullptr, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00DB68B0 @@ -3201,49 +3204,49 @@ void CPlayer::ReapplySkillEffects() { case EFST_TWOHANDQUICKEN: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x82, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x82, 0, 0, 0); } break; } case EFST_ONEHANDQUICKEN: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x82, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x82, 0, 0, 0); } break; } case EFST_NJ_BUNSINJYUTSU: { CRagEffect* effect = this->LaunchEffect(0x269, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x269, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x269, 0, 0, 0); } break; } case EFST_OVERTHRUST: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x80, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x80, 0, 0, 0); } break; } case EFST_OVERTHRUSTMAX: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x80, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x80, 0, 0, 0); } break; } case EFST_ENERGYCOAT: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0xA9, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0xA9, 0, 0, 0); } break; } case EFST_SPEARQUICKEN: { CRagEffect* effect = this->LaunchEffect(0xA6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0xFA, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0xFA, 0, 0, 0); } break; } @@ -3293,12 +3296,12 @@ void CPlayer::ReapplySkillEffects() { } for (int id = 0x1DB; id < 0x1E5; ++id) { if (this->HasId(id) == true) { - this->SendMsg(nullptr, 109, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, id, id >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } this->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } - this->SendMsg(nullptr, 109, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0544 = this->LaunchEffect(0xA4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } @@ -3325,12 +3328,12 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_DUPLELIGHT: { while (this->HasId(0x341)) { - this->SendMsg(nullptr, 109, 0, 0x341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } CRagEffect* effect = this->LaunchEffect(0x341, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); vector3d scale{2.0f, 0.0f, 0.0f}; if (effect) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&scale), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&scale), 0, 0, 0, 0); } break; } @@ -3342,11 +3345,11 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_STRIKING: { while (this->HasId(0x39D)) { - this->SendMsg(nullptr, 109, 0, 0x39D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x39D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } CRagEffect* effect = this->LaunchEffect(0x39D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x39D, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x39D, 0, 0, 0); } break; } @@ -3436,24 +3439,24 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_MELODYOFSINK: if (this->HasId(0x57) == true) { - this->SendMsg(nullptr, 109, 0, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x57, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_BEYOND_OF_WARCRY: if (this->HasId(0x31F) == true) { - this->SendMsg(nullptr, 109, 0, 0x31F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x31F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x31F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_SATURDAY_NIGHT_FEVER: if (this->HasId(0x360) == true) { - this->SendMsg(nullptr, 109, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x360, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_EQUIPED_FLOOR: - this->SendMsg(nullptr, 110, 0, 0x23B, 0, 1, 0, value, value >> 31, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 0x23B, 0, 1, 0, value, value >> 31, 0, 0, 0, 0, 0, 0); break; case EFST_ALL_RIDING: this->SetRiding(1); @@ -3461,41 +3464,41 @@ void CPlayer::ReapplySkillEffects() { this->SetBodyPalette(this->render.unknown_0048); break; case EFST_ON_PUSH_CART: - this->SendMsg(nullptr, 110, 0, type, type >> 31, 1, 0, g_session.unknown_5C1C, g_session.unknown_5C1C >> 31, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, 1, 0, g_session.unknown_5C1C, g_session.unknown_5C1C >> 31, 0, 0, 0, 0, 0, 0); break; case EFST_TELEKINESIS_INTENSE: while (this->HasId(0x418)) { - this->SendMsg(this, 109, 0, 0x418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x418, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_WIDEWEB: while (this->HasId(0x194)) { - this->SendMsg(this, 109, 0, 0x194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x194, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_BURNT: while (this->HasId(0x41E)) { - this->SendMsg(this, 109, 0, 0x41E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x41E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x41E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_CHILL: while (this->HasId(0x41F)) { - this->SendMsg(this, 109, 0, 0x41F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x41F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x41F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_OFFERTORIUM: while (this->HasId(0x421)) { - this->SendMsg(this, 109, 0, 0x421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x421, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_ZANGETSU: while (this->HasId(0x3EB)) { - this->SendMsg(this, 109, 0, 0x3EB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x3EB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x3EB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -3508,13 +3511,13 @@ void CPlayer::ReapplySkillEffects() { } } while (this->HasId(0x3C3)) { - this->SendMsg(nullptr, 109, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3C3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x3C3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_KAGEMUSYA: while (this->HasId(0x3EC)) { - this->SendMsg(nullptr, 109, 0, 0x3EC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x3EC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x3EC, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -3532,7 +3535,7 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_DARKCROW: while (this->HasId(0x410)) { - this->SendMsg(nullptr, 109, 0, 0x410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x410, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x410, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3541,11 +3544,11 @@ void CPlayer::ReapplySkillEffects() { case EFST_HALLUCINATIONWALK: case EFST_NPC_HALLUCINATIONWALK: { while (this->HasId(0x318)) { - this->SendMsg(nullptr, 109, 0, 0x318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } CRagEffect* effect = this->LaunchEffect(0x318, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 0xFFFF, 0x318, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 0xFFFF, 0x318, 0, 0, 0); } break; } @@ -3659,19 +3662,19 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_HANDICAPSTATE_DEEPBLIND: if (this->HasId(0x14E) == true) { - this->SendMsg(nullptr, 109, 0, 0x14E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x14E, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x14E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_overrideColor = 1; - this->SendMsg(nullptr, 109, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0544 = this->LaunchEffect(0xA4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EFST_HANDICAPSTATE_DEEPSILENCE: case EFST_HANDICAPSTATE_SWOONING: - this->SendMsg(nullptr, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_DEEPSILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HANDICAPSTATE_LASSITUDE: - this->SendMsg(nullptr, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LASSITUDE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HANDICAPSTATE_FROSTBITE: g_effectMgr->Spawn(this->render.accountId, 0x8DE, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); @@ -3685,21 +3688,21 @@ void CPlayer::ReapplySkillEffects() { g_effectMgr->Spawn(this->render.accountId, 0x8E1, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); break; case EFST_HANDICAPSTATE_CONFLAGRATION: - this->SendMsg(nullptr, 127, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); g_effectMgr->Retire(this->render.accountId, 0x8DD); g_effectMgr->Spawn(this->render.accountId, 0x8DD, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); break; case EFST_HANDICAPSTATE_MISFORTUNE: - this->SendMsg(nullptr, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_MISFORTUNE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HANDICAPSTATE_DEADLYPOISON: - this->SendMsg(nullptr, 127, 0, 170, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 170, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HANDICAPSTATE_DEPRESSION: - this->SendMsg(nullptr, 127, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HANDICAPSTATE_HOLYFLAME: - this->SendMsg(nullptr, 127, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case EFST_DRAGONIC_AURA: g_effectMgr->Retire(this->render.accountId, 0x6BE); @@ -3788,7 +3791,7 @@ void CPlayer::ReapplySkillEffects() { } break; case EFST_BLOCK: - g_windowMgr.EnsureWindow(0x2730); + g_windowMgr.EnsureWindow(WID_DEBUFFREMOVEWND); break; case EFST_HOLY_OIL: case EFST_FIRST_BRAND: @@ -3796,7 +3799,7 @@ void CPlayer::ReapplySkillEffects() { break; case EFST_EQUIPPED_DIVINE_ARMOR: case EFST_EQUIPPED_HOLY_ARMOR: - this->SendMsg(nullptr, 110, 0, type, type >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; default: switch (type) { @@ -3814,7 +3817,7 @@ void CPlayer::ReapplySkillEffects() { case EFST_MERMAID_LONGING: case EFST_MAGICAL_FEATHER: case EFST_TIME_ACCESSORY: - this->SendMsg(nullptr, 110, 0, type, type >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STATUS_CHANGE, 0, type, type >> 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case EFST_HEAD_EQUIPMENT_EFFECT: this->ApplyEffectState(value + 0x9B5, true); @@ -3854,9 +3857,9 @@ void CPlayer::SendMsg( request.y = this->unknown_0538; request.level = this->unknown_0530; if (request.skill == 0x7D) { - g_windowMgr.EnsureWindow(0x54)->SendMsg(nullptr, 0x44, reinterpret_cast(&request), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_TALKBOXTRAPINPUTWND)->SendMsg(nullptr, UM_SET_SKILL_INFO, reinterpret_cast(&request), 0, 0, 0); } else if (request.skill == 0xDC) { - g_windowMgr.EnsureWindow(0x65)->SendMsg(nullptr, 0x44, reinterpret_cast(&request), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_GRAFFISTRBOXWND)->SendMsg(nullptr, UM_SET_SKILL_INFO, reinterpret_cast(&request), 0, 0, 0); } else if (request.skill == 0x108 || request.skill == 0xA04) { int metadata = 0; int column = 0; @@ -3869,36 +3872,36 @@ void CPlayer::SendMsg( if (g_pathFinder.FindPath(timeGetTime(), column, row, subColumn, subRow, this->unknown_0534, this->unknown_0538, 150, route, 15) == true) { metadata = route.EndMetadata(); } - mode->SendMsg(0x46, reinterpret_cast(&request), metadata, 0, 0); + mode->SendMsg(MM_USE_SKILL_TOGROUND, reinterpret_cast(&request), metadata, 0, 0); } else { - mode->SendMsg(0x46, reinterpret_cast(&request), 0, 0, 0); + mode->SendMsg(MM_USE_SKILL_TOGROUND, reinterpret_cast(&request), 0, 0, 0); } break; } case AM_REQ_SKILL: - mode->SendMsg(0x45, this->unknown_052C, this->unknown_051C, this->unknown_0530, 0); + mode->SendMsg(MM_USE_SKILL, this->unknown_052C, this->unknown_051C, this->unknown_0530, 0); break; case AM_REQ_ATTACK_REPEAT: { CRenderObject* target = mode->scene->GetGameActorByAID(this->unknown_051C); if (target == nullptr || static_cast(target)->unknown_0314 != 7) { - mode->SendMsg(0x89, 7, this->unknown_051C, 0, 0); + mode->SendMsg(MM_REQUEST_ACT, 7, this->unknown_051C, 0, 0); } break; } case AM_REQ_ATTACK: - mode->SendMsg(0x89, 0, this->unknown_051C, 0, 0); + mode->SendMsg(MM_REQUEST_ACT, 0, this->unknown_051C, 0, 0); break; case AM_REQ_SIT: if (!StateFlag01(this->stateFlags)) { if (this->render.unknown_0070 == 0) { - mode->SendMsg(0x89, 2, this->unknown_051C, 0, 0); + mode->SendMsg(MM_REQUEST_ACT, 2, this->unknown_051C, 0, 0); } else if (this->render.unknown_0070 == 6) { - mode->SendMsg(0x89, 3, this->unknown_051C, 0, 0); + mode->SendMsg(MM_REQUEST_ACT, 3, this->unknown_051C, 0, 0); } } break; case AM_REQ_MOVE: - this->SendMsg(nullptr, 0xD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->render.unknown_0070 != 0x4B) { if (this->IsSpecialState(this->render.unknown_0070)) { this->unknown_0518 = 1; @@ -3908,7 +3911,7 @@ void CPlayer::SendMsg( this->unknown_0518 = 0; this->unknown_053C = -1; this->unknown_0540 = -1; - this->SendMsg(nullptr, 0x5B, 0, b, b >> 31, d, d >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, b, b >> 31, d, d >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } break; @@ -3916,7 +3919,7 @@ void CPlayer::SendMsg( g_unknown173AD3F = false; if (timeGetTime() > this->unknown_0528 + 350) { this->unknown_0528 = timeGetTime(); - mode->SendMsg(0x8A, b, d, 0, 0); + mode->SendMsg(MM_REQUEST_MOVE, b, d, 0, 0); } break; case AM_REQ_CHANGE_DIR: { @@ -3977,7 +3980,7 @@ void CPlayer::SendMsg( const int motion = this->unknown_043C; this->render.curMotion = motion; this->render.angle = static_cast((CPlayer::AngleToDirection(this->render.angle) + 4) * 45); - mode->SendMsg(0x8B, CPlayer::AngleToDirection(this->render.angle), motion, 0, 0); + mode->SendMsg(MM_CHANGE_DIRECTION, CPlayer::AngleToDirection(this->render.angle), motion, 0, 0); break; } case AM_PREMOVE: @@ -4016,13 +4019,13 @@ void CPlayer::SendMsg( case AM_CANCELATTACK: this->unknown_0514 = 0; this->unknown_0508 = 0; - mode->SendMsg(0x1A, 0, 0, 0, 0); + mode->SendMsg(MM_SETLOCKONMOUSE, 0, 0, 0, 0); break; case AM_ATTACKCLICKUP: { const int attackMode = this->unknown_0508; if (attackMode != 1 && attackMode != 5) { if (attackMode == 3) { - mode->SendMsg(0x1A, 0, 0, 0, 0); + mode->SendMsg(MM_SETLOCKONMOUSE, 0, 0, 0, 0); break; } if (attackMode != 6) { @@ -4032,8 +4035,8 @@ void CPlayer::SendMsg( if (this->unknown_0510 != 0) { this->unknown_0510 = 2; if (this->unknown_0520 != 0) { - this->SendMsg(nullptr, 0xD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - mode->SendMsg(0x49, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CANCELATTACK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_LOCKON, 0, 0, 0, 0); } } break; @@ -4061,7 +4064,7 @@ void CPlayer::SendMsg( this->unknown_052C = d; } break; - case 0x3C: + case AM_RESUMEPROCEEDATTACK: if (this->render.unknown_0070 != 6 && !StateFlag01(this->stateFlags)) { const int attackMode = this->unknown_0508 == 1 ? 5 : 1; this->unknown_0524 = timeGetTime() - 1200; @@ -4107,7 +4110,7 @@ void CPlayer::SendMsg( this->unknown_0520 = 0; } break; - case 0x95: + case AM_CLEAR_ROUTE: this->route.points.clear(); break; default: @@ -4331,7 +4334,7 @@ void CPlayer::Initialize() { this->SetSprRobe(g_session.m_robe, 0); if (g_session.unknown_6184 != 0) { const int value = g_session.unknown_6184; - this->SendMsg(nullptr, 110, 0, 856, 0, 1, 0, value, value >> 31, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_STATUS_CHANGE, 0, 856, 0, 1, 0, value, value >> 31, 0, 0, 0, 0, 0, 0); } this->bodyState = bodyState; this->stateFlags = stateFlags; @@ -4340,7 +4343,7 @@ void CPlayer::Initialize() { *reinterpret_cast(&g_session.unknown_0F0C[0]), g_session.m_jobFlags, *reinterpret_cast(&g_session.unknown_0F0C[4]), false ); - this->SendMsg(nullptr, 109, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0xA4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0544 = this->LaunchEffect(0xA4, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (!g_statusRefreshSuppressed) { this->ReapplySkillEffects(); @@ -4869,8 +4872,8 @@ void CPc::SendMsg( } break; } - case 105: - case 106: + case AM_MAKE_CHICKEN: + case AM_DELETE_CHICKEN: case 136: { this->SetSprJob(this->GetEffectiveJob(-1)); this->SetImfFileName(); @@ -5095,7 +5098,7 @@ void CPc::SendMsg( this->unknown_04D0 = entry->unknown_007C; break; } - case 114: + case AM_CHANGE_RANK: this->unknown_0494 = d; this->unknown_0498 = b; break; @@ -5136,13 +5139,13 @@ void CPc::SendMsg( break; } CMsgEffect* effect = mode->SpawnMsgEffect(effectId, &this->render.position, this->render.accountId, true); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); effect->SetAnimationSpeed(6.0f); this->AddMsgEffect(effect); this->unknown_037C[0] = reinterpret_cast(effect); break; } - case 137: { + case AM_MAKE_WOLF: { if (this->unknown_037C[1] != 0) { break; } @@ -5173,7 +5176,7 @@ void CPc::SendMsg( if (!effect) { break; } - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->AddMsgEffect(effect); this->unknown_037C[1] = reinterpret_cast(effect); break; @@ -5288,8 +5291,8 @@ void CGrannyPc::SendMsg( } break; } - case 105: - case 106: { + case AM_MAKE_CHICKEN: + case AM_DELETE_CHICKEN: { this->SetSprJob(this->GetEffectiveJob(-1)); this->SetImfFileName(); const std::int64_t weapon = this->GetWeapon(); @@ -5434,7 +5437,7 @@ void CGrannyPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 114: + case AM_CHANGE_RANK: this->unknown_047C = d; this->unknown_0480 = b; break; @@ -5595,12 +5598,12 @@ void CPlayer::SetState(int state, int resetPosition) { this->unknown_0518 = 0; this->unknown_053C = -1; this->unknown_0540 = -1; - this->SendMsg(nullptr, 91, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REQ_MOVE_PRIMITIVE, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } if (state == 3) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - mode->SendMsg(5, 0, 0, 0, 0); + mode->SendMsg(MM_HIDEMOUSEPOINTER, 0, 0, 0, 0); mode->LaunchDummyEffect(&this->render.position, 0x174, 300, 0); g_screenShakeDuration = 0; } diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 15620777a..f542e7bb3 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -1,4 +1,6 @@ #include "Contents/Actors/Npc.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Actors/ActorEnums.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Skills/SkillId.h" @@ -1095,7 +1097,7 @@ void CGameActor::PlayGroundSkillEffect(int sender, const int* skill, int argumen mode->LaunchDummyEffect(&position, 0x77, EffectLifetime(0x77) + 10, 0); if (this->unknown_037C[0] != 0) { const int address = reinterpret_cast(&position); - reinterpret_cast(this->unknown_037C[0])->SendMsg(nullptr, 0x1D, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + reinterpret_cast(this->unknown_037C[0])->SendMsg(nullptr, AM_REQ_ATTACK, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case AS_VENOMDUST: @@ -1181,7 +1183,7 @@ void CGameActor::PlayGroundSkillEffect(int sender, const int* skill, int argumen case NC_COLDSLOWER: { CRagEffect* effect = this->LaunchEffect(0x317, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; } @@ -1349,7 +1351,7 @@ void CGameActor::SetState(int state, int resetPosition) { target = mode->scene->GetGameActorByAID(this->hitTargetAid); } if (target) { - target->SendMsg(nullptr, 0x57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_MAGIC_TARGET, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->SetAction(action, 5, 1); const int job = this->GetEffectiveJob(-1); @@ -1390,8 +1392,8 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.unknown_00DC = 0; this->render.isMotionFreezed = false; if (this->bodyState == BODYSTATE_FREEZING) { - this->SendMsg(nullptr, 0x3b, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 0x3e, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_ICEEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_ICEBREAKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->render.isLieOnGround = true; this->render.isMotionFinished = false; @@ -1445,10 +1447,10 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.unknown_00C2 = 10; this->SetAnimationSequence(action, 0, action, 0, action, 0, action, 1, action, 1, 1, 3000, 0); while (HasEffectOfType(this->state.effects, 0x1be)) { - this->SendMsg(nullptr, 0x6d, 0, 0x1be, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1be, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } while (HasEffectOfType(this->state.effects, 0x1bd)) { - this->SendMsg(nullptr, 0x6d, 0, 0x1bd, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1bd, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x1bd, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x19b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -1605,10 +1607,10 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.unknown_00C2 = 20; this->SetAnimationSequence(action, 0, action, 0, action, 0, action, 1, action, 1, 1, 3000, 0); while (HasEffectOfType(this->state.effects, 0x1be)) { - this->SendMsg(nullptr, 0x6d, 0, 0x1be, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x1be, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } while (HasEffectOfType(this->state.effects, 0x430)) { - this->SendMsg(nullptr, 0x6d, 0, 0x430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 0x430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->LaunchEffect(0x430, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x19b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2917,7 +2919,7 @@ void CGameActor::SetUnknown008C(const std::uint32_t* value) { // OFFSET: 0x00CC41E0 // FUNCTION: fn_21159 void CGameActor::UnRegisterPos() { - g_modeMgr.GetGameMode()->SendMsg(13, this->render.accountId, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETEREGISTERPOS, this->render.accountId, 0, 0, 0); } // OFFSET: 0x00CC1E30 @@ -3163,7 +3165,7 @@ void CGameActor::SetHatEffect(int effectId, bool on) { } const std::int64_t value = hatEffect; - this->SendMsg(this, 109, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); bool show = on; CPc* pc; @@ -3210,30 +3212,30 @@ void CGameActor::SetEffectInstance(int effectId, int instance, bool on) { // FUNCTION: fn_21022 void CGameActor::ResetJobEffects() { this->unknown_02B8 = 0; - this->SendMsg(this, 109, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 1022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 1226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 109, 0, 1227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 976, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 977, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 979, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 1022, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 1226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 1227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 757, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 880, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 397, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const std::int64_t first = g_session.m_maxLevelEffect4th; - this->SendMsg(this, 109, 0, static_cast(first), static_cast(first >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, static_cast(first), static_cast(first >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const std::int64_t second = g_session.m_maxLevelEffect4thSub; - this->SendMsg(this, 109, 0, static_cast(second), static_cast(second >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, static_cast(second), static_cast(second >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00CAB020 @@ -3669,7 +3671,7 @@ void CGameActor::ProcessHitMessage(CGameObject*, const ActorHitInfo* info, int, if (this->unknown_0178 != 0) { CRagEffect* effect = this->LaunchEffect(0x83, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0); } this->unknown_0178 = 0; } @@ -3765,11 +3767,11 @@ void CGameActor::ProcessHitMessage(CGameObject*, const ActorHitInfo* info, int, const std::int64_t address = reinterpret_cast(&message); if (hitCount == 1) { - target->SendMsg(this, 0x1B, 0, static_cast(address), static_cast(address >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { const std::int64_t value = damage; target->SendMsg( - this, 0x1B, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, + this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0 ); } @@ -3784,7 +3786,7 @@ void CGameActor::ProcessHitMessage(CGameObject*, const ActorHitInfo* info, int, message.damage = damage; const std::int64_t value = total; target->SendMsg( - this, 0x1B, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, + this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0 ); message.time -= g_multiHitInterval / 2; @@ -3795,11 +3797,11 @@ void CGameActor::ProcessHitMessage(CGameObject*, const ActorHitInfo* info, int, message.time += g_multiHitInterval / 2 + (g_multiHitInterval / 4 + g_multiHitInterval); message.damage = extraDamage; if (hitCount == 1) { - target->SendMsg(this, 0x1B, 0, static_cast(address), static_cast(address >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { const std::int64_t value = total + extraDamage; target->SendMsg( - this, 0x1B, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, + this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0 ); } @@ -3814,7 +3816,7 @@ void CGameActor::ProcessHitMessage(CGameObject*, const ActorHitInfo* info, int, message.damage = damage; const std::int64_t value = total; target->SendMsg( - this, 0x1B, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, + this, AM_WILL_BE_ATTACKED, 0, static_cast(address), static_cast(address >> 32), static_cast(value), static_cast(value >> 32), 0, 0, 0, 0, 0, 0, 0, 0 ); } @@ -4266,10 +4268,10 @@ void C3dGrannyGameActor::RenderShadowed(int argument) { // OFFSET: 0x00CC3E50 // FUNCTION: fn_21156 void CGameActor::SetCharm(int type, int count) { - this->SendMsg(this, 0x6D, 0, 0x2E1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 0x6D, 0, 0x2E2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 0x6D, 0, 0x2DF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 0x6D, 0, 0x2E0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x2E1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x2E2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x2DF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 0x2E0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (count <= 0 || StateFlag01(this->GetStateFlags()) || StateFlag02(this->GetStateFlags())) { return; } @@ -4293,7 +4295,7 @@ void CGameActor::SetCharm(int type, int count) { CRagEffect* effect = this->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); vector3d position{static_cast(count), 0.0f, 0.0f}; if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } return; } @@ -4388,7 +4390,7 @@ void CGameActor::UpdateMaxLevelAura() { if (IsTreeGroupThreeLocal(this->GetEffectiveJob(-1)) == true) { if (static_cast(this->unknown_0210) == *reinterpret_cast(&g_session.unknown_7EF0[0x74])) { - this->SendMsg(nullptr, 0x97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL4TH_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } this->unknown_02B4 = 0; @@ -4397,7 +4399,7 @@ void CGameActor::UpdateMaxLevelAura() { if (g_session.IsSuperNovice2Job(this->GetEffectiveJob(-1))) { if (static_cast(this->unknown_0210) == *reinterpret_cast(&g_session.unknown_7EF0[0])) { - this->SendMsg(nullptr, 0x92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL160_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } this->unknown_02B4 = 0; @@ -4406,7 +4408,7 @@ void CGameActor::UpdateMaxLevelAura() { if (g_session.IsExpandedJob(this->GetEffectiveJob(-1))) { if (static_cast(this->unknown_0210) == *reinterpret_cast(&g_session.unknown_7EF0[4])) { - this->SendMsg(nullptr, 0x92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL160_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } this->unknown_02B4 = 0; @@ -4427,13 +4429,13 @@ void CGameActor::UpdateMaxLevelAura() { this->unknown_02B4 = 0; return; } - this->SendMsg(nullptr, 0x7d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL99_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } if (g_session.IsDoramJob(this->GetEffectiveJob(-1)) == true) { if (static_cast(this->unknown_0210) == *reinterpret_cast(&g_session.unknown_7EF0[0x28])) { - this->SendMsg(nullptr, 0x92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL160_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } this->unknown_02B4 = 0; @@ -4441,7 +4443,7 @@ void CGameActor::UpdateMaxLevelAura() { } if (static_cast(this->unknown_0210) == *reinterpret_cast(g_session.unknown_7EE8)) { - this->SendMsg(nullptr, 0x7d, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_LEVEL99_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } @@ -4775,7 +4777,7 @@ void CGameActor::SpawnDamageDigits(int, int damage, std::uint32_t color, int typ CMsgEffect* effect = static_cast(*it); if (effect->m_type == 22) { this->ClearUnknown037C(reinterpret_cast(effect)); - effect->SendMsg(this, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); it = this->unknown_03B0.erase(it); static_cast(g_modeMgr.GetGameMode())->scene->RemoveObject(effect); } else { @@ -4788,19 +4790,19 @@ void CGameActor::SpawnDamageDigits(int, int damage, std::uint32_t color, int typ for (auto it = digits.begin(); it != digits.end(); ++it, ++index) { CMsgEffect* effect = new CMsgEffect; effect->render.color = color; - effect->SendMsg(nullptr, 22, 0, this->render.accountId, 0, type, type >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETMASTERGID, 0, this->render.accountId, 0, type, type >> 31, 0, 0, 0, 0, 0, 0, 0, 0); const std::intptr_t position = reinterpret_cast(&this->render.position); const int count = static_cast(digits.size()); if (value >= 100000000 && g_session.m_damageMillionUnit == 2) { if (index == 0) { - effect->SendMsg(nullptr, 64, 0, position, position >> 31, *it, *it >> 31, (count - 1) * 3 + 4, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS2, 0, position, position >> 31, *it, *it >> 31, (count - 1) * 3 + 4, 0, 0, 0, 0, 0, 0, 0); } else { - effect->SendMsg(nullptr, 64, 0, position, position >> 31, *it, *it >> 31, (count - 1) * 3 - index * 8, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS2, 0, position, position >> 31, *it, *it >> 31, (count - 1) * 3 - index * 8, 0, 0, 0, 0, 0, 0, 0); } } else { - effect->SendMsg(nullptr, 64, 0, position, position >> 31, *it, *it >> 31, (count - index * 2) * 4 - 4, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS2, 0, position, position >> 31, *it, *it >> 31, (count - index * 2) * 4 - 4, 0, 0, 0, 0, 0, 0, 0); } - effect->SendMsg(this, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); effect->render.unknown_00B4 = 0; if (type == 22) { effect->render.scale = 0.5f; @@ -4853,12 +4855,12 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef if (StateFlag01Changed(this->stateFlags, previousFlags)) { this->ResetJobEffects(); if (this->GetEffectiveJob(-1) == 45) { - this->SendMsg(this, 109, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_DELETE_EFFECT, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag01(this->stateFlags)) { if (notify) { - this->SendMsg(nullptr, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->GetEffectiveJob(-1) != 25 && this->GetEffectiveJob(-1) != 4222) { this->LaunchEffect(16, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -4867,17 +4869,17 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.enabled = 0; if (this->render.accountId != g_session.m_aid && g_session.IsAdminSubMode(7) == 0) { this->render.unknown_00A4Bytes[0] = 0; - this->SendMsg(nullptr, 109, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REMOVEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (!g_session.IsGuildMemberAccount(this->render.accountId)) { this->ClearUnknown0188(); @@ -4888,7 +4890,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } } else { if (notify) { - this->SendMsg(nullptr, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; } @@ -4897,13 +4899,13 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.unknown_00A4Bytes[0] = 1; } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->RefreshGuildEmblemWindow(); if (this->unknown_02B4 != 0) { @@ -4922,17 +4924,17 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.enabled = 0; if (this->render.accountId != g_session.m_aid && g_session.IsAdminSubMode(7) == 0) { this->render.unknown_00A4Bytes[0] = 0; - this->SendMsg(nullptr, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 109, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_REMOVEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (!g_session.IsGuildMemberAccount(this->render.accountId)) { this->ClearUnknown0188(); @@ -4948,13 +4950,13 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.unknown_00A4Bytes[0] = 1; } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->RefreshGuildEmblemWindow(); if (this->unknown_02B4 != 0) { @@ -4965,36 +4967,36 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef if (!StateFlag01(this->stateFlags) && !StateFlag02(this->stateFlags) && !StateFlag06(this->stateFlags)) { if (StateFlag04Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag04(this->stateFlags) ? 101 : 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag04(this->stateFlags) ? AM_MAKE_BIRD : AM_DELETE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag20(this->stateFlags) ? 137 : 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag20(this->stateFlags) ? AM_MAKE_WOLF : AM_DELETE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } if (StateFlag19Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag19(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag19(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag23Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag23(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag23(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag24Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag24(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag24(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag25Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag25(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag25(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag26Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag26(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag26(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag21Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag21(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag21(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag05Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag05(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag05(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag15Changed(this->stateFlags, previousFlags)) { - this->SendMsg(nullptr, StateFlag15(this->stateFlags) ? 105 : 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, StateFlag15(this->stateFlags) ? AM_MAKE_CHICKEN : AM_DELETE_CHICKEN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag06Changed(this->stateFlags, previousFlags)) { @@ -5004,7 +5006,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.unknown_00A4Bytes[0] = 0; if (admin == 0) { this->render.visible = 0; - this->SendMsg(nullptr, 109, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (this->unknown_03B0.size() != 0) { for (CGameObject* object : this->unknown_03B0) { static_cast(object)->m_visible = this->render.accountId == g_session.m_aid; @@ -5014,13 +5016,13 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef this->render.visible = 1; } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (!g_session.IsGuildMemberAccount(this->render.accountId)) { this->ClearUnknown0188(); @@ -5041,13 +5043,13 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } } if (this->unknown_02FC > 0) { - this->SendMsg(nullptr, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CART, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag04(this->stateFlags)) { - this->SendMsg(nullptr, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_BIRD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (StateFlag20(this->stateFlags)) { - this->SendMsg(nullptr, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_WOLF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->RefreshGuildEmblemWindow(); if (this->unknown_02B4 != 0) { @@ -5070,8 +5072,8 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef break; } case OPT1_FREEZE: { - this->SendMsg(nullptr, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_ICEEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_ICEBREAKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); const vector3d& player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player)->render.position; g_soundMgr->PlayWave( "_frozen_explosion.wav", this->render.position.x - player.x, 0.0f, this->render.position.z - player.z, 250, 40, 1.0f, 0 @@ -5086,19 +5088,19 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef break; } case OPT1_STUN: - this->SendMsg(nullptr, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_STUN_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; break; case OPT1_SLEEP: - this->SendMsg(nullptr, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; break; case OPT1_BURNING: - this->SendMsg(nullptr, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_BURNING_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case OPT1_IMPRISON: while (this->HasId(802)) { - this->SendMsg(nullptr, 109, 0, 802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 802, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; default: @@ -5115,7 +5117,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef color[0] = 0x40; break; case OPT1_FREEZE: - this->SendMsg(nullptr, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_ICEEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->render.isMotionFinished = true; this->render.isMotionFreezed = true; this->render.unknown_00A3 = 1; @@ -5130,7 +5132,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } break; case OPT1_STUN: - this->SendMsg(nullptr, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_STUN_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (notify) { const vector3d& player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player)->render.position; g_soundMgr->PlayWave( @@ -5139,7 +5141,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } break; case OPT1_SLEEP: - this->SendMsg(nullptr, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_SLEEP_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case OPT1_STONEWAIT: this->render.unknown_00A3 = 1; @@ -5148,7 +5150,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef color[0] = 0x80; break; case OPT1_BURNING: - this->SendMsg(nullptr, 139, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_BURNING_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); break; case OPT1_IMPRISON: if (!this->HasId(802)) { @@ -5183,7 +5185,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef poisonSound = true; } else if (this->render.accountId == g_session.m_aid) { if (g_playerPoisoned == 1) { - this->SendMsg(nullptr, 109, 0, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_playerPoisoned = 0; } @@ -5200,7 +5202,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } if (this->unknown_02C4 & 0x02) { - this->SendMsg(nullptr, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_CURSE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->render.unknown_00A3 = 1; color[1] = 0x32; color[2] = 0xC8; @@ -5212,7 +5214,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef ); } } else { - this->SendMsg(nullptr, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_CURSE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->unknown_02C4 & 0x04) { @@ -5222,12 +5224,12 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef "_silence.wav", this->render.position.x - player.x, 0.0f, this->render.position.z - player.z, 250, 40, 1.0f, 0 ); } - this->SendMsg(nullptr, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_SILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_SILENCE_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - this->SendMsg(nullptr, (this->unknown_02C4 & 0x20) ? 75 : 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, (this->unknown_02C4 & 0x20) ? AM_MAKE_ANGELUS_EFFECT : AM_DELETE_ANGELUS_EFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if ((this->unknown_02C4 & 0x08) && notify) { const vector3d& player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player)->render.position; @@ -5253,7 +5255,7 @@ void CGameActor::SetStatusStates(int bodyState, std::uint32_t stateFlags, int ef } else if (this->render.accountId == g_session.m_aid) { if (static_cast(this->render.instant.Get(16)) == 0) { if (g_overrideColor == 1) { - this->SendMsg(nullptr, 109, 0, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } g_overrideColor = 0; } @@ -5411,7 +5413,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i message.unknown_002C = 0; message.unknown_0030 = skillId; message.unknown_0034 = 0; - target->SendMsg(this, 0x1B, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } } else if (skillId == SO_CLOUD_KILL || skillId == NPC_CLOUD_KILL || skillId == SU_SV_ROOTTWIST_ATK || skillId == GN_CARTCANNON) { @@ -5436,7 +5438,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i message.unknown_002C = 0; message.unknown_0030 = skillId; message.unknown_0034 = 0; - target->SendMsg(this, 0x1B, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return; } } else if (skillId == SO_CLOUD_KILL || skillId == NPC_CLOUD_KILL) { @@ -5482,7 +5484,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i if (ShowsCastEffect(skillId) && level != -2) { CRagEffect* effect = this->LaunchEffect(castEffect, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 44, 0, hitCount, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, hitCount, 0, 0, 0, 0); } } @@ -5547,8 +5549,8 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i CRagEffect* launched = this->LaunchEffect(hitEffect, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (launched != nullptr) { - launched->SendMsg(nullptr, 44, 0, hitCount, 0, 0, 0, 0); - launched->SendMsg(nullptr, 14, 0, reinterpret_cast(&targetPos), 0, 0, 0, 0); + launched->SendMsg(nullptr, AM_SETCOUNT, 0, hitCount, 0, 0, 0, 0); + launched->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&targetPos), 0, 0, 0, 0); } int effect = skillId < 493 && !(skillId >= 411 && skillId <= 472) ? 0 : -1; @@ -5689,26 +5691,26 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i case SR_EARTHSHAKER: case SR_FALLENEMPIRE: case SR_TIGERCANNON: - target->SendMsg(this, 0x1B, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case WL_TETRAVORTEX_WATER: message.time += 500; - target->SendMsg(this, 0x1B, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case WL_TETRAVORTEX_WIND: message.time += 1000; - target->SendMsg(this, 0x1B, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case WL_TETRAVORTEX_GROUND: message.time += 1500; - target->SendMsg(this, 0x1B, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case TK_DOWNKICK: case TK_TURNKICK: case SJ_SOLARBURST: case SJ_PROMINENCEKICK: message.time += 300; - target->SendMsg(this, 0x82, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED2, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case TK_STORMKICK: case TK_COUNTER: @@ -5718,16 +5720,16 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i case SR_CRESCENTELBOW_AUTOSPELL: case SJ_FULLMOONKICK: case SJ_FLASHKICK: - target->SendMsg(this, 0x82, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED2, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; case PR_TURNUNDEAD: message.time += 500; [[fallthrough]]; default: if (hitCount == 1) { - target->SendMsg(this, 0x1B, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { - target->SendMsg(this, 0x1B, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, damage, damage >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } break; } @@ -5766,21 +5768,21 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i case MO_COMBOFINISH: this->SetSequenceInterval(6); this->SetFrameSequence(0x60, 1, 2, 0x60, 2, 1, g_session.FindUnknown0778(this->render.accountId), 0); - static_cast(g_modeMgr.GetGameMode())->SendMsg(122, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\mon_맹룡과강.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); this->LaunchEffect(0x107, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x14A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case CH_PALMSTRIKE: this->SetFrameSequence(0x60, 3, 4, 0x60, 4, 1, 1, 0); - static_cast(g_modeMgr.GetGameMode())->SendMsg(122, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\맹호경파산.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); static_cast(target)->LaunchEffect(0x178, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case CH_TIGERFIST: this->SetSequenceInterval(6); this->SetFrameSequence(0x60, 4, 4, 0x60, 4, 1, g_session.FindUnknown0778(this->render.accountId), 0); - static_cast(g_modeMgr.GetGameMode())->SendMsg(122, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->SendMsg(MM_QUAKE, 0, 0, 0, 0); this->LaunchEffect(0x179, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x107, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -5789,7 +5791,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i CRagEffect* follow = this->LaunchEffect(0x200, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (follow != nullptr) { vector3d position = target->render.position; - follow->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + follow->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; } @@ -5806,7 +5808,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i this->SetSequenceInterval(6); this->SetFrameSequence(0x60, 1, 2, 0x60, 2, 1, g_session.FindUnknown0778(this->render.accountId), 0); if (!this->HasId(0x378)) { - static_cast(g_modeMgr.GetGameMode())->SendMsg(122, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\SR_EARTHSHAKER.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); this->LaunchEffect(0x376, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); this->LaunchEffect(0x378, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -5815,7 +5817,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i case SR_FALLENEMPIRE: this->SetSequenceInterval(6); this->SetFrameSequence(0x60, 3, 3, 0x60, 3, 1, g_session.FindUnknown0778(this->render.accountId), 0); - static_cast(g_modeMgr.GetGameMode())->SendMsg(122, 0, 0, 0, 0); + static_cast(g_modeMgr.GetGameMode())->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\SR_FALLENEMPIRE.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); g_effectMgr->Spawn(target->render.accountId, 0x622, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); g_effectMgr->Spawn(target->render.accountId, 0x623, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); @@ -5827,7 +5829,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i CRagEffect* follow = this->LaunchEffect(0x37B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (follow != nullptr) { vector3d position = target->render.position; - follow->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + follow->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } break; @@ -5869,7 +5871,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i total += damage; message.action = action; message.damage = damage; - target->SendMsg(this, 0x1B, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); continue; } @@ -5884,7 +5886,7 @@ void CGameActor::ProcessSkillMessage(CGameObject*, const ActorSkillInfo* info, i break; case CH_CHAINCRUSH: message.action = 0x6C; - this->SendMsg(this, 0x1B, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); message.action = action; break; case WL_CRIMSONROCK: diff --git a/Source/Contents/Actors/Skill.cpp b/Source/Contents/Actors/Skill.cpp index fa485309c..f67ca6ab8 100644 --- a/Source/Contents/Actors/Skill.cpp +++ b/Source/Contents/Actors/Skill.cpp @@ -180,7 +180,7 @@ void CSkill::ReleaseModel() { delete this->m_model; this->m_model = nullptr; if (this->m_effect != nullptr) { - this->m_effect->SendMsg(nullptr, 24, 0, 0, 0, 0, 0, 0); + this->m_effect->SendMsg(nullptr, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); } this->m_effect = nullptr; @@ -479,13 +479,13 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int const int address = reinterpret_cast(&damageMessage); int total = damage; - target->SendMsg(this, 0x1B, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); for (int index = 0; index < hitCount - 1;) { ++index; damageMessage.time += g_multiHitInterval; total += damage; damageMessage.unknown_0034 = index; - target->SendMsg(this, 0x1B, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(this, AM_WILL_BE_ATTACKED, 0, address, address >> 31, total, total >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -916,7 +916,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int !g_effectMgr->Spawn(0, this->m_effectId, this->render.position.x, this->render.position.y, this->render.position.z, 0, -1, 0, 0)) { CRagEffect* effect = this->LaunchEffect(this->m_effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&this->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&this->render.position), 0, 0, 0, 0); } } break; diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 80bb2f302..737182669 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "Render/DeviceContext/DCSurface.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -380,7 +382,7 @@ bool CCashEmotionAction_Play::Execute(int packId, int emotionId) { emotionId = this->m_yutEmotion + std::max(rand() % 7, 0); } - mode->SendMsg(31, emotionId, packId, 0, 0); + mode->SendMsg(MM_REQ_EMOTION, emotionId, packId, 0, 0); return true; } @@ -424,7 +426,7 @@ bool CCashEmotionAction_SelectedUnPurchasedPack::Execute(int packId, int) { UICashEmotionListWnd* listWnd = static_cast(g_windowMgr.unknown_0384); if (!listWnd) { - listWnd = static_cast(g_windowMgr.EnsureWindow(87)); + listWnd = static_cast(g_windowMgr.EnsureWindow(WID_CASHEMOTIONLISTWND)); } const unsigned int now = g_cashEmotionMgr->GetServerTime(); @@ -438,9 +440,9 @@ bool CCashEmotionAction_SelectedUnPurchasedPack::Execute(int packId, int) { const unsigned int endTime = g_cashEmotionMgr->GetPackEndTime(packId); if (endTime) { const char* key = now < endTime ? "EMSG_NOT_YET_SALE_START_TIME" : "EMSG_EMOTION_EXPANTION_FAIL_DATE"; - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString(key)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString(key)), 255, 0, 0, 0); } else if (g_cashEmotionMgr->GetPackStartTime(packId) > now) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_NOT_YET_SALE_START_TIME")), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_NOT_YET_SALE_START_TIME")), 255, 0, 0, 0); } return true; @@ -1679,10 +1681,10 @@ __declspec(noinline) void UICashEmotionScrollWnd::UpdateScrollBars() { void UICashEmotionListChildWnd_Abstract::OnWheel(int delta) { if (this->wheelScroll == 1) { if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 15, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -15, 0, 0, 0); } } @@ -1700,12 +1702,12 @@ int UICashEmotionListChildWnd_Abstract::SendMsg(UIWindow* sender, int message, s } this->scrollBar->SetPosition(this->scrollPosition); this->scrollBar->Invalidate(); - this->SendMsg(sender, 60, 0, 0, 0, 0); + this->SendMsg(sender, UM_REFRESH, 0, 0, 0, 0); break; case UM_REFRESH: this->Invalidate(); if (this->parent) { - this->parent->SendMsg(sender, 60, 0, 0, 0, 0); + this->parent->SendMsg(sender, UM_REFRESH, 0, 0, 0, 0); } break; default: @@ -1810,10 +1812,10 @@ void UICashEmotionListChildWnd_Basic::OnProcess() { int UICashEmotionListChildWnd_Basic::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { ICashEmotionAction* action; switch (message) { - case 174: + case UM_CASH_EMOTION_ACTIVATE: action = this->m_playAction; break; - case 175: + case UM_CASH_EMOTION_SELECT: action = this->m_selectAction; break; default: @@ -1921,7 +1923,7 @@ void UICashEmotionListChildWnd_Purchase::Paint() { // OFFSET: 0x007C52B0 // FUNCTION: fn_09370 int UICashEmotionListChildWnd_Purchase::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 174) { + if (message != UM_CASH_EMOTION_ACTIVATE) { return UICashEmotionListChildWnd_Abstract::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (this->unknown_00BC) { @@ -2040,7 +2042,7 @@ void UICashEmotionListChildWnd_Search::Paint() { // OFFSET: 0x007C5DA0 // FUNCTION: fn_09385 int UICashEmotionListChildWnd_Search::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 174) { + if (message != UM_CASH_EMOTION_ACTIVATE) { return UICashEmotionListChildWnd_Abstract::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (this->m_action) { @@ -2136,11 +2138,11 @@ void UICashEmotionListChildWnd_UnPurchased::Paint() { // OFFSET: 0x007C6AC0 // FUNCTION: fn_09396 int UICashEmotionListChildWnd_UnPurchased::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 171) { + if (message != UM_CASH_EMOTION_SELECT_PACK) { return UICashEmotionListChildWnd_Abstract::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (this->parent) { - this->parent->SendMsg(sender, 2, argument1, 0, 0, 0); + this->parent->SendMsg(sender, UM_TOGGLEPUSH, argument1, 0, 0, 0); for (UICashEmotionPack* pack : this->m_items) { UICashEmotionPack_Unpurchase* item = static_cast(pack); item->SetPressed(item->unknown_00A8 == argument1, false); @@ -2210,7 +2212,7 @@ void UICashEmotionListWnd::OnCreate(int width, int height) { tab->Move(0, x); const char id = static_cast(index + 1); - tab->SendMsg(this, 13, id == 1, 0, 0, 0); + tab->SendMsg(this, UM_SETSTATE, id == 1, 0, 0, 0); this->AddChild(tab); this->m_tabs.insert(std::make_pair(id, static_cast(tab))); @@ -2258,7 +2260,7 @@ void UICashEmotionListWnd::OnCreate(int width, int height) { auto first = this->m_tabs.find(1); if (first != this->m_tabs.end()) { - this->SendMsg(first->second, 6, 215, 0, 0, 0); + this->SendMsg(first->second, UM_COMMAND, ID_RADIOBTN, 0, 0, 0); } this->m_period = new UIStaticText(); @@ -2309,7 +2311,7 @@ void UICashEmotionListWnd::ShowPack(int packId) { auto tab = this->m_tabs.find(3); if (tab != this->m_tabs.end()) { - this->SendMsg(tab->second, 6, 215, 0, 0, 0); + this->SendMsg(tab->second, UM_COMMAND, ID_RADIOBTN, 0, 0, 0); } if (this->m_searchEdit) { @@ -2323,7 +2325,7 @@ void UICashEmotionListWnd::ShowPack(int packId) { } if (this->m_currentList) { - this->m_currentList->SendMsg(this, 171, packId, 0, 0, 0); + this->m_currentList->SendMsg(this, UM_CASH_EMOTION_SELECT_PACK, packId, 0, 0, 0); } } @@ -2380,7 +2382,7 @@ int UICashEmotionListWnd::SetPeriod(int packId) { this->m_period->Show(1); } - return this->SendMsg(this, 60, 0, 0, 0, 0); + return this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x007C80C0 @@ -2397,7 +2399,7 @@ void UICashEmotionListWnd::RestartExpirySchedule() { // FUNCTION: fn_09417 int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0: + case UM_DEFPUSH: this->RefreshCurrentList(); return 0; @@ -2413,7 +2415,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_COMMAND: switch (argument1) { - case 189: + case ID_BUTTON1: if (this->m_searchEdit) { this->m_searchEdit->SetText(""); } @@ -2422,23 +2424,23 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 190: + case ID_BUTTON2: this->RefreshCurrentList(); return 0; case 191: - if (!g_windowMgr.LookupWindow(86)) { - g_windowMgr.EnsureWindow(86); + if (!g_windowMgr.LookupWindow(WID_EMOTIONWND)) { + g_windowMgr.EnsureWindow(WID_EMOTIONWND); } else { - g_windowMgr.CloseWindow(86); + g_windowMgr.CloseWindow(WID_EMOTIONWND); } return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(87); + g_windowMgr.CloseWindow(WID_CASHEMOTIONLISTWND); return 0; - case 215: { + case ID_RADIOBTN: { if (this->m_tab != 0) { auto current = std::as_const(this->m_tabs).find(this->m_tab); if (current == this->m_tabs.end() || sender == current->second) { @@ -2449,10 +2451,10 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a char selected = 0; for (auto& tab : this->m_tabs) { if (sender == tab.second) { - tab.second->SendMsg(nullptr, 13, 1, 0, 0, 0); + tab.second->SendMsg(nullptr, UM_SETSTATE, 1, 0, 0, 0); selected = tab.first; } else { - tab.second->SendMsg(nullptr, 13, 0, 0, 0, 0); + tab.second->SendMsg(nullptr, UM_SETSTATE, 0, 0, 0, 0); } } this->SetTab(selected); @@ -2469,13 +2471,13 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (g_session.IsDoramJob(g_session.GetDisplayJob())) { skill = g_session.m_skillBundle.Find(5018); if (!skill || skill->level <= 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 255, 0, 0, 0); return 0; } } else { skill = g_session.m_skillBundle.Find(1); if (!skill || skill->level <= 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_BASICSKILL_LEVEL")), 255, 0, 0, 0); return 0; } } @@ -2487,7 +2489,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a const bool free = price == 0; if (!free && g_session.GetInventoryItemCount(g_cashEmotionMgr->unknown_01C8) < price) { - g_windowMgr.SendNotice(1, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_NYANGVINE")), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(g_simpleStringMgr->GetString("EMSG_EMOTION_EXPANTION_NOT_ENOUGH_NYANGVINE")), 255, 0, 0, 0); return 0; } @@ -2521,7 +2523,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 2: + case UM_TOGGLEPUSH: if (this->unknown_00E4) { this->unknown_00E4->Enable(1); } @@ -2860,7 +2862,7 @@ int UICashEmotionMiniWnd::SendMsg( this->Invalidate(); return 0; - case 174: + case UM_CASH_EMOTION_ACTIVATE: entry.first = static_cast(argument1); entry.second = static_cast(argument2); break; @@ -2873,7 +2875,7 @@ int UICashEmotionMiniWnd::SendMsg( } return 0; - case 176: + case UM_CASH_EMOTION_KEY: if (argument1 == 13) { if (!this->m_selected) { return 0; @@ -3122,12 +3124,12 @@ int UICashEmotionPack::SendMsg( case UM_REFRESH: this->Invalidate(); if (this->parent) { - this->parent->SendMsg(sender, 60, 0, 0, 0, 0); + this->parent->SendMsg(sender, UM_REFRESH, 0, 0, 0, 0); } return 0; - case 174: + case UM_CASH_EMOTION_ACTIVATE: if (this->parent) { - this->parent->SendMsg(sender, 174, argument1, argument2, argument3, argument4); + this->parent->SendMsg(sender, UM_CASH_EMOTION_ACTIVATE, argument1, argument2, argument3, argument4); } return 0; default: @@ -3196,7 +3198,7 @@ void UICashEmotionPack_Purchase::ShowExpiry(__time32_t expiry) { this->m_titleText->SetTextFitted(text.c_str()); } - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x007CAE70 @@ -3228,13 +3230,13 @@ int UICashEmotionPack_Purchase::SendMsg( case UM_REFRESH: this->Invalidate(); if (this->parent) { - this->parent->SendMsg(sender, 60, 0, 0, 0, 0); + this->parent->SendMsg(sender, UM_REFRESH, 0, 0, 0, 0); } return 0; - case 174: + case UM_CASH_EMOTION_ACTIVATE: this->m_purchaseAction->Execute(static_cast(argument1), static_cast(argument2)); return 0; - case 175: + case UM_CASH_EMOTION_SELECT: this->m_selectAction->Execute(static_cast(argument1), static_cast(argument2)); return 0; default: @@ -3310,7 +3312,7 @@ UICashEmotionPack_Search_Normal::~UICashEmotionPack_Search_Normal() { int UICashEmotionPack_Search_Normal::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message != 175) { + if (message != UM_CASH_EMOTION_SELECT) { return UICashEmotionPack::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -3343,10 +3345,10 @@ int UICashEmotionPack_Search_UnPurchased::SendMsg( case UM_REFRESH: this->Invalidate(); if (this->parent) { - this->parent->SendMsg(this, 60, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } return 0; - case 174: + case UM_CASH_EMOTION_ACTIVATE: if (this->m_action) { this->m_action->Execute(static_cast(argument1), static_cast(argument2)); return 0; @@ -3386,7 +3388,7 @@ void UICashEmotionPack_Unpurchase::Paint() { // FUNCTION: fn_09475 void UICashEmotionPack_Unpurchase::OnLBtnDblClk(int, int) { if (!this->m_pressed && this->parent) { - this->parent->SendMsg(this, 171, this->unknown_00A8, 0, 0, 0); + this->parent->SendMsg(this, UM_CASH_EMOTION_SELECT_PACK, this->unknown_00A8, 0, 0, 0); } } @@ -3394,7 +3396,7 @@ void UICashEmotionPack_Unpurchase::OnLBtnDblClk(int, int) { // FUNCTION: fn_09476 void UICashEmotionPack_Unpurchase::OnLBtnDown(int, int) { if (!this->m_pressed && this->parent) { - this->parent->SendMsg(this, 171, this->unknown_00A8, 0, 0, 0); + this->parent->SendMsg(this, UM_CASH_EMOTION_SELECT_PACK, this->unknown_00A8, 0, 0, 0); } } @@ -3418,12 +3420,12 @@ void UICashEmotionPack_Unpurchase::SetPressed(bool pressed, bool force) { int UICashEmotionPack_Unpurchase::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message != 174) { + if (message != UM_CASH_EMOTION_ACTIVATE) { return UICashEmotionPack::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (!this->m_pressed && this->parent) { - this->parent->SendMsg(this, 171, this->unknown_00A8, 0, 0, 0); + this->parent->SendMsg(this, UM_CASH_EMOTION_SELECT_PACK, this->unknown_00A8, 0, 0, 0); } return 0; @@ -3498,7 +3500,7 @@ void UICashEmotionPiece::Paint() { // FUNCTION: fn_09484 void UICashEmotionPiece::OnLBtnDblClk(int, int) { if (this->parent) { - this->parent->SendMsg(this, 175, this->m_packId, this->m_emotionId, 0, 0); + this->parent->SendMsg(this, UM_CASH_EMOTION_SELECT, this->m_packId, this->m_emotionId, 0, 0); } } @@ -3507,7 +3509,7 @@ void UICashEmotionPiece::OnLBtnDblClk(int, int) { void UICashEmotionPiece::OnMouseEnter() { this->m_hovered = true; if (this->m_hoverable) { - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } } @@ -3516,7 +3518,7 @@ void UICashEmotionPiece::OnMouseEnter() { void UICashEmotionPiece::OnMouseLeave() { this->m_hovered = false; if (this->m_hoverable) { - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } } @@ -3544,13 +3546,13 @@ int UICashEmotionPiece::SendMsg( switch (message) { case UM_COMMAND: if (argument1 == 189 && this->parent) { - this->parent->SendMsg(this, 174, this->m_packId, this->m_emotionId, 0, 0); + this->parent->SendMsg(this, UM_CASH_EMOTION_ACTIVATE, this->m_packId, this->m_emotionId, 0, 0); } return 0; case UM_REFRESH: this->Invalidate(); if (this->parent) { - this->parent->SendMsg(this, 60, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } return 0; default: diff --git a/Source/Contents/ChampionMonsterMgr.cpp b/Source/Contents/ChampionMonsterMgr.cpp index 3bc57a76a..b451af17a 100644 --- a/Source/Contents/ChampionMonsterMgr.cpp +++ b/Source/Contents/ChampionMonsterMgr.cpp @@ -1,4 +1,5 @@ #include "Contents/ChampionMonsterMgr.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Actors/ActorStateFlags.h" #include "Contents/Actors/GameActor.h" #include "Contents/Effects/EffectActor.h" @@ -108,7 +109,7 @@ int CChampionMonsterMgr::ApplyEffects(int id, CGameActor* actor, int aid) { } else { for (unsigned int i = 0; i < effects.size(); ++i) { const int effect = effects[i]; - actor->SendMsg(actor, 109, 0, effect, effect >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(actor, AM_DELETE_EFFECT, 0, effect, effect >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } diff --git a/Source/Contents/ClientItemLists.cpp b/Source/Contents/ClientItemLists.cpp index 7f552c178..75c02a7c7 100644 --- a/Source/Contents/ClientItemLists.cpp +++ b/Source/Contents/ClientItemLists.cpp @@ -1,4 +1,8 @@ #include "Network/Packets/NoticeEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Items/InventoryType.h" @@ -223,16 +227,16 @@ static_assert(sizeof(EquipmentProperties::CEquipmentPropertiesMgr) == 0x1FC); // FUNCTION: fn_17229 void __fastcall RefreshItemWindows(UIWindowMgr* mgr) { if (mgr->unknown_01D4) { - reinterpret_cast(mgr->unknown_01D4)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(mgr->unknown_01D4)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (mgr->window_01E8) { - mgr->window_01E8->SendMsg(nullptr, 23, 0, 0, 0, 0); + mgr->window_01E8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = mgr->LookupWindow(159)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = mgr->LookupWindow(WID_QUIKSLOTWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (mgr->window_4F260) { - mgr->window_4F260->SendMsg(nullptr, 23, 0, 0, 0, 0); + mgr->window_4F260->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -298,7 +302,7 @@ void ReceiveItemSlot(const unsigned char* data) { const ItemAddSlotPacket packet = *reinterpret_cast(data); ItemRandomOption options[5] = {}; if (packet.slot < 0) { - g_modeMgr.gameMode->SendMsg(0x35, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); } if (packet.itemId == 0) { @@ -327,7 +331,7 @@ void ReceiveItemSlot(const unsigned char* data) { void ReceiveItemSlotOptions(const unsigned char* data) { const ItemAddSlotOptionsPacket packet = *reinterpret_cast(data); if (packet.slot < 0) { - g_modeMgr.gameMode->SendMsg(0x35, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); } if (packet.itemId == 0) { @@ -359,14 +363,14 @@ void ReceiveFriendAddResult(const unsigned char* data) { std::memcpy(name, packet->name, 24); name[24] = '\0'; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); char buffer[128]; int message; switch (packet->result) { case FRIEND_ADD_SUCCEED: { std::sprintf(buffer, LookupMessage(821), name); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0xFFFF00, 0, 0, 0); MessengerMember member; member.name = name; @@ -381,7 +385,7 @@ void ReceiveFriendAddResult(const unsigned char* data) { message = 822; break; case FRIEND_ADD_ME_OVERSIZE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(819)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(819)), 0xFF, 0, 0, 0); return; case FRIEND_ADD_OTHER_OVERSIZE: message = 820; @@ -403,7 +407,7 @@ void ReceiveFriendAddResult(const unsigned char* data) { } std::sprintf(buffer, LookupMessage(message), name); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0xFF, 0, 0, 0); } // OFFSET: 0x00D1FDA0 @@ -692,7 +696,7 @@ void CGameMode::RefreshItemListWindow(unsigned char listType, bool partial) { case INVTYPE_STORAGE: case INVTYPE_GUILD_STORAGE: if (UIWindow* window = g_windowMgr.window_0288) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); reinterpret_cast(window)[0x190] = 1; } break; @@ -760,7 +764,7 @@ bool CSession::AddItem1768(const ITEM_INFO& item, unsigned char alternate, unsig value.quantity += item.quantity; if (refresh == 1) { if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02FC)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } } @@ -772,7 +776,7 @@ bool CSession::AddItem1768(const ITEM_INFO& item, unsigned char alternate, unsig if (refresh == 1) { UIWindow* window = reinterpret_cast(alternate ? g_windowMgr.unknown_040C : g_windowMgr.unknown_02FC); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return true; @@ -785,7 +789,7 @@ bool CSession::AddItem1740(const ITEM_INFO& item) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return false; } @@ -793,7 +797,7 @@ bool CSession::AddItem1740(const ITEM_INFO& item) { this->unknown_1740.push_back(item); if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return true; } @@ -812,7 +816,7 @@ bool CSession::AddItem1750(const ITEM_INFO& item, int type, unsigned char refres window = type == 2 ? g_windowMgr.unknown_0420 : g_windowMgr.unknown_02F8; } if (window) { - reinterpret_cast(window)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(window)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return false; @@ -828,7 +832,7 @@ bool CSession::AddItem1750(const ITEM_INFO& item, int type, unsigned char refres window = type == 2 ? g_windowMgr.unknown_0420 : g_windowMgr.unknown_02F8; } if (window) { - reinterpret_cast(window)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(window)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return true; @@ -1023,7 +1027,7 @@ bool CSession::AddItem1738(const ITEM_INFO& item, unsigned char refresh) { if (value.unknown_0000[1] == item.unknown_0000[1]) { value.quantity += item.quantity; if (refresh && g_windowMgr.window_0288) { - g_windowMgr.window_0288->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_0288->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return false; } @@ -1031,7 +1035,7 @@ bool CSession::AddItem1738(const ITEM_INFO& item, unsigned char refresh) { this->unknown_1738.push_back(item); if (refresh && g_windowMgr.window_0288) { - g_windowMgr.window_0288->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_0288->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return true; } @@ -1063,7 +1067,7 @@ bool CSession::EquipUnknown17F0(const ITEM_INFO& item, const char* name) { // OFFSET: 0x00DFC9B0 // FUNCTION: fn_23599 bool CSession::OnItemEquipped(ITEM_INFO& item) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s %s", item.DisplayName(0).c_str(), LookupMessage(0xAA)).c_str()), 0xC8FF00, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s %s", item.DisplayName(0).c_str(), LookupMessage(0xAA)).c_str()), 0xC8FF00, 7, 0, 0); if (item.unknown_0064 == 1) { item.unknown_0064 = 2; } @@ -1096,7 +1100,7 @@ bool CSession::OnItemEquipped(ITEM_INFO& item) { this->RemoveItem1710(item.unknown_0000[1], 1); } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_022C)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } return true; } @@ -1107,7 +1111,7 @@ bool CSession::UnequipItem(int location, std::uint32_t identity) { if (location == 0x8000) { const ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, identity); if (item.unknown_0000[1] != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), LookupMessage(0xAB)).c_str()), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), LookupMessage(0xAB)).c_str()), 0xFF, 7, 0, 0); } this->unknown_16EC = 0; g_windowMgr.InvalidateFrames(); @@ -1125,7 +1129,7 @@ bool CSession::UnequipItem(int location, std::uint32_t identity) { } if (mode->scene && mode->scene->player && mode->scene->player->unknown_0544) { - mode->scene->player->unknown_0544->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + mode->scene->player->unknown_0544->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } } } else { @@ -1133,7 +1137,7 @@ bool CSession::UnequipItem(int location, std::uint32_t identity) { if (slots.values[2] < 10) { if (slots.values[2] != -1) { ITEM_INFO& item = this->unknown_17F0[slots.values[2]]; - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), LookupMessage(0xAB)).c_str()), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", item.DisplayName(0).c_str(), LookupMessage(0xAB)).c_str()), 0xFF, 7, 0, 0); item.unknown_0000[3] = 0; bool merged = false; @@ -1169,7 +1173,7 @@ bool CSession::UnequipItem(int location, std::uint32_t identity) { g_equipmentPropertiesMgr->UnequipWearable(location); g_windowMgr.InvalidateFrames(); if (UIWindow* window = g_windowMgr.unknown_022C) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } return true; } @@ -1330,7 +1334,7 @@ void CSession::ClearPartyMembers() { for (auto member = this->m_partyMembers.begin(); member != this->m_partyMembers.end(); ++member) { CRenderObject* actor = mode->scene->GetGameActorByAidIncludeMe(member->accountId); if (actor && static_cast(actor)->HasId(160) == true) { - actor->SendMsg(nullptr, 109, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -1520,7 +1524,7 @@ void CSession::RemoveItem1710(std::uint32_t id, int quantity) { // FUNCTION: fn_23609 void CSession::RefreshItem1768Window(unsigned char alternate, int argument) { if (UIWindow* window = reinterpret_cast(alternate ? g_windowMgr.unknown_040C : g_windowMgr.unknown_02FC)) { - window->SendMsg(nullptr, 23, argument, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, argument, 0, 0, 0); } } @@ -1565,13 +1569,13 @@ bool CSession::RemoveItem1740(const ITEM_INFO& item) { } } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return true; } } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_02F4)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return false; } @@ -1695,13 +1699,13 @@ bool CSession::RemoveItem1738(const ITEM_INFO& item) { } } if (UIWindow* window = g_windowMgr.window_0288) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return true; } } if (UIWindow* window = g_windowMgr.window_0288) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return false; } @@ -1838,8 +1842,8 @@ bool CSession::AddExchangeItem(ITEM_INFO item) { } } - if (UIWindow* window = g_windowMgr.LookupWindow(10011)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return true; diff --git a/Source/Contents/ClientState.cpp b/Source/Contents/ClientState.cpp index 65015307f..ec443e262 100644 --- a/Source/Contents/ClientState.cpp +++ b/Source/Contents/ClientState.cpp @@ -1,4 +1,6 @@ #include "Contents/ClientState.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CGameMode.h" #include "Contents/Configuration/ServiceOptions.h" @@ -507,7 +509,7 @@ std::uint32_t CSession::ReadReplayExtra(const std::vector& data) } if (this->unknown_593C == 1) { - g_windowMgr.EnsureWindow(0x89); + g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND); } return offset; @@ -971,7 +973,7 @@ void CSession::SetHomunculusAutoFeed(bool enabled) { } const char* text = LookupMessage(message); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00E48980 @@ -979,14 +981,14 @@ void CSession::SetHomunculusAutoFeed(bool enabled) { void CSession::SetPetAutoFeed(bool enabled) { g_petAutoFeed = enabled == true; const char* text = LookupMessage(enabled ? 2579 : 2580); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00E489C0 // FUNCTION: fn_24224 void __stdcall SetPetInfoAlert(bool enabled) { std::string notice = LookupMessage(enabled ? 4357 : 4379); - g_windowMgr.SendNotice(1, reinterpret_cast(notice.c_str()), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice.c_str()), 0x64FFFF, 0, 0, 0); g_serviceOptions.Set(0x128, enabled); g_windowMgr.RefreshGameSettingOption(0x128); } @@ -1006,7 +1008,7 @@ void CSession::CollectCardItems() { // FUNCTION: fn_24226 void RequestBasicInfoRefresh() { if (g_windowMgr.unknown_01E0 != nullptr) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 106, 575, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_SET_DISABLE, 575, 0, 0, 0); } } @@ -1014,9 +1016,9 @@ void RequestBasicInfoRefresh() { // FUNCTION: fn_24232 void CSession::SetUnknown5BC0(int value) { this->unknown_5BC0 = value; - UIWindow* window = g_windowMgr.LookupWindow(0x272E); + UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLDELAYINFO); if (window != nullptr) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -1086,9 +1088,9 @@ std::uint32_t CSession::ReadReplayEntryQueue(const std::vector& d int value; std::memcpy(&value, data.data() + offset, header.bytes); offset += header.bytes; - UIEntryQueueWnd* window = dynamic_cast(g_windowMgr.LookupWindow(157)); + UIEntryQueueWnd* window = dynamic_cast(g_windowMgr.LookupWindow(WID_JOINTO_BATTLEFIELDWND)); if (window) { - window->SendMsg(nullptr, 135, 0, value, 0, 0); + window->SendMsg(nullptr, UM_LIST_SELECTION, 0, value, 0, 0); } break; } @@ -1105,7 +1107,7 @@ std::uint32_t CSession::ReadReplayEntryQueue(const std::vector& d std::memset(queueText, 0, sizeof(queueText)); std::memcpy(queueText, data.data() + offset, header.bytes); offset += header.bytes; - UIEntryQueueStandByWnd* window = dynamic_cast(g_windowMgr.LookupWindow(209)); + UIEntryQueueStandByWnd* window = dynamic_cast(g_windowMgr.LookupWindow(WID_ENTRYQUEUESTANDBYWND)); if (window) { window->SetInfo(queueText, waiting, ranking); } diff --git a/Source/Contents/ClientTiming.cpp b/Source/Contents/ClientTiming.cpp index 3c1615319..53ac1f105 100644 --- a/Source/Contents/ClientTiming.cpp +++ b/Source/Contents/ClientTiming.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Session.h" #include "Contents/AchievementMgr.h" @@ -609,8 +611,8 @@ void CSession::AddItemSlot(ITEM_INFO item) { } } - if (UIWindow* window = g_windowMgr.LookupWindow(10011)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index a1f056d8d..b7326e17c 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -1,3 +1,7 @@ +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Configuration/ServiceOptions.h" #include "Utility/EncryptedName.h" #include "Contents/Actors/Pc.h" @@ -418,7 +422,7 @@ __declspec(noinline) void ApplyServiceOption(int id, unsigned char value, bool n // FUNCTION: fn_45461 void GreetFriends() { g_session.HiFriends(nullptr); - g_windowMgr.SendNotice(1, reinterpret_cast("[ To Friends ] : (Hi) *^_^*"), 0x1EFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("[ To Friends ] : (Hi) *^_^*"), 0x1EFFFF, 0, 0, 0); } // OFFSET: 0x006BFE60 @@ -790,8 +794,8 @@ void NotifyServiceOption(unsigned char enabled, int enabledMessage, int disabled } if (!text.empty()) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), color, 0, 0, 0); } } @@ -799,7 +803,7 @@ void NotifyServiceOption(unsigned char enabled, int enabledMessage, int disabled // FUNCTION: fn_06372 void NotifyGameModeOption() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x11F, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_RANKING, 0, 0, 0, 0); } } @@ -807,7 +811,7 @@ void NotifyGameModeOption() { // FUNCTION: fn_06373 void NotifyGameModeOptionAlt() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x11F, 2, 0, 0, 0); + mode->SendMsg(MM_REQ_RANKING, 2, 0, 0, 0); } } @@ -815,7 +819,7 @@ void NotifyGameModeOptionAlt() { // FUNCTION: fn_06374 void NotifyGameModeMenu() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x4B, 0, 0, 0, 0); + mode->SendMsg(MM_REMEMBER_WARPPOINT, 0, 0, 0, 0); } } @@ -849,7 +853,7 @@ void RotatePlayerDirection(bool clockwise) { } } - mode->SendMsg(0x8B, (static_cast(angle) + 180) / 45 % 8, 0, 0, 0); + mode->SendMsg(MM_CHANGE_DIRECTION, (static_cast(angle) + 180) / 45 % 8, 0, 0, 0); } #pragma inline_depth(0) @@ -931,7 +935,7 @@ void ToggleSitStand() { const int motion = (player->render.curMotion != 2) + 1; player->render.curMotion = motion; player->render.angle = static_cast(std::ceil(player->render.angle)); - mode->SendMsg(0x8B, (static_cast(player->render.angle) + 180) / 45 % 8, motion, 0, 0); + mode->SendMsg(MM_CHANGE_DIRECTION, (static_cast(player->render.angle) + 180) / 45 % 8, motion, 0, 0); if (player->render.unknown_0070 == 6) { std::list& times = mode->unknown_05D4; @@ -939,7 +943,7 @@ void ToggleSitStand() { times.push_back(timeGetTime()); const unsigned long elapsed = times.back() - times.front(); if (elapsed - 1501 <= 1498) { - mode->SendMsg(0xA9, 0, 0, 0, 0); + mode->SendMsg(MM_DORIDORI, 0, 0, 0, 0); for (unsigned long& time : times) { time = 0; } @@ -996,7 +1000,7 @@ void ApplyServiceOptionWithNotice(int id, unsigned char value, bool notify, int if (value != g_serviceOptions.Get(id)) { g_serviceOptions.Set(id, value); if (g_serviceOptions.Get(107)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB4)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB4)), 0x64FFFF, 0, 0, 0); return; } @@ -1026,13 +1030,13 @@ void ApplyServiceOptionActorRefresh(int id, unsigned char value, bool notify, in // OFFSET: 0x006C4750 // FUNCTION: fn_06359 void ShowHelpMessages() { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); int count = 0; g_session.m_hotkeyScript->Call("GetTableSizeForC", "s>d", "HelpMsgStr", &count); for (int index = 1; index <= count; ++index) { const char* text = nullptr; if (g_session.m_hotkeyScript->Call("getHelpMsg", "d>s", index, &text) && std::strlen(text) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF64, 0, 0, 0); } } } @@ -1101,7 +1105,7 @@ void ApplyServiceOptionWindow159(int id, unsigned char value, bool notify, int e } } - if (UIWindow* window = g_windowMgr.EnsureWindow(0x9F)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_QUIKSLOTWND)) { window->Show(value); } } @@ -1118,7 +1122,7 @@ void ApplyServiceOptionWindow190(int id, unsigned char value, bool notify, int e } } - if (UIWindow* window = g_windowMgr.LookupWindow(0xBE)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NCASH_CALLWND)) { window->Show(value); } } @@ -1135,7 +1139,7 @@ void ApplyServiceOptionWindow267(int id, unsigned char value, bool notify, int e } } - if (UIWindow* window = g_windowMgr.LookupWindow(0x10B)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MILEAGEWND)) { window->Show(value); } } @@ -1168,7 +1172,7 @@ void ApplyServiceOptionNotifyWindow(int id, unsigned char value, bool notify, in } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_01C0)) { - window->SendMsg(nullptr, 6, 0x1F6, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, 0x1F6, 0, 0, 0); } } #pragma inline_depth() @@ -1184,7 +1188,7 @@ void ApplyServiceOptionWindow268(int id, unsigned char value, bool notify, int e } } - if (UIWindow* window = g_windowMgr.LookupWindow(0x10C)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_OPENROULLETTEWND)) { window->Show(value); } } @@ -1276,12 +1280,12 @@ void ApplyServiceOptionWindow27() { if (g_windowMgr.unknown_02FC != 0) { CMode* mode = g_modeMgr.GetGameMode(); if (mode) { - mode->SendMsg(0x52, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_OPENSTORE, 0, 0, 0, 0); } return; } - g_windowMgr.EnsureWindow(0x1B); + g_windowMgr.EnsureWindow(WID_CHATROOMMAKEWND); } // GLOBAL: gl_24912 @@ -1322,7 +1326,7 @@ void ApplyServiceOptionJitterScale(int id, unsigned char value, bool notify, int // FUNCTION: fn_45463 void RequestModeAction48() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x30, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_EXIT_ROOM, 0, 0, 0, 0); } } @@ -1345,7 +1349,7 @@ void ApplyItemWndServiceOption(int id, unsigned char value, bool notify, int ena // FUNCTION: fn_45464 void RequestModeAction61() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x3D, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_LEAVE_GROUP, 0, 0, 0, 0); } } @@ -1353,7 +1357,7 @@ void RequestModeAction61() { // FUNCTION: fn_45465 void NotifyGameModeOptionFirst() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x11F, 1, 0, 0, 0); + mode->SendMsg(MM_REQ_RANKING, 1, 0, 0, 0); } } @@ -1362,7 +1366,7 @@ void NotifyGameModeOptionFirst() { void RequestPlayerAction31() { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (CPlayer* player = mode->scene->player) { - player->SendMsg(nullptr, 0x1F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_REQ_SIT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1389,15 +1393,15 @@ void ShowPlayerLocation() { } const std::string text = std::format("{}({}) : {}, {}", g_session.GetMapDisplayName(mode->MapName().c_str()), name.c_str(), column, row); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x64FFFF, 0, 0, 0); if (g_serviceType != 10) { - g_windowMgr.SendNotice(19, reinterpret_cast(text.c_str()), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY2, reinterpret_cast(text.c_str()), 0x64FFFF, 0, 0, 0); } } static void ShowNoticeType6() { - g_windowMgr.SendNotice(6, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_SAVE_CHAT_TO_FILE, 0, 0, 0, 0, 0); } // OFFSET: 0x006C4950 diff --git a/Source/Contents/Effects/DummyEffectLauncher.cpp b/Source/Contents/Effects/DummyEffectLauncher.cpp index 34fb3ea0b..43c5b2f12 100644 --- a/Source/Contents/Effects/DummyEffectLauncher.cpp +++ b/Source/Contents/Effects/DummyEffectLauncher.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/DummyEffectLauncher.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectLists.h" #include "Contents/Effects/RagEffect.h" @@ -17,7 +18,7 @@ bool CDummyEffectLauncher::OnProcess() { // OFFSET: 0x00E50A60 // FUNCTION: fn_24296 __declspec(safebuffers) void CDummyEffectLauncher::SendMsg(CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int, int, int, int) { - if (message != 14 || a != 0) { + if (message != AM_SETPOS || a != 0) { this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); return; } @@ -41,7 +42,7 @@ __declspec(safebuffers) void CDummyEffectLauncher::SendMsg(CGameObject* sender, value.z = 0.0f; value.x = static_cast(static_cast(i) << 32 | static_cast(h)); if (effect != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&value), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&value), 0, 0, 0, 0); } } } else { diff --git a/Source/Contents/Effects/Effect.cpp b/Source/Contents/Effects/Effect.cpp index 2ab1708fb..fb6b973e6 100644 --- a/Source/Contents/Effects/Effect.cpp +++ b/Source/Contents/Effects/Effect.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "Contents/Effects/Effect.h" #include "Client/Session.h" @@ -153,7 +154,7 @@ void CEffect::Update(std::uint32_t aid) { } break; case 1: - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); break; } } diff --git a/Source/Contents/Effects/EffectActor.cpp b/Source/Contents/Effects/EffectActor.cpp index 142420245..8bec2dd41 100644 --- a/Source/Contents/Effects/EffectActor.cpp +++ b/Source/Contents/Effects/EffectActor.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectActor.h" #include "Contents/Effects/RagEffect.h" @@ -22,7 +23,7 @@ EffectActor::~EffectActor() { for (std::list::iterator it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { if (*it) { CRagEffect* effect = *it; - effect->SendMsg(this, 0x18, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_MASTER_DEAD, 0, 0, 0, 0, 0, 0); } } this->state.effects.erase(this->state.effects.begin(), this->state.effects.end()); diff --git a/Source/Contents/Effects/EffectLists.cpp b/Source/Contents/Effects/EffectLists.cpp index 4f3e53e8f..e89af9625 100644 --- a/Source/Contents/Effects/EffectLists.cpp +++ b/Source/Contents/Effects/EffectLists.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/EffectLists.h" +#include "Client/Mode/ModeMessage.h" #include "Contents/Effects/EffectTypes.h" #include "Contents/Effects/CharacterParticleBundle.h" #include "Contents/Effects/GravityControlEffect.h" @@ -161,7 +162,7 @@ double ScreenAngle(vector3d from, vector3d to) { // OFFSET: 0x00B3BFD0 // FUNCTION: fn_18805 std::string CurrentMapScriptName() { - std::string name = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(9, 0, 0, 0, 0)); + std::string name = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); const std::size_t at = name.rfind('@'); if (at != std::string::npos && at > 3) { name.erase(at - 4, 3); diff --git a/Source/Contents/Effects/EffectMaker.cpp b/Source/Contents/Effects/EffectMaker.cpp index bc6b27b52..3a2c63f3d 100644 --- a/Source/Contents/Effects/EffectMaker.cpp +++ b/Source/Contents/Effects/EffectMaker.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/EffectMaker.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -57,7 +58,7 @@ bool CEffectMaker::OnProcess() { this->unknown_0158 = 0; CRagEffect* effect = this->LaunchEffect(this->unknown_0160, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect != nullptr) { - effect->SendMsg(nullptr, 46, 0, reinterpret_cast(&this->unknown_0164), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPARAM, 0, reinterpret_cast(&this->unknown_0164), 0, 0, 0, 0); } } diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 644386846..88ebbee98 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -1,4 +1,6 @@ #include "Contents/Effects/EffectPrimitiveMotion.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectPrimId.h" #include "Client/Application/ErrorDialog.h" #include "Render/DeviceContext/DCSurface.h" @@ -2049,7 +2051,7 @@ void CEffectPrim::PrimTanji2() { if (effect) { vector3d position = slot.vecBNow; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } } @@ -6982,7 +6984,7 @@ void CEffectPrim::PrimBubbleSwirl() { if (this->state.slots[0].height[9] >= -60.0f && static_cast(this->state.slots[0].fullDisplayAngle - 250) < 31) { this->state.slots[0].flag1[4] = 0; CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - mode->SendMsg(122, 0, 0, 0, 0); + mode->SendMsg(MM_QUAKE, 0, 0, 0, 0); return; } } else { @@ -7002,7 +7004,7 @@ void CEffectPrim::PrimBubbleSwirl() { } if (pattern == 0 && process == 33) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - mode->SendMsg(122, 0, 0, 0, 0); + mode->SendMsg(MM_QUAKE, 0, 0, 0, 0); } this->state.slots[0].alphaB -= 5; if (this->state.slots[0].alphaB < 0) { diff --git a/Source/Contents/Effects/EffectPrimitiveRendering.cpp b/Source/Contents/Effects/EffectPrimitiveRendering.cpp index 3c58b9ad3..e1a31b8df 100644 --- a/Source/Contents/Effects/EffectPrimitiveRendering.cpp +++ b/Source/Contents/Effects/EffectPrimitiveRendering.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectPrimId.h" #include "Contents/Effects/RagEffect.h" #include "Contents/Configuration/ServiceOptions.h" @@ -2302,7 +2303,7 @@ void CEffectPrim::RenderSMA3(matrix&) { CRagEffect* effect = gameMode->scene->player->LaunchEffect(556, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = slot.vecBNow; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } return; } else if (slot.flag1[0] == 99) { @@ -2319,7 +2320,7 @@ void CEffectPrim::RenderSMA3(matrix&) { if (effect) { vector3d position = slot.vecBNow; float extra[3] = {static_cast(slot.process), slot.process % 16 != 0 ? 1.0f : 0.0f, 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), reinterpret_cast(extra), reinterpret_cast(extra) >> 31, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), reinterpret_cast(extra), reinterpret_cast(extra) >> 31, 0, 0); } } // OFFSET: 0x00BDD0D0 @@ -4957,7 +4958,7 @@ void CEffectPrim::RenderSoulLink(matrix& wtm) { if (effect) { vector3d position = vecA; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } diff --git a/Source/Contents/Effects/EffectPrimitiveSprites.cpp b/Source/Contents/Effects/EffectPrimitiveSprites.cpp index 8fe468b4b..9d8ff49a8 100644 --- a/Source/Contents/Effects/EffectPrimitiveSprites.cpp +++ b/Source/Contents/Effects/EffectPrimitiveSprites.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectPrim.h" #include "Contents/Effects/EffectPrimitiveState.h" #include "Contents/Effects/RagEffect.h" @@ -87,7 +88,7 @@ __declspec(safebuffers) void CEffectPrim::RenderLaunchEffects(matrix&) { CRagEffect* effect = gameMode->scene->player->LaunchEffect(850, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position{baseX, baseY, baseZ}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } else { CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); @@ -95,7 +96,7 @@ __declspec(safebuffers) void CEffectPrim::RenderLaunchEffects(matrix&) { CRagEffect* effect = actor->LaunchEffect(850, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position{baseX, baseY, baseZ}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } } @@ -105,7 +106,7 @@ __declspec(safebuffers) void CEffectPrim::RenderLaunchEffects(matrix&) { CRagEffect* effect = gameMode->scene->player->LaunchEffect(932, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position{baseX, baseY, baseZ}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } else { CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); @@ -113,7 +114,7 @@ __declspec(safebuffers) void CEffectPrim::RenderLaunchEffects(matrix&) { CRagEffect* effect = actor->LaunchEffect(932, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position{baseX, baseY, baseZ}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } } } diff --git a/Source/Contents/Effects/MeteorEffect.cpp b/Source/Contents/Effects/MeteorEffect.cpp index c29cbfeac..8a4903dd6 100644 --- a/Source/Contents/Effects/MeteorEffect.cpp +++ b/Source/Contents/Effects/MeteorEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/SkillEffects.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -117,7 +118,7 @@ void CMeteorEffect::OnProcess() { CSpriteParticle* spriteParticle = static_cast(particle); spriteParticle->UpdateFrame(); if (static_cast(spriteParticle->frame) == *reinterpret_cast(&this->unknown_00D8)) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } ++particle->unknown_00E8; } diff --git a/Source/Contents/Effects/MsgEffect.cpp b/Source/Contents/Effects/MsgEffect.cpp index f6a0fb975..fdfbfd01f 100644 --- a/Source/Contents/Effects/MsgEffect.cpp +++ b/Source/Contents/Effects/MsgEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Skills/SkillUnitId.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/GameModeEnums.h" #include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/MsgEffect.h" @@ -77,7 +78,7 @@ CMsgEffect::CMsgEffect() { // FUNCTION: fn_24258 CMsgEffect::~CMsgEffect() { if (this->m_owner != nullptr) { - this->m_owner->SendMsg(this, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->m_owner->SendMsg(this, AM_MSGEFFECT_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -402,7 +403,7 @@ bool CMsgEffect::OnProcess() { return false; } if (this->m_value == static_cast(g_session.m_aid)) { - g_modeMgr.GetGameMode()->SendMsg(0x21, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_PLAYER_EMOTION_END, 0, 0, 0, 0); } return false; } @@ -535,7 +536,7 @@ bool CSkill::OnProcess() { } if (this->m_effect) { this->m_effect->SetStateDuration(this->m_effect->GetDuration() + 21); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } break; diff --git a/Source/Contents/Effects/PartyMemberEffects.cpp b/Source/Contents/Effects/PartyMemberEffects.cpp index 5ad9cbcc5..cdec1db3b 100644 --- a/Source/Contents/Effects/PartyMemberEffects.cpp +++ b/Source/Contents/Effects/PartyMemberEffects.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/RagEffect.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/EffectActor.h" #include "Contents/Effects/PartyMemberEffects.h" #include "Client/Application/LaunchInfo.h" @@ -161,7 +162,7 @@ CRagEffect* EffectActor::LaunchEffect(int effectId, vector3d deltaPos, float rot CRagEffect* EffectActor::LaunchEffect(int effectId, int duration) { CRagEffect* effect = this->LaunchEffect(effectId, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 80, 0, duration, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SET_DURATION, 0, duration, 0, 0, 0, 0); } return effect; diff --git a/Source/Contents/Effects/RagEffect.cpp b/Source/Contents/Effects/RagEffect.cpp index 07f580118..a1498a77b 100644 --- a/Source/Contents/Effects/RagEffect.cpp +++ b/Source/Contents/Effects/RagEffect.cpp @@ -1,4 +1,6 @@ #include "Contents/Effects/RagEffect.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Actors/ActorEnums.h" #include "Contents/Actors/Pc.h" #include "Contents/MapSkyMgr.h" @@ -87,7 +89,7 @@ CRagEffect::~CRagEffect() { } if (this->state.parent) { - this->state.parent->SendMsg(this, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(this, AM_EFFECT_DEAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } if (this->state.resource) { @@ -2530,12 +2532,12 @@ void CRagEffect::PotionPillar(float heightSpeed, int duration) { // FUNCTION: fn_20094 bool CRagEffect::Potion_Berserk() { if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 127, 0, 250, 0, 120, 0, 120, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 250, 0, 120, 0, 120, 0, 0, 0, 0, 0, 0, 0); this->PotionPillar(1.0f, 50); } if (this->state.stateCnt == 18) { - g_modeMgr.GetGameMode()->SendMsg(122, 1, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 1, 0, 0, 0); g_soundMgr->PlayWave("effect\\ac_concentration.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } @@ -2569,7 +2571,7 @@ bool CRagEffect::Potion_Berserk() { return true; } - this->state.parent->SendMsg(nullptr, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return false; } @@ -8867,7 +8869,7 @@ void CRagEffect::CloudDrift() { // FUNCTION: fn_20285 void CRagEffect::NotifyGameMode(char value) { if (this->state.stateCnt == 0) { - g_modeMgr.gameMode->SendMsg(165, value, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SONG_TALK, value, 0, 0, 0); } } @@ -9530,7 +9532,7 @@ bool CRagEffect::FirePillarBomb() { } if (this->state.stateCnt == 35) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } return this->ProcessEZ2STR(0.0f, -80.0f, 0.0f) ? true : false; @@ -10239,7 +10241,7 @@ bool CRagEffect::OnProcess2() { this->SlashFan(0); this->SlashFan(1); if (this->state.stateCnt == 44) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); this->render.position = this->state.parent->render.position; PlayEffectWave(*this, "effect\\연주붕격.wav"); } @@ -11423,11 +11425,11 @@ void CRagEffect::EarthSpike(char type) { } CMode* mode = g_modeMgr.GetGameMode(); - mode->SendMsg(122, 1, 0, 0, 0); + mode->SendMsg(MM_QUAKE, 1, 0, 0, 0); float red = 1.0f; float green = 0.24f; float blue = 0.2f; - mode->SendMsg(135, reinterpret_cast(&red), reinterpret_cast(&green), reinterpret_cast(&blue), 0); + mode->SendMsg(MM_SETQUAKEINFO, reinterpret_cast(&red), reinterpret_cast(&green), reinterpret_cast(&blue), 0); this->state.lastPrim = CreateEffectParticle(*this, this->render, 9, 0.0f, 0.0f, 0.0f, WorldObjects()); this->state.lastPrim->state.duration = 240; @@ -11501,7 +11503,7 @@ void CRagEffect::Sightrasher() { this->state.tlvertY = vertex.y; if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 109, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); PlayEffectWave(*this, "effect\\wizard_sightrasher.wav"); } @@ -13603,7 +13605,7 @@ void CRagEffect::StoneSpike() { } PlayEffectWave(*this, "effect\\wizard_earthspike.wav"); - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); this->state.duration += 50; for (int z = -10; z < 15; z += 5) { @@ -14803,7 +14805,7 @@ void CRagEffect::Gravitation() { return; } - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); for (int z = -10; z < 15; z += 5) { for (int x = -10; x < 15; x += 5) { @@ -15182,12 +15184,12 @@ void CRagEffect::SendMsg( case AM_SET_DURATION: this->SetStateDuration(static_cast(first)); break; - case 127: + case AM_CHANGE_COLOR: this->state.unknown_11C88[0] = static_cast(first); this->state.unknown_11C88[1] = static_cast(second); this->state.unknown_11C88[2] = static_cast(third); break; - case 143: + case AM_EFFECT_LOOP_COUNT: if (first == 735 || first == 736 || first == 737 || first == 738) { this->state.unknown_11C84->isChangeProcessed = static_cast(second); } @@ -15279,19 +15281,19 @@ void CRagEffect::AlphaCenterRise() { } if (this->state.stateCnt == 35 && this->state.parent != nullptr) { - this->state.parent->SendMsg(nullptr, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_MAKE_SMOKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } // OFFSET: 0x00C36710 // FUNCTION: fn_20093 bool CRagEffect::Potion_Awakening() { if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 127, 0, 250, 0, 250, 0, 200, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_CHANGE_COLOR, 0, 250, 0, 250, 0, 200, 0, 0, 0, 0, 0, 0, 0); this->PotionPillar(1.0f, 50); } if (this->state.stateCnt == 18) { - g_modeMgr.GetGameMode()->SendMsg(122, 1, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 1, 0, 0, 0); } this->render.position = this->state.parent->render.position; @@ -15324,7 +15326,7 @@ bool CRagEffect::Potion_Awakening() { return true; } - this->state.parent->SendMsg(nullptr, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_RETURN_COLOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return false; } // OFFSET: 0x00C3C4E0 @@ -15339,7 +15341,7 @@ void CRagEffect::StatusIconColumn() { } if (this->state.count != 0) { - this->SendMsg(nullptr, 25, 0, 100, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_CHILD_DEAD, 0, 100, 0, 0, 0, 0); this->state.count = 0; this->state.stateCnt = 0; } @@ -17352,7 +17354,7 @@ void CPlayer::UpdateFootprints(int kind) { // OFFSET: 0x00C74B60 // FUNCTION: fn_20334 void CPlayer::RefreshEffect164() { - this->SendMsg(nullptr, 109, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0544 = this->LaunchEffect(164, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } @@ -20023,7 +20025,7 @@ bool CRagEffect::OnProcess3() { this->LineStreakLayered(11); } if (this->state.stateCnt == 44) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } if (this->state.stateCnt >= 20 && this->state.stateCnt <= 100) { if ((this->state.parent->render.flags & 8) == 0) { @@ -20364,13 +20366,13 @@ bool CRagEffect::OnProcess3() { if (this->state.stateCnt != 0) { if (this->state.stateCnt != 40) { if (this->state.stateCnt == 80) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } } else { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } } else { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } this->TetraVortexPillar(4); for (int index = 0; index < 7; ++index) { @@ -21109,13 +21111,13 @@ bool CRagEffect::OnProcess3() { if (this->state.stateCnt != 0) { if (this->state.stateCnt != 35) { if (this->state.stateCnt == 70) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } } else { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } } else { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } break; case EF_BUBBLE_DROP: @@ -21160,17 +21162,17 @@ bool CRagEffect::OnProcess3() { if (this->state.stateCnt == 0) { this->render.position = this->state.parent->render.position; PlayEffectWave(*this, "effect\\EF_hit2.wav"); - this->state.parent->SendMsg(nullptr, 88, 0, 1, 0, 0xFFFF0000, 0, 114, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_MAKE_NUMBER, 0, 1, 0, 0xFFFF0000, 0, 114, 0, 0, 0, 0, 0, 0, 0); } break; case EF_DAMAGE1_2: if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 88, 0, 1, 0, 0xFFFF0000, 0, 114, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_MAKE_NUMBER, 0, 1, 0, 0xFFFF0000, 0, 114, 0, 0, 0, 0, 0, 0, 0); } break; case EF_DAMAGE1_3: if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 88, 0, 1, 0, 0xFFFF00FF, 0, 114, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_MAKE_NUMBER, 0, 1, 0, 0xFFFF00FF, 0, 114, 0, 0, 0, 0, 0, 0, 0); } break; case EF_SPREADATTACK: @@ -21426,7 +21428,7 @@ bool CRagEffect::OnProcess3() { break; case EF_NPC_STOP2_DEL: if (this->state.stateCnt == 0) { - this->state.parent->SendMsg(nullptr, 109, 0, 604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->state.parent->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 604, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; case EF_SIGHT2: @@ -21568,7 +21570,7 @@ bool CRagEffect::OnProcess3() { break; case EF_ACIDDEMON: if (this->state.stateCnt == 5) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } this->TexturedFireWall("effect\\ring_black.tga", 33); break; @@ -21665,7 +21667,7 @@ bool CRagEffect::OnProcess3() { this->LineStreakLayered(11); } if (this->state.stateCnt == 44) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); this->render.position = this->state.parent->render.position; PlayEffectWave(*this, "effect\\연주붕격.wav"); } @@ -21908,7 +21910,7 @@ bool CRagEffect::OnProcess3() { break; case EF_SCREEN_QUAKE: if (this->state.stateCnt < 100 && this->state.stateCnt % 5 == 0) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } break; case EF_HITTEXTURE: @@ -22111,7 +22113,7 @@ bool CRagEffect::OnProcess3() { if (this->state.stateCnt == 1) { this->render.position = this->state.parent->render.position; PlayEffectWave(*this, "effect\\dragonfear.wav"); - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } this->ProcessEZ2STR(0.0f, -80.0f, 0.0f); break; @@ -23030,14 +23032,14 @@ bool CRagEffect::OnProcess3() { } this->TexturedFourRing("effect\\alpha_down.tga", 0); this->TexturedFourRing("effect\\alpha_down.tga", 1); - this->SendMsg(this, 127, 0, 255, 115, 0, 0, 0); + this->SendMsg(this, AM_CHANGE_COLOR, 0, 255, 115, 0, 0, 0); break; case EF_GLOW_BLACK: this->Map_MagicZone("effect\\glow04_bk.bmp", 5); for (int index = 2; index < 21; index += 2) { this->TexturedOrbitDust("effect\\mpa3.tga", index, 2); } - this->SendMsg(this, 127, 0, 255, 115, 0, 0, 0); + this->SendMsg(this, AM_CHANGE_COLOR, 0, 255, 115, 0, 0, 0); break; case EF_WH_WILD_WALK: if (this->state.stateCnt == 0) { @@ -23919,7 +23921,7 @@ bool CRagEffect::OnProcess() { break; } if (this->state.stateCnt >= 50 && this->state.stateCnt % 50 == 0 && this->state.stateCnt < 300) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } if (!this->ProcessEZ2STR(0.0f, -80.0f, 0.0f)) { return false; @@ -23939,7 +23941,7 @@ bool CRagEffect::OnProcess() { PlayEffectWave(*this, "effect\\wizard_meteor.wav"); } if (this->state.stateCnt == 40) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } if (!this->ProcessEZ2STR(0.0f, -80.0f, 0.0f)) { return false; @@ -24426,7 +24428,7 @@ bool CRagEffect::OnProcess() { if (this->state.stateCnt == 0) { this->Hit2(1); } else if (this->state.stateCnt == 3 || this->state.stateCnt == 7 || this->state.stateCnt == 9) { - g_modeMgr.GetGameMode()->SendMsg(122, 1, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 1, 0, 0, 0); } if (!this->ProcessEZ2STR(0.0f, -80.0f, 0.0f)) { return false; @@ -24893,7 +24895,7 @@ bool CRagEffect::OnProcess() { PlayEffectWave(*this, "effect\\매직 크래쉬.wav"); } if (this->state.stateCnt == 30) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } if (this->state.stateCnt >= 30 && this->state.stateCnt <= 60) { if ((this->state.parent->render.flags & 1) == 0) { @@ -24948,7 +24950,7 @@ bool CRagEffect::OnProcess() { break; case EF_FALCONASSAULT: if (this->state.stateCnt == 30) { - g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } if (this->state.stateCnt >= 30 && this->state.stateCnt <= 54) { this->state.parent->render.angle += 30.0f; diff --git a/Source/Contents/Effects/ShadowExceedEffect.cpp b/Source/Contents/Effects/ShadowExceedEffect.cpp index dd493327c..b470c3f36 100644 --- a/Source/Contents/Effects/ShadowExceedEffect.cpp +++ b/Source/Contents/Effects/ShadowExceedEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/ShadowExceedEffect.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -28,7 +29,7 @@ void CShadowExceed::Close() { CRenderObject* actor = FindRenderObject(this->actor); if (actor) { while (static_cast(actor)->HasId(1004) == true) { - actor->SendMsg(nullptr, 109, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } @@ -119,7 +120,7 @@ void CShadowExceed::OnProcess() { CRenderObject* actor = FindRenderObject(this->actor); if (actor) { while (static_cast(actor)->HasId(1004) == true) { - actor->SendMsg(nullptr, 109, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } static_cast(actor)->LaunchEffect(1004, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } diff --git a/Source/Contents/Effects/ShowEffect.cpp b/Source/Contents/Effects/ShowEffect.cpp index c9a338de5..de55d5502 100644 --- a/Source/Contents/Effects/ShowEffect.cpp +++ b/Source/Contents/Effects/ShowEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/ShowEffect.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" @@ -59,7 +60,7 @@ void CShowEffect::Close() { for (const auto& entry : this->effects) { if (target) { - target->SendMsg(nullptr, 0x9F, 0, entry.first, entry.first >> 31, entry.second, 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_DELETE_TAGGED_EFFECT, 0, entry.first, entry.first >> 31, entry.second, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (g_effectMgr->HasAllocator(entry.second)) { g_effectMgr->Retire(actorId, entry.first, entry.second); } @@ -91,6 +92,6 @@ void CShowEffect::Remove(int tag) { return; } - target->SendMsg(target, 0x9F, 0, tag, tag >> 31, this->effects[tag], 0, 0, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(target, AM_DELETE_TAGGED_EFFECT, 0, tag, tag >> 31, this->effects[tag], 0, 0, 0, 0, 0, 0, 0, 0, 0); this->effects.erase(tag); } diff --git a/Source/Contents/Emblems/EmblemCache.cpp b/Source/Contents/Emblems/EmblemCache.cpp index e584c8d86..22938f952 100644 --- a/Source/Contents/Emblems/EmblemCache.cpp +++ b/Source/Contents/Emblems/EmblemCache.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Client/Application/Launcher.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -133,7 +134,7 @@ void CGuildMgr::RefreshEmblem(std::uint32_t guild) { static_cast(g_modeMgr.GetGameMode())->NotifyUnknown0604(guild); } - UIWindow* window = g_windowMgr.LookupWindow(60); + UIWindow* window = g_windowMgr.LookupWindow(WID_GUILDINFOMANAGEWND); if (window) { window->Invalidate(); diff --git a/Source/Contents/EnchantMgr.cpp b/Source/Contents/EnchantMgr.cpp index fd2a4b7df..d8d72782f 100644 --- a/Source/Contents/EnchantMgr.cpp +++ b/Source/Contents/EnchantMgr.cpp @@ -1,4 +1,6 @@ #include "Contents/EnchantMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Network/Packets/PacketId.h" #include "Client/Session.h" #include "Contents/Effects/EffectLists.h" @@ -78,11 +80,11 @@ void CEnchantMgr::SendCloseEnchant() { // FUNCTION: fn_05544 void CEnchantMgr::OpenEnchant(uint64_t group) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - if (g_windowMgr.LookupWindow(10006)) { - g_windowMgr.CloseWindow(10006); + if (g_windowMgr.LookupWindow(WID_ENCHANTUI)) { + g_windowMgr.CloseWindow(WID_ENCHANTUI); } } else { - CUIEnchantUI* window = static_cast(g_windowMgr.EnsureWindow(10006)); + CUIEnchantUI* window = static_cast(g_windowMgr.EnsureWindow(WID_ENCHANTUI)); if (window) { window->SetEnchantGroup(group); this->m_unknown_0030 = false; @@ -150,10 +152,10 @@ void CEnchantMgr::HandleEnchantResult(int messageId, int itemId) { } g_effectMgr->Spawn(g_session.m_aid, effect, 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(messageId)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(messageId)), 0xFF, 0, 0, 0); } - g_windowMgr.CloseWindow(10006); + g_windowMgr.CloseWindow(WID_ENCHANTUI); this->m_unknown_0030 = false; } @@ -161,7 +163,7 @@ void CEnchantMgr::HandleEnchantResult(int messageId, int itemId) { // FUNCTION: fn_05545 void CEnchantMgr::RequestPerfectEnchant(uint64_t group, int16_t index, int16_t slot, int32_t itemId) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } @@ -180,7 +182,7 @@ void CEnchantMgr::RequestPerfectEnchant(uint64_t group, int16_t index, int16_t s // FUNCTION: fn_05546 void CEnchantMgr::RequestRandomEnchant(uint64_t group, int16_t index, int16_t slot) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } @@ -198,7 +200,7 @@ void CEnchantMgr::RequestRandomEnchant(uint64_t group, int16_t index, int16_t sl // FUNCTION: fn_05547 void CEnchantMgr::RequestResetEnchant(uint64_t group, int16_t index) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } @@ -216,7 +218,7 @@ void CEnchantMgr::RequestResetEnchant(uint64_t group, int16_t index) { // FUNCTION: fn_05548 void CEnchantMgr::RequestUpgradePerfectEnchant(uint64_t group, int16_t index, int16_t slot, int32_t itemId) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } @@ -236,7 +238,7 @@ void CEnchantMgr::RequestUpgradePerfectEnchant(uint64_t group, int16_t index, in // FUNCTION: fn_05549 void CEnchantMgr::RequestUpgradeEnchant(uint64_t group, int16_t index, int16_t slot) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } @@ -255,7 +257,7 @@ void CEnchantMgr::RequestUpgradeEnchant(uint64_t group, int16_t index, int16_t s // FUNCTION: fn_05550 void CEnchantMgr::RequestUpgradeRandomEnchant(uint64_t group, int16_t index, int16_t slot) { if (g_session.m_weight * 100 / g_session.m_maxWeight >= 70) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3837)), 0xFF, 0, 0, 0); return; } diff --git a/Source/Contents/EntryQueueMgr.cpp b/Source/Contents/EntryQueueMgr.cpp index 066201df7..322381a6a 100644 --- a/Source/Contents/EntryQueueMgr.cpp +++ b/Source/Contents/EntryQueueMgr.cpp @@ -1,4 +1,6 @@ #include "Contents/EntryQueueMgr.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Network/Packets/NoticeEnums.h" #include "Client/Session.h" @@ -121,8 +123,8 @@ void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { int message; switch (packet->result) { case BG_APPLY_ACCEPT: { - if (!g_windowMgr.CloseWindow(209)) { - g_windowMgr.EnsureWindow(209); + if (!g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND)) { + g_windowMgr.EnsureWindow(WID_ENTRYQUEUESTANDBYWND); } strcpy_s(this->queueName.text, sizeof(this->queueName.text), packet->queueName); @@ -134,7 +136,7 @@ void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { } text += "]"; text += LookupMessage(0x833); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x4763FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x4763FF, 0, 0, 0); this->ready = 1; return; } @@ -181,7 +183,7 @@ void CEntryQueueMgr::OnCancelResult(const EntryQueueNotice* notice) { switch (notice->result) { case 1: g_windowMgr.Confirm(LookupMessage(0x83E), 0, false, false, 0, "Message", 0x118, 0x78, 0); - g_windowMgr.CloseWindow(209); + g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND); this->ready = 0; break; case 3: @@ -192,7 +194,7 @@ void CEntryQueueMgr::OnCancelResult(const EntryQueueNotice* notice) { break; case 14: g_windowMgr.Confirm(LookupMessage(0x841), 0, false, false, 0, "Message", 0x118, 0x78, 0); - g_windowMgr.CloseWindow(209); + g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND); this->ready = 0; break; } @@ -201,7 +203,7 @@ void CEntryQueueMgr::OnCancelResult(const EntryQueueNotice* notice) { text += this->current->displayName; text += "]"; text += LookupMessage(0x842); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 0, 0, 0); this->current = nullptr; } @@ -221,9 +223,9 @@ void CEntryQueueMgr::IgnorePacket(const unsigned char* packet) { // FUNCTION: fn_19671 void CEntryQueueMgr::OnStatus(const EntryQueueStatus* packet) { this->ready = 1; - UIWindow* window = g_windowMgr.LookupWindow(209); - if (!window && !g_windowMgr.CloseWindow(209)) { - window = g_windowMgr.EnsureWindow(209); + UIWindow* window = g_windowMgr.LookupWindow(WID_ENTRYQUEUESTANDBYWND); + if (!window && !g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND)) { + window = g_windowMgr.EnsureWindow(WID_ENTRYQUEUESTANDBYWND); } if (!this->current) { @@ -241,7 +243,7 @@ void CEntryQueueMgr::OnStatus(const EntryQueueStatus* packet) { ); } - g_windowMgr.CloseWindow(157); + g_windowMgr.CloseWindow(WID_JOINTO_BATTLEFIELDWND); } // OFFSET: 0x00BA2C70 @@ -249,18 +251,18 @@ void CEntryQueueMgr::OnStatus(const EntryQueueStatus* packet) { void CEntryQueueMgr::OnReady(const EntryQueueReady* packet) { strcpy_s(this->queueName.text, sizeof(this->queueName.text), packet->queueName); strcpy_s(this->characterName.text, sizeof(this->characterName.text), packet->characterName); - if (g_windowMgr.CloseWindow(210)) { + if (g_windowMgr.CloseWindow(WID_ENTRYQUEUEREQUESTWND)) { return; } - g_windowMgr.EnsureWindow(210); + g_windowMgr.EnsureWindow(WID_ENTRYQUEUEREQUESTWND); g_soundMgr->PlayWave("se_btg_ready.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); std::string text("["); text += this->current->displayName; text += "]"; text += LookupMessage(0x843); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0x4763FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0x4763FF, 0, 0, 0); } // OFFSET: 0x00BA2E50 diff --git a/Source/Contents/Items/BarterMarketItemMgr.cpp b/Source/Contents/Items/BarterMarketItemMgr.cpp index 456d1dfe5..ea498c0b9 100644 --- a/Source/Contents/Items/BarterMarketItemMgr.cpp +++ b/Source/Contents/Items/BarterMarketItemMgr.cpp @@ -4,6 +4,8 @@ #include "Contents/Items/ItemInfo.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include #include @@ -139,9 +141,9 @@ void CBarterMarketItemMgr::AddItem(const BarterMarketItem& item) it->value -= item.value; if (it->value <= 0) { this->items.erase(it); - UIWindow* window = g_windowMgr.LookupWindow(334); + UIWindow* window = g_windowMgr.LookupWindow(WID_BARTERMARKETWND); if (window != NULL) { - window->SendMsg(NULL, 23, 0, 0, 0, 0); + window->SendMsg(NULL, UM_REFRESHITEM, 0, 0, 0, 0); } } } @@ -160,9 +162,9 @@ void CBarterMarketItemMgr::RemoveItem(const BarterMarketItem& item) it->value -= item.value; if (it->value <= 0) { this->allItems.erase(it); - UIWindow* window = g_windowMgr.LookupWindow(335); + UIWindow* window = g_windowMgr.LookupWindow(WID_BARTERITEMPURCHASEWND); if (window != NULL) { - window->SendMsg(NULL, 23, 0, 0, 0, 0); + window->SendMsg(NULL, UM_REFRESHITEM, 0, 0, 0, 0); } } break; diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 4ea11578e..11ec99665 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/Items/ItemInfo.h" #include "Contents/Items/ItemId.h" #include "Client/Session.h" @@ -710,7 +711,7 @@ bool CSession::RemoveItem1750(const ITEM_INFO& item, int type, unsigned char ref } if (window) { - reinterpret_cast(window)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(window)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return true; @@ -726,7 +727,7 @@ bool CSession::RemoveItem1750(const ITEM_INFO& item, int type, unsigned char ref } if (window) { - reinterpret_cast(window)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(window)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return false; diff --git a/Source/Contents/Items/SelectPackageItemMgr.cpp b/Source/Contents/Items/SelectPackageItemMgr.cpp index 1a4ac70f9..9bde1aae5 100644 --- a/Source/Contents/Items/SelectPackageItemMgr.cpp +++ b/Source/Contents/Items/SelectPackageItemMgr.cpp @@ -1,4 +1,5 @@ #include "Contents/Items/SelectPackageItemMgr.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Network/TextEncoding.h" #include "Script/LuaInstance.h" @@ -218,8 +219,8 @@ bool CSelectPackageItemMgr::OpenItem(unsigned int itemIndex) { if (item.unknown_0000[1] > 0) { const int packageId = std::atoi(item.itemId.c_str()); if (this->m_packages.find(packageId) != this->m_packages.end()) { - if (g_windowMgr.LookupWindow(0x2731) == nullptr || g_windowMgr.CloseWindow(0x2731)) { - CUISelectPackageItemBox* box = static_cast(g_windowMgr.EnsureWindow(0x2731)); + if (g_windowMgr.LookupWindow(WID_SELECTPACKAGEITEMBOX) == nullptr || g_windowMgr.CloseWindow(WID_SELECTPACKAGEITEMBOX)) { + CUISelectPackageItemBox* box = static_cast(g_windowMgr.EnsureWindow(WID_SELECTPACKAGEITEMBOX)); if (box != nullptr) { box->Open(itemIndex); } diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index 338b7c0c9..3a9a3adb5 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -1,4 +1,7 @@ #include "Contents/Skills/SkillId.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" #include "Contents/Combat/CombatTypes.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/CMode.h" @@ -1594,7 +1597,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { entry.unknown_0000 = 0; entry.itemId = 0; entry.unknown_0005 = 0; - g_modeMgr.GetGameMode()->SendMsg(313, index + 36, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_SHORTCUT_KEY_CHANGE, index + 36, 0, 0, 0); } } @@ -1608,7 +1611,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { target.itemId = static_cast(id); target.unknown_0005 = static_cast(value); - return g_modeMgr.GetGameMode()->SendMsg(313, slot + 36, 0, 0, 0); + return g_modeMgr.GetGameMode()->SendMsg(MM_SHORTCUT_KEY_CHANGE, slot + 36, 0, 0, 0); } // OFFSET: 0x00E26030 @@ -1834,7 +1837,7 @@ void CEquipmentPropertiesMgr::RemoveWearable(const int& location) { this->properties1.erase(key); } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } } @@ -1852,7 +1855,7 @@ bool CSession::UnequipItem2B50(int location) { const char* message = LookupMessage(0xAB); const std::string name = item.DisplayName(0); const std::string text = FormatOwnedString("%s%s", name.c_str(), message); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 7, 0, 0); item.unknown_0000[3] = 0; this->AddItem1710(item, 1); item.Reset(); @@ -1869,7 +1872,7 @@ bool CSession::UnequipItem2B50(int location) { this->InvalidateWindowFrames(); if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_022C)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (g_equipmentPropertiesMgr == nullptr) { g_equipmentPropertiesMgr = new (std::nothrow) EquipmentProperties::CEquipmentPropertiesMgr; @@ -1918,7 +1921,7 @@ bool LaunchLuaSkillEffect(int skillId, int level, CGameActor* source, CGameActor bool onTarget = false; g_session.m_hotkeyScript->Call("IsOnTarget", "d>b", skillId, &onTarget); if (onTarget && target != nullptr) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } } @@ -2025,103 +2028,103 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case KN_PIERCE: effect = source->LaunchEffect(0x94, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case WZ_JUPITEL: effect = source->LaunchEffect(0x5D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case WZ_EARTHSPIKE: effect = target->LaunchEffect(0x4F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case WZ_WATERBALL: effect = source->LaunchEffect(0x75, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case KN_SPEARBOOMERANG: effect = source->LaunchEffect(0x50, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } effect = source->LaunchEffect(0x97, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case KN_BOWLINGBASH: effect = source->LaunchEffect(0x95, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case KN_BRANDISHSPEAR: effect = target->LaunchEffect(0x46, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case KN_SPEARSTAB: effect = source->LaunchEffect(0x96, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AS_GRIMTOOTH: effect = source->LaunchEffect(0x7B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AS_SONICBLOW: effect = source->LaunchEffect(0x79, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } effect = source->LaunchEffect(0x8F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case PR_TURNUNDEAD: effect = source->LaunchEffect(0x52, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case MG_FIREBALL: effect = source->LaunchEffect(0x18, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case MG_FROSTDIVER: effect = source->LaunchEffect(0x1B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AC_SHOWER: { @@ -2147,19 +2150,19 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case MG_COLDBOLT: effect = target->LaunchEffect(0x1A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); } break; case MG_FIREBOLT: effect = target->LaunchEffect(0x1F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); } break; case MG_LIGHTNINGBOLT: effect = target->LaunchEffect(0x1D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); } break; case MG_THUNDERSTORM: @@ -2172,7 +2175,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x50, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case CR_GRANDCROSS: @@ -2185,14 +2188,14 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0xF9, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case RG_BACKSTAP: effect = source->LaunchEffect(0x113, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AM_ACIDTERROR: @@ -2212,41 +2215,41 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(0xE3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case MO_TRIPLEATTACK: effect = source->LaunchEffect(0x149, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case MO_FINGEROFFENSIVE: effect = source->LaunchEffect(0x109, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); } break; case MO_INVESTIGATE: effect = source->LaunchEffect(0x108, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } effect = source->LaunchEffect(0x10B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AL_HEAL: target->LaunchEffect(0x140, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case MO_EXTREMITYFIST: - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\mon_아수라 패황권.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); target->LaunchEffect(0x10A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2254,7 +2257,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x5D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case WS_CARTTERMINATION: @@ -2277,7 +2280,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x1EE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case CR_ACIDDEMONSTRATION: { @@ -2312,22 +2315,22 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = target->LaunchEffect(0x26B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case NJ_HUUJIN: effect = source->LaunchEffect(0x26D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = vector3d{0.0f, static_cast(target->render.accountId), 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); - effect->SendMsg(nullptr, 44, 0, level, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, level, 0, 0, 0, 0); } break; case NJ_KAMAITACHI: effect = source->LaunchEffect(0x270, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case GS_FLING: @@ -2346,7 +2349,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x26F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case GS_DUST: @@ -2356,7 +2359,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x248, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case GS_RAPIDSHOWER: @@ -2378,7 +2381,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x285, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case PA_PRESSURE: @@ -2397,7 +2400,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x169, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case HW_MAGICCRASHER: @@ -2413,14 +2416,14 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x184, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case CG_ARROWVULCAN: effect = source->LaunchEffect(0x189, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case NPC_SHIELDBRAKE: @@ -2445,7 +2448,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x1B7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1CA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2453,7 +2456,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x223, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x226, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2461,7 +2464,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x22B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1AD, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2470,7 +2473,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x229, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = vector3d{0.0f, static_cast(target->render.accountId), 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1AF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x22A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -2494,7 +2497,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = static_cast(g_modeMgr.GetGameMode())->scene->player->LaunchEffect(0xE3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case NPC_WIDESTONE: @@ -2536,11 +2539,11 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame CRagEffect* second = target->LaunchEffect(0x406, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (first) { vector3d position = source->render.position; - first->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + first->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } if (second) { vector3d position = source->render.position; - second->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + second->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } g_soundMgr->PlayWave("effect\\LG_CANNONSPEAR.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; @@ -2557,12 +2560,12 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x2D3, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } effect = source->LaunchEffect(0x343, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case GC_PHANTOMMENACE: @@ -2579,7 +2582,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = target->LaunchEffect(0x302, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case GC_CROSSRIPPERSLASHER: { @@ -2615,7 +2618,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x301, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = vector3d{0.0f, static_cast(target->render.accountId), 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x226, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2625,7 +2628,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x1B7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1CA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; @@ -2634,7 +2637,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x620, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case RA_SENSITIVEKEEN: @@ -2656,7 +2659,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x324, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case RA_WUGBITE: @@ -2705,7 +2708,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame source->LaunchEffect(0x2EE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case RK_CRUSHSTRIKE: - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); target->LaunchEffect(0x24D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("_enemy_hit_wind2.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; @@ -2718,12 +2721,12 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x340, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } effect = source->LaunchEffect(0x68E, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case AB_DUPLELIGHT_MELEE: @@ -2731,8 +2734,8 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x109, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); - effect->SendMsg(nullptr, 44, 0, 3, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 3, 0, 0, 0, 0); } break; case AB_JUDEX: @@ -2819,14 +2822,14 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x326, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case WM_METALICSOUND: effect = source->LaunchEffect(0x630, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\metalic.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } break; @@ -2864,14 +2867,14 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x38B, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case LG_SHIELDPRESS: source->LaunchEffect(0x38A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case LG_TRAMPLE: - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); source->LaunchEffect(0x389, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("effect\\LG_TRAMPLE.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; @@ -2973,7 +2976,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x581, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } g_soundMgr->PlayWave("effect\\LG_CANNONSPEAR.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; @@ -2983,7 +2986,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x627, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } g_soundMgr->PlayWave("effect\\SR_GATEOFHELL.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; @@ -2997,7 +3000,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x37D, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1CA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("effect\\SR_KNUCKLEARROW.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -3006,8 +3009,8 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x35F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); } target->LaunchEffect(0x1D2, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("effect\\LG_EARTHDRIVE.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -3019,7 +3022,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = target->LaunchEffect(0x365, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1A9, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); g_soundMgr->PlayWave("effect\\metalic.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -3092,7 +3095,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame break; } case NC_PILEBUNKER: - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); g_soundMgr->PlayWave("effect\\맹호경파산.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; case NC_AXETORNADO: @@ -3177,7 +3180,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = target->LaunchEffect(0x1AE, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = source->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case NPC_DRAGONBREATH: @@ -3190,7 +3193,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x4B6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = vector3d{0.0f, static_cast(target->render.accountId), 0.0f}; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } target->LaunchEffect(0x1AF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); target->LaunchEffect(0x1A1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); @@ -3259,7 +3262,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x43A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case EL_CIRCLE_OF_FIRE: @@ -3280,7 +3283,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x3AF, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case EL_TIDAL_WEAPON: @@ -3288,7 +3291,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x1B7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case EL_WATER_SCREW: @@ -3297,13 +3300,13 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case EL_ICE_NEEDLE: effect = target->LaunchEffect(0x1A, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } break; case EL_FIRE_ARROW: effect = target->LaunchEffect(0x1F, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { - effect->SendMsg(nullptr, 44, 0, 1, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, 1, 0, 0, 0, 0); } break; case EL_FIRE_BOMB: @@ -3312,7 +3315,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame if (effect) { target->LaunchEffect(0x11, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case EL_FIRE_WAVE: @@ -3336,7 +3339,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame effect = source->LaunchEffect(0x3A7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); if (effect) { vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); } break; case EL_AQUAPLAY: @@ -3368,7 +3371,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case EL_UPHEAVAL: g_soundMgr->PlayWave("effect\\wizard_earthspike.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); source->LaunchEffect(0x3AA, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); target->LaunchEffect(0x3B6, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EL_GUST: @@ -3384,7 +3387,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case EL_WILD_STORM: g_soundMgr->PlayWave("effect\\EF_LightBolt3.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); source->LaunchEffect(0x3A9, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); target->LaunchEffect(0x3B7, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; case EL_PYROTECHNIC: @@ -3400,7 +3403,7 @@ void CSession::PlaySkillEffect(int skillId, int level, CGameActor* source, CGame case EL_TROPIC: g_soundMgr->PlayWave("effect\\EF_FireArrow1.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); source->LaunchEffect(0x3A8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - g_modeMgr.GetGameMode()->SendMsg(0x7A, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_QUAKE, 0, 0, 0, 0); target->LaunchEffect(0x3BB, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; } diff --git a/Source/Contents/Messenger/ClientMessenger.cpp b/Source/Contents/Messenger/ClientMessenger.cpp index 1d5a55f5b..2d9d7358f 100644 --- a/Source/Contents/Messenger/ClientMessenger.cpp +++ b/Source/Contents/Messenger/ClientMessenger.cpp @@ -1,4 +1,6 @@ #include "Network/Packets/NoticeEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Items/ItemType.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Messenger/ClientMessenger.h" @@ -807,7 +809,7 @@ void EquipmentProperties::CEquipment::CallOnStartEquip(lua_State* state) { if (lua_type(state, -1) == LUA_TFUNCTION) { if (lua_pcall(state, 0, 0, 0) != 0) { std::string message = lua_tolstring(state, -1, nullptr); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF, 0, 0, 0); lua_settop(state, -2); } } else { @@ -1037,7 +1039,7 @@ void EquipmentProperties::CEquipment::NotifyProperties(const COLORREF& color, bo ReplaceAll(line, "#", " "); RemoveAll(line, "{~}"); if (line.size() > 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(std::format("{0}{1}", suffix, line).c_str()), color, 0x18, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(std::format("{0}{1}", suffix, line).c_str()), color, 0x18, 0, 0); } } } @@ -4111,13 +4113,13 @@ void EquipmentProperties::CEquipmentPropertiesMgr::AddExpansion(const int& kind, CEquipmentExpansion* expansion = new CEquipmentExpansion(itemId, kind); CEquipment* equipment = this->properties2.insert({key, expansion}).first->second; if (kind == 1) { - notify = g_windowMgr.LookupWindow(0x169) != nullptr; + notify = g_windowMgr.LookupWindow(WID_RUNESYSTEMWND) != nullptr; } equipment->Load(notify); this->EquipItem(equipment->GetId(), notify); if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -4140,7 +4142,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::RemoveExpansion(const int& ki } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -4168,7 +4170,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::RefreshExpansion(const int& k } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -4197,7 +4199,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::RefreshShop() { } this->unknown_0014 = shopId; if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -4241,7 +4243,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::RefreshPretend() { } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -4934,7 +4936,7 @@ int C_Logger(lua_State* state) { } const std::string text = lua_tostring(state, -1); - g_windowMgr.SendNotice(1, reinterpret_cast(FromUtf8(text, g_textCodePage).c_str()), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FromUtf8(text, g_textCodePage).c_str()), 0xFFFF, 0, 0, 0); return 0; } @@ -5182,7 +5184,7 @@ __declspec(noinline) void UIWindowMgr::NotifyItemWindows(int accountId, int lowe matches = member.accountId == accountId; } if (matches) { - window->SendMsg(nullptr, 6, 34, accountId, lower, upper); + window->SendMsg(nullptr, UM_COMMAND, 34, accountId, lower, upper); break; } } @@ -5253,7 +5255,7 @@ void CGameMode::NotifyItemBounds() { this->itemWindow->Invalidate(); } if (g_windowMgr.window_02C8) { - g_windowMgr.window_02C8->SendMsg(nullptr, 6, 34, g_session.m_aid, 0, 0); + g_windowMgr.window_02C8->SendMsg(nullptr, UM_COMMAND, 34, g_session.m_aid, 0, 0); } g_windowMgr.NotifyItemWindows(g_session.m_aid, g_session.unknown_5568, g_session.unknown_556C); } @@ -5957,7 +5959,7 @@ UIWindow* UIWindowMgr::FindItemWindow(int accountId) { // FUNCTION: fn_17230 void UIWindowMgr::NotifyMemberWindows(const MessengerMember* target) { if (this->window_02C8) { - this->window_02C8->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->window_02C8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } for (UIWindow* window : this->snapExcluded) { bool matches; @@ -5967,7 +5969,7 @@ void UIWindowMgr::NotifyMemberWindows(const MessengerMember* target) { } if (matches) { if (window) { - window->SendMsg(nullptr, 23, reinterpret_cast(target), 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(target), 0, 0, 0); } break; } @@ -6354,7 +6356,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::UnequipWearable(const int& ma this->properties1.erase(found); } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -6377,7 +6379,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::RefreshWearable(const int& ke } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -6800,7 +6802,7 @@ void EquipmentProperties::CEquipmentPropertiesMgr::EquipWearable(const ITEM_INFO } } if (this->unknown_0020 != nullptr) { - this->unknown_0020->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->unknown_0020->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index 33a2cfd45..d6bb3a40d 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -1,4 +1,7 @@ #include "Contents/Messenger/MessengerMember.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -431,7 +434,7 @@ __declspec(noinline) void UIDragMiniPartyWnd::MoveGauge(int x, int y) { // OFFSET: 0x00738CE0 // FUNCTION: fn_07671 void UIDragMiniPartyWnd::OnLBtnUp(int argument1, int argument2) { - auto* window = static_cast(g_windowMgr.LookupWindow(34)); + auto* window = static_cast(g_windowMgr.LookupWindow(WID_MESSENGERGROUPWND)); if (window) { window->DropMember(argument1 + this->geometry.x, argument2 + this->geometry.y, this->unknown_0108); } @@ -534,7 +537,7 @@ int UIFriendOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(68); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); break; case ID_CHECK: if (this->option0Box == sender) { @@ -626,7 +629,7 @@ void UIJobIconButton::Paint() { // OFFSET: 0x007395E0 // FUNCTION: fn_07688 void UIJobIconButton::OnLBtnDown(int x, int y) { - if (UIWindow* window = g_windowMgr.LookupWindow(34)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MESSENGERGROUPWND)) { window->OnLBtnDown(x + this->geometry.x, y + this->geometry.y); } } @@ -634,7 +637,7 @@ void UIJobIconButton::OnLBtnDown(int x, int y) { // OFFSET: 0x00739610 // FUNCTION: fn_07689 void UIJobIconButton::OnLBtnUp(int x, int y) { - if (UIWindow* window = g_windowMgr.LookupWindow(34)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MESSENGERGROUPWND)) { window->OnLBtnUp(x + this->geometry.x, y + this->geometry.y); } } @@ -642,7 +645,7 @@ void UIJobIconButton::OnLBtnUp(int x, int y) { // OFFSET: 0x00739640 // FUNCTION: fn_07690 void UIJobIconButton::OnRBtnUp(int x, int y) { - if (UIWindow* window = g_windowMgr.LookupWindow(34)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MESSENGERGROUPWND)) { window->OnRBtnUp(x + this->geometry.x, y + this->geometry.y); } } @@ -684,7 +687,7 @@ __declspec(noinline) void UIMessengerGroupWnd::DropMember(int x, int y, int inde MessengerMember member = this->MemberAtIndex(index); SessionRecord0734 record = g_session.FindRecord0734(member.accountId); - UIWindow* window = g_windowMgr.LookupWindow(307); + UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND); if (record.unknown_0000 != 1) { int top = static_cast(static_cast(g_renderer->viewport.height) * 0.3f); if (window) { @@ -740,7 +743,7 @@ __declspec(noinline) void UIMessengerGroupWnd::OpenMiniPartyWnd(int cell, const window->SetSize(174, 52); window->m_cell = cell; g_windowMgr.AddMiniPartyWindow(window); - window->SendMsg(nullptr, 0x17, reinterpret_cast(&member), 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(&member), 0, 0, 0); g_session.AddRecord0734(member.accountId, cell); } @@ -806,7 +809,7 @@ void UIMessengerGroupWnd::OnCreate(int, int) { this->tabs[index]->SetSize(tabWidths[index], 12); this->tabs[index]->Move(index * 60 + 4, this->geometry.height - 16); this->tabs[index]->SetText(tabLabels[index]); - this->tabs[index]->SendMsg(this, 0xD, tabValues[index], 0, 0, 0); + this->tabs[index]->SendMsg(this, UM_SETSTATE, tabValues[index], 0, 0, 0); this->AddChild(this->tabs[index]); } } @@ -900,7 +903,7 @@ void UIMessengerGroupWnd::OnCreate(int, int) { resizer->Move(this->geometry.width - 15, this->geometry.height - 15); resizer->SetColors(0xFFFF00FF, 0xFFFF00FF); this->AddChild(this->resizeButton); - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x0073B9D0 @@ -1098,7 +1101,7 @@ void UIMessengerGroupWnd::Paint() { // FUNCTION: fn_07708 void UIMessengerGroupWnd::OnLBtnDblClk(int, int) { if (!g_session.m_lockMouse) { - this->SendMsg(nullptr, 6, 232, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0); } } @@ -1116,7 +1119,7 @@ void UIMessengerGroupWnd::OnRBtnUp(int x, int y) { } if (this->selected != -1) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } @@ -1261,7 +1264,7 @@ void UIMessengerGroupWnd::OnWheel(int delta) { if (step > 3) { step = 3; } - this->SendMsg(this->scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -1399,7 +1402,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->saved->Reset(); } this->iconIndex = this->saved->unknown_0018; - this->SendMsg(nullptr, 0xE, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_REFRESHITEM: { @@ -1491,7 +1494,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } this->titleText->SetTextFitted(title); if (g_windowMgr.modal) { - g_windowMgr.modal->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + g_windowMgr.modal->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } UIBitmapButton* button = static_cast(this->buttons[0]); @@ -1519,7 +1522,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_MAKEMENU: this->menuItems.clear(); if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->selected != -1) { if (this->mode == 0) { @@ -1554,12 +1557,12 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } if (this->menuItems.size()) { - UIWindow* menu = g_windowMgr.EnsureWindow(0x12); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (unsigned index = 0; index < this->menuItems.size(); ++index) { - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(this->menuItems[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->menuItems[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 0x53, 0x22, 0, 0, 0); - menu->SendMsg(nullptr, 0x1E, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 0x22, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); menu->Move( std::min(std::max(g_mouse.x + 1, 1), g_renderer->viewport.width - menu->geometry.width), std::min(std::max(g_mouse.y + 1, 1), g_renderer->viewport.height - menu->geometry.height) @@ -1581,27 +1584,27 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, switch (this->menuItems[a].value) { case MENUID_EXPEL: case MENUID_DELETE_WHISPER_NAME: - this->SendMsg(nullptr, 6, 0xEB, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_DELETE_FRIEND, 0, 0, 0); return 0; case MENUID_QUERYINFO: - this->SendMsg(nullptr, 6, 0xE9, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_FRIEND_INFO, 0, 0, 0); return 0; case MENUID_INVITE_IN_PARTY: if (this->selected != -1) { MessengerMember target = this->MemberAtIndex(this->selected); if (target.valid) { - g_modeMgr.gameMode->SendMsg(0x3B, reinterpret_cast(target.name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast(target.name.c_str()), 0, 0, 0); } } return 0; case MENUID_SEND_MSG: - this->SendMsg(nullptr, 6, 0xE7, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_SENDMSG, 0, 0, 0); return 0; case MENUID_TALKONLYTWO: - this->SendMsg(nullptr, 6, 0xE8, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0); return 0; case MENUID_LEAVE: - this->SendMsg(nullptr, 6, 0xEC, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_LEAVE, 0, 0, 0); return 0; case MENUID_MAKE_WHISPER_WINDOW: this->SendMsg(nullptr, 0x47, 0, 0, 0, 0); @@ -1611,18 +1614,18 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, MessengerMember target = this->MemberAtIndex(this->selected); if (target.valid && !target.offline) { if (g_windowMgr.Confirm(LookupMessage(0x5FD), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0x104, target.accountId, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_GROUP_CHANGE_MASTER, target.accountId, 0, 0, 0); } } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x5FE)), 0xFF, 3, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x5FE)), 0xFF, 3, 0, 0); } } return 0; case 0x3A: { MessengerMember target = this->MemberAtIndex(this->selected); if (target.valid) { - g_modeMgr.gameMode->SendMsg(0x10C, reinterpret_cast(target.name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast(target.name.c_str()), 0, 0, 0); } return 0; } @@ -1645,7 +1648,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } case UM_COMMAND: switch (a) { - case 0xE7: + case ID_SENDMSG: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); } @@ -1678,22 +1681,22 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case ID_PARTY_SETTING: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { - g_windowMgr.CloseWindow(0xD0); + g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND); } if (this->mode == 0) { - if (!g_windowMgr.CloseWindow(0x44)) { - g_windowMgr.EnsureWindow(0x44); + if (!g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND)) { + g_windowMgr.EnsureWindow(WID_FRIENDOPTIONWND); } - } else if (!g_windowMgr.CloseWindow(0x35) && g_session.PartyCount() && this->mode == 1) { - g_windowMgr.EnsureWindow(0x35); + } else if (!g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT) && g_session.PartyCount() && this->mode == 1) { + g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } UIWindow* window; if (this->mode == 0) { - g_windowMgr.CloseWindow(0x35); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); window = g_windowMgr.unknown_033C; } else { - g_windowMgr.CloseWindow(0x44); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); window = g_windowMgr.unknown_030C; } if (window) { @@ -1710,25 +1713,25 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (member.valid) { if (this->mode == 0) { if (g_windowMgr.Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0xB0, member.accountId, member.characterId, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_DELETE_FRIEND, member.accountId, member.characterId, 0, 0); } } else if (!(member.name == g_session.DecodePlayerName())) { if (g_windowMgr.Confirm(LookupMessage(0x16B), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0x3E, reinterpret_cast(member.name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_EXPEL_GROUP_MEMBER, reinterpret_cast(member.name.c_str()), 0, 0, 0); } } } } return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(0x45); + g_windowMgr.CloseWindow(WID_MESSENGERWND); return 0; case ID_LEAVE: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid && member.name == g_session.DecodePlayerName()) { if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0x3D, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_LEAVE_GROUP, 0, 0, 0, 0); } } } @@ -1743,9 +1746,9 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->tabs[index]->Invalidate(); if (clicked == this->tabs[index]) { this->mode = index; - this->tabs[index]->SendMsg(this, 0xD, 1, 0, 0, 0); + this->tabs[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->tabs[index]->SendMsg(this, 0xD, 0, 0, 0, 0); + this->tabs[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } int secondTip; @@ -1760,9 +1763,9 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, static_cast(this->buttons[3])->SetTooltip(LookupMessage(firstTip)); static_cast(this->buttons[4])->SetTooltip(LookupMessage(secondTip)); if (this->mode != previous) { - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 0xE, 7, this->geometry.width, this->geometry.height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->geometry.width, this->geometry.height, 0); return 0; } case 0x22: { @@ -1795,19 +1798,19 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->iconIndex = 1; this->iconModeButtons[1]->Enable(1); this->iconModeButtons[0]->Enable(0); - this->SendMsg(sender, 0xE, 7, 0xF3, 0xB3, 0); + this->SendMsg(sender, UM_RESIZE, 7, 0xF3, 0xB3, 0); return 0; case 0x16C: if (g_session.m_lockMouse != true) { g_windowMgr.RearrangeMiniPartyWindows(); } return 0; - case 0x220: - if (!g_windowMgr.CloseWindow(0x144)) { - g_windowMgr.EnsureWindow(0x144); + case ID_TOGGLE_PARTY_BOARD: + if (!g_windowMgr.CloseWindow(WID_ADVENPARTYBOARDWND)) { + g_windowMgr.EnsureWindow(WID_ADVENPARTYBOARDWND); } return 0; - case 0x179: + case ID_TOGGLE_PARTY_MOUSE_LOCK: if (sender == this->buttons[5]) { g_session.m_lockMouse = false; this->buttons[6]->Move(sender->geometry.x, sender->geometry.y); @@ -1819,16 +1822,16 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } sender->Move(-100, -100); return 0; - case 0x1BD: + case ID_OPEN_PARTY_SETTINGS: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_033C) { - g_windowMgr.CloseWindow(0x44); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); } - if (!g_windowMgr.CloseWindow(0x35) && !g_session.PartyCount()) { + if (!g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT) && !g_session.PartyCount()) { if (this->mode != 1) { return 0; } - g_windowMgr.EnsureWindow(0xCF); + g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_HEIGHT_220); } if (this->mode == 1) { if (UIWindow* window = g_windowMgr.unknown_030C) { @@ -1840,27 +1843,27 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0x1BE: + case ID_LEAVE_PARTY: if (!g_session.m_lockMouse) { if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0x3D, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_LEAVE_GROUP, 0, 0, 0, 0); if (g_windowMgr.unknown_042C) { - g_windowMgr.CloseWindow(0xD0); + g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND); } } } return 0; - case 0x1BF: + case ID_OPEN_PARTY_INVITATION: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_033C) { - g_windowMgr.CloseWindow(0x44); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); } if (g_windowMgr.unknown_030C) { - g_windowMgr.CloseWindow(0x35); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } - if (!g_windowMgr.CloseWindow(0xD0)) { + if (!g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND)) { if (g_session.unknown_5464) { - g_windowMgr.EnsureWindow(0xD0); + g_windowMgr.EnsureWindow(WID_PARTYINVITATIONTOWND); } else { g_windowMgr.Confirm(LookupMessage(0x816), 4, true, false, 0, "Message", 0x118, 0x78, 0); } @@ -1875,11 +1878,11 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0x20B: + case ID_RESTORE_PARTY_LIST: this->iconIndex = 0; this->iconModeButtons[1]->Enable(0); this->iconModeButtons[0]->Enable(1); - this->SendMsg(sender, 0xE, 7, 0x111, 0x146, 0); + this->SendMsg(sender, UM_RESIZE, 7, 0x111, 0x146, 0); return 0; } return 0; @@ -1887,9 +1890,9 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scrollTop; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->scrollTop = previous - this->visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->scrollTop = this->visibleRows - 1 + previous; } else { this->scrollTop = a + previous; diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index c92aa18fb..2161c43df 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -1,4 +1,6 @@ #include "Contents/NavigationManager.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/MessageTable.h" #include "Utility/Text/FormatString.h" @@ -406,13 +408,13 @@ __declspec(noinline) void CNavigationManager::ShowRouteResult(int result, int mo char buffer[250]; std::memset(buffer, 0, sizeof(buffer)); std::sprintf(buffer, LookupMessage(2315), message.c_str()); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); if (result == 5 && this->selectedNode != -1 && this->nodes.size() > static_cast(this->selectedNode)) { const int type = this->nodes[this->selectedNode]->GetType(); if (type == 201 || type == 202 || type == 203 || type == 204) { std::sprintf(buffer, LookupMessage(2316), this->nodes[this->selectedNode]->GetName()); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); CNaviInfo* info = static_cast(this->nodes[this->selectedNode])->GetLinkedInfo(); if (info != nullptr) { @@ -423,12 +425,12 @@ __declspec(noinline) void CNavigationManager::ShowRouteResult(int result, int mo } } else if (type == 205) { std::sprintf(buffer, LookupMessage(2316), this->nodes[this->selectedNode]->GetName()); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); std::sprintf(buffer, LookupMessage(2319)); } else { std::sprintf(buffer, LookupMessage(2320)); } - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 0x62B0FF, 0, 0, 0); } } @@ -691,7 +693,7 @@ bool CNavigationManager::StartNavigation(std::string name, int type, unsigned ch if (g_windowMgr.window_4F174) { static_cast(g_windowMgr.window_4F174)->RefreshLayout(); } else if (!this->unknown_1248) { - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } { @@ -728,9 +730,9 @@ bool CNavigationManager::SearchNavigation(std::string name, int type, bool flag) if (!this->unknown_1248) { if (g_windowMgr.window_4F174 == nullptr) { - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } else { - g_windowMgr.window_4F174->SendMsg(nullptr, 6, 200, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, UM_COMMAND, ID_BASE, 0, 0, 0); if (g_windowMgr.modal != nullptr) { static_cast(g_windowMgr.modal)->RefreshWorldMapLevels(); } @@ -1246,7 +1248,7 @@ bool CNavigationManager::SelectNodeState() { this->LoadTargetPreview(); this->ClearRouteNodes(); if (this->data.GetInfo() && !this->data.GetInfo()->IsSearchable(this->data.GetInfo()->GetName())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4195)), 0x0A0AFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4195)), 0x0A0AFF, 0, 0, 0); } return false; } @@ -1312,7 +1314,7 @@ bool CNavigationManager::SetDestinationMap(std::string mapName, int x, int y) { } this->LoadTargetPreview(); - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); if (g_windowMgr.window_4F174) { UIWindow* window = g_windowMgr.window_4F174; window->geometry.targetAlpha = 255; @@ -1669,7 +1671,7 @@ void CNavigationManager::CancelRoute() { static_cast(g_windowMgr.window_4F174)->RefreshLayout(); } } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2309)), 0x62B0FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2309)), 0x62B0FF, 0, 0, 0); } // OFFSET: 0x00B97B90 @@ -1755,7 +1757,7 @@ static_assert(sizeof(NavigationReplayHeader) == 6); // OFFSET: 0x00B9B080 // FUNCTION: fn_19616 int CNavigationManager::LoadReplayState(const std::vector& data) { - g_windowMgr.CloseWindow(203); + g_windowMgr.CloseWindow(WID_NAVIGATIONV4WND); this->Reset(true); if (data.empty()) { return -1; @@ -1936,11 +1938,11 @@ int CNavigationManager::LoadReplayState(const std::vector& data) void CNavigationManager::ResumeRoute() { if (this->unknown_1258 == 1) { this->LoadTargetPreview(); - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } else if (this->unknown_1258 == 2) { this->ShowRouteResult(this->RouteFromPlayer(), 1); if (!this->unknown_1248) { - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } } } diff --git a/Source/Contents/Party/ChangePartyMasterCompletion.cpp b/Source/Contents/Party/ChangePartyMasterCompletion.cpp index 07e28fad3..a0c225152 100644 --- a/Source/Contents/Party/ChangePartyMasterCompletion.cpp +++ b/Source/Contents/Party/ChangePartyMasterCompletion.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "UI/Window/UIWindow.h" #include "UI/Window/WindowManagerWindows.h" @@ -25,8 +27,8 @@ void CAdventurerAgencyMgr::CompleteChangeMaster(AsyncDiagnostic diagnostic, std: const int type = root["Type"].asInt(); if (type != 2 && type != 3) { - if (UIWindow* window = windows.LookupWindow(324)) { - window->SendMsg(nullptr, 6, 415, 0, 0, 0); + if (UIWindow* window = windows.LookupWindow(WID_ADVENPARTYBOARDWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_PARTY_RELOAD_FIRST_PAGE, 0, 0, 0); } } } diff --git a/Source/Contents/Party/MyPartyCompletion.cpp b/Source/Contents/Party/MyPartyCompletion.cpp index 474dad679..5df0fdc42 100644 --- a/Source/Contents/Party/MyPartyCompletion.cpp +++ b/Source/Contents/Party/MyPartyCompletion.cpp @@ -1,4 +1,5 @@ #include "Contents/Party/AdventurerAgencyMgr.h" +#include "UI/Window/WindowId.h" #include "UI/Party/UIAdvenPartyBoardWnd.h" #include "UI/Window/WindowManagerWindows.h" #include "Utility/Async/AsyncDiagnostic.h" @@ -28,7 +29,7 @@ void CAdventurerAgencyMgr::CompleteMyParty(AsyncDiagnostic diagnostic, std::stri if (root["data"].isNull()) { this->registered = false; - auto* board = static_cast(windows.EnsureWindow(324)); + auto* board = static_cast(windows.EnsureWindow(WID_ADVENPARTYBOARDWND)); if (board) { board->Registration(false); @@ -50,7 +51,7 @@ void CAdventurerAgencyMgr::CompleteMyParty(AsyncDiagnostic diagnostic, std::stri info.maximumLevel = data.get("MaxLV", 999).asInt(); info.type = data.get("Type", 1).asInt(); info.memo = data.get("Memo", "").asString(); - auto* board = static_cast(windows.EnsureWindow(324)); + auto* board = static_cast(windows.EnsureWindow(WID_ADVENPARTYBOARDWND)); if (board) { board->SetOwnParty(info); diff --git a/Source/Contents/Party/PartyBookingMgr.cpp b/Source/Contents/Party/PartyBookingMgr.cpp index be308202e..540980c01 100644 --- a/Source/Contents/Party/PartyBookingMgr.cpp +++ b/Source/Contents/Party/PartyBookingMgr.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Contents/Party/PartyBookingMgr.h" #include "Client/Session.h" @@ -152,7 +154,7 @@ std::pair PartyBookingMgr::MakeEntry(PARTY_BOOKING_AD_I // OFFSET: 0x00B175B0 // FUNCTION: fn_18448 void PartyBookingMgr::OnAdvertisement(PARTY_BOOKING_AD_INFO info) { - UISeekPartyListWnd* window = static_cast(g_windowMgr.LookupWindow(0xA9)); + UISeekPartyListWnd* window = static_cast(g_windowMgr.LookupWindow(WID_SEEKPARTYLISTWND)); if (window == nullptr) { if (this->m_filterEnabled) { PARTY_BOOKING_AD_INFO ad = info; @@ -181,7 +183,7 @@ void PartyBookingMgr::OnAdvertisement(PARTY_BOOKING_AD_INFO info) { if (this->m_alarm) { g_soundMgr->PlayWave("party_alarm.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); const char* message = LookupMessage(0x6D9); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 15, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 15, 0, 0); } return; } diff --git a/Source/Contents/Party/PartyInfoCompletion.cpp b/Source/Contents/Party/PartyInfoCompletion.cpp index aa0312c39..bffe632ef 100644 --- a/Source/Contents/Party/PartyInfoCompletion.cpp +++ b/Source/Contents/Party/PartyInfoCompletion.cpp @@ -1,4 +1,7 @@ #include "Client/Session.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Party/AdventurerAgencyMgr.h" @@ -35,8 +38,8 @@ void CAdventurerAgencyMgr::CompletePartyInfo(AsyncDiagnostic diagnostic, std::st auto entry = root["data"].begin(); if (entry == root["data"].end()) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3443)), 0xFF, 0, 0, 0); - g_windowMgr.CloseWindow(345); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3443)), 0xFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); return; } @@ -52,7 +55,7 @@ void CAdventurerAgencyMgr::CompletePartyInfo(AsyncDiagnostic diagnostic, std::st info.maximumLevel = (*entry).get("MaxLV", 999).asInt(); info.type = (*entry).get("Type", 1).asInt(); info.memo = (*entry).get("Memo", "").asString(); - UIWindow* board = g_windowMgr.LookupWindow(324); + UIWindow* board = g_windowMgr.LookupWindow(WID_ADVENPARTYBOARDWND); if (board) { for (auto& value : this->entries) { @@ -62,10 +65,10 @@ void CAdventurerAgencyMgr::CompletePartyInfo(AsyncDiagnostic diagnostic, std::st } } - board->SendMsg(nullptr, 60, 0, 0, 0, 0); + board->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } - auto* application = static_cast(g_windowMgr.LookupWindow(345)); + auto* application = static_cast(g_windowMgr.LookupWindow(WID_APPLYFORPARTYWND)); if (application) { application->SetInfo(info); @@ -73,11 +76,11 @@ void CAdventurerAgencyMgr::CompletePartyInfo(AsyncDiagnostic diagnostic, std::st } if (info.minimumLevel > g_session.m_level || info.maximumLevel < g_session.m_level) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3416)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3416)), 0xFF, 0, 0, 0); } else if (g_session.PartyCount() > 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(79)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(79)), 0xFF, 0, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(265, reinterpret_cast(&info.accountId), reinterpret_cast(&info.characterId), 0, 0); - g_windowMgr.CloseWindow(345); + g_modeMgr.gameMode->SendMsg(MM_PARTY_REQ_MASTER_TO_JOIN, reinterpret_cast(&info.accountId), reinterpret_cast(&info.characterId), 0, 0); + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); } } diff --git a/Source/Contents/Party/PartyJoinResult.cpp b/Source/Contents/Party/PartyJoinResult.cpp index 3da5f84f5..079bcfaf1 100644 --- a/Source/Contents/Party/PartyJoinResult.cpp +++ b/Source/Contents/Party/PartyJoinResult.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/MessageTable.h" @@ -11,42 +12,42 @@ // FUNCTION: fn_21788 void ReceivePartyJoinResult(const void* packet) { const auto* bytes = static_cast(packet); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); std::uint32_t status; std::memcpy(&status, bytes + 54, sizeof(status)); switch (status) { case 5: case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3492)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3492)), 0xFF, 0, 0, 0); break; case 9: { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3494)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3494)), 0xFF, 0, 0, 0); std::uint32_t master; std::memcpy(&master, bytes + 50, sizeof(master)); g_adventurerAgencyMgr->RequestStop(master); break; } case 10: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3443)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3443)), 0xFF, 0, 0, 0); break; case 11: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3495)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3495)), 0xFF, 0, 0, 0); break; case 4: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3496)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3496)), 0xFF, 0, 0, 0); break; case 8: { char text[500] = {}; StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(3503), reinterpret_cast(bytes + 2)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); break; } case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3442)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3442)), 0xFF, 0, 0, 0); break; case 2: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3497)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3497)), 0xFF, 0, 0, 0); break; case 0: { char text[500] = {}; @@ -57,7 +58,7 @@ void ReceivePartyJoinResult(const void* packet) { StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(3498), reinterpret_cast(bytes + 26)); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF64, 0, 0, 0); break; } case 1: { @@ -69,22 +70,22 @@ void ReceivePartyJoinResult(const void* packet) { StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(3499), reinterpret_cast(bytes + 26)); } - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); break; } case 7: { char text[500] = {}; StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(3500), reinterpret_cast(bytes + 2)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); break; } case 13: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1816)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1816)), 0xFF, 0, 0, 0); break; case 12: { char text[500] = {}; StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(608), reinterpret_cast(bytes + 2)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); break; } default: diff --git a/Source/Contents/Party/PartyListCompletion.cpp b/Source/Contents/Party/PartyListCompletion.cpp index 3c4295c7c..3956cc03c 100644 --- a/Source/Contents/Party/PartyListCompletion.cpp +++ b/Source/Contents/Party/PartyListCompletion.cpp @@ -1,4 +1,6 @@ #include "Contents/Party/AdventurerAgencyMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Party/UIAdvenPartyBoardWnd.h" #include "UI/Window/WindowManagerWindows.h" #include "Utility/Async/AsyncDiagnostic.h" @@ -27,7 +29,7 @@ void CAdventurerAgencyMgr::CompleteList(AsyncDiagnostic diagnostic, std::string } this->LoadList(root["data"]); - auto* board = static_cast(windows.EnsureWindow(324)); + auto* board = static_cast(windows.EnsureWindow(WID_ADVENPARTYBOARDWND)); if (board) { const int pages = root.get("totalPage", 0).asInt(); @@ -36,6 +38,6 @@ void CAdventurerAgencyMgr::CompleteList(AsyncDiagnostic diagnostic, std::string board->totalPages = pages; } - board->SendMsg(nullptr, 60, 0, 0, 0, 0); + board->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } diff --git a/Source/Contents/Party/PartyRegistrationCompletion.cpp b/Source/Contents/Party/PartyRegistrationCompletion.cpp index cb466c9f7..418d37483 100644 --- a/Source/Contents/Party/PartyRegistrationCompletion.cpp +++ b/Source/Contents/Party/PartyRegistrationCompletion.cpp @@ -1,4 +1,6 @@ #include "Contents/Party/AdventurerAgencyMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Utility/Async/AsyncDiagnostic.h" #include "Contents/MessageTable.h" #include "UI/Window/UIWindow.h" @@ -26,17 +28,17 @@ void CAdventurerAgencyMgr::CompleteRegistration(AsyncDiagnostic diagnostic, std: const int type = root["Type"].asInt(); if (type == 2 || type == 3) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3417)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3417)), 0xFF, 0, 0, 0); return; } this->registered = true; - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3418)), 0xFFFF64, 0, 0, 0); - UIWindow* board = g_windowMgr.LookupWindow(324); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3418)), 0xFFFF64, 0, 0, 0); + UIWindow* board = g_windowMgr.LookupWindow(WID_ADVENPARTYBOARDWND); if (board) { - board->SendMsg(nullptr, 6, 415, 0, 0, 0); + board->SendMsg(nullptr, UM_COMMAND, ID_PARTY_RELOAD_FIRST_PAGE, 0, 0, 0); } else { - g_windowMgr.EnsureWindow(324); + g_windowMgr.EnsureWindow(WID_ADVENPARTYBOARDWND); } } diff --git a/Source/Contents/Party/StopRecruitingCompletion.cpp b/Source/Contents/Party/StopRecruitingCompletion.cpp index 197808695..c7b375b5f 100644 --- a/Source/Contents/Party/StopRecruitingCompletion.cpp +++ b/Source/Contents/Party/StopRecruitingCompletion.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Utility/Async/AsyncDiagnostic.h" @@ -16,7 +18,7 @@ void CAdventurerAgencyMgr::CompleteStopRecruiting(AsyncDiagnostic diagnostic, st if (!diagnostic.success) { if (this->unknown_0008 == g_session.m_aid) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3507)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3507)), 0xFF, 0, 0, 0); } return; @@ -33,21 +35,21 @@ void CAdventurerAgencyMgr::CompleteStopRecruiting(AsyncDiagnostic diagnostic, st case 2: case 3: if (this->unknown_0008 == g_session.m_aid) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3507)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3507)), 0xFF, 0, 0, 0); } return; } if (this->unknown_0008 == g_session.m_aid) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3459)), 0xFFFF64, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3459)), 0xFFFF64, 0, 0, 0); } this->registered = false; - auto* board = static_cast(g_windowMgr.LookupWindow(324)); + auto* board = static_cast(g_windowMgr.LookupWindow(WID_ADVENPARTYBOARDWND)); if (board) { board->stop->Enable(0); - board->SendMsg(nullptr, 6, 415, 0, 0, 0); + board->SendMsg(nullptr, UM_COMMAND, ID_PARTY_RELOAD_FIRST_PAGE, 0, 0, 0); } } diff --git a/Source/Contents/RenewQuestMgr.cpp b/Source/Contents/RenewQuestMgr.cpp index dc4c47c00..707de4de7 100644 --- a/Source/Contents/RenewQuestMgr.cpp +++ b/Source/Contents/RenewQuestMgr.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Contents/RenewQuestMgr.h" #include "Contents/MessageTable.h" #include "File/File.h" @@ -633,7 +635,7 @@ int CRenewQuestMgr::L_AddQuestIconTooltip(lua_State* state) { // OFFSET: 0x0067B620 // FUNCTION: fn_05457 void CRenewQuestMgr::ShowOngoingQuestInfo(unsigned int questId) { - if (auto* window = static_cast(g_windowMgr.EnsureWindow(0x2719))) { + if (auto* window = static_cast(g_windowMgr.EnsureWindow(WID_ONGOINGQUESTINFO))) { window->SetQuest(questId); } } @@ -641,7 +643,7 @@ void CRenewQuestMgr::ShowOngoingQuestInfo(unsigned int questId) { // OFFSET: 0x0067B650 // FUNCTION: fn_05458 void CRenewQuestMgr::ShowQuestInfo(unsigned int questId) { - if (auto* window = static_cast(g_windowMgr.EnsureWindow(0x2718))) { + if (auto* window = static_cast(g_windowMgr.EnsureWindow(WID_RENEWQUESTUI))) { window->UpdateQuestLists(0xF); window->SelectQuest(questId); } @@ -650,7 +652,7 @@ void CRenewQuestMgr::ShowQuestInfo(unsigned int questId) { // OFFSET: 0x0067B690 // FUNCTION: fn_05459 void CRenewQuestMgr::UpdateOngoingQuestInfo() { - if (auto* window = static_cast(g_windowMgr.LookupWindow(0x2719))) { + if (auto* window = static_cast(g_windowMgr.LookupWindow(WID_ONGOINGQUESTINFO))) { window->UpdateHuntInfo(); } } @@ -662,7 +664,7 @@ void CRenewQuestMgr::UpdateQuestWindows() { g_windowMgr.window_0428->Invalidate(); } - if (auto* window = static_cast(g_windowMgr.LookupWindow(0x2718))) { + if (auto* window = static_cast(g_windowMgr.LookupWindow(WID_RENEWQUESTUI))) { window->UpdateQuestLists(0xD); } } @@ -782,7 +784,7 @@ void CRenewQuestMgr::ReadOngoingQuests(const char* buffer, unsigned int) { g_windowMgr.window_0428->Invalidate(); } - if (auto* window = static_cast(g_windowMgr.LookupWindow(0x2718))) { + if (auto* window = static_cast(g_windowMgr.LookupWindow(WID_RENEWQUESTUI))) { window->UpdateQuestLists(0xD); } } diff --git a/Source/Contents/ReputeMgr.cpp b/Source/Contents/ReputeMgr.cpp index 8cf4dbe5b..41a9be771 100644 --- a/Source/Contents/ReputeMgr.cpp +++ b/Source/Contents/ReputeMgr.cpp @@ -1,4 +1,6 @@ #include "Contents/ReputeMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Application/ErrorDialog.h" #include "Render/DeviceContext/DCSurface.h" #include "Contents/MessageTable.h" @@ -237,7 +239,7 @@ bool CReputeMgr::Load() { // OFFSET: 0x0060E4A0 // FUNCTION: fn_04296 void CReputeMgr::OpenRepute(std::uint64_t groupId, std::uint64_t reputeId) { - UIWindow* window = g_windowMgr.EnsureWindow(346); + UIWindow* window = g_windowMgr.EnsureWindow(WID_REPUTEWND); if (!window) { return; } @@ -246,11 +248,11 @@ void CReputeMgr::OpenRepute(std::uint64_t groupId, std::uint64_t reputeId) { const unsigned int groupIdHigh = static_cast(groupId >> 32); if (groupIdLow == 0 && groupIdHigh == 0) { - window->SendMsg(nullptr, 22, reinterpret_cast(LookupMessage(3829)), 0, 0, 0); + window->SendMsg(nullptr, UM_TAB, reinterpret_cast(LookupMessage(3829)), 0, 0, 0); } else { auto group = this->m_groups.find(groupId); if (group != this->m_groups.end()) { - window->SendMsg(nullptr, 22, reinterpret_cast(group->second.name.c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_TAB, reinterpret_cast(group->second.name.c_str()), 0, 0, 0); } } @@ -293,9 +295,9 @@ std::vector CReputeMgr::FindReputes(const std::string& keywor void CReputeMgr::SetPointsReceived(bool received) { this->m_waitingForPoints = !received; if (received == true) { - UIWindow* window = g_windowMgr.LookupWindow(346); + UIWindow* window = g_windowMgr.LookupWindow(WID_REPUTEWND); if (window) { - window->SendMsg(nullptr, 136, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESH_REPUTE_FILTER, 0, 0, 0, 0); } } } diff --git a/Source/Contents/RouletteMgr.cpp b/Source/Contents/RouletteMgr.cpp index 61f9bc828..d006b5286 100644 --- a/Source/Contents/RouletteMgr.cpp +++ b/Source/Contents/RouletteMgr.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/RouletteMgr.h" #include "Render/Renderer.h" #include "Render/TextureQuad.h" @@ -144,7 +145,7 @@ void RouletteMgr::StartSpin(int x, int y, int originX, int originY) { g_windowMgr.unknown_0464->m_enabled = 0; if (g_windowMgr.unknown_0464) { - g_windowMgr.unknown_0464->SendMsg(nullptr, 60, 0, 0, 0, 0); + g_windowMgr.unknown_0464->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } diff --git a/Source/Contents/Schedule/PartialShutDownSchedule.cpp b/Source/Contents/Schedule/PartialShutDownSchedule.cpp index dd527c044..b4580ee17 100644 --- a/Source/Contents/Schedule/PartialShutDownSchedule.cpp +++ b/Source/Contents/Schedule/PartialShutDownSchedule.cpp @@ -1,4 +1,5 @@ #include "Contents/Schedule/PartialShutDownSchedule.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" @@ -77,7 +78,7 @@ void CPartialShutDownSchedule::Process(const std::uint64_t& now) { char text[256]; std::memset(text, 0, 255); std::sprintf(text, LookupMessage(2349), seconds / 3600, (seconds % 3600) / 60); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); return; } @@ -89,7 +90,7 @@ void CPartialShutDownSchedule::Process(const std::uint64_t& now) { text, LookupMessage(2348), this->endTime->Year(), this->endTime->Month(), this->endTime->Day(), this->endTime->Hour(), this->endTime->Minute(), this->endTime->Second() ); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFFFF, 0, 0, 0); ++this->noticeIndex; this->UpdateNotice(); } diff --git a/Source/Contents/Schedule/ShutDownSchedule.cpp b/Source/Contents/Schedule/ShutDownSchedule.cpp index 2d30611f5..de82dbfcd 100644 --- a/Source/Contents/Schedule/ShutDownSchedule.cpp +++ b/Source/Contents/Schedule/ShutDownSchedule.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/Schedule/ShutDownSchedule.h" #include "Client/Mode/ModeMgr.h" @@ -34,7 +35,7 @@ void CShutDownSchedule::Process(const std::uint64_t& now) { if (this->noticeIndex < 6) { if (g_modeMgr.GetGameMode()) { const char* message = LookupMessage(2020); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 0, 0, 0); ++this->noticeIndex; this->UpdateNotice(); } diff --git a/Source/Contents/ShowRankingScheduler.cpp b/Source/Contents/ShowRankingScheduler.cpp index 022bd231d..fb0929359 100644 --- a/Source/Contents/ShowRankingScheduler.cpp +++ b/Source/Contents/ShowRankingScheduler.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/ShowRankingScheduler.h" #include "Client/Session.h" #include "Contents/Schedule/CheckGDISchedule.h" @@ -62,7 +63,7 @@ void CShowRankingScheduler::Process(const std::uint64_t& now) { } } if (!complete) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3481)), 0xffff, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3481)), 0xffff, 0, 0, 0); return; } this->Show(); @@ -111,7 +112,7 @@ void CShowRankingScheduler::Show() { background = 0; color = 0; } - g_windowMgr.SendNotice(1, reinterpret_cast(title), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(title), color, 0, 0, 0); const auto* ids = reinterpret_cast(this->rankingData + 4); const auto* points = reinterpret_cast(this->rankingData + 44); @@ -134,13 +135,13 @@ void CShowRankingScheduler::Show() { } std::string line = FormatOwnedString("[ %2d ] %s : %4d POINT", index + 1, name.c_str(), points[index]); - g_windowMgr.SendNotice(1, reinterpret_cast(line.c_str()), background, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line.c_str()), background, 0, 0, 0); } - g_windowMgr.SendNotice(1, reinterpret_cast("==========================================="), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("==========================================="), color, 0, 0, 0); std::string mine = FormatOwnedString("MY POINT : %4d POINT ", *reinterpret_cast(this->rankingData + 84)); - g_windowMgr.SendNotice(1, reinterpret_cast(mine.c_str()), background, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("==========================================="), color, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(mine.c_str()), background, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("==========================================="), color, 0, 0, 0); } // OFFSET: 0x00E493E0 diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index 2bf090d9a..a9301e15e 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -1,4 +1,6 @@ #include "Contents/Skills/ClientSkills.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Application/ErrorDialog.h" @@ -178,15 +180,15 @@ CSkillInfo CSession::LookupSkill(std::uint32_t id) { // FUNCTION: fn_23904 void CSession::NotifySkillWindows() { if (g_windowMgr.window_02C4) { - g_windowMgr.window_02C4->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_02C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.window_01E8) { - g_windowMgr.window_01E8->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_01E8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - if (UIWindow* window = g_windowMgr.LookupWindow(159)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_QUIKSLOTWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -405,7 +407,7 @@ void CSession::AddStackedItem(ITEM_INFO item) { } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_0458)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -725,11 +727,11 @@ CSkillInfo CSession::HomunSkillAt(int index) const { // FUNCTION: fn_23902 __declspec(noinline) void CSession::NotifyHomunSkillWindows() { if (g_windowMgr.window_03C4) { - g_windowMgr.window_03C4->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_03C4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.window_01E8) { - g_windowMgr.window_01E8->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_01E8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -737,11 +739,11 @@ __declspec(noinline) void CSession::NotifyHomunSkillWindows() { // FUNCTION: fn_23903 __declspec(noinline) void CSession::NotifyMercSkillWindows() { if (g_windowMgr.window_03CC) { - g_windowMgr.window_03CC->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_03CC->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.window_01E8) { - g_windowMgr.window_01E8->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_01E8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -938,7 +940,7 @@ void CSession::ReturnStackedItem(int index, int count) { } if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_0458)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } diff --git a/Source/Contents/Skills/PlayerSkillBundle.cpp b/Source/Contents/Skills/PlayerSkillBundle.cpp index 712a063ae..0c71cb18c 100644 --- a/Source/Contents/Skills/PlayerSkillBundle.cpp +++ b/Source/Contents/Skills/PlayerSkillBundle.cpp @@ -1,4 +1,6 @@ #include "Contents/Skills/PlayerSkillBundle.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Skills/SkillId.h" #include "Client/Session.h" #include "UI/Window/UIWindow.h" @@ -173,8 +175,8 @@ void CPlayerSkillBundle::ClearExtra() { // FUNCTION: fn_08274 void CPlayerSkillBundle::AddExtra(const CSkillInfo& value) { this->extraIds.push_back(value.id); - if (UIWindow* window = g_windowMgr.LookupWindow(37)) { - window->SendMsg(nullptr, 161, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLLISTWND)) { + window->SendMsg(nullptr, UM_REFRESH_EXTRA_SKILL_TAB, 0, 0, 0, 0); } this->extra.push_back(value); @@ -192,8 +194,8 @@ bool CPlayerSkillBundle::RemoveExtra(std::uint32_t id) { const auto item = std::find(this->extraIds.begin(), this->extraIds.end(), id); if (item != this->extraIds.end()) { this->extraIds.erase(item); - if (UIWindow* window = g_windowMgr.LookupWindow(37)) { - window->SendMsg(nullptr, 161, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLLISTWND)) { + window->SendMsg(nullptr, UM_REFRESH_EXTRA_SKILL_TAB, 0, 0, 0, 0); } } diff --git a/Source/Contents/Skills/SkillActionAlitea.cpp b/Source/Contents/Skills/SkillActionAlitea.cpp index 4ea1cf2f9..70175e4af 100644 --- a/Source/Contents/Skills/SkillActionAlitea.cpp +++ b/Source/Contents/Skills/SkillActionAlitea.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Session.h" #include "Client/Mode/ModeMgr.h" @@ -592,7 +593,7 @@ void CSkillAction_Earthing::OnSkillDamage(int level, CGameActor* source, CGameAc } if (CRagEffect* effect = source->LaunchEffect(0, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); } } @@ -907,7 +908,7 @@ void CSkillAction_AT_QUILL_SPEAR::OnSkillEffect(int level, CGameActor* source, C ); effect->SetAngle(angle); if (CRagEffect* ragEffect = source->LaunchEffect(2442, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - ragEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + ragEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } } @@ -930,7 +931,7 @@ void CSkillAction_AT_QUILL_SPEAR_S::OnSkillEffect(int level, CGameActor* source, ); effect->SetAngle(angle); if (CRagEffect* ragEffect = source->LaunchEffect(2442, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - ragEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + ragEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } } } @@ -1005,7 +1006,7 @@ void CSkillAction_AT_GRAVITY_HOLE::OnSkillCast(int level, CGameActor* source) { void CSkillAction_AT_GRAVITY_HOLE::OnSkillDamage(int level, CGameActor* source, CGameActor* target) { if (source) { if (CRagEffect* effect = source->LaunchEffect(0, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); } } } @@ -1867,7 +1868,7 @@ void CSkillAction_AT_SAVAGE_LUNGE::OnSkillEffect(int level, CGameActor* source, } if (CRagEffect* effect = source->LaunchEffect(2439, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } EffectLists* effects = g_effectMgr; effects->Spawn(0, CEZ2STREffectMgr::GetInstance()->EffectId([] { diff --git a/Source/Contents/Skills/SkillActionDruid.cpp b/Source/Contents/Skills/SkillActionDruid.cpp index 603062794..028bdd662 100644 --- a/Source/Contents/Skills/SkillActionDruid.cpp +++ b/Source/Contents/Skills/SkillActionDruid.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/GameActor.h" @@ -1213,7 +1214,7 @@ void CSkillAction_DR_CRUEL_BITE::OnSkillEffect(int level, CGameActor* source, CG } if (CRagEffect* effect = source->LaunchEffect(2439, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } const char effectSource[] = {'\xC2', '\x4F', '\xEA', '\xB2', '\x0F', '\xD0', '\x45', '\x30', '\xD5', '\x58', '\x9F'}; diff --git a/Source/Contents/Skills/SkillActionKarnos.cpp b/Source/Contents/Skills/SkillActionKarnos.cpp index b9b2b10a0..58ebb893a 100644 --- a/Source/Contents/Skills/SkillActionKarnos.cpp +++ b/Source/Contents/Skills/SkillActionKarnos.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/GameActor.h" #include "Contents/Camera/Camera.h" @@ -359,7 +360,7 @@ void CSkillAction_KR_GROUND_BLOOM::OnSkillDamage(int level, CGameActor* source, } if (CRagEffect* effect = source->LaunchEffect(0, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&source->render.position), 0, 0, 0, 0); } } diff --git a/Source/Contents/Skills/SkillActionMeister.cpp b/Source/Contents/Skills/SkillActionMeister.cpp index a48cfa9d6..775928989 100644 --- a/Source/Contents/Skills/SkillActionMeister.cpp +++ b/Source/Contents/Skills/SkillActionMeister.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/GameActor.h" @@ -176,7 +177,7 @@ void CSkillAction_MT_RUSH_STRIKE::OnSkillEffect(int level, CGameActor* source, C } if (CRagEffect* ragEffect = static_cast(source)->LaunchEffect(1568, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - ragEffect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + ragEffect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } EffectLists* effects = g_effectMgr; effects->Spawn(target->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("rush_strike_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); @@ -237,7 +238,7 @@ void CEfstAction_GRADUAL_GRAVITY::OnEfstBegin(int efstId, int value, int argumen void CEfstAction_GRADUAL_GRAVITY::OnEfstEnd(int efstId, int argument2, int argument3, int argument4, CRenderObject* actor) { if (actor) { while (static_cast(actor)->HasId(779)) { - actor->SendMsg(nullptr, 109, 0, 779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } diff --git a/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp b/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp index df3bc2d2a..09c3e2953 100644 --- a/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp +++ b/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp @@ -1,3 +1,4 @@ +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Contents/Combat/CombatTypes.h" #include "Client/Mode/ModeMgr.h" @@ -544,7 +545,7 @@ void CEfstAction_SHADOW_CLOCK::OnEfstBegin(int efstId, int value, int argument3, void CEfstAction_SHADOW_CLOCK::OnEfstEnd(int efstId, int argument2, int argument3, int argument4, CRenderObject* actor) { if (actor) { while (static_cast(actor)->HasId(963)) { - actor->SendMsg(nullptr, 109, 0, 963, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 963, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } } diff --git a/Source/Contents/Skills/SkillActionSoulAscetic.cpp b/Source/Contents/Skills/SkillActionSoulAscetic.cpp index 684cd8c8d..d446e982a 100644 --- a/Source/Contents/Skills/SkillActionSoulAscetic.cpp +++ b/Source/Contents/Skills/SkillActionSoulAscetic.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/GameActor.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/EffectResourceSwitcher.h" #include "Contents/Effects/Effect.h" #include "Contents/Effects/EffectActor.h" @@ -188,7 +189,7 @@ void CSkillAction_SOA_TALISMAN_OF_SOUL_STEALING::OnSkillCast(int level, CGameAct void CSkillAction_SOA_TALISMAN_OF_SOUL_STEALING::OnSkillEffect(int level, CGameActor* source, CGameActor* target) { if (target) { target->LaunchEffect(253, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); - target->SendMsg(nullptr, 88, 0, level, level >> 31, static_cast(0xFF0000FF), 0, 114, 0, 0, 0, 0, 0, 0, 0); + target->SendMsg(nullptr, AM_MAKE_NUMBER, 0, level, level >> 31, static_cast(0xFF0000FF), 0, 114, 0, 0, 0, 0, 0, 0, 0); } } diff --git a/Source/Contents/Skills/SkillInfo.cpp b/Source/Contents/Skills/SkillInfo.cpp index 1a30e6726..cdd2ebba5 100644 --- a/Source/Contents/Skills/SkillInfo.cpp +++ b/Source/Contents/Skills/SkillInfo.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/ModeMgr.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Contents/Actors/GameActor.h" #include "Contents/Actors/Pc.h" @@ -917,7 +918,7 @@ void CEfstAction_SHADOW_EXCEED::OnEfstEnd(int efstId, int argument2, int argumen auto* effectActor = static_cast(actor); while (effectActor->HasId(1004)) { - actor->SendMsg(nullptr, 109, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + actor->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 1004, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1199,7 +1200,7 @@ void CSkillAction_ABC_CHASING_BREAK::OnSkillEffect(int level, CGameActor* source } if (CRagEffect* effect = static_cast(source)->LaunchEffect(2416, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } for (int angle = 0; angle < 360; angle += 45) { @@ -1236,7 +1237,7 @@ void CSkillAction_ABC_CHASING_SHOT::OnSkillEffect(int level, CGameActor* source, } if (CRagEffect* effect = static_cast(source)->LaunchEffect(2416, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); } for (int angle = 0; angle < 360; angle += 45) { diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 6a311debc..51714c95a 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "Contents/Sound/SoundMaker.h" #include "Contents/Actors/ActorEnums.h" #include "Contents/Jobs/JobId.h" @@ -455,7 +456,7 @@ void CNpc::RegisterPos() { case JT_HIDDEN_WARP_NPC: break; default: - mode->SendMsg(12, this->render.accountId, column, row, 0); + mode->SendMsg(MM_ADDREGISTERPOS, this->render.accountId, column, row, 0); break; } } @@ -470,7 +471,7 @@ void CNpc::UnRegisterPos() { case JT_HIDDEN_WARP_NPC: break; default: - g_modeMgr.GetGameMode()->SendMsg(13, this->render.accountId, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETEREGISTERPOS, this->render.accountId, 0, 0, 0); break; } } @@ -739,7 +740,7 @@ void CNpc::SendMsg( return; } - if (message == 0x22 && a == 0) { + if (message == AM_UPDATEGAGE && a == 0) { if (g_session.IsCompanionAid(this->render.accountId)) { if (this->unknown_042C == nullptr) { this->unknown_042C = new UIPlayerGage(); @@ -1323,7 +1324,7 @@ void CNpc::UpdateMinimapMarker() { return; } if (this->unknown_0434) { - this->unknown_0434->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->unknown_0434->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0434 = nullptr; this->unknown_0438 = 9999; } @@ -1332,7 +1333,7 @@ void CNpc::UpdateMinimapMarker() { const int base = marker->unknown_0004 < 6 ? 0x24 : 0x36; CMsgEffect* effect = mode->SpawnMsgEffect(base + marker->unknown_0004, &this->render.position, this->render.accountId, true); this->unknown_03B0.push_back(effect); - effect->SendMsg(this, 0x32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(this, AM_SET_MASTER_POINTER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0434 = effect; this->minimapMarkerCell[0] = marker->unknown_0004; this->minimapMarkerCell[1] = marker->unknown_0006; @@ -1340,7 +1341,7 @@ void CNpc::UpdateMinimapMarker() { } if (this->unknown_0434) { - this->unknown_0434->SendMsg(nullptr, 0x35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->unknown_0434->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->unknown_0434 = nullptr; this->unknown_0438 = 9999; } @@ -1408,7 +1409,7 @@ bool CNpc::OnProcess() { } else { reinterpret_cast(this->unknown_030C)->Load(".\\AI\\AI.lua"); } - this->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } @@ -1431,12 +1432,12 @@ bool CNpc::OnProcess() { path = ".\\AI\\AI_M.lua"; } reinterpret_cast(this->unknown_0310)->Load(path); - this->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } if (g_session.IsPetAid(this->render.accountId)) { - this->SendMsg(nullptr, 0x22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_UPDATEGAGE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->UpdateBubblePositions(); @@ -1672,7 +1673,7 @@ void CNpc::SetState(int state, int) { break; } if (this->render.accountId == g_session.unknown_1010) { - g_modeMgr.GetGameMode()->SendMsg(148, emotion, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_PET_ACT, emotion, 0, 0, 0); } this->unknown_02C8 = 0; this->render.isMotionFinished = false; @@ -1732,8 +1733,8 @@ void CNpc::SetState(int state, int) { this->render.unknown_00DC = 0; this->render.isMotionFreezed = false; if (this->bodyState == 2) { - this->SendMsg(nullptr, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_ICEEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_ICEBREAKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->render.isLieOnGround = true; this->render.isMotionFreezed = false; @@ -1779,8 +1780,8 @@ void CNpc::SetState(int state, int) { break; case ST_SLEEP: if (this->bodyState == 2) { - this->SendMsg(nullptr, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(nullptr, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_DELETE_ICEEFFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(nullptr, AM_MAKE_ICEBREAKE_FFECT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this->render.isLieOnGround = false; this->render.isMotionFinished = true; diff --git a/Source/Contents/SpriteLayerDrawing.cpp b/Source/Contents/SpriteLayerDrawing.cpp index dfe949283..04fc2e6e8 100644 --- a/Source/Contents/SpriteLayerDrawing.cpp +++ b/Source/Contents/SpriteLayerDrawing.cpp @@ -1,4 +1,5 @@ #include "Contents/SpriteLayerDrawing.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Session.h" #include "Contents/Actors/ActorStateFlags.h" @@ -655,7 +656,7 @@ void SpriteLayerRenderer::DrawLayer( quad.image = resolved.image; const std::uint32_t* palette = this->GetPalette(layer, sprite, action); int effect = 0xA6; - this->pc->SendMsg(nullptr, 0x78, 0, reinterpret_cast(&effect), reinterpret_cast(&effect) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->pc->SendMsg(nullptr, AM_IS_HAVE_EFFECT, 0, reinterpret_cast(&effect), reinterpret_cast(&effect) >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); int blend; switch (layer) { diff --git a/Source/Contents/Store/MCStoreInfoBackup.cpp b/Source/Contents/Store/MCStoreInfoBackup.cpp index 57715496b..164e39dc3 100644 --- a/Source/Contents/Store/MCStoreInfoBackup.cpp +++ b/Source/Contents/Store/MCStoreInfoBackup.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/UserData/AccountService.h" #include "Contents/Async/AsyncWorkMgr.h" #include "Contents/Store/MCStoreInfoBackup.h" @@ -131,12 +132,12 @@ void CMCStoreInfoBackup::CompleteSave(AsyncDiagnostic diagnostic, std::string re return; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); if (this->type == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3685)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3685)), 0xFFFF, 0, 0, 0); } else if (this->type == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3686)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3686)), 0xFFFF, 0, 0, 0); } } diff --git a/Source/Contents/World/WorldEffects.cpp b/Source/Contents/World/WorldEffects.cpp index d25104718..c7d431a99 100644 --- a/Source/Contents/World/WorldEffects.cpp +++ b/Source/Contents/World/WorldEffects.cpp @@ -1,4 +1,6 @@ #include "Contents/World/World.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Contents/Effects/EffectLists.h" @@ -16,7 +18,7 @@ SoundConfiguration g_soundConfiguration; // OFFSET: 0x00AC9040 // FUNCTION: fn_17682 void CWorld::LoadMapEffects() { - std::string name = reinterpret_cast(this->gameMode->SendMsg(9, 0, 0, 0, 0)); + std::string name = reinterpret_cast(this->gameMode->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); C3dWorldRes* resource = static_cast(ResourceMgr::Instance().Load(name.c_str())); for (auto it = resource->effects.begin(); it != resource->effects.end(); ++it) { @@ -27,7 +29,7 @@ void CWorld::LoadMapEffects() { } else { CEffectMaker* effect = new CEffectMaker; const int address = reinterpret_cast(record); - effect->SendMsg(nullptr, 14, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->objects.push_back(effect); } } @@ -39,7 +41,7 @@ void CWorld::LoadMapEffects() { WorldSoundRecord* record = *it; CSoundMaker* sound = new CSoundMaker; const int address = reinterpret_cast(record); - sound->SendMsg(nullptr, 14, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + sound->SendMsg(nullptr, AM_SETPOS, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->objects.push_back(sound); } } diff --git a/Source/Contents/World/WorldModelLoading.cpp b/Source/Contents/World/WorldModelLoading.cpp index d9a2a776e..cdd1c5c1e 100644 --- a/Source/Contents/World/WorldModelLoading.cpp +++ b/Source/Contents/World/WorldModelLoading.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Application/ApplicationMessages.h" #include "Contents/Models/ModelActor.h" #include "Contents/Ground/TerrainHeight.h" @@ -143,7 +145,7 @@ void CWorld::InitWorld() { static_cast(&ShowErrorDialog) ); - const char* rawMapName = reinterpret_cast(this->gameMode->SendMsg(9, 0, 0, 0, 0)); + const char* rawMapName = reinterpret_cast(this->gameMode->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); std::string mapName(rawMapName ? rawMapName : ""); auto* worldRes = static_cast(ResourceMgr::Instance().Load(mapName.c_str())); @@ -238,7 +240,7 @@ void CWorld::InitWorld() { if ((percent != lastPercent && now - lastNoticeTime > 15) || percent == 100) { lastPercent = percent; lastNoticeTime = now; - g_windowMgr.SendNotice(4, percent, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_LOADINGPERCENT, percent, 0, 0, 0, 0); g_windowMgr.CenterSurface0478(); g_windowMgr.DrawWindows(); if (g_renderer->Draw()) { diff --git a/Source/Contents/World/WorldObjects.cpp b/Source/Contents/World/WorldObjects.cpp index 290054538..dd80c3617 100644 --- a/Source/Contents/World/WorldObjects.cpp +++ b/Source/Contents/World/WorldObjects.cpp @@ -1,4 +1,7 @@ #include "Client/Mode/CGameMode.h" +#include "Contents/Actors/ActorEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/GameModeEnums.h" #include "Client/Session.h" #include "Contents/Actors/EffectActors.h" @@ -180,7 +183,7 @@ void CWorld::OnProcess() { break; } - skill->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (skill->HasPendingDamage()) { bool found = false; for (const std::uint32_t pendingAid : this->pendingActorIds) { @@ -288,7 +291,7 @@ void CGameMode::SpawnArrowEffect(std::uint32_t aid, int target, char flag, int a if (effect) { this->scene->objects.push_back(effect); - effect->SendMsg(nullptr, 14, 0, static_cast(aid), static_cast(aid) >> 31, target, 0, reinterpret_cast(&flag), + effect->SendMsg(nullptr, AM_SETPOS, 0, static_cast(aid), static_cast(aid) >> 31, target, 0, reinterpret_cast(&flag), reinterpret_cast(&flag) >> 31, argument, argument >> 31, 0, 0, 0, 0); } } @@ -300,7 +303,7 @@ void CGameMode::SpawnArrowEffect64(const vector3d* source, const vector3d* targe if (effect) { this->scene->objects.push_back(effect); - effect->SendMsg(nullptr, 64, 0, reinterpret_cast(source), reinterpret_cast(source) >> 31, reinterpret_cast(target), + effect->SendMsg(nullptr, AM_SETPOS2, 0, reinterpret_cast(source), reinterpret_cast(source) >> 31, reinterpret_cast(target), reinterpret_cast(target) >> 31, reinterpret_cast(&speed), reinterpret_cast(&speed) >> 31, 0, 0, 0, 0, 0, 0); } } @@ -423,9 +426,9 @@ bool CGameMode::LaunchTargetEffect(int effectId, CGameActor* source, CGameActor* } vector3d position = target->render.position; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&position), 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(&position), 0, 0, 0, 0); if (argument != -1) { - effect->SendMsg(nullptr, 44, 0, argument, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETCOUNT, 0, argument, 0, 0, 0, 0); } return true; } @@ -567,7 +570,7 @@ void CGameMode::ShowGuildEmblem(CGameActor* actor, int guildId, int unused) { } UIEmblemWnd* window = new UIEmblemWnd; - window->SendMsg(nullptr, 34, actor->render.accountId, guildId, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, actor->render.accountId, guildId, 0, 0); g_windowMgr.AddRenderedFront(window); actor->unknown_0188 = reinterpret_cast(window); this->AddUnknown0604(window); @@ -593,8 +596,8 @@ CMsgEffect* CGameMode::SpawnCashEmotion(int aid, int packId, int emotionId, std: this->scene->objects.emplace_back(effect); } - effect->SendMsg(nullptr, 22, 0, duration, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); - effect->SendMsg(nullptr, 14, 0, aid, aid >> 31, reinterpret_cast(&names), reinterpret_cast(&names) >> 31, data->unknown_0020, + effect->SendMsg(nullptr, AM_SETMASTERGID, 0, duration, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, aid, aid >> 31, reinterpret_cast(&names), reinterpret_cast(&names) >> 31, data->unknown_0020, data->unknown_0020 >> 31, 0, 0, 0, 0, 0, 0); } } @@ -629,7 +632,7 @@ void CGameMode::SpawnMandraAttack(std::uint32_t aid, int target, char flag) { if (effect) { this->scene->objects.push_back(effect); - effect->SendMsg(nullptr, 14, 0, aid, 0, reinterpret_cast(&flag), reinterpret_cast(&flag) >> 31, target, target >> 31, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, aid, 0, reinterpret_cast(&flag), reinterpret_cast(&flag) >> 31, target, target >> 31, 0, 0, 0, 0, 0, 0); } } @@ -656,58 +659,58 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { if (actor != nullptr && g_session.IsHomunAid(actor->render.accountId)) { if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->actorMenuIds.erase(this->actorMenuIds.begin(), this->actorMenuIds.end()); - menu = g_windowMgr.EnsureWindow(0x12); + menu = g_windowMgr.EnsureWindow(WID_MENUWND); this->unknown_02E0 = pick->accountId; this->actorMenuIds.push_back(0x25); sprintf(text, LookupMessage(0x458)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x26); sprintf(text, LookupMessage(0x459)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x27); sprintf(text, LookupMessage(0x45A)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); } else if (actor != nullptr && g_session.IsMercenaryAid(pick->accountId)) { if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->actorMenuIds.erase(this->actorMenuIds.begin(), this->actorMenuIds.end()); - menu = g_windowMgr.EnsureWindow(0x12); + menu = g_windowMgr.EnsureWindow(WID_MENUWND); this->unknown_02E0 = pick->accountId; this->actorMenuIds.push_back(0x28); sprintf(text, LookupMessage(0x458)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x29); sprintf(text, LookupMessage(0x45A)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); } else if (actor != nullptr && pick->accountId == g_session.unknown_1010 && actor->unknown_0314 == 7) { if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->actorMenuIds.erase(this->actorMenuIds.begin(), this->actorMenuIds.end()); - menu = g_windowMgr.EnsureWindow(0x12); + menu = g_windowMgr.EnsureWindow(WID_MENUWND); this->unknown_02E0 = pick->accountId; this->actorMenuIds.push_back(0x21); sprintf(text, LookupMessage(0x254)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x1D); sprintf(text, LookupMessage(0x250)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x1E); sprintf(text, LookupMessage(0x251)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x20); sprintf(text, LookupMessage(0x253)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); this->actorMenuIds.push_back(0x1F); sprintf(text, LookupMessage(0x252)); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); } else { if (pick->accountId == g_session.m_aid) { return; @@ -739,14 +742,14 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->actorMenuIds.erase(this->actorMenuIds.begin(), this->actorMenuIds.end()); - menu = g_windowMgr.EnsureWindow(0x12); + menu = g_windowMgr.EnsureWindow(WID_MENUWND); this->unknown_02E0 = pick->accountId; this->actorMenuIds.push_back(0x41); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xDA5)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xDA5)), 0, 0, 0); } else { std::string name; if (target->unknown_02F8 == 1 && (this->scene->unknown_0048 == 1 || this->scene->unknown_004C == 1)) { @@ -756,10 +759,10 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->actorMenuIds.erase(this->actorMenuIds.begin(), this->actorMenuIds.end()); - menu = g_windowMgr.EnsureWindow(0x12); + menu = g_windowMgr.EnsureWindow(WID_MENUWND); this->unknown_02E0 = pick->accountId; char line[128]; @@ -767,19 +770,19 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { if (isAdmin) { this->actorMenuIds.push_back(0x1C); sprintf(line, LookupMessage(0x1CA), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } CPlayer* player = static_cast(g_modeMgr.GetGameMode())->scene->player; if (!StateFlag01(player->GetStateFlags()) && !StateFlag02(player->GetStateFlags())) { this->actorMenuIds.push_back(0x2A); sprintf(line, LookupMessage(0x550), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } if (!StateFlag01(player->GetStateFlags()) && !StateFlag02(player->GetStateFlags())) { this->actorMenuIds.push_back(4); sprintf(line, LookupMessage(0x187), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } const bool canInviteParty = @@ -787,13 +790,13 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { if (canInviteParty) { this->actorMenuIds.push_back(5); sprintf(line, LookupMessage(0x188), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } if (g_session.IsPartyRecommendTarget(pick->accountId) == true) { this->actorMenuIds.push_back(0x24); sprintf(line, LookupMessage(0x377), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } if (g_guildInfo.m_guildId != 0) { @@ -802,73 +805,73 @@ void CGameMode::OpenActorMenu(const ActorPickInfo* pick, int handled) { if (g_guildInfo.unknown_00AC != 0 && guildId == 0) { this->actorMenuIds.push_back(0x16); sprintf(line, LookupMessage(0x17E), name.c_str()); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } if (g_guildInfo.unknown_00B4 != 0 && guildId != g_guildInfo.m_guildId) { - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); this->actorMenuIds.push_back(0x19); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x18F)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x18F)), 0, 0, 0); this->actorMenuIds.push_back(0x1A); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x193)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x193)), 0, 0, 0); } } - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); this->actorMenuIds.push_back(0x14); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x168)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x168)), 0, 0, 0); if (!IsAdminAccount(pick->accountId) && !g_windowMgr.IsFriend(name.c_str()) && g_serviceMode != 3) { this->actorMenuIds.push_back(10); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x166)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x166)), 0, 0, 0); } this->actorMenuIds.push_back(0x3A); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xAF8)), 0, 0, 0); - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xAF8)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); if (g_whisperBlockMgr->Contains(name)) { this->actorMenuIds.push_back(0xD); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xEEB)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xEEB)), 0, 0, 0); } else { this->actorMenuIds.push_back(0xC); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xEEC)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xEEC)), 0, 0, 0); } if (IsAdminAccount(g_session.m_aid)) { - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); this->actorMenuIds.push_back(0x2C); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x636)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x636)), 0, 0, 0); if (g_serviceMode != 3) { this->actorMenuIds.push_back(0x17); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x185)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x185)), 0, 0, 0); this->actorMenuIds.push_back(0x18); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x186)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x186)), 0, 0, 0); sprintf(line, LookupMessage(0x2C9), g_session.CountProhibitionLog(this->unknown_02E0)); this->actorMenuIds.push_back(0x23); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } sprintf(line, "%s : %d (GID) : %s", g_session.m_serverName.c_str(), this->unknown_02E0, name.c_str()); this->actorMenuIds.push_back(0x22); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(line), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(line), 0, 0, 0); } this->unknown_02EC = name; - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); this->actorMenuIds.push_back(0x3F); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xFE3)), 0xFF, 0, 0); - menu->SendMsg(nullptr, 0x48, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xFE3)), 0xFF, 0, 0); + menu->SendMsg(nullptr, UM_ADDBOUNDARY, 0, 0, 0, 0); if (CPc* pc = dynamic_cast(static_cast(this->scene->GetGameActorByAID(pick->accountId)))) { const std::string code = std::string("[C-Code] : ") + ShortcutFilename(pc->GetPkState()); this->actorMenuIds.push_back(0x39); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(code.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(code.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 0x1E, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); menu->Move(g_mouse.x + 1, g_mouse.y + 1); return; } } - menu->SendMsg(nullptr, 0x1E, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); menu->Move(g_mouse.x + 1, g_mouse.y + 1); } @@ -906,7 +909,7 @@ bool CWorld::RemoveSkill(std::uint32_t aid) { return false; } - skill->SendMsg(nullptr, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + skill->SendMsg(nullptr, AM_DISAPPEAR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (skill->HasPendingDamage() == true) { for (std::uint32_t pending : this->pendingActorIds) { @@ -941,8 +944,8 @@ CMsgEffect* CGameMode::SpawnDamageMsgEffect(const vector3d* position, std::uint3 CMsgEffect* effect = new CMsgEffect; if (effect) { this->scene->objects.push_back(effect); - effect->SendMsg(nullptr, 22, 0, accountId, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0); - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(position), reinterpret_cast(position) >> 31, reinterpret_cast(&names), + effect->SendMsg(nullptr, AM_SETMASTERGID, 0, accountId, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(position), reinterpret_cast(position) >> 31, reinterpret_cast(&names), reinterpret_cast(&names) >> 31, 0, 0, 0, 0, 0, 0, 0, 0); effect->render.color = color; effect->render.unknown_00B4 = 0; @@ -1351,9 +1354,9 @@ CMsgEffect* CGameMode::SpawnMsgEffect(int effectId, const vector3d* position, st if (effect) { this->scene->objects.push_back(effect); - effect->SendMsg(nullptr, 22, 0, accountId, 0, type, type >> 31, 0, 0, 0, 0, 0, 0, 0, 0); + effect->SendMsg(nullptr, AM_SETMASTERGID, 0, accountId, 0, type, type >> 31, 0, 0, 0, 0, 0, 0, 0, 0); effect->m_visible = visible; - effect->SendMsg(nullptr, 14, 0, reinterpret_cast(position), reinterpret_cast(position) >> 31, reinterpret_cast(names), + effect->SendMsg(nullptr, AM_SETPOS, 0, reinterpret_cast(position), reinterpret_cast(position) >> 31, reinterpret_cast(names), reinterpret_cast(names) >> 31, animation, animation >> 31, 0, 0, 0, 0, 0, 0); } diff --git a/Source/Contents/WorldView/WorldViewData.cpp b/Source/Contents/WorldView/WorldViewData.cpp index b0c82cf35..b82fedd5b 100644 --- a/Source/Contents/WorldView/WorldViewData.cpp +++ b/Source/Contents/WorldView/WorldViewData.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "Contents/WorldView/WorldViewData.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Mode/CMode.h" @@ -355,7 +356,7 @@ unsigned int CWorldViewMgr::FindWorld(int mapId) { if (!mode) { return 0; } - const std::string modeName(reinterpret_cast(mode->SendMsg(9, 0, 0, 0, 0))); + const std::string modeName(reinterpret_cast(mode->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0))); name = modeName; } diff --git a/Source/Network/Packets/PartyJoinPacket.h b/Source/Network/Packets/PartyJoinPacket.h index 330991bde..0d195cc8e 100644 --- a/Source/Network/Packets/PartyJoinPacket.h +++ b/Source/Network/Packets/PartyJoinPacket.h @@ -2,6 +2,7 @@ #define RAGNAROK_SOURCE_NETWORK_PACKETS_PARTYJOINPACKET_H #include "Network/Connection/Connection.h" +#include "UI/Window/WindowId.h" #include "Network/Packets/PacketLengths.h" #include "UI/Window/WindowManagerWindows.h" @@ -46,7 +47,7 @@ inline void SendPartyInvitationDecision( CConnection& connection, const PacketLengths& lengths, WindowManagerWindows& windows, std::string& pendingName, std::uint32_t identity, bool accepted ) { if (accepted) { - windows.EnsureWindow(34); + windows.EnsureWindow(WID_MESSENGERGROUPWND); } else { pendingName.assign("", 0); } diff --git a/Source/Network/Packets/SkillUpdatePacket.cpp b/Source/Network/Packets/SkillUpdatePacket.cpp index caea43e98..f94273b2c 100644 --- a/Source/Network/Packets/SkillUpdatePacket.cpp +++ b/Source/Network/Packets/SkillUpdatePacket.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "UI/Window/UIEnums.h" #include "Network/Packets/PacketId.h" #include "Client/Session.h" #include "UI/Window/UIWindow.h" @@ -112,10 +113,10 @@ void CGameMode::ApplyAdditionalSkillPacket(const void* packet) { g_session.m_guildSkillPoint = Read(bytes + 4); g_session.InvalidateWindowFrames(); if (g_windowMgr.window_032C) { - g_windowMgr.window_032C->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_032C->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } if (g_windowMgr.window_01E8) { - g_windowMgr.window_01E8->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.window_01E8->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } diff --git a/Source/Resource/ResourceFailures.cpp b/Source/Resource/ResourceFailures.cpp index d1ceea553..a37049aa9 100644 --- a/Source/Resource/ResourceFailures.cpp +++ b/Source/Resource/ResourceFailures.cpp @@ -1,4 +1,5 @@ #include "Resource/ResourceFailures.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "Utility/Threading/NSyncObject.h" @@ -29,7 +30,7 @@ void ResourceFailures::Report(std::string requested, std::string resolved) { this->m_reported.insert(resolved); } - g_windowMgr.SendNotice(1, reinterpret_cast("Resource File Loading fail"), 255, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(requested.c_str()), 255, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(resolved.c_str()), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("Resource File Loading fail"), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(requested.c_str()), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(resolved.c_str()), 255, 0, 0, 0); } diff --git a/Source/Script/LuaScript.cpp b/Source/Script/LuaScript.cpp index bc676d3c0..7e0047fc8 100644 --- a/Source/Script/LuaScript.cpp +++ b/Source/Script/LuaScript.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Contents/Effects/EffectMessageId.h" #include "Script/LuaScript.h" #include "Archive/PakRegistry.h" @@ -736,7 +737,7 @@ int AddEntryQueue(lua_State* state) { int AddIngredient(lua_State* state) { const int id = static_cast(luaL_checknumber(state, 1)); const int quantity = static_cast(luaL_checknumber(state, 2)); - if (UIWindow* window = g_windowMgr.LookupWindow(0x122)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_LAPINEBOXWND)) { static_cast(window)->AddMaterial(id, quantity); } return 0; @@ -746,7 +747,7 @@ int AddIngredient(lua_State* state) { // FUNCTION: fn_18359 int AddIngredientLapineUpgradeBox(lua_State* state) { const int id = static_cast(luaL_checknumber(state, 1)); - if (UIWindow* window = g_windowMgr.LookupWindow(0x12e)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_LAPINEUPGRADEBOXWND)) { static_cast(window)->AddMaterial(id); } return 0; @@ -769,7 +770,7 @@ int LuaReturnOne() { int AddCashshopBanner(lua_State* state) { std::string image = luaL_checkstring(state, 1); std::string url = luaL_checkstring(state, 2); - if (UIWindow* window = g_windowMgr.LookupWindow(0x13e)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND)) { AddCashShopBanner(reinterpret_cast(window), image, url); } @@ -781,7 +782,7 @@ int AddCashshopBanner(lua_State* state) { int AddCashshopBanner2(lua_State* state) { std::string image = luaL_checkstring(state, 1); std::string url = luaL_checkstring(state, 2); - if (UIWindow* window = g_windowMgr.LookupWindow(0x13e)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND)) { AddCashShopBanner2(reinterpret_cast(window), image, url); } @@ -795,7 +796,7 @@ int AddCheckAttendanceBanner(lua_State* state) { std::string url = luaL_checkstring(state, 2); const int action = luaL_checkinteger(state, 3); const int argument = luaL_checkinteger(state, 4); - if (UIWindow* window = g_windowMgr.LookupWindow(0x148)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_CHECKATTENDANCEWND)) { AddAttendanceBanner(static_cast(window), image, url, action, argument); } diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index c83161585..b8c2aaa42 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -1,4 +1,6 @@ #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Contents/Items/ItemType.h" #include "Client/Mode/CLoginMode.h" @@ -279,7 +281,7 @@ UIEquipWnd::UIEquipWnd() : UIFrameWnd(0) { // OFFSET: 0x008CAC40 // FUNCTION: fn_11997 UIItemCollectionWnd::~UIItemCollectionWnd() { - g_windowMgr.CloseWindow(276); + g_windowMgr.CloseWindow(WID_ROUNDBOXTOOLTIPWND); } UIChooseSellBuyWnd::~UIChooseSellBuyWnd() = default; @@ -347,7 +349,7 @@ void UIChooseSellBuyWnd::OnCreate(int width, int height) { this->viewer->textColor = 0xFF000000u | RGB(red, green, blue); this->viewer->Invalidate(); this->AddChild(this->viewer); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(92)), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(92)), 38, 0, 0); } // OFFSET: 0x008DD9A0 @@ -454,13 +456,13 @@ void UIDisconnectedServerMsgWnd::OnCreate(int width, int height) { this->m_viewer->textColor = 0xFF000000u | RGB(red, green, blue); this->m_viewer->Invalidate(); this->AddChild(this->m_viewer); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2)), 38, 0, 0); } // OFFSET: 0x008DE6D0 // FUNCTION: fn_12170 void UIEmailAddressWnd::OnCreate(int, int) { - g_modeMgr.gameMode->SendMsg(10013, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GET_EMAIL_ADDRESS, 0, 0, 0, 0); this->m_edit = new UIEditCtrl(); this->m_edit->SetSize(this->geometry.width - 77, 16); this->m_edit->Move(15, 22); @@ -631,7 +633,7 @@ void UIEquipWnd::Paint() { } if (this->unknown_0124) { - this->unknown_0124->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0124->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -776,7 +778,7 @@ void UIMinimapZoomWnd::OnCreate(int, int) { buttons.push_back(button); } - this->SendMsg(this, 6, 502, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 502, 0, 0, 0); for (int index = 0;; ++index) { TownInfo town = g_townInfoMgr->GetTownInfo(static_cast(g_modeMgr.GetGameMode())->MapName(), index); @@ -790,7 +792,7 @@ void UIMinimapZoomWnd::OnCreate(int, int) { // OFFSET: 0x008FF130 // FUNCTION: fn_12357 int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return this->UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -798,8 +800,8 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum case ID_BUTTON1: if (!g_session.IsNavigationAllowed()) { g_windowMgr.Confirm(LookupMessage(2767), 0, true, false, 0, "Message", 280, 120, 0); - } else if (!g_windowMgr.CloseWindow(273)) { - g_windowMgr.EnsureWindow(273); + } else if (!g_windowMgr.CloseWindow(WID_MINIMAPWND)) { + g_windowMgr.EnsureWindow(WID_MINIMAPWND); } return 0; case ID_PLUS: @@ -822,8 +824,8 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->Invalidate(); return 0; case 454: - if (!g_windowMgr.CloseWindow(140)) { - g_windowMgr.EnsureWindow(140); + if (!g_windowMgr.CloseWindow(WID_ROMAPWND)) { + g_windowMgr.EnsureWindow(WID_ROMAPWND); } return 0; case 453: { @@ -1007,16 +1009,16 @@ void UINpcTextEditDialogWnd::Paint() { // FUNCTION: fn_12365 int UINpcEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); return 0; } switch (message) { case UM_COMMAND: { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); - if (argument1 == 184 && this->edit->Length()) { - g_modeMgr.gameMode->SendMsg(99, this->unknown_00B8, std::atoi(this->edit->Text()), 0, 0); - g_windowMgr.CloseWindow(56); + if (argument1 == ID_OK && this->edit->Length()) { + g_modeMgr.gameMode->SendMsg(MM_SEND_NUMBER_TO_NPC, this->unknown_00B8, std::atoi(this->edit->Text()), 0, 0); + g_windowMgr.CloseWindow(WID_NPCEDITDIALOGWND); } return 0; } @@ -1032,13 +1034,13 @@ int UINpcEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg // OFFSET: 0x008FFD70 // FUNCTION: fn_12366 int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); return 0; } - if (message == 28) { + if (message == UM_SETNAID) { this->unknown_00B8 = static_cast(argument1); return 0; } @@ -1051,7 +1053,7 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->edit->SetText("임시"); } - if (argument1 != 184 || !this->edit->Length()) { + if (argument1 != ID_OK || !this->edit->Length()) { return 0; } @@ -1064,7 +1066,7 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t if (!g_forbiddenWords.Allows(this->edit->Text())) { this->edit->TextColor(RGB(255, 0, 0), 0xFFFFFFFF); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(14)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(14)), 0xFF, 0, 0, 0); return 0; } @@ -1072,23 +1074,23 @@ int UINpcTextEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t if (g_navigationLinkParser->HasLink(std::string(this->edit->Text())) || (!this->edit->LinkedText().empty() && this->m_tagCtrl && !this->m_tagCtrl->unknown_0140.empty())) { this->edit->SetText(""); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3042)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3042)), 0xFF, 0, 0, 0); return 0; } if (!this->edit->LinkedText().empty()) { - mode->SendMsg(164, this->unknown_00B8, reinterpret_cast(this->edit->Text()), reinterpret_cast(this->edit->LinkedText().c_str()), 0); + mode->SendMsg(MM_SEND_TEXT_TO_NPC, this->unknown_00B8, reinterpret_cast(this->edit->Text()), reinterpret_cast(this->edit->LinkedText().c_str()), 0); } else if (this->m_tagCtrl && !this->m_tagCtrl->unknown_0140.empty()) { if (g_navigationLinkParser->HasUnownedItemLink(std::string(this->m_tagCtrl->unknown_0140.c_str())) == true) { this->edit->SetText(""); return 0; } - mode->SendMsg(164, this->unknown_00B8, reinterpret_cast(this->edit->Text()), reinterpret_cast(this->m_tagCtrl->unknown_0140.c_str()), 0); + mode->SendMsg(MM_SEND_TEXT_TO_NPC, this->unknown_00B8, reinterpret_cast(this->edit->Text()), reinterpret_cast(this->m_tagCtrl->unknown_0140.c_str()), 0); } else { - mode->SendMsg(164, this->unknown_00B8, reinterpret_cast(this->edit->Text()), 0, 0); + mode->SendMsg(MM_SEND_TEXT_TO_NPC, this->unknown_00B8, reinterpret_cast(this->edit->Text()), 0, 0); } - g_windowMgr.CloseWindow(100); + g_windowMgr.CloseWindow(WID_NPCTEXTEDITDIALOGWND); return 0; } @@ -1128,21 +1130,21 @@ void UIPasswordWnd::Paint() { // OFFSET: 0x009002D0 // FUNCTION: fn_12367 int UIPartyInvitationToWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - if (argument1 == 184) { + if (argument1 == ID_OK) { std::string name; name = this->m_edit->Text(); this->m_edit->SelectAll(); if (std::strlen(name.c_str()) != 0) { - g_modeMgr.GetGameMode()->SendMsg(59, reinterpret_cast(name.c_str()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast(name.c_str()), 0, 0, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2072)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2072)), 0xFF, 0, 0, 0); } - } else if (argument1 == 185) { - g_windowMgr.CloseWindow(208); + } else if (argument1 == ID_CANCEL) { + g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND); } return 0; @@ -1156,42 +1158,42 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s switch (a) { case ID_OK: { if (this->m_mode != 50) { - g_windowMgr.CloseWindow(53); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } CMode* mode = g_modeMgr.GetGameMode(); if (g_session.PartyCount() != 0) { if (g_session.unknown_5464 != 0) { if (this->m_expShare != g_session.unknown_54A0 || this->m_itemShare != g_session.unknown_54A4 || this->m_itemDistribute != g_session.unknown_54A8) { - mode->SendMsg(259, this->m_expShare, this->m_itemShare, this->m_itemDistribute, 0); + mode->SendMsg(MM_GROUPINFO_CHANGE_V2, this->m_expShare, this->m_itemShare, this->m_itemDistribute, 0); } } return 0; } if (this->m_mode != 50) { - mode->SendMsg(168, 0, this->m_itemShare, this->m_itemDistribute, 0); + mode->SendMsg(MM_CONFORM_MAKEGROUP, 0, this->m_itemShare, this->m_itemDistribute, 0); return 0; } std::string name = this->m_nameEdit->Text(); if (name.find('#') != std::string::npos) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2839)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2839)), 0xFF, 0, 0, 0); } else if (name.find(s_partyItemLinkOpen) != std::string::npos || name.find(s_partyItemLinkClose) != std::string::npos) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2812)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2812)), 0xFF, 0, 0, 0); } else if (std::strlen(name.c_str()) != 0) { - mode->SendMsg(285, reinterpret_cast(name.c_str()), 0, 0, 0); - g_windowMgr.CloseWindow(53); - g_windowMgr.CloseWindow(207); - mode->SendMsg(168, 0, this->m_itemShare, this->m_itemDistribute, 0); + mode->SendMsg(MM_WHISPER_FILTER, reinterpret_cast(name.c_str()), 0, 0, 0); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_HEIGHT_220); + mode->SendMsg(MM_CONFORM_MAKEGROUP, 0, this->m_itemShare, this->m_itemDistribute, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2073)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2073)), 0xFF, 0, 0, 0); } return 0; } case ID_CANCEL: case ID_CLOSE: - g_windowMgr.CloseWindow(53); - g_windowMgr.CloseWindow(207); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_HEIGHT_220); return 0; case ID_RADIOBTN: if (g_session.PartyCount() == 0 || g_session.unknown_5464 != 0) { @@ -1199,9 +1201,9 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s for (int i = 0; i < 2; ++i) { if (sender == this->m_expShareButtons[i]) { this->m_expShare = i; - this->m_expShareButtons[i]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_expShareButtons[i]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->m_expShareButtons[i]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_expShareButtons[i]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } } @@ -1209,15 +1211,15 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s for (int i = 0; i < 2; ++i) { if (sender == this->m_itemShareButtons[i]) { this->m_itemShare = i; - this->m_itemShareButtons[i]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_itemShareButtons[i]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->m_itemShareButtons[i]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_itemShareButtons[i]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } } } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(294)), 0xFFFF64, 10, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(294)), 0xFFFF64, 10, 0, 0); } return 0; default: @@ -1232,20 +1234,20 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; case UM_REFRESH: if (this->m_mode == 5) { - g_windowMgr.CloseWindow(53); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } else { this->Invalidate(); this->m_expShare = g_session.unknown_54A0; this->m_itemShare = g_session.unknown_54A4; this->m_itemDistribute = g_session.unknown_54A8; for (int i = 0; i < 2; ++i) { - this->m_expShareButtons[i]->SendMsg(this, 13, this->m_expShare == i, 0, 0, 0); + this->m_expShareButtons[i]->SendMsg(this, UM_SETSTATE, this->m_expShare == i, 0, 0, 0); if (this->m_itemShareButtons[i]) { - this->m_itemShareButtons[i]->SendMsg(this, 13, this->m_itemShare == i, 0, 0, 0); + this->m_itemShareButtons[i]->SendMsg(this, UM_SETSTATE, this->m_itemShare == i, 0, 0, 0); } } if (this->m_itemDistributeButton) { - this->m_itemDistributeButton->SendMsg(this, 13, 1, 0, 0, 0); + this->m_itemDistributeButton->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } } break; @@ -1260,10 +1262,10 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s int UIPasswordWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: - if (a == 184) { + if (a == ID_OK) { CMode* mode = g_modeMgr.gameMode; - mode->SendMsg(45, this->unknown_00BC, reinterpret_cast(this->m_edit->Text()), 0, 0); - g_windowMgr.CloseWindow(29); + mode->SendMsg(MM_REQ_ENTER_ROOM, this->unknown_00BC, reinterpret_cast(this->m_edit->Text()), 0, 0); + g_windowMgr.CloseWindow(WID_PASSWORDWND); } return 0; case UM_SETROOMID: @@ -1374,7 +1376,7 @@ int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->m_skills.push_back(static_cast(argument1)); ITEM_INFO item; this->m_items.push_back(item); - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return 0; } case UM_SETCHOOSE: @@ -1388,9 +1390,9 @@ int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_scroll = previous - this->m_rows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_scroll = previous + this->m_rows - 1; } else { this->m_scroll = previous + static_cast(argument1); @@ -1404,26 +1406,26 @@ int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen case UM_COMMAND: { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); CMode* mode = g_modeMgr.gameMode; - if (argument1 == 184) { + if (argument1 == ID_OK) { const int selected = this->m_selected; if (selected < 0 || static_cast(selected) >= this->m_skills.size()) { return 0; } if (this->unknown_00FC != 0) { - mode->SendMsg(256, this->m_skills[selected], this->unknown_00FC, 0, 0); + mode->SendMsg(MM_SKILL_SELECT_RESPONSE, this->m_skills[selected], this->unknown_00FC, 0, 0); } else { - mode->SendMsg(163, this->m_skills[selected], 0, 0, 0); + mode->SendMsg(MM_SELECT_SPELL, this->m_skills[selected], 0, 0, 0); } - } else if (argument1 == 185) { + } else if (argument1 == ID_CANCEL) { if (this->unknown_00FC != 0) { - mode->SendMsg(256, 0, this->unknown_00FC, 0, 0); + mode->SendMsg(MM_SKILL_SELECT_RESPONSE, 0, this->unknown_00FC, 0, 0); } else { - mode->SendMsg(163, 0, 0, 0, 0); + mode->SendMsg(MM_SELECT_SPELL, 0, 0, 0, 0); } } else { return 0; } - g_windowMgr.CloseWindow(99); + g_windowMgr.CloseWindow(WID_SPELLLISTWND); return 0; } default: @@ -1555,7 +1557,7 @@ void UInCash_CallWnd::Paint() { // FUNCTION: fn_12264 void UIItemIdentifyWnd::OnLBtnDblClk(int x, int y) { this->OnLBtnDown(x, y); - this->SendMsg(nullptr, 6, 184, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OK, 0, 0, 0); } // OFFSET: 0x008F0750 @@ -1665,7 +1667,7 @@ void UIStatusWnd::Paint() { // FUNCTION: fn_12265 void UIStatusWnd::OnLBtnDblClk(int, int y) { if (y < 17) { - this->SendMsg(this, 6, 202, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_MINI, 0, 0, 0); } } @@ -1685,8 +1687,8 @@ void UIWhisperWnd::OnLBtnDblClk(int, int y) { EmptyClipboard(); SetClipboardData(CF_TEXT, memory); CloseClipboard(); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("C-Code copied to clipboard"), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("C-Code copied to clipboard"), 0x64FFFF, 0, 0, 0); } } @@ -1768,7 +1770,7 @@ void UIPetTamingDeceiveWnd::OnLBtnDown(int, int) { this->m_state = 1; this->m_frame = 7; this->m_started = 1; - g_modeMgr.GetGameMode()->SendMsg(149, this->m_target, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_PETDECEIVE_SHOOT, this->m_target, 0, 0, 0); } // OFFSET: 0x008EFB40 @@ -1982,11 +1984,11 @@ void UIMenuWnd::OnLBtnUp(int x, int y) { UIWindow* target = this->m_menuId == 301 ? g_windowMgr.FindSnapExcludedWindow(static_cast(this->unknown_00CC)) : g_windowMgr.LookupWindow(this->m_menuId); if (target) { - target->SendMsg(nullptr, 48, choice, 0, 0, 0); + target->SendMsg(nullptr, UM_MENU_SELECTED, choice, 0, 0, 0); } else if (this->m_menuId == 10041) { - g_modeMgr.gameMode->SendMsg(24, choice, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_MENUSELECTED, choice, 0, 0, 0); } - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } // OFFSET: 0x008F4520 @@ -2178,7 +2180,7 @@ int UIMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp // FUNCTION: fn_12073 void UITipboxWnd::ShowTip(int id) { g_itemTagOwner->SelectTip(id); - this->SendMsg(this, 6, 543, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 543, 0, 0, 0); g_windowMgr.Promote(this); } @@ -2210,23 +2212,23 @@ void UITipboxWnd::UpdatePageText() { void UIExchangeWnd::DragAndDrop(int x, int y, std::intptr_t value) { CMode* mode = g_modeMgr.GetGameMode(); if (this->unknown_00CC != 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 1) { if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 5, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 5, 0, 0, 0); return; } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x008D0010 @@ -2236,7 +2238,7 @@ void UIEquipWnd::DragAndDrop(int x, int y, std::intptr_t value) { return; } - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -2265,25 +2267,25 @@ void UIEquipWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 16: case 17: case 19: - mode->SendMsg(87, drag->id, item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_EQUIP_ARROW, drag->id, item.unknown_0000[2], 0, 0); break; default: if (fromStorage) { - mode->SendMsg(305, reinterpret_cast(&item), 0, 0, 0); + mode->SendMsg(MM_SWAP_EQUIPMENT_BY_INDEX, reinterpret_cast(&item), 0, 0, 0); } else if (item.identified && item.unknown_0000[2] != 0 && item.unknown_0000[3] == 0) { - mode->SendMsg(19, drag->id, item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_EQUIP, drag->id, item.unknown_0000[2], 0, 0); } break; } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x008D02D0 // FUNCTION: fn_12084 void UInCashWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -2295,25 +2297,25 @@ void UInCashWnd::DragAndDrop(int x, int y, std::intptr_t value) { if (x < 445) { const int quantity = g_session.GetItem1720QuantityByItemId(drag->name.c_str()); if (quantity < 2) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 20, quantity, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 20, quantity, 0, 0); return; } break; case 6: if (x > 444) { - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 19, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 19, 0, 0, 0); return; } break; } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x008D9F00 @@ -2344,7 +2346,7 @@ void UIExchangeWnd::LayoutButtons() { // FUNCTION: fn_12142 void UIEquipWnd::NotifyEquipmentChanged() { if (this->unknown_0124) { - this->unknown_0124->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0124->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -2422,7 +2424,7 @@ void UINpcTextEditDialogWnd::InsertSkillTag(int tagId) { void UICombinedCardItemCollectionWnd::Move(int x, int y) { UIFrameWnd::Move(x, y); if (UIWindow* comparison = g_windowMgr.unknown_0224) { - if (UIWindow* window = g_windowMgr.LookupWindow(82)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_COMBINEDCARDITEMCOLLECTIONWND)) { static_cast(comparison)->UIFrameWnd::Move(window->geometry.x - window->geometry.width, window->geometry.y); } } @@ -2439,7 +2441,7 @@ void UIEquipWnd::Move(int x, int y) { void UIItemCollectionWnd::Move(int x, int y) { UIFrameWnd::Move(x, y); if (UIWindow* comparison = g_windowMgr.unknown_0220) { - if (UIWindow* window = g_windowMgr.LookupWindow(12)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND)) { static_cast(comparison)->UIFrameWnd::Move(window->geometry.x - window->geometry.width, window->geometry.y); } } @@ -2486,7 +2488,7 @@ void UIItemCollectionWnd::OnProcess() { // FUNCTION: fn_12297 void UINotifyItemObtainWnd::OnProcess() { if (timeGetTime() > this->m_shownTick + 5000) { - g_windowMgr.CloseWindow(58); + g_windowMgr.CloseWindow(WID_NOTIFYITEMOBTAINWND); } } @@ -2501,7 +2503,7 @@ void UIPetTamingDeceiveWnd::OnProcess() { this->m_finishTime = timeGetTime(); } } else if (this->m_frame == frame && this->m_delay <= this->m_maxDelay && timeGetTime() - this->m_finishTime >= 2000) { - g_windowMgr.CloseWindow(91); + g_windowMgr.CloseWindow(WID_PETTAMINGDECEIVEWND); } } @@ -2531,16 +2533,16 @@ void UIItemIdentifyWnd::OnRBtnUp(int, int) { // OFFSET: 0x008F59A0 // FUNCTION: fn_12308 void UIWhisperWnd::OnRBtnUp(int, int) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } // OFFSET: 0x008F5A10 // FUNCTION: fn_12310 void UIExchangeWnd::OnWheel(int delta) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 7, 1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, 1, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 7, -1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, -1, 0, 0, 0); } } @@ -2549,9 +2551,9 @@ void UIExchangeWnd::OnWheel(int delta) { void UIEquipWnd::OnWheel(int delta) { if (g_session.unknown_80C8 > 4 && this->m_page == 3) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 8, 1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLHORZ, 1, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 8, -1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLHORZ, -1, 0, 0, 0); } } } @@ -2567,7 +2569,7 @@ void UIItemIdentifyWnd::OnWheel(int delta) { if (step > 3) { step = 3; } - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } // OFFSET: 0x008F6370 @@ -2643,7 +2645,7 @@ void UIExchangeWnd::CancelInput() { this->unknown_00C0->Move(129, 500); this->unknown_00C0 = nullptr; if (g_windowMgr.window_01C8) { - g_windowMgr.window_01C8->SendMsg(nullptr, 54, 0, 0, 0, 0); + g_windowMgr.window_01C8->SendMsg(nullptr, UM_GET_EDIT_FOCUS, 0, 0, 0, 0); } } this->Invalidate(); @@ -2670,11 +2672,11 @@ void UIComboBoxWnd::Resize(int width, int height) { // OFFSET: 0x008F9520 // FUNCTION: fn_12336 int UICombinedCardItemCollection_ComparisonWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 34) { + if (message != UM_SETINFO) { return this->UIItemCollectionWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - UIWindow* window = g_windowMgr.LookupWindow(82); + UIWindow* window = g_windowMgr.LookupWindow(WID_COMBINEDCARDITEMCOLLECTIONWND); if (window) { this->UIFrameWnd::Move(window->geometry.x - window->geometry.width, window->geometry.y); } @@ -2684,7 +2686,7 @@ int UICombinedCardItemCollection_ComparisonWnd::SendMsg(UIWindow* sender, int me // OFFSET: 0x008F9460 // FUNCTION: fn_12335 int UICombinedCardItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 34) { + if (message != UM_SETINFO) { return this->UIItemCollectionWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -2732,21 +2734,21 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a int found; ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found != 0) { - g_modeMgr.gameMode->SendMsg(0x7C, item.unknown_0000[1], this->m_compositionState, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_ITEMCOMPOSITION, item.unknown_0000[1], this->m_compositionState, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(0x7C, -1, -1, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_ITEMCOMPOSITION, -1, -1, 0, 0); } - g_windowMgr.CloseWindow(0x4A); + g_windowMgr.CloseWindow(WID_ITEMCOMPOSITIONWND); } break; case ID_CANCEL: - g_modeMgr.gameMode->SendMsg(0x7C, -1, -1, 0, 0); - g_windowMgr.CloseWindow(0x4A); + g_modeMgr.gameMode->SendMsg(MM_REQ_ITEMCOMPOSITION, -1, -1, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMCOMPOSITIONWND); break; } return 0; } - case 0x7B: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -2801,7 +2803,7 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_ADDITEM: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(b)); this->m_items.push_back(item); - this->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return 0; } case UM_COMMAND: { @@ -2815,14 +2817,14 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s int found; ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found != 0) { - g_modeMgr.gameMode->SendMsg(0x79, item.unknown_0000[1], 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_ITEMIDENTIFY, item.unknown_0000[1], 0, 0, 0); } - g_windowMgr.CloseWindow(0x49); + g_windowMgr.CloseWindow(WID_ITEMIDENTIFYWND); } break; case ID_CANCEL: - g_modeMgr.gameMode->SendMsg(0x79, -1, 0, 0, 0); - g_windowMgr.CloseWindow(0x49); + g_modeMgr.gameMode->SendMsg(MM_REQ_ITEMIDENTIFY, -1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMIDENTIFYWND); break; } return 0; @@ -2831,9 +2833,9 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_scroll = previous - this->m_rows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_scroll = previous + this->m_rows - 1; } else { this->m_scroll = previous + static_cast(a); @@ -2844,7 +2846,7 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } return this->m_scroll - previous; } - case 0x7B: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -2879,11 +2881,11 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // OFFSET: 0x008FD5F0 // FUNCTION: fn_12347 int UIItemCollection_ComparisonWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 34) { + if (message != UM_SETINFO) { return this->UIItemCollectionWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - UIWindow* window = g_windowMgr.LookupWindow(12); + UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND); if (window) { UIFrameWnd::Move(window->geometry.x - window->geometry.width, window->geometry.y); } @@ -2893,8 +2895,8 @@ int UIItemCollection_ComparisonWnd::SendMsg(UIWindow* sender, int message, std:: // OFFSET: 0x008F9570 // FUNCTION: fn_12337 int UIComboBoxIDWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (this->m_owner && message == 39) { - return this->m_owner->SendMsg(this, 39, argument1, argument2, argument3, argument4); + if (this->m_owner && message == UM_COMBOBOX_SELECTED) { + return this->m_owner->SendMsg(this, UM_COMBOBOX_SELECTED, argument1, argument2, argument3, argument4); } return this->m_list->SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -2902,8 +2904,8 @@ int UIComboBoxIDWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume // OFFSET: 0x008F95B0 // FUNCTION: fn_12338 int UIComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (this->m_owner && message == 39) { - return this->m_owner->SendMsg(this, 39, argument1, argument2, argument3, argument4); + if (this->m_owner && message == UM_COMBOBOX_SELECTED) { + return this->m_owner->SendMsg(this, UM_COMBOBOX_SELECTED, argument1, argument2, argument3, argument4); } return this->m_list->SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -2911,11 +2913,11 @@ int UIComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x008F97D0 // FUNCTION: fn_12340 int UIDisconnectedServerMsgWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - if (argument1 == 184) { - g_modeMgr.GetGameMode()->SendMsg(141, 0, 0, 0, 0); + if (argument1 == ID_OK) { + g_modeMgr.GetGameMode()->SendMsg(MM_QUIT_TO_IDENTRY, 0, 0, 0, 0); } return 0; } @@ -2985,7 +2987,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int if (this->m_page == 2 || this->m_page == 3) { if (this->unknown_0124 && this->unknown_0124->geometry.unknown_0030 != 0) { - this->SendMsg(nullptr, 6, 508, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 508, 0, 0, 0); } if (this->unknown_012C) { this->unknown_012C->SetState(0); @@ -2996,7 +2998,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int if (this->unknown_0124) { if (g_session.m_swapEquipmentMode == 1) { this->unknown_0124->geometry.unknown_0030 = 0; - this->SendMsg(nullptr, 6, 508, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 508, 0, 0, 0); } static_cast(this->unknown_0124)->unknown_00BC = this->m_page + 1; this->unknown_0124->Invalidate(); @@ -3040,7 +3042,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } } - this->SendMsg(this, 106, 575, 0, 0, 0); + this->SendMsg(this, UM_SET_DISABLE, 575, 0, 0, 0); this->Invalidate(); return 0; case UM_SETINFO: @@ -3049,7 +3051,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int reinterpret_cast(this->m_placement)->Reset(); } if (this->m_placement->height != this->m_placement->show && g_session.m_swapEquipmentMode == 0) { - this->SendMsg(nullptr, 6, 202, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } else { const int height = this->geometry.height + 20; this->m_placement->show = height; @@ -3102,26 +3104,26 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int return 0; } if (this->m_page == 1) { - g_modeMgr.gameMode->SendMsg(328, b, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CONFIG_CALL, b, 0, 0, 0); return 0; } - g_modeMgr.gameMode->SendMsg(253, b, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_OPEN_EQUIPEDITEM_CHANGE, b, 0, 0, 0); return 0; case ID_RADIOBTN: for (int index = 0; index < 4; ++index) { this->unknown_0138[index + 2]->Invalidate(); if (sender == this->unknown_0138[index + 2]) { this->unknown_015C = index; - this->unknown_0138[index + 2]->SendMsg(this, 13, 1, 0, 0, 0); + this->unknown_0138[index + 2]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->unknown_0138[index + 2]->SendMsg(this, 13, 0, 0, 0, 0); + this->unknown_0138[index + 2]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } return 0; case ID_EQUIP_OPTION_OFF: { if (g_windowMgr.unknown_0304 != nullptr) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(525)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(525)), 255, 0, 0, 0); return 0; } @@ -3141,17 +3143,17 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int if (enabled && notice.size() != 0) { if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); if (!menu) { return 0; } - menu->SendMsg(nullptr, 75, 0, 0, 0, 0); - menu->SendMsg(nullptr, 31, reinterpret_cast("Cart Off"), 0, 0, 0); - menu->SendMsg(nullptr, 31, reinterpret_cast(notice.c_str()), 0, 0, 0); - menu->SendMsg(nullptr, 83, 10, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast("Cart Off"), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(notice.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 10, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); static_cast(menu)->unknown_00DC = 1; int x = g_mouse.x + 1; int y = g_mouse.y + 1; @@ -3182,9 +3184,9 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int return 0; } case ID_EQUIP_OPTION_OPEN: - if ((g_replayAnimationScaling == 0 || Replay::Instance().header.options.Get(ReplayRecordOption::Item) != 0) && !g_windowMgr.LookupWindow(227) && - !g_windowMgr.CloseWindow(40) && g_session.unknown_5C1C > 0) { - g_windowMgr.EnsureWindow(40); + if ((g_replayAnimationScaling == 0 || Replay::Instance().header.options.Get(ReplayRecordOption::Item) != 0) && !g_windowMgr.LookupWindow(WID_MERGEITEMWND) && + !g_windowMgr.CloseWindow(WID_MERCHANTITEMWND) && g_session.unknown_5C1C > 0) { + g_windowMgr.EnsureWindow(WID_MERCHANTITEMWND); } return 0; case ID_APPLY: { @@ -3255,13 +3257,13 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int return 0; } case 582: - if (!g_windowMgr.CloseWindow(10001)) { - g_windowMgr.EnsureWindow(10001); + if (!g_windowMgr.CloseWindow(WID_EQUIPMENTPROPERTIESWND)) { + g_windowMgr.EnsureWindow(WID_EQUIPMENTPROPERTIESWND); } return 0; } return 0; - case 106: + case UM_SET_DISABLE: if (a == 575) { if (this->m_page == 1) { UIBitmapButton* button = this->unknown_0130; @@ -3437,7 +3439,7 @@ void UIEquipWnd::OnCreate(int width, int height) { this->unknown_0130->SetId(575); this->unknown_0130->SetTooltip(LookupMessage(0xF73)); this->AddChild(this->unknown_0130); - this->SendMsg(this, 106, 575, 0, 0, 0); + this->SendMsg(this, UM_SET_DISABLE, 575, 0, 0, 0); if (this->m_viewOther == 0) { this->m_tabs->AddTab(LookupMessage(0xF95), LookupMessage(0xF96)); @@ -3494,7 +3496,7 @@ void UIEquipWnd::OnCreate(int width, int height) { } else { radio->Move(index * 60 + 28, this->m_contentTop + 20); } - radio->SendMsg(this, 13, index == this->unknown_015C, 0, 0, 0); + radio->SendMsg(this, UM_SETSTATE, index == this->unknown_015C, 0, 0, 0); radio->SetText(labels[index]); const std::string unchecked("유저인터페이스\\tipbox\\checkBox.bmp"); const std::string checked("유저인터페이스\\tipbox\\checkBox_check.bmp"); @@ -3519,7 +3521,7 @@ void UIEquipWnd::OnCreate(int width, int height) { } if (g_session.m_swapEquipmentMode == 1) { - this->SendMsg(nullptr, 6, 508, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 508, 0, 0, 0); } } @@ -3553,12 +3555,12 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st this->RecordResponse(static_cast(a), b, c, d); switch (a) { case ID_OK: - g_windowMgr.CloseWindow(110); - g_modeMgr.gameMode->SendMsg(173, this->identity, 1, 0, 0); + g_windowMgr.CloseWindow(WID_BABYACCEPTWND2); + g_modeMgr.gameMode->SendMsg(MM_JOIN_BABY, this->identity, 1, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(110); - g_modeMgr.gameMode->SendMsg(173, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BABYACCEPTWND2); + g_modeMgr.gameMode->SendMsg(MM_JOIN_BABY, this->identity, 0, 0, 0); break; } return 0; @@ -3567,10 +3569,10 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st this->identity = static_cast(a); const std::string text = LookupMessage(2965); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* packet = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, packet, sizeof(header)); @@ -3603,12 +3605,12 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std this->RecordResponse(static_cast(a), b, c, d); switch (a) { case ID_OK: - g_windowMgr.CloseWindow(105); - g_windowMgr.EnsureWindow(110)->SendMsg(nullptr, 91, 184, b, 0, 0); + g_windowMgr.CloseWindow(WID_BABYACCEPTWND); + g_windowMgr.EnsureWindow(WID_BABYACCEPTWND2)->SendMsg(nullptr, UM_SET_BABY_MSG, 184, b, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(105); - g_modeMgr.gameMode->SendMsg(173, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BABYACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_BABY, this->identity, 0, 0, 0); break; } return 0; @@ -3620,10 +3622,10 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std text += ")"; text += LookupMessage(794); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* packet = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, packet, sizeof(header)); @@ -3640,7 +3642,7 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std std::memset(name, 0, sizeof(name)); std::memcpy(name, packet + offset, header.length); offset += header.length; - this->SendMsg(nullptr, 91, 0, reinterpret_cast(name), 0, 0); + this->SendMsg(nullptr, UM_SET_BABY_MSG, 0, reinterpret_cast(name), 0, 0); break; } default: @@ -3661,27 +3663,27 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_LEFTPUSH: - this->SendMsg(this, 6, 354, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_PREVIEW, 0, 0, 0); break; case UM_RIGHTPUSH: - this->SendMsg(this, 6, 355, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_NEXTVIEW, 0, 0, 0); break; case UM_COMMAND: switch (a) { case ID_CLOSE: - this->SendMsg(this, 6, 356, 0, 0, 0); - g_windowMgr.CloseWindow(106); + this->SendMsg(this, UM_COMMAND, ID_BOOKMARK, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BOOKWND); break; case ID_PREVIEW: if (this->m_autoRead == 0) { - this->SendMsg(this, 92, this->m_page == 1 ? 1 : this->m_page - 1, 0, 0, 0); + this->SendMsg(this, UM_READBOOK, this->m_page == 1 ? 1 : this->m_page - 1, 0, 0, 0); } break; case ID_NEXTVIEW: if (this->m_autoRead == 0) { - this->SendMsg(this, 92, this->m_page == this->m_pageCount ? this->m_page : this->m_page + 1, 0, 0, 0); + this->SendMsg(this, UM_READBOOK, this->m_page == this->m_pageCount ? this->m_page : this->m_page + 1, 0, 0, 0); } break; case ID_BOOKMARK: { @@ -3788,9 +3790,9 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp if (g_inlineCharset) { char* text = new char[this->m_lines[line].size() + 17]; std::sprintf(text, "%s%s", g_serverLanguage->Prefix(true), this->m_lines[line].c_str()); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text), 100, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 100, 0, 0); } else { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_lines[line].c_str()), 100, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->m_lines[line].c_str()), 100, 0, 0); } } this->Invalidate(); @@ -3824,7 +3826,7 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp g_windowMgr.Schedule(this->unknown_00B8); this->unknown_00B8 = nullptr; } - g_windowMgr.CloseWindow(106); + g_windowMgr.CloseWindow(WID_BOOKWND); break; } @@ -3843,16 +3845,16 @@ int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (this->geometry.visible != 0) { switch (response) { case ID_CANCEL: - g_modeMgr.gameMode->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(25); + g_modeMgr.gameMode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSESELLBUYWND); break; case ID_SELL: - g_modeMgr.gameMode->SendMsg(37, this->identity, 0, 0, 0); - g_windowMgr.LookupWindow(25)->Show(0); + g_modeMgr.gameMode->SendMsg(MM_ACK_SELL, this->identity, 0, 0, 0); + g_windowMgr.LookupWindow(WID_CHOOSESELLBUYWND)->Show(0); break; case ID_BUY: - g_modeMgr.gameMode->SendMsg(38, this->identity, 0, 0, 0); - g_windowMgr.LookupWindow(25)->Show(0); + g_modeMgr.gameMode->SendMsg(MM_ACK_BUY, this->identity, 0, 0, 0); + g_windowMgr.LookupWindow(WID_CHOOSESELLBUYWND)->Show(0); break; default: return 0; @@ -3867,7 +3869,7 @@ int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->identity = static_cast(a); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, bytes, sizeof(header)); @@ -3880,10 +3882,10 @@ int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (header.type == 20851) { static_cast(g_modeMgr.GetGameMode())->unknown_024C = 1; - this->SendMsg(nullptr, 28, 0, 0, 0, 0); - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(23); - g_windowMgr.CloseWindow(24); + this->SendMsg(nullptr, UM_SETNAID, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); break; } @@ -4430,7 +4432,7 @@ void UIMonsterDisplayWnd::OnCreate(int, int) { // OFFSET: 0x008E3090 // FUNCTION: fn_12179 void UIItemParamChangeDisplayWnd::OnCreate(int, int) { - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x008E3330 @@ -4593,7 +4595,7 @@ int ScaleByScreenHeight(int value) { // FUNCTION: fn_12389 int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 154: + case UM_RESOLVE_PLAYER_TAGS: this->m_chatHistory->ResolvePlayerTags(reinterpret_cast(a)); return 0; case UM_SETINFO: { @@ -4602,13 +4604,13 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i if (info->IsValid() == 0) { static_cast(this->unknown_0100)->Reset(); } - this->SendMsg(nullptr, 14, 7, this->unknown_0100->width, this->unknown_0100->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->unknown_0100->width, this->unknown_0100->height, 0); this->Move(this->unknown_0100->x, this->unknown_0100->y); return 0; } case UM_COMMAND: { - if (a != 184) { - if (a == 201) { + if (a != ID_OK) { + if (a == ID_CLOSE) { g_windowMgr.Schedule(this); } return 0; @@ -4616,7 +4618,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i if (HasItemLinkTag(std::string(this->m_edit->Text())) == true) { this->m_edit->SetText(""); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3042)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3042)), 0xFF, 0, 0, 0); return 0; } @@ -4629,7 +4631,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } if (g_serviceType == 1 && !ValidateCharacterName(text)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(190)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(190)), 0xFF, 0, 0, 0); return 0; } @@ -4650,7 +4652,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } else if (talkType == 51) { this->SaveChatLog(); } else { - g_modeMgr.gameMode->SendMsg(42, talkType, reinterpret_cast(parts), 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, talkType, reinterpret_cast(parts), 0, 0); } return 0; } @@ -4663,7 +4665,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i g_windowMgr.unknown_04DC.assign(text, std::strlen(text)); } - g_modeMgr.gameMode->SendMsg(11, reinterpret_cast(this->m_target.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(this->m_target.c_str()), 0, 0, 0); return 0; } case UM_MENU_SELECTED: @@ -4674,7 +4676,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case UM_MAKEMENU: { this->m_log.clear(); if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } this->m_log.push_back(WhisperLogLine{std::string(LookupMessage(312)), 11}); @@ -4682,16 +4684,16 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->m_log.push_back(WhisperLogLine{std::string(LookupMessage(358)), 21}); } - g_modeMgr.gameMode->SendMsg(101, reinterpret_cast(this->m_target.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_INITWHISPERMENU, reinterpret_cast(this->m_target.c_str()), 0, 0, 0); if (this->m_log.empty()) { return 0; } - UIWindow* menu = g_windowMgr.EnsureWindow(0x12); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (unsigned index = 0; index < this->m_log.size(); ++index) { - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(this->m_log[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_log[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 0x1E, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); menu->Move( std::min(std::max(g_mouse.x + 1, 1), g_renderer->viewport.width - menu->geometry.width), std::min(std::max(g_mouse.y + 1, 1), g_renderer->viewport.height - menu->geometry.height) @@ -4716,12 +4718,12 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } case UM_PAGEUPPUSH: if (this->m_chatHistory->verticalOverflow != 0) { - this->m_chatHistory->SendMsg(nullptr, 9, 0, 0, 0, 0); + this->m_chatHistory->SendMsg(nullptr, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } return 0; case UM_PAGEDOWNPUSH: if (this->m_chatHistory->verticalOverflow != 0) { - this->m_chatHistory->SendMsg(nullptr, 10, 0, 0, 0, 0); + this->m_chatHistory->SendMsg(nullptr, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } return 0; case UM_RESIZE: @@ -4781,8 +4783,8 @@ void UIWhisperWnd::SaveChatLog() { if (this->m_chatHistory->SaveChatLog(path)) { std::string message(path); message += " is Saved."; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); } } @@ -4829,21 +4831,21 @@ std::vector MakeFramedMessage(std::uint16_t type, const std::vect // FUNCTION: fn_12373 int UIQuitWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { CMode* mode = g_modeMgr.GetGameMode(); - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } switch (argument1) { case ID_RESTART: - mode->SendMsg(25, 1, 0, 0, 0); - g_windowMgr.CloseWindow(48); + mode->SendMsg(MM_RESTART, 1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_QUITWND); break; case ID_EXIT: - mode->SendMsg(88, 0, 0, 0, 0); - g_windowMgr.CloseWindow(48); + mode->SendMsg(MM_QUIT_GAME, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_QUITWND); break; case ID_CANCEL: - g_windowMgr.CloseWindow(48); + g_windowMgr.CloseWindow(WID_QUITWND); break; } @@ -4854,25 +4856,25 @@ int UIQuitWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s // FUNCTION: fn_12374 int UIRestartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { CMode* mode = g_modeMgr.GetGameMode(); - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } switch (argument1) { case ID_TO_CHARACTER_SELECT: - mode->SendMsg(25, 1, 0, 0, 0); - g_windowMgr.CloseWindow(19); - g_windowMgr.CloseWindow(269); + mode->SendMsg(MM_RESTART, 1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_RESTARTWND); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); break; case ID_RESTART: - mode->SendMsg(25, 0, 0, 0, 0); + mode->SendMsg(MM_RESTART, 0, 0, 0, 0); [[fallthrough]]; case ID_CANCEL: - g_windowMgr.CloseWindow(19); + g_windowMgr.CloseWindow(WID_RESTARTWND); break; case ID_QUIT: - g_windowMgr.CloseWindow(19); - mode->SendMsg(88, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_RESTARTWND); + mode->SendMsg(MM_QUIT_GAME, 0, 0, 0, 0); break; } @@ -4882,16 +4884,16 @@ int UIRestartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 // OFFSET: 0x00909830 // FUNCTION: fn_12392 int UInCash_CallWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, a, b, c, d); } - if (a == 192) { + if (a == ID_STATUS) { if (g_session.unknown_5912) { - g_modeMgr.GetGameMode()->SendMsg(331, 2, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STOVE_AUTHENTICATION, 2, 0, 0, 0); return 0; } - g_modeMgr.GetGameMode()->SendMsg(323, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQUEST_CASH_SHOP, 0, 0, 0, 0); } return 0; } @@ -4901,7 +4903,7 @@ int UInCash_CallWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std void UIEquipWnd::UpdateCharacterView(int reset) { CMode* mode = g_modeMgr.gameMode; if (!reset && g_session.unknown_5C1C > 0) { - mode->SendMsg(80, 6, 0, 0, 0); + mode->SendMsg(MM_REQ_CARTOFF, 6, 0, 0, 0); return; } @@ -4916,7 +4918,7 @@ void UIEquipWnd::UpdateCharacterView(int reset) { StateFlag25(g_session.m_jobFlags) || StateFlag26(g_session.m_jobFlags)) { view = 1; } - mode->SendMsg(80, view, 0, 0, 0); + mode->SendMsg(MM_REQ_CARTOFF, view, 0, 0, 0); } // OFFSET: 0x009099C0 @@ -4936,7 +4938,7 @@ void __stdcall Nullsub314(int, int, int) { // FUNCTION: fn_12397 void UIWaitWnd::SetMessage(const char* text, int, int) { this->m_textViewer->Clear(); - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(text), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 38, 0, 0); } // OFFSET: 0x00909CE0 @@ -5069,7 +5071,7 @@ void UInCashWnd::StoreInfo() { // FUNCTION: fn_12375 int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2730)), 0x64FFFF, 0, 0, 0); return 0; } @@ -5083,10 +5085,10 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->Move(this->m_placement->x, this->m_placement->y); return 0; case UM_UPPUSH: - this->m_viewer->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_DOWNPUSH: - this->m_viewer->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, this->unknown_00C8); @@ -5102,7 +5104,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: *reinterpret_cast(&g_session.unknown_5490[0x04]) = tick; g_modeMgr.gameMode->SendMsg(this->unknown_00C8, this->unknown_00CC, 218, 0, 0); this->unknown_00D4 = 1; - this->SendMsg(nullptr, 32, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DISABLENEXTBUTTON, 0, 0, 0, 0); break; } case 600: @@ -5119,20 +5121,20 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: static_cast(this->m_viewer)->Clear(); this->unknown_00D4 = 0; } - this->m_viewer->SendMsg(nullptr, 29, a, c, 1, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, a, c, 1, 0); } this->unknown_00CC = static_cast(b); return 0; case UM_ENABLENEXTBUTTON: this->m_message0 = 218; this->unknown_00C8 = 22; - this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_next"), 0, 0); + this->SendMsg(nullptr, UM_ADD_BUTTON, 218, reinterpret_cast("btn_next"), 0, 0); this->Invalidate(); return 0; case UM_ENABLECLOSEBUTTON: this->m_message0 = 201; this->unknown_00C8 = 89; - this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_close"), 0, 0); + this->SendMsg(nullptr, UM_ADD_BUTTON, 218, reinterpret_cast("btn_close"), 0, 0); this->Invalidate(); return 0; case UM_ADD_BUTTON: { @@ -5151,7 +5153,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } case UM_DISABLENEXTBUTTON: this->m_message0 = 600; - this->SendMsg(nullptr, 86, 218, 0, 0, 0); + this->SendMsg(nullptr, UM_DELETE_BUTTON, 218, 0, 0, 0); this->Invalidate(); return 0; case UM_DELETE_BUTTON: @@ -5164,7 +5166,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } return 0; - case 123: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -5181,7 +5183,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: std::memset(text, 0, sizeof(text)); std::memcpy(text, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 26, reinterpret_cast(text), 0, 0, 0); + this->SendMsg(nullptr, UM_SETSAYDIALOG, reinterpret_cast(text), 0, 0, 0); break; } case 22504: @@ -5252,10 +5254,10 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: if (amount > g_session.m_zeny) { amount = g_session.m_zeny; } - mode->SendMsg(51, 0, g_session.unknown_5210 + amount, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, 0, g_session.unknown_5210 + amount, 0, 0); this->CancelInput(); } - mode->SendMsg(52, 0, 0, 0, 0); + mode->SendMsg(MM_CONCLUDE_EXCHANGE_ITEM, 0, 0, 0, 0); this->unknown_00D4 = 1; return 0; case ID_EXCHANGE: @@ -5264,9 +5266,9 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } if (this->unknown_011C) { const std::string text = FormatOwnedString(LookupMessage(1832), this->unknown_00F0.c_str()); - g_modeMgr.gameMode->SendMsg(68, reinterpret_cast(text.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SCREENSHOT, reinterpret_cast(text.c_str()), 0, 0, 0); } - mode->SendMsg(54, 0, 0, 0, 0); + mode->SendMsg(MM_EXEC_EXCHANGE_ITEM, 0, 0, 0, 0); this->unknown_00D8 = 1; this->LayoutButtons(); return 0; @@ -5274,7 +5276,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: if (this->unknown_00DC != 0) { return 0; } - mode->SendMsg(53, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); this->unknown_00DC = 1; return 0; case ID_RIGHT: { @@ -5288,7 +5290,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: if (amount > g_session.m_zeny) { amount = g_session.m_zeny; } - mode->SendMsg(51, 0, g_session.unknown_5210 + amount, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, 0, g_session.unknown_5210 + amount, 0, 0); this->CancelInput(); return 0; } @@ -5312,11 +5314,11 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - mode->SendMsg(51, mode->drag.id, mode->drag.quantity, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header{}; std::memcpy(&header, records, sizeof(header)); @@ -5341,46 +5343,46 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: std::memset(name, 0, sizeof(name)); std::memcpy(name, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 50, reinterpret_cast(name), number, level, 0); + this->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(name), number, level, 0); break; } case 20605: std::memcpy(&this->unknown_00CC, records + position, header.length); position += header.length; if (this->unknown_00CC != 0) { - this->SendMsg(nullptr, 51, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MYDRAGCLOSED, 0, 0, 0, 0); } break; case 20606: std::memcpy(&this->unknown_00D0, records + position, header.length); position += header.length; if (this->unknown_00D0 != 0) { - this->SendMsg(nullptr, 52, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_OTHERDRAGCLOSED, 0, 0, 0, 0); } break; case 20607: std::memcpy(&this->unknown_00D4, records + position, header.length); position += header.length; if (this->unknown_00D4 != 0) { - this->SendMsg(nullptr, 6, 184, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OK, 0, 0, 0); } break; case 20608: std::memcpy(&this->unknown_00D8, records + position, header.length); position += header.length; if (this->unknown_00D8 != 0) { - this->SendMsg(nullptr, 6, 230, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_EXCHANGE, 0, 0, 0); } break; case 20609: std::memcpy(&this->unknown_00DC, records + position, header.length); position += header.length; if (this->unknown_00DC != 0) { - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); } break; case 20601: - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; default: position += header.length; @@ -5402,7 +5404,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: int UIGraffiStrboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: { - if (a == 184) { + if (a == ID_OK) { struct { int area[4]; const char* text; @@ -5412,8 +5414,8 @@ int UIGraffiStrboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s request.area[2] = this->area[2]; request.area[3] = this->area[3]; request.text = this->edit->Text(); - g_modeMgr.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); - } else if (a != 185) { + g_modeMgr.GetGameMode()->SendMsg(MM_USE_SKILL_TOGROUND_WITH_TALKBOX, reinterpret_cast(&request), 0, 0, 0); + } else if (a != ID_CANCEL) { return 0; } @@ -5536,13 +5538,13 @@ void UIStatusWnd::ValidatePlacement() { } } - this->SendMsg(nullptr, 35, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } // OFFSET: 0x008FEAA0 // FUNCTION: fn_12354 int UILoadingWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 17) { + if (message == UM_LOADINGPERCENT) { char text[100]; std::sprintf(text, "Loading %d %s", static_cast(argument1), "%"); this->m_progressBar->SetValue(static_cast(argument1)); @@ -5577,8 +5579,8 @@ void UISayDialogWnd::OnCreate(int width, int height) { int UIMonsterDisplayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: { - if (argument1 == 201) { - g_windowMgr.CloseWindow(201); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_MONSTERDISPLAYWND); } return 0; } @@ -5596,11 +5598,11 @@ int UIMonsterDisplayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar // OFFSET: 0x008FFBA0 // FUNCTION: fn_12362 int UINotifyJobLevelUpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, a, b, c, d); } - if (a == 192) { - g_windowMgr.Promote(g_windowMgr.EnsureWindow(37)); + if (a == ID_STATUS) { + g_windowMgr.Promote(g_windowMgr.EnsureWindow(WID_SKILLLISTWND)); } return 0; } @@ -5608,7 +5610,7 @@ int UINotifyJobLevelUpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x008E0A20 // FUNCTION: fn_12173 void UIExchangeWnd::OnCreate(int, int) { - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->unknown_00CC = 0; this->unknown_00D0 = 0; this->unknown_00D4 = 0; @@ -5696,8 +5698,8 @@ void UIChatRoomMakeWnd::Paint() { // FUNCTION: fn_12161 void UIChatRoomMakeWnd::OnCreate(int width, int height) { if (g_session.IsTrickDeadActive()) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x295)), 0xFF, 0, 0, 0); - g_windowMgr.CloseWindow(0x1B); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x295)), 0xFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHATROOMMAKEWND); } this->m_limit = 20; @@ -5802,7 +5804,7 @@ void UIChatRoomMakeWnd::OnCreate(int width, int height) { this->m_publicButtons[index]->SetSize(width, 12); this->m_publicButtons[index]->Move(x, 70); this->m_publicButtons[index]->SetText(labels[index]); - this->m_publicButtons[index]->SendMsg(this, 13, states[index], 0, 0, 0); + this->m_publicButtons[index]->SendMsg(this, UM_SETSTATE, states[index], 0, 0, 0); this->AddChild(this->m_publicButtons[index]); } @@ -5831,7 +5833,7 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s switch (a) { case ID_OK: { if (g_windowMgr.HasTitleAtActorCell(g_session.m_aid)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(661)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(661)), 0xFF, 0, 0, 0); break; } @@ -5852,8 +5854,8 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s setting.roomId = -1; setting.title = this->m_titleEdit->Text(); setting.password = this->m_passwordEdit->Text(); - g_modeMgr.gameMode->SendMsg(43, reinterpret_cast(&setting), 0, 0, 0); - g_windowMgr.CloseWindow(27); + g_modeMgr.gameMode->SendMsg(MM_CREATE_CHATROOM, reinterpret_cast(&setting), 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHATROOMMAKEWND); break; } g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); @@ -5861,44 +5863,44 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } case ID_CANCEL: case ID_CLOSE: - g_windowMgr.CloseWindow(27); + g_windowMgr.CloseWindow(WID_CHATROOMMAKEWND); break; case ID_RADIOBTN: for (int i = 0; i < 2; ++i) { this->m_publicButtons[i]->Invalidate(); if (sender == this->m_publicButtons[i]) { this->m_public = i; - this->m_publicButtons[i]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_publicButtons[i]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->m_publicButtons[i]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_publicButtons[i]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } break; case ID_NUMCOMBO: case ID_CLASSCOMBO: { if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } - UIWindow* list = g_windowMgr.EnsureWindow(26); + UIWindow* list = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); int count = 1; - if (a == 228) { + if (a == ID_NUMCOMBO) { this->m_listKind = 0; count = static_cast(this->m_limitLabels.size()); for (unsigned int i = 0; i < this->m_limitLabels.size(); ++i) { - list->SendMsg(nullptr, 31, reinterpret_cast(this->m_limitLabels[i].c_str()), 0, 0, 0); + list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_limitLabels[i].c_str()), 0, 0, 0); } - } else if (a == 229) { + } else if (a == ID_CLASSCOMBO) { this->m_listKind = 1; count = static_cast(this->m_typeLabels.size()); for (unsigned int i = 0; i < this->m_typeLabels.size(); ++i) { - list->SendMsg(nullptr, 31, reinterpret_cast(this->m_typeLabels[i].c_str()), 0, 0, 0); + list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_typeLabels[i].c_str()), 0, 0, 0); } } const int height = count * 16; - list->SendMsg(nullptr, 40, 0, 0, 0, 0); + list->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); list->Resize(74, height > 48 ? 48 : height); - list->SendMsg(nullptr, 83, 27, 0, 0, 0); + list->SendMsg(nullptr, UM_SET_CALLER_WID, 27, 0, 0, 0); int x = this->m_listKind * 137 + 44; int y = 64; this->ToScreen(x, y); @@ -5946,8 +5948,8 @@ int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, setting.roomId = -1; setting.title = this->m_titleEdit->Text(); setting.password = this->m_passwordEdit->Text(); - g_modeMgr.gameMode->SendMsg(44, reinterpret_cast(&setting), 0, 0, 0); - g_windowMgr.CloseWindow(30); + g_modeMgr.gameMode->SendMsg(MM_CHANGE_CHATROOM, reinterpret_cast(&setting), 0, 0, 0); + g_windowMgr.CloseWindow(WID_CHATROOMCHANGEWND); return 0; } g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); @@ -5955,33 +5957,33 @@ int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } case ID_CANCEL: case ID_CLOSE: - g_windowMgr.CloseWindow(30); + g_windowMgr.CloseWindow(WID_CHATROOMCHANGEWND); return 0; case ID_NUMCOMBO: case ID_CLASSCOMBO: { if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } - UIWindow* list = g_windowMgr.EnsureWindow(26); + UIWindow* list = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); int count = 1; - if (a == 228) { + if (a == ID_NUMCOMBO) { this->m_listKind = 0; count = static_cast(this->m_limitLabels.size()); for (unsigned int i = 0; i < this->m_limitLabels.size(); ++i) { - list->SendMsg(nullptr, 31, reinterpret_cast(this->m_limitLabels[i].c_str()), 0, 0, 0); + list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_limitLabels[i].c_str()), 0, 0, 0); } - } else if (a == 229) { + } else if (a == ID_CLASSCOMBO) { this->m_listKind = 1; count = static_cast(this->m_typeLabels.size()); for (unsigned int i = 0; i < this->m_typeLabels.size(); ++i) { - list->SendMsg(nullptr, 31, reinterpret_cast(this->m_typeLabels[i].c_str()), 0, 0, 0); + list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_typeLabels[i].c_str()), 0, 0, 0); } } const int height = count * 16; - list->SendMsg(nullptr, 40, 0, 0, 0, 0); + list->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); list->Resize(74, height > 48 ? 48 : height); - list->SendMsg(nullptr, 83, 30, 0, 0, 0); + list->SendMsg(nullptr, UM_SET_CALLER_WID, 30, 0, 0, 0); int x = this->m_listKind * 137 + 44; int y = 64; this->ToScreen(x, y); @@ -6002,7 +6004,7 @@ int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->m_public = setting->isPublic == 0; for (int i = 0; i < 2; ++i) { this->m_publicButtons[i]->Invalidate(); - this->m_publicButtons[i]->SendMsg(this, 13, i == this->m_public ? 1 : 0, 0, 0, 0); + this->m_publicButtons[i]->SendMsg(this, UM_SETSTATE, i == this->m_public ? 1 : 0, 0, 0, 0); } this->m_closeButton->SetTooltip(""); this->Invalidate(); @@ -6059,11 +6061,11 @@ void UIPasswordWnd::Show(int visible) { // OFFSET: 0x00907610 // FUNCTION: fn_12387 int UIToolTipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - if (argument1 == 184 || argument1 == 185) { + if (argument1 == ID_OK || argument1 == ID_CANCEL) { g_windowMgr.Schedule(this); } @@ -6075,7 +6077,7 @@ int UIToolTipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 int UIPetTamingDeceiveWnd::SendMsg( UIWindow*, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message == 80) { + if (message == UM_SET_TARGET) { if (argument1 == 0) { this->m_target = static_cast(argument2); return 0; @@ -6109,8 +6111,8 @@ void UIStatusWnd::StoreInfo() { int UIWaitWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 185) { - g_modeMgr.gameMode->SendMsg(10021, 0, 0, 0, 0); + if (argument1 == ID_CANCEL) { + g_modeMgr.gameMode->SendMsg(LMM_DISCONNECT_ACSVR, 0, 0, 0, 0); } break; case UM_ENABLE_CANCEL: @@ -6128,10 +6130,10 @@ int UINoticeConfirmWnd::SendMsg( ) { switch (message) { case UM_COMMAND: { - if (argument1 == 184) { + if (argument1 == ID_OK) { g_modeMgr.gameMode->SendMsg(this->m_event, 0, 0, 0, 0); - } else if (argument1 == 185) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + } else if (argument1 == ID_CANCEL) { + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } return 0; @@ -6204,7 +6206,7 @@ void UIItemCollectionWnd::SetHeight(int height) { } else { this->m_moveInfo->Move(-1000, -1000); } - this->m_viewer->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); } class UIAutoMessageWnd : public UIFrameWnd { @@ -6227,11 +6229,11 @@ void UIAutoMessageWnd::Paint() { // OFFSET: 0x008FFC40 // FUNCTION: fn_12364 int UINotifyQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, a, b, c, d); } - if (a == 192) { - if (UIWindow* window = g_windowMgr.EnsureWindow(0x2718)) { + if (a == ID_STATUS) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_RENEWQUESTUI)) { g_windowMgr.Promote(window); } } @@ -6273,7 +6275,7 @@ void UInCashWnd::OnCreate(int width, int height) { this->m_pageCount = 1; this->m_page = 1; g_session.ClearItems1784(10); - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); this->AddCloseButton("Alt+X", 0); const int titleWidth = this->TextWidth(LookupMessage(0x817), 0, 0, 12, 1, 0); @@ -6409,11 +6411,11 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Move(this->m_placement->x, this->m_placement->y); return 0; - case 122: + case UM_UPDATE_CASHSHOP_BALANCE: this->m_pointBalance = argument1; this->m_cashBalance = argument2; this->m_pointEdit->SetText("0"); - this->SendMsg(this, 6, 386, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 386, 0, 0, 0); return 0; case 120: { @@ -6442,17 +6444,17 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } this->m_pointBalance = argument1; this->m_cashBalance = argument2; - this->SendMsg(this, 121, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH_PAGES, 0, 0, 0, 0); return 0; } - case 121: + case UM_REFRESH_PAGES: this->m_pageCount = (g_session.GetList1788(this->m_tab) + 7) / 8; if (this->m_pageCount < 1) { this->m_pageCount = 1; } this->m_page = 1; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; case UM_SCROLLVERT: @@ -6565,7 +6567,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } else { notice = 1860; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(notice)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(notice)), 0xFF, 0, 0, 0); return 0; } @@ -6573,7 +6575,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, NCashClosePacket packet; packet.packetType = 0x84A; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetType), &packet); - g_windowMgr.CloseWindow(184); + g_windowMgr.CloseWindow(WID_NCASHWND); return 0; } @@ -6595,7 +6597,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, g_windowMgr.Confirm(LookupMessage(1069), 0, true, false, 0, "Message", 280, 120, 0); } this->m_searchEdit->SetText(""); - this->SendMsg(this, 6, 398, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 398, 0, 0, 0); } return 0; } @@ -6667,7 +6669,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, RegSetValueExA(handle, "CASH_CATEGORY", 0, REG_DWORD, reinterpret_cast(&this->m_tab), 4); RegCloseKey(handle); } - this->SendMsg(this, 121, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH_PAGES, 0, 0, 0, 0); return 0; } @@ -6697,7 +6699,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } } else if (mode->drag.source == 6) { if (g_session.GetList2Size() >= 8) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (this->m_tab == 8) { @@ -6706,7 +6708,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, if (std::atoi(entry.itemId.c_str()) == std::atoi(mode->drag.name.c_str())) { if (entry.quantity <= 0) { g_windowMgr.Confirm(LookupMessage(2523), 0, true, false, 0, "Message", 280, 120, 0); - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (mode->drag.quantity + owned > entry.quantity) { @@ -6748,7 +6750,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_otherItems.push_back(other); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -6765,9 +6767,9 @@ void UInCashWnd::OnWheel(int delta) { return; } if (delta < 0) { - this->SendMsg(this, 10, 0, 0, 0, 0); + this->SendMsg(this, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } else { - this->SendMsg(this, 9, 0, 0, 0, 0); + this->SendMsg(this, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } } @@ -6836,13 +6838,13 @@ __declspec(noinline) int UIItemCollectionWnd::CardSlotAt(int x, int y, int* slot // OFFSET: 0x008FFBE0 // FUNCTION: fn_12363 int UINotifyLevelUpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, a, b, c, d); } - if (a == 192) { - UIWindow* window = g_windowMgr.EnsureWindow(11); + if (a == ID_STATUS) { + UIWindow* window = g_windowMgr.EnsureWindow(WID_STATUSWND); if (window->geometry.height == 17) { - window->SendMsg(nullptr, 6, 0xCA, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } g_windowMgr.Promote(window); } @@ -6927,7 +6929,7 @@ ITEM_INFO UIEquipWnd::ItemEntryAt(int x, int y) { // FUNCTION: fn_12263 void UIEquipWnd::OnLBtnDblClk(int x, int y) { if (y < 17) { - this->SendMsg(this, 6, 202, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_MINI, 0, 0, 0); } if (this->m_viewOther != 0) { @@ -6937,7 +6939,7 @@ void UIEquipWnd::OnLBtnDblClk(int x, int y) { ITEM_INFO item = this->ItemIconAt(x, y); if (item.unknown_0000[1] != 0 && item.quantity > 0) { const EquipSlots slots = g_session.GetEquipSlots(static_cast(item.unknown_0000[3])); - g_modeMgr.gameMode->SendMsg(20, slots.values[2], this->m_page == 1, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_TAKE_OFF_EQUIP, slots.values[2], this->m_page == 1, 0, 0); } } @@ -7005,7 +7007,7 @@ void UIEquipWnd::OnMouseHover(int x, int y) { void UIEquipWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->ItemEntryAt(x, y); if (item.unknown_0000[1] != 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -7061,8 +7063,8 @@ void UIExchangeWnd::OnMouseHover(int x, int y) { void UIExchangeWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->ItemAt(x, y); if (item.unknown_0000[1] != 0) { - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -7209,7 +7211,7 @@ void UInCashWnd::OnLBtnDown(int x, int y) { void UInCashWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->ItemAt(x, y); if (item.unknown_0000[1] != 0 && this->m_selected >= 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -7475,7 +7477,7 @@ void UIPartySettingWnd::OnCreate(int width, int height) { this->m_expShareButtons[i]->SetSize(160, g_serviceType == 12 ? 17 : 12); this->m_expShareButtons[i]->Move(20, y); this->m_expShareButtons[i]->SetText(texts[i]); - this->m_expShareButtons[i]->SendMsg(this, 13, this->m_expShare == i, 0, 0, 0); + this->m_expShareButtons[i]->SendMsg(this, UM_SETSTATE, this->m_expShare == i, 0, 0, 0); this->AddChild(this->m_expShareButtons[i]); if (g_session.unknown_5464 == 0) { this->m_expShareButtons[i]->enabled = 0; @@ -7497,7 +7499,7 @@ void UIPartySettingWnd::OnCreate(int width, int height) { this->m_itemShareButtons[i]->SetSize(160, g_serviceType == 12 ? 17 : 12); this->m_itemShareButtons[i]->SetText(texts[i]); this->m_itemShareButtons[i]->Move(20, this->m_mode + offset + 37); - this->m_itemShareButtons[i]->SendMsg(this, 13, this->m_itemShare == i, 0, 0, 0); + this->m_itemShareButtons[i]->SendMsg(this, UM_SETSTATE, this->m_itemShare == i, 0, 0, 0); this->m_itemShareButtons[i]->enabled = g_session.PartyCount() == 0; if (g_session.unknown_5464 != 0) { this->m_itemShareButtons[i]->enabled = 1; @@ -7510,7 +7512,7 @@ void UIPartySettingWnd::OnCreate(int width, int height) { this->m_itemDistributeButton->SetSize(160, g_serviceType == 12 ? 17 : 12); this->m_itemDistributeButton->Move(20, this->m_mode + 102); this->m_itemDistributeButton->SetText(LookupMessage(739)); - this->m_itemDistributeButton->SendMsg(this, 13, 1, 0, 0, 0); + this->m_itemDistributeButton->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_itemDistributeButton->enabled = g_session.PartyCount() == 0; if (g_session.unknown_5464 != 0) { this->m_itemDistributeButton->enabled = 1; @@ -7590,15 +7592,15 @@ int UIJoinGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->RecordResponse(static_cast(a), b, c, d); switch (a) { case ID_OK: - g_windowMgr.CloseWindow(70); - g_windowMgr.CloseWindow(214); - g_windowMgr.CloseWindow(213); - g_windowMgr.CloseWindow(212); - g_modeMgr.gameMode->SendMsg(114, this->identity, 1, 0, 0); + g_windowMgr.CloseWindow(WID_JOINGUILDACCEPTWND); + g_windowMgr.CloseWindow(WID_GUILDTIPWND); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_0); + g_windowMgr.CloseWindow(WID_GUILDHELPERWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_GUILD, this->identity, 1, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(70); - g_modeMgr.gameMode->SendMsg(114, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_JOINGUILDACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_GUILD, this->identity, 0, 0, 0); break; } break; @@ -7616,10 +7618,10 @@ int UIJoinGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a text += ")"; text += LookupMessage(377); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); break; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, bytes, sizeof(header)); @@ -7635,7 +7637,7 @@ int UIJoinGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a char name[260] = {}; std::memcpy(name, bytes + offset, header.length); offset += header.length; - this->SendMsg(nullptr, 73, 0, reinterpret_cast(name), 0, 0); + this->SendMsg(nullptr, UM_SET_JOIN_GUILD_MSG, 0, reinterpret_cast(name), 0, 0); break; } default: @@ -7705,7 +7707,7 @@ void UINoticeConfirmWnd::OnCreate(int width, int height) { this->m_viewer->textColor = 0xFF000000u | RGB(red, green, blue); this->m_viewer->Invalidate(); this->AddChild(this->m_viewer); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(0)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(0)), 38, 0, 0); } // OFFSET: 0x008E4390 @@ -7869,7 +7871,7 @@ void UIWaitWnd::OnCreate(int width, int height) { this->m_textViewer->textColor = 0xFF000000u | RGB(red, green, blue); this->m_textViewer->Invalidate(); this->AddChild(this->m_textViewer); - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(121)), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(121)), 38, 0, 0); } namespace { @@ -7920,12 +7922,12 @@ int UICoupleAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_COMMAND: switch (a) { case ID_OK: - g_windowMgr.CloseWindow(104); - g_modeMgr.gameMode->SendMsg(167, this->identity, 1, 0, 0); + g_windowMgr.CloseWindow(WID_COUPLEACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_COUPLE, this->identity, 1, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(104); - g_modeMgr.gameMode->SendMsg(167, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COUPLEACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_COUPLE, this->identity, 0, 0, 0); break; } break; @@ -7936,7 +7938,7 @@ int UICoupleAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s text += ")"; text += LookupMessage(737); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); break; } default: @@ -8013,12 +8015,12 @@ int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->RecordResponse(static_cast(a), b, c, d); switch (a) { case ID_OK: - g_windowMgr.CloseWindow(109); - g_modeMgr.gameMode->SendMsg(175, this->m_accountId, this->m_characterId, 1, 0); + g_windowMgr.CloseWindow(WID_JOINFRIENDACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_FRIEND, this->m_accountId, this->m_characterId, 1, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(109); - g_modeMgr.gameMode->SendMsg(175, this->m_accountId, this->m_characterId, 0, 0); + g_windowMgr.CloseWindow(WID_JOINFRIENDACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_FRIEND, this->m_accountId, this->m_characterId, 0, 0); break; } break; @@ -8028,10 +8030,10 @@ int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t char text[128]; std::sprintf(text, LookupMessage(818), reinterpret_cast(c)); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 38, 0, 0); break; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* packet = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, packet, sizeof(header)); @@ -8048,7 +8050,7 @@ int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t std::memset(name, 0, sizeof(name)); std::memcpy(name, packet + offset, header.length); offset += header.length; - this->SendMsg(nullptr, 95, 0, 0, reinterpret_cast(name), 0); + this->SendMsg(nullptr, UM_SET_JOIN_FRIEND_MSG, 0, 0, reinterpret_cast(name), 0); break; } default: @@ -8072,14 +8074,14 @@ int UIMixAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case UM_COMMAND: switch (a) { case ID_OK: - g_windowMgr.CloseWindow(160); - g_windowMgr.CloseWindow(161); - g_modeMgr.gameMode->SendMsg(266, 0, 0, 0, 0); - g_windowMgr.CloseWindow(163); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND2); + g_windowMgr.CloseWindow(WID_ITEMSELLWND2); + g_modeMgr.gameMode->SendMsg(MM_ITEMLISTWIN_RES, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MIXACCEPTWND); g_session.ClearTradeItems(); break; case ID_CANCEL: - g_windowMgr.CloseWindow(163); + g_windowMgr.CloseWindow(WID_MIXACCEPTWND); break; } break; @@ -8088,7 +8090,7 @@ int UIMixAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: std::string text; text = LookupMessage(1584); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); break; } default: @@ -8149,10 +8151,10 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(46); + g_windowMgr.CloseWindow(WID_SKILLDESCRIBEWND); break; case ID_HELP: { - UIWindow* window = g_windowMgr.EnsureWindow(10030); + UIWindow* window = g_windowMgr.EnsureWindow(WID_SKILLDELAYINFO); if (window) { static_cast(window)->SetSkill(this->m_skillId); window->PlaceBeside(this); @@ -8174,8 +8176,8 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (this->m_skillId == static_cast(a)) { return -1; } - if (g_windowMgr.LookupWindow(10030)) { - g_windowMgr.CloseWindow(10030); + if (g_windowMgr.LookupWindow(WID_SKILLDELAYINFO)) { + g_windowMgr.CloseWindow(WID_SKILLDELAYINFO); } this->unknown_00EC = this->unknown_00D4 = skill.DisplayName(*g_session.m_hotkeyScript); @@ -8208,7 +8210,7 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, const int delay = g_session.GetShopEntry(1, this->m_skillId).first; if (delay != 0) { const std::string line = FormatOwnedString(LookupMessage(4001), static_cast(delay * 0.1), delay % 10); - this->m_text->SendMsg(nullptr, 29, reinterpret_cast(line.c_str()), 0, 0, 1); + this->m_text->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(line.c_str()), 0, 0, 1); } } const std::vector lines = Split(text, "\r\n"); @@ -8217,11 +8219,11 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, buffer.resize(lines[index].size() + 4); StringFormat(buffer.data(), buffer.size(), static_cast(-1), "%s%s", g_serverLanguage->Prefix(true), lines[index].c_str()); UIWindow* target = static_cast(this->m_text->lines.size()) < 2 ? static_cast(this->m_text) : static_cast(this->m_viewer); - target->SendMsg(nullptr, 29, reinterpret_cast(buffer.data()), 0, 1, 1); + target->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(buffer.data()), 0, 1, 1); } } } else { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast("Unknown Skill"), 33, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast("Unknown Skill"), 33, 0, 0); } const int textHeight = 18 * static_cast(this->m_text->lines.size()); @@ -8250,11 +8252,11 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, int UISkillNameChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: - if (a == 184) { + if (a == ID_OK) { if (this->m_skillId != -1 && this->m_edit->Length() != 0) { g_modeMgr.gameMode->SendMsg(98, this->m_skillId, reinterpret_cast(this->m_edit->Text()), 0, 0); } - g_windowMgr.CloseWindow(55); + g_windowMgr.CloseWindow(WID_SKILLNAMECHANGEWND); } break; case UM_SET_SKILL_INFO: @@ -8276,12 +8278,12 @@ int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a switch (message) { case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); - if (a == 184) { + if (a == ID_OK) { CMode* mode = g_modeMgr.GetGameMode(); - g_windowMgr.CloseWindow(119); - mode->SendMsg(190, this->m_place, 0, 0, 0); - } else if (a == 185) { - g_windowMgr.CloseWindow(119); + g_windowMgr.CloseWindow(WID_STARPLACEACCEPTWND); + mode->SendMsg(MM_STARPLACE_ACCEPT, this->m_place, 0, 0, 0); + } else if (a == ID_CANCEL) { + g_windowMgr.CloseWindow(WID_STARPLACEACCEPTWND); } return 0; } @@ -8294,12 +8296,12 @@ int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a text = LookupMessage(1028); } this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; } } - if (message != 123) { + if (message != UM_REPLAY_FRAMED_DATA) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } @@ -8320,7 +8322,7 @@ int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (tag == 0x54C6) { std::memcpy(&this->m_place, packet + offset, size); offset += size; - this->SendMsg(nullptr, 91, this->m_place, 0, 0, 0); + this->SendMsg(nullptr, UM_SET_BABY_MSG, this->m_place, 0, 0, 0); } else { offset += size; } @@ -8342,11 +8344,11 @@ int UIYourItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: packet.index = static_cast(this->m_index); packet.location = this->m_location; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetType), &packet); - g_windowMgr.CloseWindow(138); + g_windowMgr.CloseWindow(WID_YOURITEMWND); break; } case ID_CANCEL: - g_windowMgr.CloseWindow(138); + g_windowMgr.CloseWindow(WID_YOURITEMWND); break; } break; @@ -8354,7 +8356,7 @@ int UIYourItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: std::string text; text = LookupMessage(1327); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); this->m_index = static_cast(a); this->m_location = static_cast(b); break; @@ -8418,7 +8420,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(38); + g_windowMgr.CloseWindow(WID_TIPOFTHEDAYWND); break; case ID_CHECK: { this->m_showTipsAtStartup = static_cast(b); @@ -8437,7 +8439,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (this->m_tipIndex >= g_tipOfTheDay.Size()) { this->m_tipIndex = 0; } - this->SendMsg(nullptr, 29, reinterpret_cast(&g_tipOfTheDay.GetTip(this->m_tipIndex)), 0, 0, 0); + this->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(&g_tipOfTheDay.GetTip(this->m_tipIndex)), 0, 0, 0); } break; case ID_PREV: @@ -8445,7 +8447,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (--this->m_tipIndex < 0) { this->m_tipIndex = g_tipOfTheDay.Size() - 1; } - this->SendMsg(nullptr, 29, reinterpret_cast(&g_tipOfTheDay.GetTip(this->m_tipIndex)), 0, 0, 0); + this->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(&g_tipOfTheDay.GetTip(this->m_tipIndex)), 0, 0, 0); } break; } @@ -8454,9 +8456,9 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st case UM_SETTEXT: { const auto& tip = *reinterpret_cast(a); this->m_textViewer->Clear(); - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(175)), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(175)), 38, 0, 0); for (unsigned i = 0; i < tip.size(); ++i) { - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(tip[i].c_str()), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(tip[i].c_str()), 38, 0, 0); } return 0; } @@ -8469,15 +8471,15 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // INLINED static __forceinline void RequestStatusPointUp(UIStatusWnd* window, CMode* mode, const int* statCosts, int statusPoint, int index) { if (statCosts[index] <= statusPoint) { - mode->SendMsg(30, 13 + index, 1, 0, 0); - window->SendMsg(window, 35, 0, 0, 0, 0); + mode->SendMsg(MM_STATUS_CHANGE, 13 + index, 1, 0, 0); + window->SendMsg(window, UM_REFRESHBUTTON, 0, 0, 0, 0); } } // INLINED static __forceinline void RequestTraitPointUp(CMode* mode, int index) { if (g_session.GetTraitStat(231) > 0 && g_session.m_traits.points[index] > 0) { - mode->SendMsg(314, 219 + index, 1, 0, 0); + mode->SendMsg(MM_ADVANCED_STATUS_CHANGE, 219 + index, 1, 0, 0); } } @@ -8491,7 +8493,7 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(11); + g_windowMgr.CloseWindow(WID_STATUSWND); break; case ID_MINI: { const int height = this->geometry.height; @@ -8574,14 +8576,14 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in if (!this->m_info->IsValid()) { this->m_info->Reset(); } - this->SendMsg(nullptr, 14, 7, this->m_info->width, this->m_info->unknown_0010, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->m_info->width, this->m_info->unknown_0010, 0); if (this->m_info->height != this->m_info->unknown_0010) { - this->SendMsg(nullptr, 6, 202, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } - this->SendMsg(nullptr, 35, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); this->Move(this->m_info->x, this->m_info->y); this->m_extended = this->m_info->unknown_0018 != 1; - this->SendMsg(nullptr, 6, 550, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 550, 0, 0, 0); break; case UM_REFRESHBUTTON: if (this->geometry.unknown_0030 == 0) { @@ -8625,12 +8627,12 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { CMode* mode = g_modeMgr.gameMode; - if (message == 6) { + if (message == UM_COMMAND) { switch (a) { case ID_CANCEL: g_windowMgr.CloseWindow(115); if (mode->cursorType == 9) { - g_windowMgr.EnsureWindow(277); + g_windowMgr.EnsureWindow(WID_NEWSELECTCHARWND); } break; @@ -8774,7 +8776,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ break; case ID_STORE_RETURN: - this->SendMsg(this, 6, 184, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); break; case ID_STORE_PASSWORD_NUM0: if (++this->unknown_00EC > 8) { @@ -9074,7 +9076,7 @@ int UISelectCartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std break; } case UM_COMMAND: - if (a != 201) { + if (a != ID_CLOSE) { const int type = static_cast(a) - 9000; std::vector::iterator cart = carts.begin(); for (;; ++cart) { @@ -9085,9 +9087,9 @@ int UISelectCartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std break; } } - g_modeMgr.GetGameMode()->SendMsg(154, type, this->unknown_00B4, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_SELECT_CART, type, this->unknown_00B4, 0, 0); } - g_windowMgr.CloseWindow(95); + g_windowMgr.CloseWindow(WID_SELECTCARTWND); break; } return 0; @@ -9375,15 +9377,15 @@ void UIWhisperWnd::OnCreate(int, int) { // OFFSET: 0x008F6A30 // FUNCTION: fn_12324 int UIAutoMessageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } - if (a == 184) { + if (a == ID_OK) { reinterpret_cast(g_session.unknown_56B8[4]) = this->m_edit->Text(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(942)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(942)), 0x64FFFF, 0, 0, 0); g_windowMgr.RestoreInput(); - g_windowMgr.CloseWindow(116); + g_windowMgr.CloseWindow(WID_AUTOMESSAGEWND); } return 0; } @@ -9393,8 +9395,8 @@ int UIAutoMessageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st int UICardItemIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: - if (a == 201) { - g_windowMgr.CloseWindow(47); + if (a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_CARDITEMILLUSTWND); } break; case UM_CARDITEMILLUSTRATE: { @@ -9410,7 +9412,7 @@ int UICardItemIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, g_windowMgr.Promote(this); break; } - g_windowMgr.CloseWindow(47); + g_windowMgr.CloseWindow(WID_CARDITEMILLUSTWND); break; } default: @@ -9742,7 +9744,7 @@ int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume switch (message) { case UM_ADDITEM: this->m_items.push_back(LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(argument2))); - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return 0; case UM_REFRESH: this->UpdateScroll(); @@ -9752,9 +9754,9 @@ int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_scroll = previous - this->m_rows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_scroll = previous + this->m_rows - 1; } else { this->m_scroll = previous + static_cast(argument1); @@ -9775,12 +9777,12 @@ int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume int found = 0; ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found) { - g_modeMgr.gameMode->SendMsg(146, item.unknown_0000[1], 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PETEGG_SELECT_FROM_LIST, item.unknown_0000[1], 0, 0, 0); } break; } case ID_CANCEL: - g_windowMgr.CloseWindow(90); + g_windowMgr.CloseWindow(WID_PETEGGLISTWND); break; } return 0; @@ -10028,9 +10030,9 @@ void UIItemCollectionWnd::OnRBtnDown(int x, int y) { card.unknown_0000[0] = 6; card.unknown_0060 = 0; card.SetItemId(cardId); - UIWindow* window = g_windowMgr.EnsureWindow(82); - window->SendMsg(nullptr, 76, card.identified, 0, 0, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&card), index >= ItemSlotsCount(this->m_item), 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_COMBINEDCARDITEMCOLLECTIONWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, card.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&card), index >= ItemSlotsCount(this->m_item), 0, 0); if (UIItemCollectionWnd* comparison = static_cast(g_windowMgr.unknown_0220)) { int compareId; @@ -10041,9 +10043,9 @@ void UIItemCollectionWnd::OnRBtnDown(int x, int y) { compareCard.unknown_0000[0] = 6; compareCard.unknown_0060 = 0; compareCard.SetItemId(compareId); - UIWindow* compareWindow = g_windowMgr.EnsureWindow(250); - compareWindow->SendMsg(nullptr, 76, compareCard.identified, 0, 0, 0); - compareWindow->SendMsg(nullptr, 24, reinterpret_cast(&compareCard), 1, 0, 0); + UIWindow* compareWindow = g_windowMgr.EnsureWindow(WID_COMBINEDCARDITEMCOLLECTION_COMPARISONWND); + compareWindow->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, compareCard.identified, 0, 0, 0); + compareWindow->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&compareCard), 1, 0, 0); } } } @@ -10065,9 +10067,9 @@ void UIItemCollection_ComparisonWnd::OnRBtnDown(int x, int y) { card.unknown_0000[0] = 6; card.unknown_0060 = 0; card.SetItemId(cardId); - UIWindow* window = g_windowMgr.EnsureWindow(82); - window->SendMsg(nullptr, 76, card.identified, 0, 0, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&card), index >= ItemSlotsCount(this->m_item), 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_COMBINEDCARDITEMCOLLECTIONWND); + window->SendMsg(nullptr, UM_SET_IDENTIFIY_INFO, card.identified, 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&card), index >= ItemSlotsCount(this->m_item), 0, 0); } // OFFSET: 0x008F3660 @@ -10178,7 +10180,7 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: item.SetItemId(*reinterpret_cast(a)); item.identified = 1; this->m_items.push_back(item); - this->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); break; } case UM_REFRESH: @@ -10192,9 +10194,9 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_scroll = previous - this->m_rows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_scroll = previous + this->m_rows - 1; } else { this->m_scroll = previous + static_cast(a); @@ -10217,26 +10219,26 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found != 0) { if (this->unknown_00F0 == 2) { - g_modeMgr.gameMode->SendMsg(0x99, item.GetItemId(), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ARROW_FROM_LIST, item.GetItemId(), 0, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(0xCF, item.GetItemId(), this->unknown_00F0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ITEM_FROM_LIST, item.GetItemId(), this->unknown_00F0, 0, 0); } - g_windowMgr.CloseWindow(0x5E); + g_windowMgr.CloseWindow(WID_MAKINGARROWLISTWND); } break; } case ID_CANCEL: if (this->unknown_00F0 == 2) { - g_modeMgr.gameMode->SendMsg(0x99, -1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ARROW_FROM_LIST, -1, 0, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(0xCF, -1, this->unknown_00F0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_ITEM_FROM_LIST, -1, this->unknown_00F0, 0, 0); } - g_windowMgr.CloseWindow(0x5E); + g_windowMgr.CloseWindow(WID_MAKINGARROWLISTWND); break; } break; } - case 0x7B: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -10252,14 +10254,14 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: int value = 0; std::memcpy(&value, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 0x22, static_cast(value), 0, 0, 0); + this->SendMsg(nullptr, UM_SETINFO, static_cast(value), 0, 0, 0); break; } case 0x5657: { int value = 0; std::memcpy(&value, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 0x1F, reinterpret_cast(&value), 0, 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(&value), 0, 0, 0); break; } default: @@ -10285,7 +10287,7 @@ void UITipboxWnd::OnProcess() { WrapPlainText(text.c_str(), lines, 1000); this->unknown_00BC->Clear(); for (const std::string& line : lines) { - this->unknown_00BC->SendMsg(nullptr, 29, reinterpret_cast(line.c_str()), 32, 0, 0); + this->unknown_00BC->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(line.c_str()), 32, 0, 0); } this->Invalidate(); } @@ -10315,10 +10317,10 @@ void UITipboxWnd::OnProcess() { int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); @@ -10326,14 +10328,14 @@ int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std case ID_OK: { const int selected = this->m_list->selected; if (selected != -1) { - g_modeMgr.GetGameMode()->SendMsg(0x4A, reinterpret_cast(this->m_choices[selected].c_str()), this->unknown_00B8, 0, 0); - g_windowMgr.CloseWindow(0x27); + g_modeMgr.GetGameMode()->SendMsg(MM_SELECT_WARPPOINT, reinterpret_cast(this->m_choices[selected].c_str()), this->unknown_00B8, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWARPWND); } break; } case ID_CANCEL: - g_modeMgr.GetGameMode()->SendMsg(0x4A, reinterpret_cast("cancel"), this->unknown_00B8, 0, 0); - g_windowMgr.CloseWindow(0x27); + g_modeMgr.GetGameMode()->SendMsg(MM_SELECT_WARPPOINT, reinterpret_cast("cancel"), this->unknown_00B8, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWARPWND); break; } return 0; @@ -10354,7 +10356,7 @@ int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std this->m_choices.push_back(choice); } return 0; - case 0x7B: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -10365,13 +10367,13 @@ int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std position += sizeof(header); switch (header.type) { case 0x55BF: - this->SendMsg(nullptr, 0x1B, reinterpret_cast("cancel"), 0, 0, 0); + this->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast("cancel"), 0, 0, 0); return 0; case 0x55C1: { char text[260] = {}; std::memcpy(text, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 0x1B, reinterpret_cast(text), 0, 0, 0); + this->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast(text), 0, 0, 0); break; } default: @@ -10497,9 +10499,9 @@ void UITipOfTheDayWnd::OnCreate(int width, int height) { const int index = random % g_tipOfTheDay.Size(); this->m_tipIndex = index; const StringList& tip = g_tipOfTheDay.GetTip(index); - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(175)), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(175)), 38, 0, 0); for (unsigned line = 0; line < tip.size(); ++line) { - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(tip[line].c_str()), 38, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(tip[line].c_str()), 38, 0, 0); } } } @@ -10781,7 +10783,7 @@ public: // OFFSET: 0x00903230 // FUNCTION: fn_12377 int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { switch (a) { case 419: if (std::strlen(this->unknown_00D0) == static_cast(this->unknown_010C)) { @@ -10805,7 +10807,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr break; case ID_CANCEL: if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); } break; @@ -10961,7 +10963,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->unknown_00F0 += 5; break; case ID_STORE_RETURN: - this->SendMsg(this, 6, 184, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); break; case ID_STORE_PASSWORD_NUM0: @@ -11189,7 +11191,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr // OFFSET: 0x00901D40 // FUNCTION: fn_12376 int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { switch (a) { case 419: if (std::strlen(this->unknown_00D0) == static_cast(this->unknown_010C)) { @@ -11213,7 +11215,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ break; case ID_CANCEL: if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); } break; @@ -11353,7 +11355,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; case ID_STORE_RETURN: - this->SendMsg(this, 6, 184, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); break; case ID_STORE_PASSWORD_NUM0: @@ -11660,15 +11662,15 @@ void UIBookWnd::OnProcess() { g_windowMgr.Schedule(this->unknown_00B8); this->unknown_00B8 = nullptr; } - g_windowMgr.CloseWindow(106); + g_windowMgr.CloseWindow(WID_BOOKWND); return; } const char* text = this->m_lines[line].c_str(); if ((std::strlen(text) == 0 || std::strcmp(text, " ") == 0) && line < this->m_lineCount - 1) { this->m_autoLine = line + 1; } - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(this->StripColorCodes(this->m_lines[this->m_autoLine].c_str())), 0xE1E4FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(this->StripColorCodes(this->m_lines[this->m_autoLine].c_str())), 0xE1E4FF, 0, 0, 0); UIWindow* balloon = this->unknown_00B8; if (balloon == nullptr) { balloon = new UITransBalloonText(); @@ -11946,13 +11948,13 @@ bool UIItemCollectionWnd::WrapText(std::string text, int width, std::list(LookupMessage(0xAAA)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAAA)), 0x64FFFF, 0, 0, 0); return 0; } switch (message) { case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_SETINFO: { ChooseWndInfo* placement = reinterpret_cast(a); @@ -11962,7 +11964,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in return 0; } case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); @@ -11972,19 +11974,19 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in if (tick - *reinterpret_cast(&g_session.unknown_5490[0x04]) >= 300) { *reinterpret_cast(&g_session.unknown_5490[0x04]) = tick; if (this->m_items.empty()) { - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return 0; } const int selected = this->m_list->selected; if (selected != -1) { - g_modeMgr.GetGameMode()->SendMsg(0x17, this->m_items[selected] + 1, this->unknown_00C8, 0, 0); - g_windowMgr.CloseWindow(0x11); + g_modeMgr.GetGameMode()->SendMsg(MM_CHOOSE_MENU, this->m_items[selected] + 1, this->unknown_00C8, 0, 0); + g_windowMgr.CloseWindow(WID_CHOOSEWND); } } break; } case ID_CANCEL: - g_modeMgr.GetGameMode()->SendMsg(0x28, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); break; } return 0; @@ -12015,7 +12017,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in case UM_SETNAID: this->unknown_00C8 = static_cast(a); return 0; - case 0x7B: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* records = reinterpret_cast(a); FramedMessageHeader header; std::memcpy(&header, records, sizeof(header)); @@ -12033,7 +12035,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in char text[260] = {}; std::memcpy(text, records + position, header.length); position += header.length; - this->SendMsg(nullptr, 0x1B, reinterpret_cast(text), 0, 0, 0); + this->SendMsg(nullptr, UM_SETCHOOSE, reinterpret_cast(text), 0, 0, 0); break; } default: @@ -12042,14 +12044,14 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } } if (g_windowMgr.unknown_01F0 != nullptr) { - g_windowMgr.unknown_01F0->SendMsg(nullptr, 0x20, 0, 0, 0, 0); + g_windowMgr.unknown_01F0->SendMsg(nullptr, UM_DISABLENEXTBUTTON, 0, 0, 0, 0); } } return 0; } - case 0xA6: + case UM_CANCEL_NPC_CHOICE: if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(0x17, -1, this->unknown_00C8, 0, 0); + mode->SendMsg(MM_CHOOSE_MENU, -1, this->unknown_00C8, 0, 0); } return 0; default: @@ -12061,7 +12063,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in // FUNCTION: fn_12331 int UIChoose3Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { const char* text = reinterpret_cast(a); - if (message != 27 || text == nullptr || std::strlen(text) == 0 || std::strcmp(text, LookupMessage(666)) == 0) { + if (message != UM_SETCHOOSE || text == nullptr || std::strlen(text) == 0 || std::strcmp(text, LookupMessage(666)) == 0) { return this->UIChooseWnd::SendMsg(sender, message, a, b, c, d); } int length = 0; @@ -12156,7 +12158,7 @@ void UITipboxWnd::RefreshTip() { // OFFSET: 0x00907050 // FUNCTION: fn_12386 int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } @@ -12200,7 +12202,7 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->BuildAnimations(); break; case ID_CLOSE: - g_windowMgr.CloseWindow(0x13B); + g_windowMgr.CloseWindow(WID_TIPBOXWND); break; case ID_PREV: { const int page = (std::max)(0, g_itemTagOwner->unknown_00B4); @@ -12218,7 +12220,7 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } case 0x205: if (!g_windowMgr.GetHoverWindow()) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1062)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x1062)), 0xFF, 0, 0, 0); } else { const int id = g_itemTagOwner->unknown_0114; switch (g_windowMgr.GetHoverWindow()->geometry.id) { @@ -12358,17 +12360,17 @@ void UIFrameWnd::DrawItemNameText( int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: { - if (a == 0xC9) { - g_windowMgr.CloseWindow(0x67); + if (a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_PROHIBITLISTWND); } else if (a == 0x10C) { - UIWindow* menu = g_windowMgr.EnsureWindow(0x1A); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); const std::string labels[4] = {LookupMessage(0x250), LookupMessage(0x251), LookupMessage(0x252), LookupMessage(0x253)}; - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x2CF)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x2D0)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x2D1)), 0, 0, 0); - menu->SendMsg(nullptr, 0x28, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x2CF)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x2D0)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x2D1)), 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); menu->Resize(0x82, 0x30); - menu->SendMsg(nullptr, 0x53, 0x67, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 0x67, 0, 0, 0); int x = 0xA0; int y = 0x2C; this->ToScreen(x, y); @@ -12393,11 +12395,11 @@ int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s counter->SetSize(0xB6, 0x2E); counter->Move((g_renderer->viewport.width - 640) / 2 + 200, ScaleByScreenHeight(200)); g_windowMgr.AddRendered(counter); - counter->SendMsg(nullptr, 0x50, 0x98, 0, 0, 0); + counter->SendMsg(nullptr, UM_SET_TARGET, 0x98, 0, 0, 0); text = 0x186; } else if (a == 1) { if (IsAdminAccount(g_session.m_aid)) { - mode->SendMsg(0x97, 30000, 0, 0, 0); + mode->SendMsg(MM_REQ_GIVE_MANNER_POINT_PLUS, 30000, 0, 0, 0); } return 0; } else { @@ -12408,11 +12410,11 @@ int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s counter->SetSize(0xB6, 0x2E); counter->Move((g_renderer->viewport.width - 640) / 2 + 200, ScaleByScreenHeight(200)); g_windowMgr.AddRendered(counter); - counter->SendMsg(nullptr, 0x50, 0x97, 0, 0, 0); + counter->SendMsg(nullptr, UM_SET_TARGET, 0x97, 0, 0, 0); text = 0x185; } - counter->SendMsg(nullptr, 0x1D, reinterpret_cast(LookupMessage(text)), 0, 0, 0); - counter->SendMsg(nullptr, 0x51, 1, 0, 0, 0); + counter->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(text)), 0, 0, 0); + counter->SendMsg(nullptr, UM_SET_COUNT, 1, 0, 0, 0); break; } @@ -12539,8 +12541,8 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar g_windowMgr.CloseWindow(this->m_kind); return 0; case ID_CARDITEM: { - UIWindow* window = g_windowMgr.EnsureWindow(47); - window->SendMsg(nullptr, 62, reinterpret_cast(this->m_item.itemId.c_str()), this->m_item.identified, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_CARDITEMILLUSTWND); + window->SendMsg(nullptr, UM_CARDITEMILLUSTRATE, reinterpret_cast(this->m_item.itemId.c_str()), this->m_item.identified, 0, 0); return 0; } case ID_BOOKITEM: @@ -12553,25 +12555,25 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar } CFile file; if (!file.Open(path, 0, true, false)) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("책이 없습니다"), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("책이 없습니다"), 0xFF, 0, 0, 0); return 0; } - UIWindow* window = g_windowMgr.EnsureWindow(106); - window->SendMsg(nullptr, 94, reinterpret_cast(this->m_item.itemId.c_str()), argument1, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_BOOKWND); + window->SendMsg(nullptr, UM_GETBOOKCONTENTS, reinterpret_cast(this->m_item.itemId.c_str()), argument1, 0, 0); file.Close(); return 0; } case ID_PREVIEW: { - UIWindow* window = g_windowMgr.EnsureWindow(294); + UIWindow* window = g_windowMgr.EnsureWindow(WID_PREVIEWEQUIPWND); if (window) { - window->SendMsg(this, 23, reinterpret_cast(&this->m_item), 0, 0, 0); + window->SendMsg(this, UM_REFRESHITEM, reinterpret_cast(&this->m_item), 0, 0, 0); return 0; } break; } case ID_HELP: { - UIWindow* window = g_windowMgr.EnsureWindow(10012); + UIWindow* window = g_windowMgr.EnsureWindow(WID_PROBABILITYTABLE); if (window) { static_cast(window)->SetItem(this->m_item.GetItemId()); window->PlaceBeside(this); @@ -12592,9 +12594,9 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar g_session.IsPetEgg(std::atoi(item->itemId.c_str())); this->m_item = *item; this->m_helpButton->Enable(NEO_PACKAGEITEM::CPaidPackageItemMgr::GetInstance()->IsPaidItem(std::atoi(this->m_item.itemId.c_str()))); - CUIProbabilityTable* table = static_cast(g_windowMgr.LookupWindow(10012)); + CUIProbabilityTable* table = static_cast(g_windowMgr.LookupWindow(WID_PROBABILITYTABLE)); if (table && table->m_itemId != this->m_item.GetItemId()) { - g_windowMgr.CloseWindow(10012); + g_windowMgr.CloseWindow(WID_PROBABILITYTABLE); } this->m_cardTexts.clear(); this->m_extraHeight = 0; @@ -12671,14 +12673,14 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar const int hours = static_cast(this->m_item.unknown_0068); StringFormat(text, sizeof(text), static_cast(-1), LookupMessage(3974), hours / 24, hours % 24); } - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text), color, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), color, 0, 0); } for (unsigned index = 0; index < descriptions.size(); ++index) { if (g_inlineCharset) { std::sprintf(text, "%s%s", g_serverLanguage->Prefix(true), descriptions[index]); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text), 26, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 26, 0, 0); } else { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(descriptions[index]), g_serviceType == 6 ? 24 : 26, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(descriptions[index]), g_serviceType == 6 ? 24 : 26, 0, 0); } } if (g_session.IsPetEgg(std::atoi(item->itemId.c_str())) == 1) { @@ -12707,25 +12709,25 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar if (g_inlineCharset == 1) { std::memset(text, 0, sizeof(text)); std::sprintf(text, "%s%s", g_serverLanguage->Prefix(true), state.c_str()); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text), 26, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 26, 0, 0); } else { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(state.c_str()), g_serviceType == 6 ? 24 : 26, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(state.c_str()), g_serviceType == 6 ? 24 : 26, 0, 0); } } this->Invalidate(); g_windowMgr.Promote(this); if (argument2 != 0 && g_windowMgr.unknown_022C) { - g_windowMgr.unknown_022C->SendMsg(nullptr, 64, reinterpret_cast(this->m_item.itemId.c_str()), this->m_item.identified, 0, 0); + g_windowMgr.unknown_022C->SendMsg(nullptr, UM_PARAM, reinterpret_cast(this->m_item.itemId.c_str()), this->m_item.identified, 0, 0); } if (this->m_kind == 12) { ITEM_INFO* equipped = g_session.GetEquippedItem(&this->m_item); if (g_serviceOptions.Get(264) && equipped && argument4 == 0) { - UIWindow* window = g_windowMgr.EnsureWindow(234); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTION_COMPARISONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(equipped), 1, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(equipped), 1, 0, 0); } } else { - g_windowMgr.CloseWindow(234); + g_windowMgr.CloseWindow(WID_ITEMCOLLECTION_COMPARISONWND); } } const int lineCount = static_cast(this->m_viewer->lines.size()); @@ -12829,7 +12831,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar } this->m_viewer->Clear(); for (unsigned index = 0; index < lines.size(); ++index) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(lines[index].c_str()), 26, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(lines[index].c_str()), 26, 0, 0); } this->Invalidate(); g_windowMgr.Promote(this); diff --git a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp index 2ec40c7c7..3c7349049 100644 --- a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/CMode.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" @@ -72,7 +74,7 @@ void UIExchangeAcceptWnd::OnCreate(int width, int height) { this->viewer->textColor = 0xFF000000u | RGB(red, green, blue); this->viewer->Invalidate(); this->AddChild(this->viewer); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast("deal"), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast("deal"), 38, 0, 0); } // OFFSET: 0x008FA8C0 @@ -83,12 +85,12 @@ int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->RecordResponse(static_cast(a), b, c, d); switch (a) { case ID_OK: - g_windowMgr.CloseWindow(32); - g_modeMgr.gameMode->SendMsg(50, 3, 0, 0, 0); + g_windowMgr.CloseWindow(WID_EXCHANGEACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_ACK_EXCHANGE_ITEM, 3, 0, 0, 0); return 0; case ID_CANCEL: - g_windowMgr.CloseWindow(32); - g_modeMgr.gameMode->SendMsg(50, 4, 0, 0, 0); + g_windowMgr.CloseWindow(WID_EXCHANGEACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_ACK_EXCHANGE_ITEM, 4, 0, 0, 0); return 0; } return 0; @@ -105,12 +107,12 @@ int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, text += ")"; text += LookupMessage(93); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 138, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 138, 0, 0); const std::string code = std::format("C-Code : {} {}{}", ShortcutFilename(static_cast(b)), g_serviceType == 12 ? "Nv." : "Lv.", c); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(code.c_str()), 138, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(code.c_str()), 138, 0, 0); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ExchangeRecordHeader header = {}; std::memcpy(&header, bytes, sizeof(header)); @@ -126,7 +128,7 @@ int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, char text[260] = {}; std::memcpy(text, bytes + offset, header.length); offset += header.length; - this->SendMsg(nullptr, 50, reinterpret_cast(text), 0, 0, 0); + this->SendMsg(nullptr, UM_SET_EXCHANGE_CHAR_NAME, reinterpret_cast(text), 0, 0, 0); const std::string name = text; CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); SetExchangeName(mode, name); diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp index bad01bfa0..b6ee3a714 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CMode.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" @@ -29,12 +31,12 @@ int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a switch (a) { case ID_OK: - g_windowMgr.CloseWindow(35); - g_modeMgr.gameMode->SendMsg(60, this->identity, 1, 0, 0); + g_windowMgr.CloseWindow(WID_JOINPARTYACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_GROUP, this->identity, 1, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(35); - g_modeMgr.gameMode->SendMsg(60, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_JOINPARTYACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_JOIN_GROUP, this->identity, 0, 0, 0); break; } @@ -47,12 +49,12 @@ int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a text += ")"; text += LookupMessage(94); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); std::uint16_t marker; std::memcpy(&marker, bytes, sizeof(marker)); @@ -73,7 +75,7 @@ int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a char text[260] = {}; std::memcpy(text, bytes + offset, size); offset += size; - this->SendMsg(nullptr, 56, 0, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_SET_JOIN_PARTY_MSG, 0, reinterpret_cast(text), 0, 0); break; } default: diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index b7ca0eb3a..3d28d404c 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -1,4 +1,6 @@ #include "Client/Session.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/AdventureGuideMgr.h" #include "Contents/Items/ItemInfo.h" #include "Contents/MessageTable.h" @@ -507,7 +509,7 @@ void CUIAdventureGuide::OnCreate(int width, int height) { // OFFSET: 0x009DBF20 // FUNCTION: fn_45467 void CUIAdventureGuide::OnClose() { - g_windowMgr.CloseWindow(10002); + g_windowMgr.CloseWindow(WID_ADVENTUREGUIDE); } // OFFSET: 0x009C14F0 @@ -1967,9 +1969,9 @@ void CUIItemInfo::OnRBtnDown(int, int) { } info.unknown_0000[2] = location; - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 0x18, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&info), 0, 0, 0); } } @@ -2309,11 +2311,11 @@ void CUIItem::SearchNavigation() { g_navigationManager.unknown_12C8 = 0; g_navigationManager.SelectNodeState(); - UIWindow* window = g_windowMgr.LookupWindow(203); + UIWindow* window = g_windowMgr.LookupWindow(WID_NAVIGATIONV4WND); if (!window) { - window = g_windowMgr.EnsureWindow(203); + window = g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } - window->SendMsg(nullptr, 6, 499, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, 499, 0, 0, 0); } // OFFSET: 0x009DBCB0 @@ -2331,16 +2333,16 @@ void CUIQuest::SearchNavigation() { g_navigationManager.unknown_12C8 = 0; if (!g_navigationManager.SelectNodeState()) { this->RequestNavigation(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4241)), 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4241)), 0, 0, 0, 0); return; } - UIWindow* window = g_windowMgr.LookupWindow(203); + UIWindow* window = g_windowMgr.LookupWindow(WID_NAVIGATIONV4WND); if (!window) { - window = g_windowMgr.EnsureWindow(203); + window = g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } window->Invalidate(); - window->SendMsg(nullptr, 6, 499, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, 499, 0, 0, 0); } } @@ -2980,14 +2982,14 @@ void CUIMonster::SearchNavigation() { g_navigationManager.unknown_12C4 = 0; g_navigationManager.unknown_12C8 = 0; g_navigationManager.SelectNodeState(); - if (g_windowMgr.LookupWindow(203)) { + if (g_windowMgr.LookupWindow(WID_NAVIGATIONV4WND)) { g_navigationManager.SetViewMode(1); g_navigationManager.ClearSavedTarget(); - g_windowMgr.CloseWindow(314); + g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND); static_cast(g_windowMgr.window_4F174)->RefreshLayout(); - g_windowMgr.Promote(g_windowMgr.LookupWindow(203)); + g_windowMgr.Promote(g_windowMgr.LookupWindow(WID_NAVIGATIONV4WND)); } else { - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } } diff --git a/Source/UI/Buttons/UIButton.cpp b/Source/UI/Buttons/UIButton.cpp index 943dbd004..77c67828d 100644 --- a/Source/UI/Buttons/UIButton.cpp +++ b/Source/UI/Buttons/UIButton.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Replay.h" #include "Client/Session.h" #include "UI/Window/WindowPolicy.h" @@ -120,7 +122,7 @@ void UIButton::OnMouseMove(int x, int y) { UIWindow* parent = this->parent; if (parent == g_windowMgr.unknown_01DC) { - parent->SendMsg(this, 6, 271, this->geometry.unknown_0030 != 0, 0, 0); + parent->SendMsg(this, UM_COMMAND, ID_APPLY, this->geometry.unknown_0030 != 0, 0, 0); } } @@ -207,7 +209,7 @@ void UIButton::OnLBtnUp(int x, int y) { if (id == 185 && g_modeMgr.gameMode && g_modeMgr.gameMode->cursorType == 2) { const char* text = LookupMessage(17); if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { @@ -216,11 +218,11 @@ void UIButton::OnLBtnUp(int x, int y) { parent = this->parent; } - parent->SendMsg(this, 6, id, this->m_argument, 0, 0); + parent->SendMsg(this, UM_COMMAND, id, this->m_argument, 0, 0); } } } else { - g_modeMgr.gameMode->SendMsg(0, this->geometry.id, this->m_argument, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, this->geometry.id, this->m_argument, 0, 0); } } diff --git a/Source/UI/Buttons/UICheckBox.cpp b/Source/UI/Buttons/UICheckBox.cpp index 26c1a9e79..a385aba84 100644 --- a/Source/UI/Buttons/UICheckBox.cpp +++ b/Source/UI/Buttons/UICheckBox.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -65,7 +66,7 @@ __forceinline void UICheckBox::Notify() { } if (this->parent) { - this->parent->SendMsg(this, 6, this->geometry.id, this->geometry.unknown_0030, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->geometry.unknown_0030, 0, 0); } } @@ -98,7 +99,7 @@ void UICheckBox::OnLBtnDown(int, int) { this->geometry.unknown_0030 = 1u - this->geometry.unknown_0030; this->Notify(); if (this->m_notify != 0) { - this->parent->SendMsg(this, 2, this->m_message, 0, 0, 0); + this->parent->SendMsg(this, UM_TOGGLEPUSH, this->m_message, 0, 0, 0); } } diff --git a/Source/UI/Buttons/UIDescriptRace.cpp b/Source/UI/Buttons/UIDescriptRace.cpp index 0dbe5e7c7..8c24f838e 100644 --- a/Source/UI/Buttons/UIDescriptRace.cpp +++ b/Source/UI/Buttons/UIDescriptRace.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Buttons/UIDescriptRace.h" #include @@ -16,13 +17,13 @@ UIDescriptRace::UIDescriptRace(int race) : m_race(race), unknown_0284(0) { // OFFSET: 0x008861C0 // FUNCTION: fn_11323 void UIDescriptRace::OnCreate(int, int) { - this->SendMsg(nullptr, 13, this->m_noRace, 0, 0, 0); + this->SendMsg(nullptr, UM_SETSTATE, this->m_noRace, 0, 0, 0); } // OFFSET: 0x008985D0 // FUNCTION: fn_11548 int UIDescriptRace::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 13 && (this->m_race != 1 || g_doramCreationEnabled)) { + if (message == UM_SETSTATE && (this->m_race != 1 || g_doramCreationEnabled)) { if (argument1) { this->m_noRace = 1; this->SetBitmap(this->m_race != 1 ? "유저인터페이스\\make_character_ver2\\img_human_on.bmp" : "유저인터페이스\\make_character_ver2\\img_doram_on.bmp", 0, 0); diff --git a/Source/UI/Buttons/UIRadioBtn.cpp b/Source/UI/Buttons/UIRadioBtn.cpp index b3d6c9367..c302317b9 100644 --- a/Source/UI/Buttons/UIRadioBtn.cpp +++ b/Source/UI/Buttons/UIRadioBtn.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/ModeMgr.h" +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" @@ -50,7 +51,7 @@ void UIRadioBtn::Paint() { // FUNCTION: fn_10844 void UIRadioBtn::OnLBtnDown(int, int) { if (this->parent && this->enabled != 0) { - this->parent->SendMsg(this, 6, this->geometry.id, this->value, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->value, 0, 0); } } @@ -69,7 +70,7 @@ void UIRadioBtn::OnMouseHover(int x, int y) { // OFFSET: 0x00865180 // FUNCTION: fn_10919 int UIRadioBtn::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 13) { + if (message == UM_SETSTATE) { this->geometry.unknown_0030 = argument1; this->Invalidate(); } diff --git a/Source/UI/Buttons/UITagButton.cpp b/Source/UI/Buttons/UITagButton.cpp index f527147ae..d8f10d35e 100644 --- a/Source/UI/Buttons/UITagButton.cpp +++ b/Source/UI/Buttons/UITagButton.cpp @@ -1,4 +1,5 @@ #include "UI/Buttons/UITagButton.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" @@ -37,7 +38,7 @@ void UITagButton::OnLBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 98, this->geometry.id, this->m_value, 0, 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_UP, this->geometry.id, this->m_value, 0, 0); } } diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 25660d3b9..af7dab614 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1,4 +1,7 @@ #include "Client/Input/InputCharset.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -172,7 +175,7 @@ void UITextButton::OnLBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 98, this->geometry.id, this->m_value, 0, 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_UP, this->geometry.id, this->m_value, 0, 0); g_windowMgr.ReleaseCapture(); return; } @@ -187,7 +190,7 @@ void UITextButton::OnLBtnUp(int x, int y) { void UITextButton::OnRBtnDown(int, int) { if (this->m_disabled == 0) { if (this->parent) { - this->parent->SendMsg(this, 99, this->geometry.id, this->m_value, 0, 0); + this->parent->SendMsg(this, UM_TEXT_RBTN_UP, this->geometry.id, this->m_value, 0, 0); } this->Invalidate(); @@ -208,7 +211,7 @@ void UITextButton::OnRBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 99, this->geometry.id, this->m_value, 0, 0); + this->parent->SendMsg(this, UM_TEXT_RBTN_UP, this->geometry.id, this->m_value, 0, 0); } } @@ -364,7 +367,7 @@ void UIBmpRadioBtn2::Invalidate() { UIWindow::Invalidate(); if (this->parent != nullptr && !this->parent->IsCached()) { - this->parent->SendMsg(this, 60, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } } @@ -438,7 +441,7 @@ void UIINT64BarGraph::OnMouseHover(int, int) { // OFFSET: 0x00891A40 // FUNCTION: fn_11454 void UIItemMoveInfo::OnMouseHover(int, int) { - g_windowMgr.EnsureWindow(276)->SendMsg(nullptr, 147, this->m_moveIndex, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ROUNDBOXTOOLTIPWND)->SendMsg(nullptr, UM_SET_ITEM_MOVE_TOOLTIP, this->m_moveIndex, 0, 0, 0); } // OFFSET: 0x00891A10 @@ -650,7 +653,7 @@ void UIStaticItem::OnMouseHover(int, int) { // OFFSET: 0x00892040 // FUNCTION: fn_11462 void UIItemMoveInfo::OnMouseLeave() { - g_windowMgr.ShowWindowById(276, 0); + g_windowMgr.ShowWindowById(WID_ROUNDBOXTOOLTIPWND, 0); this->Invalidate(); } @@ -843,7 +846,7 @@ int TableBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, st // OFFSET: 0x008984E0 // FUNCTION: fn_11547 int UIComboBoxV2Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { + if (message == UM_COMMAND) { if (argument1 != 273) { return 0; } @@ -864,7 +867,7 @@ int UIComboBoxV2Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } - if (message != 39) { + if (message != UM_COMBOBOX_SELECTED) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -872,11 +875,11 @@ int UIComboBoxV2Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } - this->SendMsg(nullptr, 6, 273, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OPEN_MEMBER_POS_COMBO, 0, 0, 0); this->selected = argument1; if (this->parent) { - this->parent->SendMsg(this, 39, argument1, 0, 0, 0); + this->parent->SendMsg(this, UM_COMBOBOX_SELECTED, argument1, 0, 0, 0); } this->Invalidate(); @@ -929,7 +932,7 @@ int UIImgMenu::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s // OFFSET: 0x00897BF0 // FUNCTION: fn_11541 int UIBmpRadioBtn::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 13) { + if (message == UM_SETSTATE) { this->geometry.unknown_0030 = static_cast(argument1); this->Invalidate(); } @@ -1005,7 +1008,7 @@ void UITVTextButton::OnMouseMove(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent && this->unknown_00B6 == 0) { - this->parent->SendMsg(this, 108, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_MOUSE_HOVER_BTN, this->m_value, 0, 0, 0); } } } else if (this->geometry.unknown_0030 != 0) { @@ -1139,7 +1142,7 @@ void UISlotBmpButton::OnProcess() { // FUNCTION: fn_11479 void UIBasicItemCtrl::OnRBtnDown(int, int) { if (std::atoi(this->m_item.itemId.c_str()) > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&this->m_item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->m_item), 0, 0, 0); } } @@ -1148,7 +1151,7 @@ void UIBasicItemCtrl::OnRBtnDown(int, int) { void UIBitmapButton2::OnRBtnDown(int, int) { if (this->m_disabled == 0) { if (this->parent) { - this->parent->SendMsg(this, 101, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_RBTN_UP, this->geometry.id, 0, 0, 0); } this->Invalidate(); @@ -1166,14 +1169,14 @@ void UIMemberListBox::OnRBtnDown(int x, int y) { // FUNCTION: fn_11483 void UISlotBmpButton::OnRBtnDown(int, int) { if (this->parent) { - this->parent->SendMsg(this, 6, this->geometry.id, 226, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, 226, 0, 0); } } // OFFSET: 0x00892AB0 // FUNCTION: fn_11484 void UIStaticItem::OnRBtnDown(int, int) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&this->m_item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->m_item), 0, 0, 0); } // OFFSET: 0x00892AE0 @@ -1181,7 +1184,7 @@ void UIStaticItem::OnRBtnDown(int, int) { void UITVBitmapButton::OnRBtnDown(int, int) { if (this->m_disabled == 0) { if (this->parent) { - this->parent->SendMsg(this, 101, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_RBTN_UP, this->m_value, 0, 0, 0); } this->Invalidate(); @@ -1193,7 +1196,7 @@ void UITVBitmapButton::OnRBtnDown(int, int) { void UITVTextButton::OnRBtnDown(int x, int y) { if (this->m_disabled == 0) { if (this->parent) { - this->parent->SendMsg(this, 99, this->m_value, x, y, 0); + this->parent->SendMsg(this, UM_TEXT_RBTN_UP, this->m_value, x, y, 0); } this->Invalidate(); @@ -1213,7 +1216,7 @@ void UIBitmapButton2::OnRBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 101, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_RBTN_UP, this->geometry.id, 0, 0, 0); } } @@ -1247,7 +1250,7 @@ void UIChatHisBox2::OnRBtnUp(int x, int y) { // FUNCTION: fn_11490 void UIMemberListBox::OnRBtnUp(int, int) { if (this->parent) { - this->parent->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } @@ -1264,7 +1267,7 @@ void UITVBitmapButton::OnRBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 101, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_RBTN_UP, this->m_value, 0, 0, 0); } } @@ -1277,7 +1280,7 @@ void UITVBitmapButton::OnRBtnUp(int x, int y) { void UITVTextButton::OnRBtnUp(int x, int y) { if (this->m_disabled == 0) { if (this->parent) { - this->parent->SendMsg(this, 99, this->m_value, x, y, 0); + this->parent->SendMsg(this, UM_TEXT_RBTN_UP, this->m_value, x, y, 0); } this->Invalidate(); @@ -1299,7 +1302,7 @@ void UIComboBoxV2Wnd::OnWheel(int value) { } if (this->parent) { - this->parent->SendMsg(this, 39, this->selected, 0, 0, 0); + this->parent->SendMsg(this, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } this->Invalidate(); @@ -1422,9 +1425,9 @@ void UIComboBoxID::Refresh() { void UIListBoxID::OnWheel(int value) { if (this->verticalOverflow != 0) { if (value < 0) { - this->SendMsg(this->verticalBar, 7, 3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 3, 0, 0, 0); } else { - this->SendMsg(this->verticalBar, 7, -3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -3, 0, 0, 0); } } } @@ -1434,9 +1437,9 @@ void UIListBoxID::OnWheel(int value) { void UITreeView::OnWheel(int value) { if (this->verticalOverflow != 0) { if (value < 0) { - this->SendMsg(this->verticalBar, 7, 3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 3, 0, 0, 0); } else { - this->SendMsg(this->verticalBar, 7, -3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -3, 0, 0, 0); } } } @@ -1602,7 +1605,7 @@ void UISlotBmpButton::OnLBtnDblClk(int x, int y) { UIBitmapButton::OnLBtnDblClk(x, y); if (this->parent) { - this->parent->SendMsg(this, 6, 184, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); } } @@ -1616,7 +1619,7 @@ void UITVTextButton::OnLBtnDblClk(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 97, this->m_value, x, y, 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_DblClk, this->m_value, x, y, 0); } this->Invalidate(); @@ -1626,7 +1629,7 @@ void UITVTextButton::OnLBtnDblClk(int x, int y) { // FUNCTION: fn_11411 void UIBmpRadioBtn::OnLBtnDown(int, int) { if (this->parent) { - this->parent->SendMsg(this, 6, this->geometry.id, this->m_value, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->m_value, 0, 0); } } @@ -1666,7 +1669,7 @@ void UIListBoxNavi::OnLBtnDown(int x, int y) { this->selected = this->LineAt(x, y); if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->selected, 0, 0); } this->Invalidate(); @@ -1685,8 +1688,8 @@ void UISlotBmpButton::OnLBtnDown(int x, int y) { UIBitmapButton::OnLBtnDown(x, y); if (this->parent) { - this->parent->SendMsg(this, 13, 0, 0, 0, 0); - this->parent->SendMsg(this, 6, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, 0, 0, 0); } } @@ -1701,7 +1704,7 @@ void UITVTextButton::OnLBtnDown(int, int) { this->Invalidate(); if (this->parent) { - this->parent->SendMsg(this, 107, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_BEGIN_DRAG_BTN, this->m_value, 0, 0, 0); this->unknown_00B6 = 1; } } @@ -1723,7 +1726,7 @@ void UITabControl::OnLBtnDown(int x, int y) { this->edit->Move(-100, -100); if (this->parent) { - this->parent->SendMsg(this, 22, this->unknown_007C, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->unknown_007C, 0, 0, 0); this->parent->Invalidate(); } @@ -1752,7 +1755,7 @@ void UIBitmapButton2::OnLBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 100, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_LBTN_UP, this->geometry.id, 0, 0, 0); } } @@ -1763,7 +1766,7 @@ void UIBitmapButton2::OnLBtnUp(int x, int y) { // OFFSET: 0x00890DA0 // FUNCTION: fn_11437 void UIComboBoxV2Wnd::OnLBtnUp(int, int) { - this->SendMsg(nullptr, 6, 273, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OPEN_MEMBER_POS_COMBO, 0, 0, 0); } // OFFSET: 0x00890E30 @@ -1781,7 +1784,7 @@ void UIItemStoreComboBox::OnLBtnUp(int x, int y) { this->selected = line; if (this->parent) { - this->parent->SendMsg(nullptr, 39, line, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_COMBOBOX_SELECTED, line, 0, 0, 0); } } @@ -1798,7 +1801,7 @@ void UITVBitmapButton::OnLBtnUp(int x, int y) { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 100, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_BMP_LBTN_UP, this->m_value, 0, 0, 0); } } @@ -1815,9 +1818,9 @@ void UITVTextButton::OnLBtnUp(int x, int y) { if (this->parent) { if (this->unknown_00B6 != 0) { - this->parent->SendMsg(this, 98, this->m_value, x, y, 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_UP, this->m_value, x, y, 0); } else { - this->parent->SendMsg(this, 109, this->m_value, 0, 0, 0); + this->parent->SendMsg(this, UM_END_DRAG_BTN, this->m_value, 0, 0, 0); } this->unknown_00B6 = 0; @@ -2485,7 +2488,7 @@ void UITableBox::Paint() { void UIPackageBoxNameList::OnLBtnDown(int x, int y) { this->selected = this->LineAt(x, y); if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->selected, 0, 0); } this->Invalidate(); @@ -2692,7 +2695,7 @@ void __stdcall Nullsub275(int, int, int, int) { // FUNCTION: fn_11405 void UIListBoxID::OnLBtnDblClk(int, int) { if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->lines[this->selected].id, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->lines[this->selected].id, 0, 0); } } @@ -2707,8 +2710,8 @@ void UINewComboBoxCtrl::OnLBtnDblClk(int, int) { // OFFSET: 0x00890480 // FUNCTION: fn_11416 void UIDescriptRace::OnLBtnDown(int, int) { - if (UIWindow* window = g_windowMgr.LookupWindow(278)) { - window->SendMsg(this, 6, 204, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NEWMAKECHARWND)) { + window->SendMsg(this, UM_COMMAND, ID_SLOT, 0, 0, 0); } } @@ -2921,7 +2924,7 @@ void UIItemTagButton::OnLBtnDown(int x, int y) { } if (this->m_value == 517) { - if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(315))) { + if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(WID_TIPBOXWND))) { tipbox->ShowTip(this->unknown_01F8); } return; @@ -2932,7 +2935,7 @@ void UIItemTagButton::OnLBtnDown(int x, int y) { } else { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 98, this->geometry.id, this->m_value, reinterpret_cast(this->unknown_00F8), 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_UP, this->geometry.id, this->m_value, reinterpret_cast(this->unknown_00F8), 0); this->Invalidate(); return; } @@ -2946,16 +2949,16 @@ void UIItemTagButton::OnLBtnDown(int x, int y) { void UIComboBox::OnLBtnUp(int x, int y) { this->selected = this->LineAt(x, y); if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { - target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); - g_windowMgr.CloseWindow(26); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); return; } if (this->parent) { - this->parent->SendMsg(nullptr, 39, this->selected, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } // OFFSET: 0x00890C20 @@ -2980,7 +2983,7 @@ void UIComboBoxID::OnLBtnUp(int x, int y) { extra = found->second; } - target->SendMsg(nullptr, 39, this->lines[this->selected].id, extra, 0, 0); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->lines[this->selected].id, extra, 0, 0); } else if (this->parent) { int extra = 0; const auto found = this->unknown_00C4.find(this->selected); @@ -2989,10 +2992,10 @@ void UIComboBoxID::OnLBtnUp(int x, int y) { extra = found->second; } - this->parent->SendMsg(nullptr, 39, this->lines[this->selected].id, extra, 0, 0); + this->parent->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->lines[this->selected].id, extra, 0, 0); } - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } // OFFSET: 0x00892990 @@ -3002,8 +3005,8 @@ void UIBasicSkillCtrl::OnRBtnDown(int x, int y) { return; } - UIWindow* window = g_windowMgr.EnsureWindow(46); - window->SendMsg(nullptr, 61, this->m_skillId, 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND); + window->SendMsg(nullptr, UM_SKILLDESCRIBE, this->m_skillId, 0, 0, 0); int screenX = 0; int screenY = 0; this->ToScreen(screenX, screenY); @@ -3020,7 +3023,7 @@ void UISlotBmpButton::SetSlot(int slot, int fallback) { return; } - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, this->m_slot, 0, 0, 0)); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, this->m_slot, 0, 0, 0)); if (!info) { this->icon->Show(0); return; @@ -3296,7 +3299,7 @@ void UIImgMenu::OnLBtnUp(int x, int y) { this->hovered = this->ItemAt(x, y); if (this->hovered != -1 && !this->unknown_0094[this->hovered]) { if (UIWindow* target = g_windowMgr.LookupWindow(this->unknown_00C8)) { - target->SendMsg(nullptr, 48, this->hovered, this->geometry.id, 0, 0); + target->SendMsg(nullptr, UM_MENU_SELECTED, this->hovered, this->geometry.id, 0, 0); } g_windowMgr.CloseWindow(0x7A); } @@ -3308,9 +3311,9 @@ void UIImgMenu::OnLBtnUp(int x, int y) { // FUNCTION: fn_11441 void UIString::OnLBtnUp(int, int) { if (!this->unknown_0084.empty()) { - UIWindow* window = g_windowMgr.EnsureWindow(201); - window->SendMsg(nullptr, 62, reinterpret_cast(this->unknown_0084.c_str()), 1, 0, 0); - UIWindow* frame = g_windowMgr.LookupWindow(10008); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MONSTERDISPLAYWND); + window->SendMsg(nullptr, UM_CARDITEMILLUSTRATE, reinterpret_cast(this->unknown_0084.c_str()), 1, 0, 0); + UIWindow* frame = g_windowMgr.LookupWindow(WID_RENEWQUESTUI); UIWindow* parent = this->parent; window->Move( frame->geometry.x + (parent->geometry.x + 100 + this->geometry.x), frame->geometry.y + (parent->geometry.y - 60 + this->geometry.y) @@ -3318,7 +3321,7 @@ void UIString::OnLBtnUp(int, int) { } else if (!this->unknown_00AC.empty()) { ITEM_INFO item; item.itemId = this->unknown_00AC; - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -3543,12 +3546,12 @@ void UIString::Paint() { // OFFSET: 0x00899780 // FUNCTION: fn_11557 int UISlotBmpButton::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 0x0D) { + if (message == UM_SETSTATE) { this->unknown_0124 = argument1 != 0; return 0; } - if (message != 0x1AF) { + if (message != UM_SET_CHARACTER_SLOT_STYLE) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -3611,7 +3614,7 @@ void UISlotBmpButton::Paint() { } if (this->m_slot >= 0) { - CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, this->m_slot, 0, 0, 0)); + CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, this->m_slot, 0, 0, 0)); if (info) { if (info->unknown_00AA > 0 || info->unknown_00A6 > 0) { if (this->m_inRange) { diff --git a/Source/UI/Buttons/UITextureButton.cpp b/Source/UI/Buttons/UITextureButton.cpp index 21206116a..533864e52 100644 --- a/Source/UI/Buttons/UITextureButton.cpp +++ b/Source/UI/Buttons/UITextureButton.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" #include "Client/Replay.h" #include "UI/Window/WindowPolicy.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -39,7 +41,7 @@ void UITextureButton::OnLBtnUp(int x, int y) { if (id == 185 && g_modeMgr.gameMode && g_modeMgr.gameMode->cursorType == 2) { const char* text = LookupMessage(17); if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { @@ -47,11 +49,11 @@ void UITextureButton::OnLBtnUp(int x, int y) { id = this->geometry.id; } - this->parent->SendMsg(this, 6, id, this->m_argument, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, id, this->m_argument, 0, 0); } } } else { - g_modeMgr.gameMode->SendMsg(0, this->geometry.id, this->m_argument, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, this->geometry.id, this->m_argument, 0, 0); } } diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index bfe7f8aec..5e814382a 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/CashShop/UICashShopWnd.h" #include "UI/Window/UIEnums.h" #include "Utility/EncryptedName.h" @@ -115,7 +117,7 @@ EncryptedName<85, 0x3B915119EFD523EFULL>& CashShopReplaceCartItemText::operator( // OFFSET: 0x007CE570 // FUNCTION: fn_09529 void UICashShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIFrameWnd::DragAndDrop(x, y, value); return; } @@ -127,25 +129,25 @@ void UICashShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 4) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (drag->quantity <= 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); if (g_windowMgr.window_01EC != nullptr) { - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 20, drag->quantity, 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 20, drag->quantity, 0, 0); } } // OFFSET: 0x007CE630 // FUNCTION: fn_09530 void UICashShopWnd_Cart::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -157,13 +159,13 @@ void UICashShopWnd_Cart::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 6) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); if (g_windowMgr.window_01EC != nullptr) { - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 19, 0, 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 19, 0, 0, 0); } } @@ -227,7 +229,7 @@ void UICashShopWnd::OnCreate(int, int) { button->SetBitmap(FormatOwnedString("유저인터페이스\\cashshop\\img_shop_tap%d_disable.bmp", tab).c_str(), 3); button->Move(tabX, 0x48); button->m_tooltip = LookupMessage(tooltips[tab]); - button->SendMsg(this, 13, tab == this->m_selectedTab, 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, tab == this->m_selectedTab, 0, 0, 0); tabX += 0x3A; this->AddChild(button); } @@ -341,9 +343,9 @@ void UICashShopWnd::OnCreate(int, int) { this->m_cart->Move(0x219, 0x48); this->AddChild(this->m_cart); - this->SendMsg(this->m_tabButtons[this->m_selectedTab], 6, 0xD7, 0, 0, 0); - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x140, 0, 0, 0, 0); + this->SendMsg(this->m_tabButtons[this->m_selectedTab], UM_COMMAND, ID_RADIOBTN, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_GET_ACCOUNT_LIMITED_SALE_LIST, 0, 0, 0, 0); if (g_session.unknown_5912) { charge->Enable(0); this->unknown_00F4->Show(0); @@ -494,7 +496,7 @@ void UICashShopWnd_Cart::Paint() { for (int slot = 0; slot < this->m_visibleCount; ++slot, ++index) { UICashShopWnd_CartItem* item = this->m_slots[slot]; if (index < this->m_cartItems.size()) { - item->SendMsg(this, 0x17, reinterpret_cast(&this->m_cartItems[index]), 0, 0, 0); + item->SendMsg(this, UM_REFRESHITEM, reinterpret_cast(&this->m_cartItems[index]), 0, 0, 0); } else { item->Show(0); } @@ -607,7 +609,7 @@ void UICashShopWnd_Item::Paint() { // OFFSET: 0x007D1020 // FUNCTION: fn_09544 void UICashShopWnd_CartItem::OnLBtnDblClk(int, int) { - this->SendMsg(this, 6, 0xD3, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_DELETE, 0, 0, 0); } // OFFSET: 0x007D1040 @@ -695,7 +697,7 @@ void UICashShopWnd::OnProcess() { void UICashShopWnd_Banner::OnProcess() { if (!this->m_entries.empty() && this->m_lastTick + 5000 < timeGetTime()) { const unsigned int next = this->m_index + 1; - this->SendMsg(this->m_buttons[next < this->m_entries.size() ? next : 0], 6, 0xD7, 0, 0, 0); + this->SendMsg(this->m_buttons[next < this->m_entries.size() ? next : 0], UM_COMMAND, ID_RADIOBTN, 0, 0, 0); } } @@ -703,9 +705,9 @@ void UICashShopWnd_Banner::OnProcess() { // FUNCTION: fn_09553 void UICashShopWnd_CartItem::OnRBtnUp(int x, int) { if (static_cast(x - 4) <= 0x25) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window != nullptr) { - window->SendMsg(nullptr, 24, reinterpret_cast(&this->m_item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->m_item), 0, 0, 0); } } } @@ -714,9 +716,9 @@ void UICashShopWnd_CartItem::OnRBtnUp(int x, int) { // FUNCTION: fn_09554 void UICashShopWnd_Item::OnRBtnUp(int x, int y) { if (static_cast(x - 5) <= 0x4B && static_cast(y - 0x17) <= 0x64) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window != nullptr) { - window->SendMsg(nullptr, 24, reinterpret_cast(&this->m_item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->m_item), 0, 0, 0); } } } @@ -725,9 +727,9 @@ void UICashShopWnd_Item::OnRBtnUp(int x, int y) { // FUNCTION: fn_09555 void UICashShopWnd_Cart::OnWheel(int delta) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 7, 1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, 1, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 7, -1, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, -1, 0, 0, 0); } } @@ -749,7 +751,7 @@ void UICashShopWnd_Banner::CreateButtons() { button->SetBitmap("유저인터페이스\\cashshop\\btn_ad_off.bmp", 1); button->SetBitmap("유저인터페이스\\cashshop\\btn_ad_on.bmp", 2); button->Move(this->geometry.width + (index - static_cast(this->m_entries.size())) * 12 - 12, 0x29); - button->SendMsg(this, 13, index == this->m_index, 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, index == this->m_index, 0, 0, 0); this->AddChild(button); this->m_buttons.emplace_back(button); ++index; @@ -779,8 +781,8 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument } return 0; - case 0x78: - case 0x7A: { + case UM_SET_CASHSHOP_BALANCE: + case UM_UPDATE_CASHSHOP_BALANCE: { HKEY key; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, g_subKey, 0, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) { DWORD type = REG_DWORD; @@ -792,11 +794,11 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->unknown_00E8 = argument1; this->unknown_00EC = argument2; this->unknown_00F4->SetText(IntToString(0, 0).c_str()); - this->SendMsg(this, 6, 0x182, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 0x182, 0, 0, 0); return 0; } - case 0x9B: + case UM_SET_CASHSHOP_TOTAL_PRICE: this->unknown_00F0 = argument1; this->Invalidate(); return 0; @@ -820,12 +822,12 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument case UM_DEFPUSH: if (sender == this->unknown_00E0) { - this->SendMsg(nullptr, 6, 0x141, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_SEARCH, 0, 0, 0); } return 0; case UM_ADDITEM: - this->m_cart->SendMsg(sender, 0x1F, argument1, 1, 0, 0); + this->m_cart->SendMsg(sender, UM_ADDITEM, argument1, 1, 0, 0); return 0; case UM_DROP: { @@ -850,9 +852,9 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (entry != cartItems.end()) { if (entry->quantity > drag->quantity) { - this->m_cart->SendMsg(this, 0x1F, reinterpret_cast(&*entry), -drag->quantity, 0, 0); + this->m_cart->SendMsg(this, UM_ADDITEM, reinterpret_cast(&*entry), -drag->quantity, 0, 0); } else { - this->m_cart->SendMsg(this, 0x68, entry->GetItemId(), 0, 0, 0); + this->m_cart->SendMsg(this, UM_DECITEM, entry->GetItemId(), 0, 0, 0); } } } else if (drag->source == 6) { @@ -868,8 +870,8 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument const int stock = product->unknown_0078[3]; if (stock <= 0) { g_windowMgr.Confirm(LookupMessage(0xE50), 0, true, false, 0, "Message", 0x118, 0x78, 0); - mode->SendMsg(0x12, 0, 0, 0, 0); - mode->SendMsg(0x12, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -895,11 +897,11 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument } if (product != this->m_items.end()) { - this->m_cart->SendMsg(this, 0x1F, reinterpret_cast(&*product), drag->quantity, 0, 0); + this->m_cart->SendMsg(this, UM_ADDITEM, reinterpret_cast(&*product), drag->quantity, 0, 0); } } - mode->SendMsg(0x12, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -907,9 +909,9 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument switch (argument1) { case ID_CLOSE: if (g_session.unknown_5912) { - g_modeMgr.GetGameMode()->SendMsg(0x14B, 5, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STOVE_AUTHENTICATION, 5, 0, 0, 0); } - g_windowMgr.CloseWindow(0x13E); + g_windowMgr.CloseWindow(WID_CASHSHOP_WND); return 0; case ID_RADIOBTN: { int selected = this->m_selectedTab; @@ -922,11 +924,11 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (selected != this->m_selectedTab) { for (std::map::iterator tab = this->m_tabButtons.begin(); tab != this->m_tabButtons.end(); ++tab) { if (tab->first != 10 && tab->first != 8 && tab->second != nullptr) { - tab->second->SendMsg(this, 13, selected == tab->first, 0, 0, 0); + tab->second->SendMsg(this, UM_SETSTATE, selected == tab->first, 0, 0, 0); } } this->m_selectedTab = selected; - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->unknown_00E4->Enable(this->m_selectedTab == 9); @@ -952,7 +954,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument return 0; } - g_modeMgr.GetGameMode()->SendMsg(0x14B, 3, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_STOVE_AUTHENTICATION, 3, 0, 0, 0); return 0; } @@ -1041,7 +1043,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->m_pageCount = this->m_items.size() / this->m_itemsPerPage + (this->m_items.size() % this->m_itemsPerPage != 0); for (std::map::iterator tab = this->m_tabButtons.begin(); tab != this->m_tabButtons.end(); ++tab) { if (tab->second != nullptr) { - tab->second->SendMsg(this, 13, 0, 0, 0, 0); + tab->second->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } this->LayoutPage(); @@ -1055,7 +1057,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument case 0x182: this->unknown_00F0 = 0; this->m_cart->m_cartItems.clear(); - this->m_cart->SendMsg(this->m_cart, 7, 0, 0, 0, 0); + this->m_cart->SendMsg(this->m_cart, UM_SCROLLVERT, 0, 0, 0, 0); this->m_cart->Invalidate(); this->Invalidate(); return 0; @@ -1067,21 +1069,21 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->m_page = this->m_pageCount - 1; this->LayoutPage(); return 0; - case 0x19F: - g_modeMgr.GetGameMode()->SendMsg(0x140, 0, 0, 0, 0); + case ID_PARTY_RELOAD_FIRST_PAGE: + g_modeMgr.GetGameMode()->SendMsg(MM_GET_ACCOUNT_LIMITED_SALE_LIST, 0, 0, 0, 0); return 0; } return 0; - case 0xA4: + case UM_SELECT_CASHSHOP_TAB: if (argument1 != 0 && argument1 != this->m_selectedTab) { for (std::map::iterator tab = this->m_tabButtons.begin(); tab != this->m_tabButtons.end(); ++tab) { if (tab->first != 10 && tab->first != 8 && tab->second != nullptr) { - tab->second->SendMsg(this, 13, argument1 == tab->first, 0, 0, 0); + tab->second->SendMsg(this, UM_SETSTATE, argument1 == tab->first, 0, 0, 0); } } this->m_selectedTab = argument1; - this->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return 0; } @@ -1092,13 +1094,13 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x007D2C00 // FUNCTION: fn_09559 int UICashShopWnd_Banner::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6 && argument1 == 0xD7) { + if (message == UM_COMMAND && argument1 == 0xD7) { for (unsigned int index = 0; index < this->m_buttons.size(); ++index) { if (sender == this->m_buttons[index]) { - this->m_buttons[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_buttons[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_index = index; } else { - this->m_buttons[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_buttons[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } @@ -1200,7 +1202,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg } entry.quantity = quantity; this->m_cartItems.push_back(entry); - this->SendMsg(this, 7, 1, 0, 0, 0); + this->SendMsg(this, UM_SCROLLVERT, 1, 0, 0, 0); } else { const int limit = it->unknown_0078[3]; if (limit != 0 && it->quantity + quantity > limit) { @@ -1218,7 +1220,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg } else { it->quantity = total > 0 ? total : 1; } - this->SendMsg(this, 7, 0, 0, 0, 0); + this->SendMsg(this, UM_SCROLLVERT, 0, 0, 0, 0); } if (this->parent != nullptr) { @@ -1226,7 +1228,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg for (const ITEM_INFO& entry : this->m_cartItems) { price += entry.unknown_0014[0] * entry.quantity; } - this->parent->SendMsg(this, 0x9B, price, 0, 0, 0); + this->parent->SendMsg(this, UM_SET_CASHSHOP_TOTAL_PRICE, price, 0, 0, 0); } this->Invalidate(); return UIWindow::SendMsg(sender, message, argument1, quantity, argument3, argument4); @@ -1252,9 +1254,9 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg for (const ITEM_INFO& entry : this->m_cartItems) { price += entry.unknown_0014[0] * entry.quantity; } - this->parent->SendMsg(this, 0x9B, price, 0, 0, 0); + this->parent->SendMsg(this, UM_SET_CASHSHOP_TOTAL_PRICE, price, 0, 0, 0); } - this->SendMsg(this, 7, 0, 0, 0, 0); + this->SendMsg(this, UM_SCROLLVERT, 0, 0, 0, 0); this->Invalidate(); break; } @@ -1266,28 +1268,28 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg // OFFSET: 0x007D3430 // FUNCTION: fn_09561 int UICashShopWnd_CartItem::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { + if (message == UM_COMMAND) { switch (argument1) { case ID_DELETE: if (this->parent != nullptr) { - this->parent->SendMsg(this, 0x68, atoi(this->m_item.itemId.c_str()), 0, 0, 0); + this->parent->SendMsg(this, UM_DECITEM, atoi(this->m_item.itemId.c_str()), 0, 0, 0); this->Invalidate(); } break; case ID_UP: if (this->parent != nullptr) { - this->parent->SendMsg(this, 0x1F, reinterpret_cast(&this->m_item), 1, 0, 0); + this->parent->SendMsg(this, UM_ADDITEM, reinterpret_cast(&this->m_item), 1, 0, 0); } this->Invalidate(); break; case ID_DOWN: if (this->parent != nullptr) { - this->parent->SendMsg(this, 0x1F, reinterpret_cast(&this->m_item), -1, 0, 0); + this->parent->SendMsg(this, UM_ADDITEM, reinterpret_cast(&this->m_item), -1, 0, 0); } this->Invalidate(); break; } - } else if (message == 0x17) { + } else if (message == UM_REFRESHITEM) { this->m_item = *reinterpret_cast(argument1); this->Show(1); this->Invalidate(); @@ -1299,11 +1301,11 @@ int UICashShopWnd_CartItem::SendMsg(UIWindow* sender, int message, std::intptr_t // OFFSET: 0x007D3540 // FUNCTION: fn_09562 int UICashShopWnd_Item::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { + if (message == UM_COMMAND) { if (argument1 == 0xE0 && this->parent != nullptr) { - this->parent->SendMsg(this, 0x1F, reinterpret_cast(&this->m_item), 0, 0, 0); + this->parent->SendMsg(this, UM_ADDITEM, reinterpret_cast(&this->m_item), 0, 0, 0); } - } else if (message == 0x17) { + } else if (message == UM_REFRESHITEM) { this->m_item = *reinterpret_cast(argument1); this->Show(1); this->m_addButton->SetDisabled(0); @@ -1368,7 +1370,7 @@ void UICashShopWnd::LayoutPage() { this->m_itemWindows[slot]->Move(slot % this->m_columns * 0xAF + 8, slot / this->m_columns * 0x7F + 0x6B); } - this->m_itemWindows[slot]->SendMsg(this, 0x17, reinterpret_cast(&*item), this->m_selectedTab, 0, 0); + this->m_itemWindows[slot]->SendMsg(this, UM_REFRESHITEM, reinterpret_cast(&*item), this->m_selectedTab, 0, 0); } this->Invalidate(); diff --git a/Source/UI/Chat/ChatSuggestions.cpp b/Source/UI/Chat/ChatSuggestions.cpp index 900d5db9c..86a004725 100644 --- a/Source/UI/Chat/ChatSuggestions.cpp +++ b/Source/UI/Chat/ChatSuggestions.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Chat/UINewChatWnd.h" #include "UI/Chat/UISubChatHisWnd.h" @@ -116,7 +117,7 @@ void UISubChatHisWnd::ApplyButtonLayout() { // FUNCTION: fn_12768 void UINewChatWnd::ResizeRows(int count) { if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } UIWindow& chat = *this; diff --git a/Source/UI/Chat/UIChatRoomTitle.cpp b/Source/UI/Chat/UIChatRoomTitle.cpp index d57004a9d..e8757ef6d 100644 --- a/Source/UI/Chat/UIChatRoomTitle.cpp +++ b/Source/UI/Chat/UIChatRoomTitle.cpp @@ -1,4 +1,7 @@ #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/ModeMgr.h" #include "Contents/ForbiddenWords.h" #include "Contents/MessageTable.h" @@ -38,9 +41,9 @@ void UIChatRoomTitle::OnCreate(int, int) { void UIChatRoomTitle::OnLBtnDblClk(int, int) { CMode* mode = g_modeMgr.GetGameMode(); if (this->roomType == 0) { - g_windowMgr.EnsureWindow(29)->SendMsg(nullptr, 47, this->roomId, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_PASSWORDWND)->SendMsg(nullptr, UM_SETROOMID, this->roomId, 0, 0, 0); } else if (this->roomType != 3) { - mode->SendMsg(45, this->roomId, 0, 0, 0); + mode->SendMsg(MM_REQ_ENTER_ROOM, this->roomId, 0, 0, 0); } } @@ -92,11 +95,11 @@ void UIChatRoomTitle::ResetCursor(int x, int y) { // OFFSET: 0x008637A0 // FUNCTION: fn_10910 int UIChatRoomTitle::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { return 0; } - if (message != 34) { + if (message != UM_SETINFO) { return UIWindow::SendMsg(sender, message, a, b, c, d); } diff --git a/Source/UI/Chat/UINewChatWnd.cpp b/Source/UI/Chat/UINewChatWnd.cpp index cfb9204e1..6ff272bdf 100644 --- a/Source/UI/Chat/UINewChatWnd.cpp +++ b/Source/UI/Chat/UINewChatWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Chat/UINewChatWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" @@ -46,12 +49,12 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } switch (message) { - case 0x9A: + case UM_RESOLVE_PLAYER_TAGS: for (std::map::iterator it = g_session.m_noSubChatWnds.begin(); it != g_session.m_noSubChatWnds.end(); ++it) { static_cast(this->m_tabs[it->first])->ResolvePlayerTags(reinterpret_cast(a)); } return 0; - case 0x75: { + case UM_DETACH_CHAT_TAB: { if (!g_session.m_canDragWnd || g_session.m_noSubChatWnds.size() <= 1) { return 0; } @@ -110,7 +113,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->ApplyHeaderLayout(); return 0; } - case 0x76: { + case UM_ATTACH_CHAT_TAB: { if (!g_session.m_canDragWnd || this->m_tabControl->geometry.width + this->m_tabWidth > this->geometry.width - 0x5A) { return 0; } @@ -124,8 +127,8 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i int count = static_cast(g_session.m_noSubChatWnds.size()); if (this->TextWidth(found->second.name.c_str(), 0, 0, 12, 0, 0) * (count + 1) > this->geometry.width - 0x5A) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6F0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x6F0)), 0xFF, 0, 0, 0); g_windowMgr.Promote(sender); return 0; } @@ -186,8 +189,8 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i g_session.m_noSubChatWnds[b].name = reinterpret_cast(a); this->m_tabWidth = this->m_tabControl->geometry.width / g_session.m_noSubChatWnds.size(); g_windowMgr.SetFocus(this->m_inputEdit); - if (UIWindow* window = g_windowMgr.LookupWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_currentTab, 1, 2); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_currentTab, 1, 2); } } RECT rectangle; @@ -271,7 +274,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return 0; case UM_ADDCHAT: case UM_ADDCHAT2: - if (message != 0x73) { + if (message != UM_ADDCHAT2) { std::vector lines; char name[25] = {}; if (d != 0) { @@ -333,7 +336,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i index = 0; for (std::map::iterator it = g_session.m_subChatWnds.begin(); it != g_session.m_subChatWnds.end(); ++it, ++index) { if (it->second.options[c] || everyTab) { - g_windowMgr.retainedWindows[index]->SendMsg(this, 0x25, a, b, reinterpret_cast(name), 0); + g_windowMgr.retainedWindows[index]->SendMsg(this, UM_ADDCHAT, a, b, reinterpret_cast(name), 0); } } } @@ -352,14 +355,14 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case UM_COMMAND: switch (a) { case ID_OPTION: - if (UIWindow* window = g_windowMgr.EnsureWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_currentTab, 1, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_currentTab, 1, 0); } return 0; - case 0x15B: + case ID_NAME: g_windowMgr.SelectWhisperName(reinterpret_cast(b)); return 0; - case 0x165: + case ID_STICK_ON: *reinterpret_cast(&g_windowMgr.unknown_03F4) = 1; this->m_currentTab = 0; if (this->unknown_0118 == 0) { @@ -368,23 +371,23 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->ResizeRows(this->unknown_0118); this->Invalidate(); return 0; - case 0x166: - this->SendMsg(this, 0x75, this->m_currentTab, 0, 0, 0); + case ID_STICK_OFF: + this->SendMsg(this, UM_DETACH_CHAT_TAB, this->m_currentTab, 0, 0, 0); return 0; case ID_TALKTOWHOCOMBO: { this->unknown_00F0 = 1; if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(0x1A); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } - UIWindow* menu = g_windowMgr.EnsureWindow(0x1A); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x55)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x56)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x1B5)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0x939)), 0, 0, 0); - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(LookupMessage(0xFC0)), 0, 0, 0); - menu->SendMsg(nullptr, 0x28, *reinterpret_cast(&g_session.unknown_5490[0x8]), 0, 0, 0); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x55)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x56)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x1B5)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0x939)), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(LookupMessage(0xFC0)), 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, *reinterpret_cast(&g_session.unknown_5490[0x8]), 0, 0, 0); menu->Resize(0x70, 0x30); - menu->SendMsg(nullptr, 0x53, 1, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 1, 0, 0, 0); int x = this->geometry.width - 0x73; int y = this->geometry.height - this->m_inputAreaHeight; this->ToScreen(x, y); @@ -394,27 +397,27 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case ID_WHISPERCOMBO: { this->unknown_00F0 = 0; if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(0x1A); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } const int count = static_cast(static_cast(this->unknown_00C0)->history.size()); if (count == 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xC0)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xC0)), 0xFF, 0, 0, 0); return 0; } - UIWindow* menu = g_windowMgr.EnsureWindow(0x1A); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); for (int i = 0; i < count; ++i) { - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(static_cast(this->unknown_00C0)->history[i].c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(static_cast(this->unknown_00C0)->history[i].c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(""), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(""), 0, 0, 0); int height = (count + 1) * 16; if (height > 0x50) { height = 0x50; } - menu->SendMsg(nullptr, 0x28, static_cast(this->unknown_00C0)->historyIndex, 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, static_cast(this->unknown_00C0)->historyIndex, 0, 0, 0); menu->Resize(0x70, height); - menu->SendMsg(nullptr, 0x53, 1, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 1, 0, 0, 0); int x = 0; int y = this->geometry.height - this->m_inputAreaHeight; this->ToScreen(x, y); @@ -455,7 +458,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i if (rejected) { static_cast(this->m_chatEdit)->SetText(""); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBE2)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBE2)), 0xFF, 0, 0, 0); return 0; } @@ -469,13 +472,13 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } if (g_serviceType == 1 && !ValidateCharacterName(buffer)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBE)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBE)), 0xFF, 0, 0, 0); return 0; } if (static_cast(this->unknown_00C0)->Length() != 0 && buffer[0] != '/') { g_windowMgr.unknown_04DC = buffer; - g_modeMgr.gameMode->SendMsg(0xB, reinterpret_cast(static_cast(this->unknown_00C0)->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(static_cast(this->unknown_00C0)->Text()), 0, 0, 0); return 0; } @@ -489,20 +492,20 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i if (talkType == 0x37 || talkType == 0x1A || talkType == 0x12) { if (_mbsstr(reinterpret_cast(buffer), reinterpret_cast(s_chatItemLinkOpening.c_str())) != nullptr || _mbsstr(reinterpret_cast(buffer), reinterpret_cast(s_itemLinkClosing.c_str())) != nullptr) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); return 0; } } if (offset != -1) { g_windowMgr.SetUnknown04DC(buffer + offset); } - g_modeMgr.gameMode->SendMsg(0x2A, talkType, reinterpret_cast(parts), 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, talkType, reinterpret_cast(parts), 0, 0); return 0; } case ID_HIS: - this->SendMsg(nullptr, 2, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_TOGGLEPUSH, 0, 0, 0, 0); return 0; - case 0x176: { + case ID_ADD_CHAT_TAB: { int noSubCount = static_cast(g_session.m_noSubChatWnds.size()); int subCount = static_cast(g_session.m_subChatWnds.size()); const int total = noSubCount + subCount; @@ -581,8 +584,8 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } this->RefreshTabs(true); this->ApplyHeaderLayout(); - if (UIWindow* window = g_windowMgr.LookupWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_currentTab, 1, 1); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_currentTab, 1, 1); } return 0; } @@ -625,9 +628,9 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i UIListBox* tab = static_cast(this->m_tabs[this->m_currentTab]); if (tab != nullptr && tab->verticalOverflow != 0) { if (HIBYTE(GetKeyState(VK_CONTROL))) { - tab->SendMsg(nullptr, 7, tab->LineCount(), 0, 0, 0); + tab->SendMsg(nullptr, UM_SCROLLVERT, tab->LineCount(), 0, 0, 0); } else { - tab->SendMsg(nullptr, 10, 0, 0, 0, 0); + tab->SendMsg(nullptr, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } } return 0; @@ -636,9 +639,9 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i UIListBox* tab = static_cast(this->m_tabs[this->m_currentTab]); if (tab != nullptr && tab->verticalOverflow != 0) { if (HIBYTE(GetKeyState(VK_CONTROL))) { - tab->SendMsg(nullptr, 7, -tab->LineCount(), 0, 0, 0); + tab->SendMsg(nullptr, UM_SCROLLVERT, -tab->LineCount(), 0, 0, 0); } else { - tab->SendMsg(nullptr, 9, 0, 0, 0, 0); + tab->SendMsg(nullptr, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } } return 0; diff --git a/Source/UI/Chat/UISubChatHisWnd.cpp b/Source/UI/Chat/UISubChatHisWnd.cpp index cf276bf3c..788da3ba7 100644 --- a/Source/UI/Chat/UISubChatHisWnd.cpp +++ b/Source/UI/Chat/UISubChatHisWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Chat/UISubChatHisWnd.h" #include "Contents/UserData/NormalItemSlots.h" #include "Client/Session.h" @@ -22,8 +24,8 @@ // FUNCTION: fn_12700 void UISubChatHisWnd::OnLBtnDown(int x, int y) { if (g_session.m_canDragWnd) { - if (UIWindow* window = g_windowMgr.LookupWindow(132)) { - window->SendMsg(this, 6, 193, this->m_index, 0, 2); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_index, 0, 2); } this->UIFrameWnd::OnLBtnDown(x, y); } @@ -57,11 +59,11 @@ void UISubChatHisWnd::OnLBtnUp(int x, int y) { int screenY = 0; this->ToScreen(screenX, screenY); - UIWindow* window = g_windowMgr.LookupWindow(1); + UIWindow* window = g_windowMgr.LookupWindow(WID_CHATWND); if (window && window->geometry.x <= screenX && screenX <= window->geometry.width + window->geometry.x) { const int bottom = this->geometry.height + screenY; if (window->geometry.y <= bottom && bottom <= window->geometry.height + window->geometry.y) { - window->SendMsg(this, 118, 0, 0, 0, 0); + window->SendMsg(this, UM_ATTACH_CHAT_TAB, 0, 0, 0, 0); } } } diff --git a/Source/UI/Clan/UIClanWnd.cpp b/Source/UI/Clan/UIClanWnd.cpp index ed769d829..39f63b7a5 100644 --- a/Source/UI/Clan/UIClanWnd.cpp +++ b/Source/UI/Clan/UIClanWnd.cpp @@ -1,5 +1,7 @@ #include "UI/Clan/UIClanWnd.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Contents/ClanInfo.h" #include "Contents/MapInfoMgr.h" #include "Contents/MessageTable.h" @@ -172,7 +174,7 @@ int UIClanInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1 switch (message) { case UM_COMMAND: if (a1 == 201) { - g_windowMgr.CloseWindow(237); + g_windowMgr.CloseWindow(WID_CLANINFOMANAGEWND); } return 0; case UM_REFRESH: diff --git a/Source/UI/Dialogs/UIEditctrlWnd.cpp b/Source/UI/Dialogs/UIEditctrlWnd.cpp index 68e871f38..2073bb160 100644 --- a/Source/UI/Dialogs/UIEditctrlWnd.cpp +++ b/Source/UI/Dialogs/UIEditctrlWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Dialogs/UIEditctrlWnd.h" @@ -230,7 +231,7 @@ void UIMiniMapWnd::OnLBtnDown(int x, int y) { this->dragging = 0; g_windowMgr.miniMapClickY = y - 6; g_windowMgr.miniMapClickX = x - 6 < 0 ? 0 : x - 6; - g_windowMgr.EnsureWindow(274); + g_windowMgr.EnsureWindow(WID_EDITCTRLWND); } } @@ -261,18 +262,18 @@ int UIEditctrlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (g_windowMgr.window_4F1CC) { static_cast(g_windowMgr.window_4F1CC)->LoadMemos(); } - g_windowMgr.CloseWindow(274); + g_windowMgr.CloseWindow(WID_EDITCTRLWND); } return 0; } case ID_CLOSE: - g_windowMgr.CloseWindow(274); + g_windowMgr.CloseWindow(WID_EDITCTRLWND); return 0; } return 0; case UM_DEFPUSH: if (this->edit == sender && this->edit->Length() > 0) { - this->SendMsg(this->edit, 6, 184, 0, 0, 0); + this->SendMsg(this->edit, UM_COMMAND, ID_OK, 0, 0, 0); return 0; } } @@ -376,7 +377,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 switch (message) { case UM_COMMAND: switch (argument1) { - case 194: { + case ID_ITEMS: { const bool enabled = this->unknown_0120->geometry.unknown_0030 != 0; for (auto it = this->townButtons.begin(); it != this->townButtons.end(); ++it) { it->second->Enable(enabled); @@ -384,12 +385,12 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 this->Invalidate(); return 0; } - case 200: + case ID_BASE: return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(273); + g_windowMgr.CloseWindow(WID_MINIMAPWND); return 0; - case 356: + case ID_BOOKMARK: this->dragging = 1; return 0; case 361: { @@ -464,19 +465,19 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 this->unknown_0124->SetChecked(this->m_saved->unknown_0020); return 0; - case 481: + case UM_MINIMAP_SET_PLAYER_POS: this->m_playerHead->Move(static_cast(static_cast(argument1) * this->scale - 13.0f + this->originX), static_cast(this->originY - (static_cast(argument2) * this->scale + 13.0f))); this->Invalidate(); return 0; - case 482: + case UM_MINIMAP_SET_BOSS_POS: this->unknown_012C->Move(static_cast(static_cast(argument1) * this->scale - 12.0f + this->originX), static_cast(this->originY - (static_cast(argument2) * this->scale + 12.0f))); this->Invalidate(); return 0; - case 483: + case UM_MINIMAP_SET_MARK_POS: if (static_cast(argument1) < 3 && argument2 >= 0) { std::vector& marks = (&this->partyMarks)[argument1]; if (static_cast(argument2) < marks.size()) { @@ -489,7 +490,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } return 0; - case 484: + case UM_MINIMAP_SET_MARK_COUNT: if (argument2 >= 0) { std::vector& marks = (&this->partyMarks)[argument1]; if (static_cast(argument2) != marks.size()) { @@ -500,7 +501,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } return 0; - case 485: { + case UM_MINIMAP_ADD_QUEST_MARK: { const int id = static_cast(this->questButtons.size()) + 2001; const std::string name = FormatOwnedString("유저인터페이스\\minimap\\Quest_%d_%d.bmp", argument1, argument2); UIBitmapButton* button = new UIBitmapButton(); @@ -519,7 +520,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; } - case 486: + case UM_MINIMAP_CLEAR_QUEST_MARKS: for (auto entry = this->townButtons.begin(); entry != this->townButtons.end(); ++entry) { this->RemoveChild(entry->second, 1); } diff --git a/Source/UI/Dialogs/UIEmailAddressWnd.cpp b/Source/UI/Dialogs/UIEmailAddressWnd.cpp index 38feff7a3..f419205d9 100644 --- a/Source/UI/Dialogs/UIEmailAddressWnd.cpp +++ b/Source/UI/Dialogs/UIEmailAddressWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Dialogs/UIEmailAddressWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "UI/Edit/UIEditCtrl.h" #include "UI/Window/UIWindowMgr.h" @@ -6,10 +8,10 @@ // OFFSET: 0x008F9820 // FUNCTION: fn_12341 int UIEmailAddressWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { g_windowMgr.unknown_0474 = static_cast(a); if (a == 184) { - g_modeMgr.gameMode->SendMsg(10012, reinterpret_cast(this->m_edit->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SET_EMAIL_ADDRESS, reinterpret_cast(this->m_edit->Text()), 0, 0, 0); } return 0; diff --git a/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp b/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp index 30b39a0d9..bbb146d59 100644 --- a/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp +++ b/Source/UI/Dialogs/UIWaitDBSaveWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Dialogs/UIWaitDBSaveWnd.h" +#include "UI/Window/WindowId.h" #include "Render/Textures/SpritePixels.h" #include "Resource/Bitmap/BitmapResource.h" @@ -160,7 +161,7 @@ void UIWaitDBSaveWnd::OnMouseMove(int, int) { void UIWaitDBSaveWnd::OnProcess() { if (this->m_closeTime != 0 && timeGetTime() >= this->m_closeTime) { this->m_closeTime = 0; - g_windowMgr.CloseWindow(10024); + g_windowMgr.CloseWindow(WID_WAITDBSAVEWND); return; } diff --git a/Source/UI/Edit/UIEditBoxEx.cpp b/Source/UI/Edit/UIEditBoxEx.cpp index 3ab7f82cc..1e55789ce 100644 --- a/Source/UI/Edit/UIEditBoxEx.cpp +++ b/Source/UI/Edit/UIEditBoxEx.cpp @@ -1,5 +1,6 @@ #include "UI/Edit/UIEditBoxEx.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/UIEnums.h" #include "Network/TextEncoding.h" #include "UI/Buttons/UIButton.h" #include "UI/Lists/UIScrollBar.h" @@ -311,7 +312,7 @@ void CUIEditBoxEx::Resize(int width, int height) { // OFFSET: 0x009E5AE0 // FUNCTION: fn_14449 int CUIEditBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 0 && this->onSubmit) { + if (message == UM_DEFPUSH && this->onSubmit) { this->onSubmit(); } return UIWindow::SendMsg(sender, message, a, b, c, d); @@ -435,7 +436,7 @@ int CUIEditCtrlEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_serverLanguage->Insert("\r\n"); return 0; } - UIWindow::SendMsg(sender, 0, a, b, c, d); + UIWindow::SendMsg(sender, UM_DEFPUSH, a, b, c, d); return 0; case UM_UPPUSH: if (this->line > 0) { diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index 3d3de472f..902faf292 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -1,3 +1,6 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "Render/Text/FontCache.h" #include "Contents/Items/ItemType.h" #include "UI/Window/UIEnums.h" @@ -417,19 +420,19 @@ __forceinline void UIEditCtrl::InsertLink(const char* value) { // OFFSET: 0x008641C0 // FUNCTION: fn_10914 int UIEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 153) { + if (message == UM_INSERT_ITEM_LINK) { this->InsertLink(reinterpret_cast(a)); - } else if (message == 98 && c > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + } else if (message == UM_TEXT_LBTN_UP && c > 0) { + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, c, 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, c, 0, 0, 0); } } UIWindow::SendMsg(sender, message, a, b, c, d); - if (message == 0 && this->preserveInput == 0) { + if (message == UM_DEFPUSH && this->preserveInput == 0) { g_serverLanguage->ResetInput(); } @@ -960,18 +963,18 @@ void UIEditCtrl_Custom::Synchronize() { // OFFSET: 0x00972520 // FUNCTION: fn_13272 void UIItemStoreFindWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00972570 // FUNCTION: fn_13273 void UIItemStoreSubWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -983,7 +986,7 @@ void UIItemStoreSubWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 9: break; default: - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } @@ -992,12 +995,12 @@ void UIItemStoreSubWnd::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 7, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 7, 0, 0, 0); } // OFFSET: 0x00972630 @@ -1008,19 +1011,19 @@ void UIItemStoreWnd::DragAndDrop(int x, int y, std::intptr_t value) { if (g_unknown_01738270 == 1) { std::memset(text, 0, 250); std::sprintf(text, LookupMessage(0x9C2)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); return; } if (!g_unknown_0173826C && !g_unknown_01738270) { std::memset(text, 0, 250); std::sprintf(text, LookupMessage(0x9C5)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); return; } } - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -1032,7 +1035,7 @@ void UIItemStoreWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 9: break; default: - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } @@ -1041,18 +1044,18 @@ void UIItemStoreWnd::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 7, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 7, 0, 0, 0); } // OFFSET: 0x009727F0 // FUNCTION: fn_13275 void UIItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -1072,29 +1075,29 @@ void UIItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 17: case 18: case 24: - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; case 6: case 9: case 15: if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 6, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 6, 0, 0, 0); return; case 14: { UIWindow* target = reinterpret_cast(g_windowMgr.unknown_0378); if (target) { - target->SendMsg(nullptr, 75, reinterpret_cast(drag->name.c_str()), 0, 0, 0); + target->SendMsg(nullptr, UM_CLEAR_ITEM, reinterpret_cast(drag->name.c_str()), 0, 0, 0); } break; } case 28: { - UIWindow* window = g_windowMgr.LookupWindow(295); + UIWindow* window = g_windowMgr.LookupWindow(WID_REFININGWND); if (window) { static_cast(window)->Reset(); @@ -1102,7 +1105,7 @@ void UIItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { break; } case 33: { - UIWindow* window = g_windowMgr.LookupWindow(343); + UIWindow* window = g_windowMgr.LookupWindow(WID_GRADEENCHANTWND); if (window) { static_cast(window)->ResetItem(); @@ -1111,7 +1114,7 @@ void UIItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { } } - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00989080 @@ -1126,18 +1129,18 @@ void UIItemStoreFindWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_01D4) { if (mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(56, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_BODY, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (g_windowMgr.unknown_02F4 && mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(78, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_CART, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (HIBYTE(GetAsyncKeyState(VK_SHIFT))) { if (g_windowMgr.unknown_01D4) { - mode->SendMsg(333, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_TO_PERSONAL, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1154,18 +1157,18 @@ void UIItemStoreSubWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_01D4) { if (mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(56, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_BODY, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (g_windowMgr.unknown_02F4 && mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(78, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_CART, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (HIBYTE(GetAsyncKeyState(VK_SHIFT))) { if (g_windowMgr.unknown_01D4) { - mode->SendMsg(333, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_TO_PERSONAL, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1182,16 +1185,16 @@ void UIItemStoreWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_01D4) { if (mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(56, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_BODY, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (g_windowMgr.unknown_02F4 && mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(78, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_CART, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (HIBYTE(GetAsyncKeyState(VK_SHIFT))) { - mode->SendMsg(333, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_TO_PERSONAL, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1218,27 +1221,27 @@ void UIItemWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.window_0288) { if (mode->unknown_05CE) { mode->unknown_05CE = 0; - mode->SendMsg(55, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_ADD_ITEM_TO_STORE, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } - } else if (g_windowMgr.LookupWindow(10011)) { + } else if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { if (mode->unknown_05CE) { mode->unknown_05CE = 0; - mode->SendMsg(51, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (g_windowMgr.unknown_02F4 && mode->unknown_05CE) { mode->unknown_05CE = 0; - mode->SendMsg(76, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_BODY_TO_CART, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (HIBYTE(GetAsyncKeyState(VK_SHIFT))) { if (this->tabs) { - mode->SendMsg(334, static_cast(item.unknown_0000[1]), this->tabs->unknown_007C == 3, 0, 0); + mode->SendMsg(MM_INVENTORY_TAB, static_cast(item.unknown_0000[1]), this->tabs->unknown_007C == 3, 0, 0); } } else if (HIBYTE(GetAsyncKeyState(VK_CONTROL))) { if (item.unknown_0000[1] > 0 && !g_session.IsPetEgg(item.GetItemId())) { const int magnifiers = LookupClientItem(g_session.m_inventoryItems, 611, 0).quantity + LookupClientItem(g_session.m_inventoryItems, 12325, 0).quantity; if (magnifiers <= 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2735)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2735)), 255, 0, 0, 0); } if (this->unknown_010C == 1 && !item.identified) { @@ -1252,7 +1255,7 @@ void UIItemWnd::OnRBtnDown(int x, int y) { } } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1276,10 +1279,10 @@ void UIMerchantItemPurchaseWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_0300) { item = g_session.FindItem1760ByItemId(item.itemId.c_str()); mode->drag.BeginItem(g_windowMgr, 13, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_0300)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0300)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1302,10 +1305,10 @@ void UIMerchantItemShopWnd::OnRBtnDown(int x, int y) { if (HIBYTE(GetAsyncKeyState(VK_MENU))) { if (g_windowMgr.unknown_0308) { mode->drag.BeginItem(g_windowMgr, 12, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_0308)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0308)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1319,23 +1322,23 @@ void UIMerchantItemWnd::OnRBtnDown(int x, int y) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (HIBYTE(GetAsyncKeyState(VK_MENU))) { - if (!g_windowMgr.LookupWindow(10011) && !g_windowMgr.unknown_02FC) { + if (!g_windowMgr.LookupWindow(WID_EXCHANGEUI) && !g_windowMgr.unknown_02FC) { if (g_windowMgr.window_0288) { if (mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(79, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_STORE, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else if (g_windowMgr.unknown_01D4 && mode->unknown_05CC[2]) { mode->unknown_05CC[2] = 0; - mode->SendMsg(77, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_BODY, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } } else if (HIBYTE(GetAsyncKeyState(VK_SHIFT))) { if (g_windowMgr.unknown_01D4) { - mode->SendMsg(335, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_TO_PERSONAL_FROM_STORAGE, static_cast(item.unknown_0000[1]), item.quantity, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1352,14 +1355,14 @@ void UIMerchantMirrorItemWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_02FC) { item = g_session.FindItem1750(item.unknown_0000[1]); mode->drag.BeginItem(g_windowMgr, 11, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_02FC)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_02FC)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } else if (g_windowMgr.unknown_040C) { item = g_session.FindItem1750(item.unknown_0000[1]); mode->drag.BeginItem(g_windowMgr, 20, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_040C)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_040C)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1405,7 +1408,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_RESIZE: @@ -1446,30 +1449,30 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case UM_COMMAND: { CMode* mode = g_modeMgr.gameMode; this->RecordResponse(static_cast(a), b, c, d); - if (a == 201) { + if (a == ID_CLOSE) { mode = g_modeMgr.gameMode; int windowId; if (this->unknown_0100 != 0) { if (this->shopOpen == 1) { - g_windowMgr.CloseWindow(176); - mode->SendMsg(40, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); goto closed; } - mode->SendMsg(270, 0, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(176); + mode->SendMsg(MM_REQ_CLOSE_BUYING_STORE, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1); windowId = 258; } else { if (this->shopOpen == 1) { - g_windowMgr.CloseWindow(45); - mode->SendMsg(40, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); goto closed; } - mode->SendMsg(81, 0, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); - g_windowMgr.CloseWindow(45); + mode->SendMsg(MM_REQ_CLOSESTORE, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND); windowId = 257; } @@ -1489,19 +1492,19 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - if (a == 213) { + if (a == ID_CHECK) { g_session.m_muteSellSound = !g_session.m_muteSellSound; return 0; } - if (a == 506 && + if (a == ID_CLOSE_OFFLINE_STORE && g_windowMgr.Confirm(LookupMessage(2926), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - mode->SendMsg(301, this->unknown_010C, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_CLOSE_OFFLINE_STORE, this->unknown_010C, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); if (this->unknown_0100 == 1) { - g_windowMgr.CloseWindow(176); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND_MODE_1); } else { - g_windowMgr.CloseWindow(45); + g_windowMgr.CloseWindow(WID_MERCHANTITEMMYSHOPWND); } return 0; } @@ -1521,7 +1524,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->UpdateScrollBar(); return 0; } - case 119: { + case UM_SET_BUYING_SHOP_ZENY: { char grouped[80]; char text[80]; std::sprintf(text, LookupMessage(1735), FormatGroupedInteger(static_cast(a), grouped, 80)); @@ -1530,10 +1533,10 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 = static_cast(a); return 0; } - case 28: + case UM_SETNAID: this->unknown_010C = static_cast(a); return 0; - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -1542,15 +1545,15 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 21001 || header.type == 21051) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - this->SendMsg(nullptr, 36, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); break; } if (header.type == 21052) { std::memcpy(&this->unknown_00F0, bytes + offset, header.size); offset += header.size; - this->SendMsg(nullptr, 119, this->unknown_00F0, 0, 0, 0); + this->SendMsg(nullptr, UM_SET_BUYING_SHOP_ZENY, this->unknown_00F0, 0, 0, 0); } else { offset += header.size; } @@ -1599,7 +1602,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->saved->Reset(); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_DROP: { @@ -1616,9 +1619,9 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case TYPE_ARMORTMB: case TYPE_GUN: if (g_session.GetItem1720QuantityByItemId(drag.name.c_str())) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(119)), 0xFF, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(119)), 0xFF, 0, 0, 0); return 0; } break; @@ -1630,8 +1633,8 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s int budget = g_session.m_zeny; if (this->unknown_00FC) { if (g_session.GetList2Size() == 10) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast("한 번에 10개 이상 구매 할 수 없습니다."), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("한 번에 10개 이상 구매 할 수 없습니다."), 0xFF, 0, 0, 0); return 0; } budget = g_pendingGid + g_pendingAid; @@ -1650,29 +1653,29 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s item.quantity += 30000 - (owned + item.quantity); char text[200]; std::sprintf(text, LookupMessage(1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } if (item.quantity > 0) { if (budget >= total) { g_session.MergeItem1720ByName(item); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(this->unknown_00FC ? 1254 : 55)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(this->unknown_00FC ? 1254 : 55)), 0xFF, 0, 0, 0); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; - if (a == 184) { + if (a == ID_OK) { if (!this->unknown_00FC) { - mode->SendMsg(34, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_PURCHASE, 0, 0, 0, 0); } else { if (!g_session.GetList2Size()) { break; @@ -1697,7 +1700,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s const int total = g_session.GetItem1720Total(); if (g_pendingGid + g_pendingAid < total) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1254)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1254)), 0xFF, 0, 0, 0); break; } @@ -1718,16 +1721,16 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s if (g_windowMgr.Confirm(confirm.c_str(), 2, true, true, 0, "Message", 280, 120, 0) == 187) { g_windowMgr.SetFocus(this->quantityEdit); this->quantityEdit->SetText("0"); - mode->SendMsg(249, amount, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_BUY_CASH_POINT, amount, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return 0; } - } else if (a == 185) { - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(23); + } else if (a == ID_CANCEL) { + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMPURCHASEWND); } else { - if (a == 271 && this->unknown_00FC) { + if (a == ID_APPLY && this->unknown_00FC) { int amount = std::atoi(this->quantityEdit->Text()); if (amount < 0) { amount = 0; @@ -1745,7 +1748,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; } - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); return 0; } @@ -1822,7 +1825,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->UpdateScrollBar(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -1831,14 +1834,14 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 20701) { - UIWindow* window = g_windowMgr.EnsureWindow(22); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); if (window) { - window->SendMsg(nullptr, 36, 0, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 36, 0, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } @@ -1860,7 +1863,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st switch (message) { case UM_DEFPUSH: if (this->m_message0 != 0 && this->geometry.visible != 0) { - this->SendMsg(this, 6, this->m_message0, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, this->m_message0, 0, 0, 0); return 0; } return 0; @@ -1884,7 +1887,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } return 0; case UM_COMMAND: { - if (a != 184 || this->m_edit->Length() == 0) { + if (a != ID_OK || this->m_edit->Length() == 0) { return 0; } @@ -1907,7 +1910,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (quantity <= 0 || quantity > mode->drag.quantity) { goto invalid; } - mode->SendMsg(21, quantity, 0, 0, 0); + mode->SendMsg(MM_ITEMTHROW_THROUGH_DROPCNTWND, quantity, 0, 0, 0); break; case 1: if (quantity <= 0) { @@ -1921,8 +1924,8 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (quantity >= 30000) { char text[200]; std::sprintf(text, LookupMessage(1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } window = g_windowMgr.unknown_0258; goto notify; @@ -1933,7 +1936,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st goto invalid; } if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (quantity > owned) { quantity = owned; @@ -1954,7 +1957,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st goto invalid; } if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (quantity > owned) { quantity = owned; @@ -1970,7 +1973,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st goto invalid; } if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (quantity > owned) { quantity = owned; @@ -1984,7 +1987,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st break; } if (window) { - window->SendMsg(nullptr, 38, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 1, 0, 0, 0); } break; } @@ -1994,20 +1997,20 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } const int owned = LookupClientItemByIdentity(g_session.m_inventoryItems, mode->drag.id).quantity; if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (owned != 0) { mode->drag.quantity = quantity <= owned ? quantity : owned; } - window = g_windowMgr.LookupWindow(10011); + window = g_windowMgr.LookupWindow(WID_EXCHANGEUI); if (window) { - window->SendMsg(nullptr, 38, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; } case 6: if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (mode->drag.source == 6) { if (g_session.GetItem1738Quantity(mode->drag.id) != 0) { @@ -2137,7 +2140,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } case 12: if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } mode->drag.quantity = quantity; window = g_windowMgr.unknown_0308; @@ -2148,7 +2151,7 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } const int owned = LookupClientItemByIdentity(g_session.m_inventoryItems, mode->drag.id).quantity; if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (owned != 0) { mode->drag.quantity = quantity <= owned ? quantity : owned; @@ -2233,12 +2236,12 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st if (quantity >= 30000) { char text[200] = {}; sprintf_s(text, sizeof(text), LookupMessage(1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } - UIParaItemPurchaseWnd* purchase = dynamic_cast(g_windowMgr.LookupWindow(255)); + UIParaItemPurchaseWnd* purchase = dynamic_cast(g_windowMgr.LookupWindow(WID_PARAITEMPURCHASEWND)); if (purchase) { - purchase->SendMsg(nullptr, 38, quantity, 0, 0, 0); + purchase->SendMsg(nullptr, UM_DROP, quantity, 0, 0, 0); } break; } @@ -2248,15 +2251,15 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st goto invalid; } if (quantity <= 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } if (quantity > owned) { quantity = owned; } mode->drag.quantity = quantity; - UIParaItemShopWnd* shop = dynamic_cast(g_windowMgr.LookupWindow(254)); + UIParaItemShopWnd* shop = dynamic_cast(g_windowMgr.LookupWindow(WID_PARAITEMSHOPWND)); if (shop) { - shop->SendMsg(nullptr, 38, 0, 0, 0, 0); + shop->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; } @@ -2272,9 +2275,9 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st quantity = owned; } mode->drag.quantity = quantity; - window = g_windowMgr.LookupWindow(334); + window = g_windowMgr.LookupWindow(WID_BARTERMARKETWND); if (window) { - window->SendMsg(nullptr, 38, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; } @@ -2307,9 +2310,9 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st quantity = owned; } mode->drag.quantity = quantity; - window = g_windowMgr.LookupWindow(341); + window = g_windowMgr.LookupWindow(WID_EXPANDEDBARTERMARKETWND); if (window) { - window->SendMsg(nullptr, 38, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; } @@ -2333,32 +2336,32 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st lookup: window = g_windowMgr.LookupWindow(windowId); if (window) { - window->SendMsg(nullptr, 38, quantity, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, quantity, 0, 0, 0); } else { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } break; stall: - window = g_windowMgr.LookupWindow(318); + window = g_windowMgr.LookupWindow(WID_CASHSHOP_WND); if (window) { - window->SendMsg(nullptr, 38, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; tooMany: - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(807)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(807)), 0xFF, 0, 0, 0); invalid: - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); break; notify: if (window) { - window->SendMsg(nullptr, 38, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } break; } - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.ShowWindowById(15, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 0); return 0; } default: @@ -2478,7 +2481,7 @@ void UIMerchantShopMakeWnd::OnCreate(int width, int height) { } this->unknown_0154 = this->geometry.height; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); UIBitmapButton* info = new UIBitmapButton(); info->SetBitmap("유저인터페이스\\basic_interface\\bt_shopinfo.bmp", 0, 0); @@ -2502,15 +2505,15 @@ void UIMerchantShopMakeWnd::OnRBtnDown(int x, int y) { if (g_windowMgr.unknown_02F8) { item = g_session.FindItem1768(item.unknown_0000[1]); gameMode->drag.BeginItem(g_windowMgr, 10, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_02F8)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_02F8)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); g_windowMgr.SetFocus(nullptr); } else if (g_windowMgr.unknown_0410) { item = g_session.FindItem1768(item.unknown_0000[1]); gameMode->drag.BeginItem(g_windowMgr, 19, item, item.quantity, -1); - reinterpret_cast(g_windowMgr.unknown_0410)->SendMsg(nullptr, 38, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0410)->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -2918,20 +2921,20 @@ void UIItemSellWnd::OnLBtnDblClk(int x, int y) { // OFFSET: 0x00984130 // FUNCTION: fn_13351 void UIItemStoreFindWnd::OnLBtnDblClk(int, int) { - this->SendMsg(nullptr, 6, 232, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0); } // OFFSET: 0x00984150 // FUNCTION: fn_13352 void UIItemStoreSubWnd::OnLBtnDblClk(int, int) { - this->SendMsg(nullptr, 6, 232, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0); } // OFFSET: 0x00984170 // FUNCTION: fn_13353 void UIItemWnd::OnLBtnDblClk(int x, int y) { if (y < 17) { - this->SendMsg(this, 6, 202, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_MINI, 0, 0, 0); return; } @@ -2953,13 +2956,13 @@ void UIItemWnd::OnLBtnDblClk(int x, int y) { g_windowMgr.Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) == 188) { break; } - mode->SendMsg(27, static_cast(item.unknown_0000[1]), 0, 0, 0); + mode->SendMsg(MM_USEITEM, static_cast(item.unknown_0000[1]), 0, 0, 0); break; case 18: if (*reinterpret_cast(&g_session.unknown_16F4[4]) >= 0) { if (g_windowMgr .Confirm(FormatOwnedString(LookupMessage(1226), item.DisplayName(0).c_str()).c_str(), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - mode->SendMsg(27, static_cast(item.unknown_0000[1]), 0, 0, 0); + mode->SendMsg(MM_USEITEM, static_cast(item.unknown_0000[1]), 0, 0, 0); } } break; @@ -2981,13 +2984,13 @@ void UIItemWnd::OnLBtnDblClk(int x, int y) { } } if (GetAsyncKeyState(VK_CONTROL) && g_session.m_swapEquipmentMode) { - mode->SendMsg(302, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); - } else if (g_windowMgr.LookupWindow(295)) { - g_windowMgr.LookupWindow(295)->SendMsg(this, 23, item.unknown_0000[1], 0, 0, 0); - } else if (g_windowMgr.LookupWindow(343)) { - g_windowMgr.LookupWindow(343)->SendMsg(this, 23, item.unknown_0000[1], 0, 0, 0); + mode->SendMsg(MM_WEAR_SWAP_EQUIP, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); + } else if (g_windowMgr.LookupWindow(WID_REFININGWND)) { + g_windowMgr.LookupWindow(WID_REFININGWND)->SendMsg(this, UM_REFRESHITEM, item.unknown_0000[1], 0, 0, 0); + } else if (g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)) { + g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)->SendMsg(this, UM_REFRESHITEM, item.unknown_0000[1], 0, 0, 0); } else { - mode->SendMsg(19, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); + mode->SendMsg(MM_WEAR_EQUIP, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); } break; case 10: @@ -2998,13 +3001,13 @@ void UIItemWnd::OnLBtnDblClk(int x, int y) { break; } if (GetAsyncKeyState(VK_CONTROL) && g_session.m_swapEquipmentMode) { - mode->SendMsg(302, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); + mode->SendMsg(MM_WEAR_SWAP_EQUIP, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); } else { - mode->SendMsg(87, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); + mode->SendMsg(MM_WEAR_EQUIP_ARROW, static_cast(item.unknown_0000[1]), static_cast(item.unknown_0000[2]), 0, 0); } break; case 6: - mode->SendMsg(123, static_cast(item.unknown_0000[1]), 0, 0, 0); + mode->SendMsg(MM_REQ_ITEMCOMPOSITION_LIST, static_cast(item.unknown_0000[1]), 0, 0, 0); break; } } @@ -3139,7 +3142,7 @@ void UIMerchantShopMakeWnd::OnProcess() { // FUNCTION: fn_13390 void UINoticeMessageBox_LockSellItem::OnProcess() { if (this->startTick + this->duration < timeGetTime()) { - this->SendMsg(this, 6, 201, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_CLOSE, 0, 0, 0); } } @@ -3149,7 +3152,7 @@ void UIItemSellWnd2::OnRBtnDown(int x, int y) { ITEM_INFO item = this->GetItemAt(x, y); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -3159,7 +3162,7 @@ void UIItemSellWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->GetItemAt(x, y); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -3170,7 +3173,7 @@ void UIItemShopWnd2::OnRBtnDown(int x, int y) { if (item.unknown_0000[1] > 0) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -3181,14 +3184,14 @@ void UIMerchantItemMyShopWnd::OnRBtnDown(int x, int y) { if (item.unknown_0000[1] > 0) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } // OFFSET: 0x0098A220 // FUNCTION: fn_13407 void UISkillListWnd::OnRBtnUp(int, int) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } // OFFSET: 0x009739A0 @@ -3496,11 +3499,11 @@ bool UIMerchantShopMakeWnd::HasSelection() const { // FUNCTION: fn_13304 void UIMerchantShopMakeWnd::SendShopRequest() { if (this->mode == 1) { - g_modeMgr.GetGameMode()->SendMsg(298, reinterpret_cast(this->unknown_00CC->Text()), std::atoi(this->unknown_0128->Text()), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_OPEN_BUYING_STORE_EXTENDED, reinterpret_cast(this->unknown_00CC->Text()), std::atoi(this->unknown_0128->Text()), 0, 0); return; } - g_modeMgr.GetGameMode()->SendMsg(296, reinterpret_cast(this->unknown_00CC->Text()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_OFFLINE_STORE_CREATE, reinterpret_cast(this->unknown_00CC->Text()), 0, 0, 0); } #pragma inline_depth() @@ -3721,7 +3724,7 @@ void UIMerchantShopMakeWnd::SetSuspended(unsigned char suspend) { this->suspended = 1; this->Show(0); window->Show(0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2930)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2930)), 0xFFFF, 0, 0, 0); return; } @@ -3746,7 +3749,7 @@ void UIMerchantShopMakeWnd::SetItems(int count, const short* ids) { } if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -3768,7 +3771,7 @@ void UIMerchantItemMyShopWnd::OpenShop() { const int previousHeight = this->unknown_011C; this->unknown_011C = 57; this->Resize(this->geometry.width, this->geometry.height - previousHeight + 57); - this->SendMsg(nullptr, 14, 7, this->geometry.width, this->geometry.height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->geometry.width, this->geometry.height, 0); this->Invalidate(); } @@ -3784,8 +3787,8 @@ void UIItemWnd::ReleaseSelection(unsigned char keep) { it->unknown_0074[1] = 0; } - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { - window->SendMsg(nullptr, 6, 286, 194, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 194, 0, 0); } } @@ -3932,7 +3935,7 @@ void UIMerchantItemShopWnd::StartTimer(std::uint32_t value) { const int previousHeight = this->unknown_0118; this->unknown_0118 = 57; this->Resize(this->geometry.width, this->geometry.height - previousHeight + 57); - this->SendMsg(nullptr, 14, 3, this->geometry.width, this->geometry.height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->geometry.width, this->geometry.height, 0); } // OFFSET: 0x009970A0 @@ -4043,7 +4046,7 @@ void UIMerchantShopMakeWnd::PrintBuyList() { char grouped[32]; std::sprintf(line, "====================== BUY LIST ======================"); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); for (unsigned index = 0; index < this->items.size(); ++index, ++it) { int capacity = 256; @@ -4069,29 +4072,29 @@ void UIMerchantShopMakeWnd::PrintBuyList() { } std::sprintf(line, LookupMessage(1732), name, price, quantity); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x5AFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x5AFFFF, 0, 0, 0); const std::string notice = FormatOwnedString("Commission : 1 EA = %s Zeny", FormatGroupedInteger(commission, line, 256)); - g_windowMgr.SendNotice(1, reinterpret_cast(notice.c_str()), 0x5AFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice.c_str()), 0x5AFFFF, 0, 0, 0); } std::sprintf(price, "%s", FormatGroupedInteger(g_session.m_zeny, grouped, 32)); std::sprintf(line, " Current Zeny : %s Z", price); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x78FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x78FFFF, 0, 0, 0); std::sprintf(line, "============================ ============================"); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); } // OFFSET: 0x00972100 // FUNCTION: fn_13266 void UIItemBaseWnd::DragAndDrop(int, int, std::intptr_t) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00972120 // FUNCTION: fn_13267 void UIItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -4109,22 +4112,22 @@ void UIItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { case TYPE_ARMORMB: case TYPE_ARMORTMB: case TYPE_GUN: - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; default: - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 1, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 1, 0, 0, 0); return; } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x009721F0 // FUNCTION: fn_13268 void UIItemSellWnd2::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -4133,20 +4136,20 @@ void UIItemSellWnd2::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 3) { if (drag->quantity != 1 && g_windowMgr.unknown_0064 == 0) { - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 16, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 16, 0, 0, 0); } else { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } } // OFFSET: 0x009722A0 // FUNCTION: fn_13269 void UIItemSellWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -4155,43 +4158,43 @@ void UIItemSellWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 3) { if (drag->quantity != 1 && g_windowMgr.unknown_0064 == 0) { - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 2, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 2, 0, 0, 0); } else { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } } else { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } } // OFFSET: 0x00972B50 // FUNCTION: fn_13277 void UIMerchantItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 13) { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 11, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 11, 0, 0, 0); } // OFFSET: 0x00972C00 // FUNCTION: fn_13278 void UIMerchantItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011) || g_windowMgr.unknown_01F0 || g_windowMgr.unknown_01F8) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI) || g_windowMgr.unknown_01F0 || g_windowMgr.unknown_01F8) { UIWindow::DragAndDrop(x, y, value); return; } @@ -4203,7 +4206,7 @@ void UIMerchantItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 6: break; default: - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } @@ -4212,12 +4215,12 @@ void UIMerchantItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 8, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 8, 0, 0, 0); } // OFFSET: 0x0097BC00 @@ -4237,7 +4240,7 @@ void UIMerchantItemShopWnd::OnCreate(int width, int height) { this->visibleRows = rows; this->columns = 1; this->unknown_00F0 = this->geometry.height - rows * 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00854130 @@ -4629,7 +4632,7 @@ void UIItemSellWnd2::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x009768A0 @@ -4681,7 +4684,7 @@ void UIItemSellWnd::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00977510 @@ -4716,7 +4719,7 @@ void UIItemShopWnd2::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - this->unknown_0108 - this->unknown_0104 - 17) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x009777B0 @@ -4751,7 +4754,7 @@ void UIItemShopWnd::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - this->unknown_0108 - this->unknown_0104 - 17) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00977A50 @@ -4841,7 +4844,7 @@ void UIMerchantItemWnd::OnCreate(int width, int height) { this->closeButton = this->AddCloseButton("Alt+W", 0); this->columns = (width - 40) / 32; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->info->Show(0); } @@ -4886,7 +4889,7 @@ void UIMerchantMirrorItemWnd::OnCreate(int width, int height) { } else if (Replay::Instance().state != 6) { g_session.CopyItems1740To1750(); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x0098A7A0 @@ -4968,7 +4971,7 @@ void UIEditCtrl_Custom::Trim() { // OFFSET: 0x00972350 // FUNCTION: fn_13270 void UIItemShopWnd2::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -4982,15 +4985,15 @@ void UIItemShopWnd2::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1 || g_windowMgr.unknown_0064 != 0) { - this->SendMsg(nullptr, 38, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 1, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 15, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 15, 0, 0, 0); return; default: - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } } @@ -4998,7 +5001,7 @@ void UIItemShopWnd2::DragAndDrop(int x, int y, std::intptr_t value) { // OFFSET: 0x00972410 // FUNCTION: fn_13271 void UIItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -5011,12 +5014,12 @@ void UIItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 3, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 3, 0, 0, 0); return; case 5: if (this->unknown_00F8 == 0) { @@ -5024,15 +5027,15 @@ void UIItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { } if (drag->quantity == 1 || g_windowMgr.unknown_0064 != 0) { - this->SendMsg(nullptr, 38, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 1, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 4, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 4, 0, 0, 0); return; default: - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } } @@ -5040,7 +5043,7 @@ void UIItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { // OFFSET: 0x009729C0 // FUNCTION: fn_13276 void UIMerchantItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -5059,39 +5062,39 @@ void UIMerchantItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { case TYPE_ARMORTMB: case TYPE_GUN: if (g_session.GetItem1760Quantity(drag->id)) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(119)), 0xFF, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(119)), 0xFF, 0, 0, 0); return; } - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; default: - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 12, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 12, 0, 0, 0); return; } } if (drag->source == 22) { if (drag->quantity > 1) { - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 17, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 17, 0, 0, 0); return; } - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00972CE0 // FUNCTION: fn_13279 void UIMerchantMirrorItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -5102,23 +5105,23 @@ void UIMerchantMirrorItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 10: case 21: if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); if (this->unknown_00F4 == 2) { - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 18, 0, 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 18, 0, 0, 0); return; } - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 10, 0, 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 10, 0, 0, 0); return; case 19: - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; default: - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } } @@ -5126,7 +5129,7 @@ void UIMerchantMirrorItemWnd::DragAndDrop(int x, int y, std::intptr_t value) { // OFFSET: 0x00972DB0 // FUNCTION: fn_13280 void UIMerchantShopMakeWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -5135,18 +5138,18 @@ void UIMerchantShopMakeWnd::DragAndDrop(int x, int y, std::intptr_t value) { switch (drag->source) { case 11: if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 9, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 9, 0, 0, 0); return; case 20: - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; default: - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } } @@ -5366,7 +5369,7 @@ void UISkillListWnd::OnLBtnDblClk(int x, int y) { CSkillInfo skill = this->GetSkillByIndex(this->hovered); if (skill.available && skill.level && skill.unknown_0014) { - this->SendMsg(nullptr, 58, reinterpret_cast(&skill), 0, 0, 0); + this->SendMsg(nullptr, UM_USESKILL, reinterpret_cast(&skill), 0, 0, 0); } } } @@ -5408,7 +5411,7 @@ void UIItemPurchaseWnd::OnRBtnDown(int x, int y) { if (item.unknown_0000[1] > 0) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -5426,7 +5429,7 @@ void UIItemShopWnd::OnRBtnDown(int x, int y) { if (item.unknown_0000[1] > 0) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -5435,7 +5438,7 @@ void UIItemShopWnd::OnRBtnDown(int x, int y) { void UIItemBaseWnd::OnWheel(int value) { if (this->unknown_00E4) { const int step = std::min(this->visibleRows - 1, 3); - this->SendMsg(this->scrollBar, 7, value < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, value < 0 ? step : -step, 0, 0, 0); } } @@ -5457,7 +5460,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->saved->Reset(); } this->Move(this->saved->x, this->saved->y); - this->SendMsg(nullptr, 0xE, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); return 0; case UM_RESIZE: if (a == 3) { @@ -5505,7 +5508,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } else if (this->skillTab == 1) { level = g_session.MercSkillLevel(skill->id); } - mode->SendMsg(0x71, a, level, 0, 0); + mode->SendMsg(MM_USING_SKILL, a, level, 0, 0); return 0; } break; @@ -5514,11 +5517,11 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: switch (a) { case ID_CLOSE: if (this->skillTab == 0) { - g_windowMgr.CloseWindow(0x72); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_0); return 0; } if (this->skillTab == 1) { - g_windowMgr.CloseWindow(0x7E); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_1); return 0; } break; @@ -5526,7 +5529,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: if (this->hovered != -1) { CSkillInfo skill = this->GetSkillByIndex(this->hovered); if (skill.available != 0 && skill.level != 0 && skill.unknown_0014 != 0) { - this->SendMsg(nullptr, 0x3A, reinterpret_cast(&skill), 0, 0, 0); + this->SendMsg(nullptr, UM_USESKILL, reinterpret_cast(&skill), 0, 0, 0); } return 0; } @@ -5552,12 +5555,12 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: CSkillInfo skill = this->GetSkillByIndex(index); g_skillUpgradeId = skill.id; if (skill.available != 0) { - g_modeMgr.gameMode->SendMsg(0x43, skill.id, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_UPGRADE_SKILLLEVEL, skill.id, 0, 0, 0); } } else { CSkillInfo skill = this->GetSkillByIndex(index); if (g_skillUpgradeId == static_cast(skill.id) && skill.available != 0) { - g_modeMgr.gameMode->SendMsg(0x43, skill.id, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_UPGRADE_SKILLLEVEL, skill.id, 0, 0, 0); } } return 0; @@ -5635,9 +5638,9 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; int position; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { position = previous - this->visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { position = this->visibleRows - 1 + previous; } else { position = a + previous; @@ -5706,7 +5709,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case UM_MAKEMENU: this->unknown_0138.clear(); if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->hovered != -1) { CSkillInfo skill = this->GetSkillByIndex(this->hovered); @@ -5715,16 +5718,16 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } if (this->unknown_0138.size()) { - UIWindow* menu = g_windowMgr.EnsureWindow(0x12); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (unsigned index = 0; index < this->unknown_0138.size(); ++index) { - menu->SendMsg(nullptr, 0x1F, reinterpret_cast(this->unknown_0138[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->unknown_0138[index].text.c_str()), 0, 0, 0); } if (this->skillTab == 0) { - menu->SendMsg(nullptr, 0x53, 0x72, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 0x72, 0, 0, 0); } else if (this->skillTab == 1) { - menu->SendMsg(nullptr, 0x53, 0x7E, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 0x7E, 0, 0, 0); } - menu->SendMsg(nullptr, 0x1E, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); menu->Move( std::min(std::max(g_mouse.x + 1, 1), g_renderer->viewport.width - menu->geometry.width), std::min(std::max(g_mouse.y + 1, 1), g_renderer->viewport.height - menu->geometry.height) @@ -5738,9 +5741,9 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: if (skill.available != 0) { const int kind = this->unknown_0138[a].value; if (kind == 3) { - g_windowMgr.EnsureWindow(0x2E)->SendMsg(nullptr, 0x3D, skill.id, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND)->SendMsg(nullptr, UM_SKILLDESCRIBE, skill.id, 0, 0, 0); } else if (kind == 0xE) { - g_windowMgr.EnsureWindow(0x37)->SendMsg(nullptr, 0x44, skill.id, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SKILLNAMECHANGEWND)->SendMsg(nullptr, UM_SET_SKILL_INFO, skill.id, 0, 0, 0); } } return 0; @@ -5842,7 +5845,7 @@ void UISkillListWnd::OnCreate(int width, int height) { } } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x0098A3A0 @@ -5850,7 +5853,7 @@ void UISkillListWnd::OnCreate(int width, int height) { void UISkillListWnd::OnWheel(int value) { if (this->unknown_0128) { const int step = std::min(this->visibleRows - 1, 3); - this->SendMsg(this->scrollBar, 7, value < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, value < 0 ? step : -step, 0, 0, 0); } } @@ -5959,7 +5962,7 @@ void UIMerchantShopMakeWnd::UpdateLayout() { void UIItemStoreFindWnd::OnWheel(int value) { if (this->unknown_00E4) { const int step = std::min(this->visibleRows - 1, 3); - this->SendMsg(this->scrollBar, 7, value < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, value < 0 ? step : -step, 0, 0, 0); } } @@ -5968,7 +5971,7 @@ void UIItemStoreFindWnd::OnWheel(int value) { void UIItemStoreSubWnd::OnWheel(int value) { if (this->unknown_00E4) { const int step = std::min(this->visibleRows - 1, 3); - this->SendMsg(this->scrollBar, 7, value < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, value < 0 ? step : -step, 0, 0, 0); } } @@ -5977,7 +5980,7 @@ void UIItemStoreSubWnd::OnWheel(int value) { void UIMerchantShopMakeWnd::OnWheel(int value) { if (this->unknown_0144) { const int step = std::min(this->unknown_0140 - 1, 3); - this->SendMsg(this->scrollBar, 7, value < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, value < 0 ? step : -step, 0, 0, 0); } } @@ -6057,9 +6060,9 @@ int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->scroll = previous - this->visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->scroll = this->visibleRows - 1 + previous; } else { this->scroll = a + previous; @@ -6074,13 +6077,13 @@ int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } case UM_PAGEDOWNPUSH: if (this->unknown_00E4 == 1) { - this->SendMsg(this->scrollBar, 7, this->visibleRows, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, this->visibleRows, 0, 0, 0); return 0; } break; case UM_PAGEUPPUSH: if (this->unknown_00E4 == 1) { - this->SendMsg(this->scrollBar, 7, -this->visibleRows, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -this->visibleRows, 0, 0, 0); } break; case UM_COMMAND: @@ -6103,24 +6106,24 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_COMMAND: - if (a == 201) { - g_windowMgr.CloseWindow(40); + if (a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_MERCHANTITEMWND); return 0; } break; case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->drag.source == 1) { - mode->SendMsg(76, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_BODY_TO_CART, mode->drag.id, mode->drag.quantity, 0, 0); } else if (mode->drag.source == 6) { - mode->SendMsg(78, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_CART, mode->drag.id, mode->drag.quantity, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_RESIZE: @@ -6207,12 +6210,12 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ lists->AddItem1750(item, this->unknown_00F4, 1); lists->RemoveItem1760(item); if (g_windowMgr.unknown_041C) { - reinterpret_cast(g_windowMgr.unknown_041C)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_041C)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } break; } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_SETINFO: @@ -6221,7 +6224,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_RESIZE: @@ -6265,7 +6268,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->UpdateScrollBar(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -6274,7 +6277,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 21401) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } @@ -6302,7 +6305,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->saved->Reset(); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_DROP: { @@ -6315,31 +6318,31 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: lists->AddItem1730(item); lists->ReduceItem1718(item); if (g_windowMgr.unknown_0254) { - g_windowMgr.unknown_0254->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_0254->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { const int count = g_session.GetList4Size(); CMode* mode = g_modeMgr.gameMode; - if (a == 184) { + if (a == ID_OK) { if (count > 0) { const int result = g_windowMgr.Confirm(LookupMessage(1584), 2, true, false, 0, "Message", 280, 120, 0); mode->SendMsg(result == 187 ? 266 : 267, this->unknown_00FC, 0, 0, 0); - g_windowMgr.CloseWindow(160); - g_windowMgr.CloseWindow(161); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND2); + g_windowMgr.CloseWindow(WID_ITEMSELLWND2); g_session.ClearTradeItems(); return 0; } - } else if (a == 185) { - mode->SendMsg(267, this->unknown_00FC, 0, 0, 0); - g_windowMgr.CloseWindow(160); - g_windowMgr.CloseWindow(161); + } else if (a == ID_CANCEL) { + mode->SendMsg(MM_CANCEL_ITEMLISTWIN, this->unknown_00FC, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND2); + g_windowMgr.CloseWindow(WID_ITEMSELLWND2); g_session.ClearTradeItems(); return 0; } @@ -6398,15 +6401,15 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->UpdateScrollBar(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; if (header.type == 20800) { - UIWindow* window = g_windowMgr.EnsureWindow(160); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND2); if (window) { - window->SendMsg(nullptr, 36, 1, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } while (static_cast(b) > offset) { @@ -6419,7 +6422,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: if (header.type == 20802) { std::memcpy(&this->unknown_00FC, bytes + offset, header.size); offset += header.size; - window->SendMsg(nullptr, 23, this->unknown_00FC, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, this->unknown_00FC, 0, 0, 0); } else { offset += header.size; } @@ -6444,10 +6447,10 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt this->saved->Reset(); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 28: + case UM_SETNAID: this->unknown_0104 = b; this->unknown_00F8 = a; return 0; @@ -6491,14 +6494,14 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt total = limit; item.quantity = limit - owned; std::sprintf(text, LookupMessage(this->unknown_0108 ? 1739 : 1706), limit); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 255, 0, 0, 0); } if (total > 30000) { item.quantity = 30000 - owned; std::sprintf(text, LookupMessage((this->unknown_0108 != 0) + 1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 255, 0, 0, 0); } if (item.quantity > 0) { @@ -6506,32 +6509,32 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt const int price = static_cast(drag.unknown_0314); if (this->unknown_0108) { if (static_cast(price * item.quantity) + g_session.m_zeny + pending > 0x7FFFFFFF) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(694)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(694)), 255, 0, 0, 0); } else { g_session.AddItem1760(item); g_session.RemoveItem1750(item, 2, 1); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); if (g_windowMgr.unknown_0420) { - reinterpret_cast(g_windowMgr.unknown_0420)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0420)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } } else if (g_session.m_zeny >= static_cast(price) * item.quantity + pending) { g_session.AddItem1760(item); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; - if (a == 184) { + if (a == ID_OK) { if (this->unknown_0108) { int sum = 0; for (std::list::iterator it = this->items.begin(); it != this->items.end(); ++it) { @@ -6543,27 +6546,27 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt g_windowMgr.Confirm(LookupMessage(1740), 0, true, false, 0, "Message", 280, 120, 0); return 0; } - mode->SendMsg(273, this->unknown_00F8, this->unknown_0104, 0, 0); + mode->SendMsg(MM_REQ_TRADE_BUYING_STORE, this->unknown_00F8, this->unknown_0104, 0, 0); } else { - static_cast(g_windowMgr.EnsureWindow(230))->SetPurchase(this->unknown_00F8, this->unknown_0104); + static_cast(g_windowMgr.EnsureWindow(WID_MERCHANTITEMPURCHASEMSGWND))->SetPurchase(this->unknown_00F8, this->unknown_0104); } - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); if (this->unknown_0108) { - g_windowMgr.CloseWindow(177); - g_windowMgr.CloseWindow(178); - g_windowMgr.CloseWindow(179); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND_MODE_1); + g_windowMgr.CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_2); } else { - g_windowMgr.CloseWindow(43); - g_windowMgr.CloseWindow(44); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEWND); } return 0; } - if (a == 185) { + if (a == ID_CANCEL) { int first; int second; if (this->unknown_0108) { - g_windowMgr.CloseWindow(177); + g_windowMgr.CloseWindow(WID_MERCHANTITEMSHOPWND_MODE_1); second = 179; first = 178; } else { @@ -6572,7 +6575,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt } g_windowMgr.CloseWindow(first); g_windowMgr.CloseWindow(second); - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearItems1760And1748(); } return 0; @@ -6628,7 +6631,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt this->Invalidate(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -6637,12 +6640,12 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 21101) { - this->SendMsg(nullptr, 28, 0, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SETNAID, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } if (header.type == 21151) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } offset += header.size; @@ -6665,10 +6668,10 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->saved->Reset(this->unknown_010C != 0); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 28: + case UM_SETNAID: this->unknown_0100 = a; return 0; case UM_SETTITLE: @@ -6681,13 +6684,13 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t item.Assign(reinterpret_cast(mode->drag)); g_session.RemoveItem1760(item); if (g_windowMgr.unknown_0308) { - reinterpret_cast(g_windowMgr.unknown_0308)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0308)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_RESIZE: @@ -6732,7 +6735,7 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Invalidate(); return 0; } - case 119: { + case UM_SET_BUYING_SHOP_ZENY: { this->unknown_0108 = a; char grouped[80]; char text[80]; @@ -6741,7 +6744,7 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->notice->Move(12, this->geometry.height - 21); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -6822,7 +6825,7 @@ void UIMerchantItemPurchaseWnd::OnCreate(int width, int height) { this->visibleRows = (height - 38) / 32; this->columns = 1; this->unknown_00F0 = this->geometry.height - this->visibleRows * 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00979920 @@ -6884,19 +6887,19 @@ void UIMerchantItemMyShopWnd::OnCreate(int width, int height) { this->columns = (width - 40) / 32; this->visibleRows = static_cast(height - this->unknown_011C - 17) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00993A20 // FUNCTION: fn_13434 int UINoticeMessageBox_LockSellItem::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { UIFrameWnd::SendMsg(sender, message, a, b, c, d); return 0; } - if (a == 201 && this->parent) { - this->parent->SendMsg(this, 6, 201, 0, 0, 0); + if (a == ID_CLOSE && this->parent) { + this->parent->SendMsg(this, UM_COMMAND, ID_CLOSE, 0, 0, 0); } return 0; @@ -6991,7 +6994,7 @@ void UIItemSellWnd2::OnLBtnDown(int x, int y) { item = this->GetItemByIndex(this->hovered); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -7026,7 +7029,7 @@ void UIItemSellWnd::OnLBtnDown(int x, int y) { item = this->GetItemByIndex(this->hovered); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -7061,7 +7064,7 @@ void UIItemShopWnd2::OnLBtnDown(int x, int y) { item = this->GetItemByIndex(this->hovered); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 1, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 1, 0, 0); } } @@ -7832,7 +7835,7 @@ void UIItemStoreWnd::OnCreate(int width, int height) { this->tabBar->Move(0, 18); this->tabBar->tabCount = 8; this->tabBar->style = 3; - this->tabBar->SendMsg(this, 13, 0, 0, 0, 0); + this->tabBar->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); this->AddChild(this->tabBar); UIScrollBar* scrollBar = new UIScrollBar(); @@ -7907,13 +7910,13 @@ void UIItemStoreWnd::OnCreate(int width, int height) { for (int index = 0; index < 3; ++index) { if (sortModes[index] == true) { this->sortCombo->Select(index); - this->SendMsg(this->sortCombo, 39, index, 0, 0, 0); + this->SendMsg(this->sortCombo, UM_COMBOBOX_SELECTED, index, 0, 0, 0); break; } if (index == 2) { this->sortCombo->Select(0); - this->SendMsg(this->sortCombo, 39, 0, 0, 0, 0); + this->SendMsg(this->sortCombo, UM_COMBOBOX_SELECTED, 0, 0, 0, 0); break; } } @@ -7941,7 +7944,7 @@ void UIItemWnd::OnCreate(int width, int height) { this->unknown_0110 = this->geometry.height; this->columns = (width - 40) / 32; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->tabs = new (std::nothrow) UITabControl(); this->tabs->Configure(0, 17, 10, 1, 0, 1, 0, 0, 0, 0, 0, 0); @@ -8115,11 +8118,11 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: static_cast(this->saved)->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_COMMAND: - if (a == 213) { + if (a == ID_CHECK) { g_windowMgr.unknown_0064 = b; return 0; } @@ -8132,11 +8135,11 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: item.Assign(reinterpret_cast(mode->drag)); g_session.RemoveItem1720ByName(item); if (g_windowMgr.unknown_0258) { - g_windowMgr.unknown_0258->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_0258->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case 1: { @@ -8147,11 +8150,11 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: lists->MergeItem1718(item); lists->RemoveItem1730(item); if (g_windowMgr.unknown_0260) { - g_windowMgr.unknown_0260->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_0260->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } } @@ -8221,12 +8224,12 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); - if (a == 213) { + if (a == ID_CHECK) { if (g_replayAnimationScaling != 0) { this->checkBox->geometry.unknown_0030 = b; this->checkBox->Invalidate(); @@ -8244,11 +8247,11 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: item.Assign(reinterpret_cast(mode->drag)); g_session.RemoveItem1720ByName(item); if (g_windowMgr.unknown_0258) { - g_windowMgr.unknown_0258->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_0258->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (a == 1) { @@ -8259,11 +8262,11 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: lists->MergeItem1718(item); lists->RemoveItem1730(item); if (g_windowMgr.unknown_025C) { - g_windowMgr.unknown_025C->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_025C->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } break; @@ -8349,17 +8352,17 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } this->Move(this->saved->x, this->saved->y); - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); return 0; case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->drag.source == 1) { - mode->SendMsg(55, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_ADD_ITEM_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } else if (mode->drag.source == 9) { - mode->SendMsg(79, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_REFRESHITEM: { @@ -8469,15 +8472,15 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Invalidate(); return 0; } - case 365: + case UM_SEARCH_ITEMS: if (!this->unknown_0138.empty() && this->FilterByName2(std::string(this->unknown_0138.c_str(), this->unknown_0138.size()))) { this->Invalidate(); this->UpdateScrollBar(); } return 0; - case 364: + case UM_SORT_ITEMS: if (g_session.m_itemDefaultSort == true) { - this->SendMsg(nullptr, 246, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESET_ITEM_SORT, 0, 0, 0, 0); return 0; } @@ -8491,9 +8494,9 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Invalidate(); this->UpdateScrollBar(); return 0; - case 246: + case UM_RESET_ITEM_SORT: this->unknown_0158 = 0; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; default: return UIItemBaseWnd::SendMsg(sender, message, a, b, c, d); @@ -8517,7 +8520,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } this->Move(this->saved->x, this->saved->y); - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->unknown_016C = 3; this->unknown_0170 = 3; this->unknown_0174 = 3; @@ -8538,16 +8541,16 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: for (int index = 0; index < 7; ++index) { g_windowMgr.CloseWindow(index + 146); } - g_windowMgr.CloseWindow(309); + g_windowMgr.CloseWindow(WID_ITEMSTORESUBWND_TAB_7); this->saved->unknown_0010 = openTabs; - g_windowMgr.CloseWindow(153); + g_windowMgr.CloseWindow(WID_ITEMSTOREFINDWND); this->unknown_0140 = nullptr; if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(57, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CLOSE_STORE, 0, 0, 0, 0); } break; } - case 364: + case ID_SORT_ITEMS: reinterpret_cast(this)->Sort3(); this->Invalidate(); this->UpdateScrollBar(); @@ -8556,25 +8559,25 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->buttons[3]->Move(this->geometry.width - 48, this->geometry.height - 52); for (int id = 146; id < 153; ++id) { if (g_windowMgr.LookupWindow(id)) { - g_windowMgr.LookupWindow(id)->SendMsg(nullptr, 364, 0, 0, 0, 0); + g_windowMgr.LookupWindow(id)->SendMsg(nullptr, UM_SORT_ITEMS, 0, 0, 0, 0); } } - if (g_windowMgr.LookupWindow(309)) { - g_windowMgr.LookupWindow(309)->SendMsg(nullptr, 364, 0, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_ITEMSTORESUBWND_TAB_7)) { + g_windowMgr.LookupWindow(WID_ITEMSTORESUBWND_TAB_7)->SendMsg(nullptr, UM_SORT_ITEMS, 0, 0, 0, 0); } if (this->unknown_0140) { - this->unknown_0140->SendMsg(nullptr, 364, 0, 0, 0, 0); + this->unknown_0140->SendMsg(nullptr, UM_SORT_ITEMS, 0, 0, 0, 0); } break; - case 246: + case ID_PREV: this->unknown_0184[0] = 0; static_cast(this->buttons[1])->Enable(1); static_cast(this->buttons[3])->Enable(0); this->buttons[1]->Move(this->geometry.width - 105, this->geometry.height - 24); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); for (int index = 0; index < 7; ++index) { if (this->unknown_0120[index]) { - this->unknown_0120[index]->SendMsg(nullptr, 246, 0, 0, 0, 0); + this->unknown_0120[index]->SendMsg(nullptr, UM_RESET_ITEM_SORT, 0, 0, 0, 0); } } this->buttons[1]->Move(220, this->geometry.height - 50); @@ -8582,11 +8585,11 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case 365: { std::string text(this->searchEdit->Text()); if (!text.empty()) { - UIItemStoreFindWnd* window = static_cast(g_windowMgr.EnsureWindow(153)); + UIItemStoreFindWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_ITEMSTOREFINDWND)); this->unknown_0140 = window; window->SetSearchText(std::string(text.c_str(), text.size())); - this->unknown_0140->SendMsg(nullptr, 23, 365, 0, 0, 0); - this->unknown_0140->SendMsg(nullptr, 365, 0, 0, 0, 0); + this->unknown_0140->SendMsg(nullptr, UM_REFRESHITEM, 365, 0, 0, 0); + this->unknown_0140->SendMsg(nullptr, UM_SEARCH_ITEMS, 0, 0, 0, 0); this->searchEdit->SetText(""); } break; @@ -8608,7 +8611,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->unknown_0120[index] = nullptr; this->unknown_0120[index] = g_windowMgr.EnsureWindow(a); if (this->unknown_0120[index]) { - this->unknown_0120[index]->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->unknown_0120[index]->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->saved->unknown_0010 |= 1 << index; break; @@ -8628,15 +8631,15 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: if (this->tabs[7]->geometry.unknown_0030 != 0) { this->unknown_0120[7] = nullptr; - this->unknown_0120[7] = g_windowMgr.EnsureWindow(309); + this->unknown_0120[7] = g_windowMgr.EnsureWindow(WID_ITEMSTORESUBWND_TAB_7); if (this->unknown_0120[7]) { - this->unknown_0120[7]->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->unknown_0120[7]->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->saved->unknown_0010 |= 0x80; break; } - g_windowMgr.CloseWindow(309); + g_windowMgr.CloseWindow(WID_ITEMSTORESUBWND_TAB_7); if (this->unknown_0120[7]) { this->saved->unknown_0010 ^= 0x80; this->unknown_0120[7] = nullptr; @@ -8644,11 +8647,11 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: break; case 133: if (!this->unknown_0140) { - this->unknown_0140 = g_windowMgr.EnsureWindow(153); + this->unknown_0140 = g_windowMgr.EnsureWindow(WID_ITEMSTOREFINDWND); std::string text(this->searchEdit->Text()); if (!text.empty() && reinterpret_cast(this)->FilterByName3(std::string(text.c_str(), text.size()))) { static_cast(this->unknown_0140)->SetSearchText(std::string(text.c_str(), text.size())); - this->unknown_0140->SendMsg(nullptr, 365, 0, 0, 0, 0); + this->unknown_0140->SendMsg(nullptr, UM_SEARCH_ITEMS, 0, 0, 0, 0); } } break; @@ -8657,12 +8660,12 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->drag.source == 1) { - mode->SendMsg(55, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_ADD_ITEM_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } else if (mode->drag.source == 9) { - mode->SendMsg(79, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_RESIZE: @@ -8771,32 +8774,32 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: for (int index = 0; index < 7; ++index) { UIWindow* window = g_windowMgr.LookupWindow(index + 146); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } - UIWindow* window = g_windowMgr.LookupWindow(309); + UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMSTORESUBWND_TAB_7); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - window = g_windowMgr.LookupWindow(153); + window = g_windowMgr.LookupWindow(WID_ITEMSTOREFINDWND); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } } else { for (int index = 0; index < 7; ++index) { UIWindow* window = g_windowMgr.LookupWindow(index + 146); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } - UIWindow* window = g_windowMgr.LookupWindow(309); + UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMSTORESUBWND_TAB_7); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - window = g_windowMgr.LookupWindow(153); + window = g_windowMgr.LookupWindow(WID_ITEMSTOREFINDWND); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->Invalidate(); this->UpdateScrollBar(); @@ -8812,9 +8815,9 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } this->Invalidate(); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -8823,7 +8826,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 20901) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } @@ -8838,7 +8841,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: g_session.m_itemAscendingOrder = a == 1; g_session.m_itemDescendingOrder = a == 2; if (a == 0) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; } @@ -8850,11 +8853,11 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: for (int index = 0; index < 8; ++index) { if (this->unknown_0120[index]) { - this->unknown_0120[index]->SendMsg(nullptr, 364, 0, 0, 0, 0); + this->unknown_0120[index]->SendMsg(nullptr, UM_SORT_ITEMS, 0, 0, 0, 0); } } if (this->unknown_0140) { - this->unknown_0140->SendMsg(nullptr, 364, 0, 0, 0, 0); + this->unknown_0140->SendMsg(nullptr, UM_SORT_ITEMS, 0, 0, 0, 0); } this->Invalidate(); @@ -9751,13 +9754,13 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp case 456: Singleton::GetInstance()->ToggleOption(264); return 0; - case 507: { + case ID_TOGGLE_ITEM_TRADE_LOCK: { const char* normal; const char* over; const char* press; if (g_session.m_blockPrivateTab == 1) { if (this->unknown_0128) { - this->SendMsg(this->unknown_0128, 6, 201, 0, 0, 0); + this->SendMsg(this->unknown_0128, UM_COMMAND, ID_CLOSE, 0, 0, 0); } g_session.m_blockPrivateTab = 0; press = "유저인터페이스\\inventory\\bt_itemDeal_lock_press.bmp"; @@ -9783,12 +9786,12 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->Invalidate(); return 0; } - case 545: + case ID_EXTEND_INVENTORY: if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(310, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_OPEN_MSGBOX_EXTEND_BODYITEM_SIZE, 0, 0, 0, 0); } return 0; - case 364: + case ID_SORT_ITEMS: if (this->unknown_010C != 3) { return 0; } @@ -9802,7 +9805,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->unknown_0128 = nullptr; this->Invalidate(); } else { - g_windowMgr.CloseWindow(8); + g_windowMgr.CloseWindow(WID_ITEMWND); } return 0; case ID_MINI: { @@ -9874,7 +9877,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } case UM_TAB: this->unknown_010C = static_cast(a); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; case UM_REFRESHITEM: if (this->unknown_010C == 3) { @@ -9940,16 +9943,16 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp if (this->saved->IsValid() == 0) { this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->unknown_0010, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->unknown_0010, 0); this->unknown_010C = this->saved->unknown_0014; this->unknown_0100 = 3; this->unknown_0104 = 3; this->unknown_0108 = 4; this->tabs->unknown_007C = this->saved->unknown_0014; this->Invalidate(); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); if (this->saved->height != this->saved->unknown_0010) { - this->SendMsg(nullptr, 6, 202, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } this->Move(this->saved->x, this->saved->y); return 0; @@ -9958,32 +9961,32 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp ModeDragState& drag = static_cast(mode)->drag; switch (drag.source) { case 2: - mode->SendMsg(20, drag.slot, 0, 0, 0); + mode->SendMsg(MM_TAKE_OFF_EQUIP, drag.slot, 0, 0, 0); break; case 6: - mode->SendMsg(56, static_cast(drag.id), drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_STORE_TO_BODY, static_cast(drag.id), drag.quantity, 0, 0); break; case 9: - mode->SendMsg(77, static_cast(drag.id), drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_BODY, static_cast(drag.id), drag.quantity, 0, 0); break; case 15: if (g_windowMgr.unknown_0458) { - g_windowMgr.unknown_0458->SendMsg(nullptr, 104, static_cast(drag.id), drag.quantity, 0, 0); + g_windowMgr.unknown_0458->SendMsg(nullptr, UM_DECITEM, static_cast(drag.id), drag.quantity, 0, 0); } break; case 17: - mode->SendMsg(303, drag.slot, 0, 0, 0); + mode->SendMsg(MM_TAKE_OFF_SWAP_EQUIP, drag.slot, 0, 0, 0); break; case 18: - mode->SendMsg(303, drag.slot, 1, 0, 0); + mode->SendMsg(MM_TAKE_OFF_SWAP_EQUIP, drag.slot, 1, 0, 0); break; case 24: - mode->SendMsg(20, drag.slot, 1, 0, 0); + mode->SendMsg(MM_TAKE_OFF_EQUIP, drag.slot, 1, 0, 0); break; default: break; } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } default: @@ -10010,15 +10013,15 @@ void UIItemWnd::RefreshSortButton() { // OFFSET: 0x00990810 // FUNCTION: fn_13428 int UIMerchantItemPurchaseMSGWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } switch (a) { case ID_OK: - g_modeMgr.gameMode->SendMsg(83, this->purchaseIndex, this->unknown_00D0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PC_PURCHASE_ITEMLIST_FROMMC, this->purchaseIndex, this->unknown_00D0, 0, 0); case ID_CANCEL: - g_windowMgr.CloseWindow(230); + g_windowMgr.CloseWindow(WID_MERCHANTITEMPURCHASEMSGWND); g_session.ClearItems1760And1748(); break; } @@ -10497,7 +10500,7 @@ void UIMerchantShopMakeWnd::PrintSellList() { char grouped[32]; std::sprintf(line, "====================== SALE LIST ======================"); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); std::memset(name, 0, sizeof(name)); for (unsigned index = 0; index < this->items.size(); ++index, ++it) { @@ -10533,19 +10536,19 @@ void UIMerchantShopMakeWnd::PrintSellList() { } std::sprintf(line, " %s : %s Zeny", name, price); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x5AFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x5AFFFF, 0, 0, 0); const double rate = PriceCommission(_atoi64(text)) * 0.01; const std::int64_t commission = static_cast(_atoi64(text) * rate); const std::string notice = FormatOwnedString("Commission : 1 EA = %s Zeny", FormatGroupedInteger(commission, line, 256)); - g_windowMgr.SendNotice(1, reinterpret_cast(notice.c_str()), 0x5AFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(notice.c_str()), 0x5AFFFF, 0, 0, 0); } std::sprintf(price, "%s", FormatGroupedInteger(g_session.m_zeny, grouped, 32)); std::sprintf(line, " Current Zeny : %s Z", price); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x78FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x78FFFF, 0, 0, 0); std::sprintf(line, "============================ ============================"); - g_windowMgr.SendNotice(1, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(line), 0x96FFFF, 0, 0, 0); } // OFFSET: 0x00985160 @@ -10813,7 +10816,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->saved->Reset(); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_DROP: { @@ -10826,29 +10829,29 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: lists->AddItem1730(item); lists->ReduceItem1718(item); if (g_windowMgr.unknown_0250) { - g_windowMgr.unknown_0250->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.unknown_0250->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; - if (a == 184) { + if (a == ID_OK) { if (g_session.HasRequiredItems()) { - mode->SendMsg(35, 0, 0, 0, 0); + mode->SendMsg(MM_REQ_SELL, 0, 0, 0, 0); } - } else if (a != 185) { + } else if (a != ID_CANCEL) { break; } - g_windowMgr.CloseWindow(22); - g_windowMgr.CloseWindow(24); - mode->SendMsg(40, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMSHOPWND); + g_windowMgr.CloseWindow(WID_ITEMSELLWND); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); return 0; } @@ -10908,7 +10911,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->UpdateScrollBar(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -10917,13 +10920,13 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 20751) { - UIWindow* window = g_windowMgr.EnsureWindow(22); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); if (window) { - window->SendMsg(nullptr, 36, 1, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 1, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } @@ -11188,7 +11191,7 @@ void UIItemPurchaseWnd::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x0098DBF0 @@ -11202,7 +11205,7 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } this->Move(this->saved->x, this->saved->y); - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); return 0; case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); @@ -11229,9 +11232,9 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } case UM_COMMAND: - if (a == 201) { - g_windowMgr.CloseWindow(153); - static_cast(g_windowMgr.LookupWindow(33))->unknown_0140 = 0; + if (a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_ITEMSTOREFINDWND); + static_cast(g_windowMgr.LookupWindow(WID_ITEMSTOREWND))->unknown_0140 = 0; return 0; } case UM_RESIZE: @@ -11264,17 +11267,17 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->drag.source == 1) { - mode->SendMsg(55, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_ADD_ITEM_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } else if (mode->drag.source == 9) { - mode->SendMsg(79, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_MOVE_ITEM_FROM_CART_TO_STORE, mode->drag.id, mode->drag.quantity, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } - case 246: + case UM_RESET_ITEM_SORT: this->sorted = false; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; case UM_SETCOUNTINFO: { char text[64]; @@ -11283,9 +11286,9 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->Invalidate(); return 0; } - case 364: + case UM_SORT_ITEMS: if (g_session.m_itemDefaultSort == true) { - this->SendMsg(nullptr, 246, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESET_ITEM_SORT, 0, 0, 0, 0); return 0; } @@ -11296,7 +11299,7 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, reinterpret_cast(this)->SortReversed1(); } break; - case 365: + case UM_SEARCH_ITEMS: if (this->searchText.empty()) { return 0; } @@ -11340,7 +11343,7 @@ void UIItemDropCntWnd::Show(int visible) { g_windowMgr.StoreSnapRectangle(this); } else { if (this->m_edit == g_windowMgr.GetHoverWindow() && ChatWindow()) { - ChatWindow()->SendMsg(nullptr, 54, 0, 0, 0, 0); + ChatWindow()->SendMsg(nullptr, UM_GET_EDIT_FOCUS, 0, 0, 0, 0); } g_windowMgr.RemoveSnapRectangle(this); } @@ -11389,8 +11392,8 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t item.quantity = 30000 - g_session.GetItem1768Quantity(mode->drag.id); char text[200]; std::sprintf(text, LookupMessage(1705), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } if (item.quantity != 0) { const bool full = this->unknown_012C <= g_session.GetList11Size(); @@ -11437,7 +11440,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); break; } case UM_REFRESHITEM: { @@ -11489,9 +11492,9 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->scroll = previous - this->unknown_0140 + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->scroll = previous + this->unknown_0140 - 1; } else { this->scroll = previous + static_cast(a); @@ -11521,7 +11524,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } return this->scroll - previous; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* data = reinterpret_cast(a); ItemListChunkHeader header; std::memcpy(&header, data, sizeof(header)); @@ -11533,7 +11536,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t if (header.type == 21301 || header.type == 21351) { UIWindow* window = g_windowMgr.EnsureWindow(header.type == 21301 ? 42 : 175); if (window) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } break; } @@ -11543,50 +11546,50 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t break; } case UM_COMMAND: - if (a == 213) { + if (a == ID_CHECK) { g_session.m_skipPriceWarning = !g_session.m_skipPriceWarning; - } else if (a == 343) { - if (!g_windowMgr.LookupWindow(333)) { - g_windowMgr.EnsureWindow(333); + } else if (a == ID_HELP) { + if (!g_windowMgr.LookupWindow(WID_NOTEWND)) { + g_windowMgr.EnsureWindow(WID_NOTEWND); } - } else if (a == 560) { + } else if (a == ID_RESTORE_STORE_INFO) { this->unknown_0168->SetDisabled(1); this->unknown_0168->Invalidate(); g_session.m_storeInfoBackup.Load(g_session.m_aid, g_session.m_gid, std::string(g_session.m_accountName.c_str()), this->mode); - } else if (a == 185) { + } else if (a == ID_CANCEL) { CMode* mode = g_modeMgr.GetGameMode(); if (this->mode == 0) { if (this->unknown_0188 != 1) { - mode->SendMsg(82, reinterpret_cast(this->unknown_00CC->Text()), 0, 0, 0); - g_windowMgr.CloseWindow(41); + mode->SendMsg(MM_REQ_OPENSTORE, reinterpret_cast(this->unknown_00CC->Text()), 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); } else if (this->suspended == 1) { this->SetSuspended(0); } else { - mode->SendMsg(297, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_VENDING_MAKE, 0, 0, 0, 0); } } else if (this->unknown_0188 == 1) { if (this->suspended == 1) { this->SetSuspended(0); } else { - mode->SendMsg(299, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_BUYING_STORE_MAKE, 0, 0, 0, 0); } } else { - mode->SendMsg(271, 0, 0, 0, 0); - g_windowMgr.CloseWindow(174); + mode->SendMsg(MM_REQ_OPEN_BUYING_STORE, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND_MODE_1); } this->RecordResponse(185, static_cast(b), static_cast(c), static_cast(d)); - } else if (a == 184) { + } else if (a == ID_OK) { CMode* mode = g_modeMgr.GetGameMode(); if (g_windowMgr.HasTitleAtActorCell(g_session.m_aid)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2983)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2983)), 0xFF, 0, 0, 0); break; } if (g_windowMgr.window_027C || g_windowMgr.window_0274) { g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); if (this->unknown_0188 == 1) { - g_modeMgr.GetGameMode()->SendMsg(this->mode == 1 ? 299 : 297, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(this->mode == 1 ? MM_CANCEL_BUYING_STORE_MAKE : MM_CANCEL_VENDING_MAKE, 0, 0, 0, 0); } else { - g_windowMgr.CloseWindow(41); + g_windowMgr.CloseWindow(WID_MERCHANTSHOPMAKEWND); } break; } @@ -11678,7 +11681,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } const std::int64_t budget = _atoi64(this->unknown_0128->Text()); if (budget > g_session.m_zeny || budget > 0x7FFFFFFF) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(budget > g_session.m_zeny ? 3683 : 1870)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(budget > g_session.m_zeny ? 3683 : 1870)), 0x6464FF, 0, 0, 0); break; } } @@ -11723,7 +11726,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->SetSuspended(1); } else { const int budget = static_cast(_atoi64(this->unknown_0128->Text())); - mode->SendMsg(271, reinterpret_cast(this->unknown_00CC->Text()), 1, budget, 0); + mode->SendMsg(MM_REQ_OPEN_BUYING_STORE, reinterpret_cast(this->unknown_00CC->Text()), 1, budget, 0); } } else { std::int64_t total = g_session.m_zeny; @@ -11738,7 +11741,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t if (this->unknown_0188 == 1) { this->SetSuspended(1); } else { - mode->SendMsg(82, reinterpret_cast(this->unknown_00CC->Text()), 1, 0, 0); + mode->SendMsg(MM_REQ_OPENSTORE, reinterpret_cast(this->unknown_00CC->Text()), 1, 0, 0); } } this->RecordText(0, this->unknown_00CC->Text()); diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index 67fbd1036..9a2f6874d 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "UI/Window/UIEnums.h" #include "Client/Input/Language.h" @@ -35,7 +36,7 @@ UIEditCtrl2::~UIEditCtrl2() = default; // OFFSET: 0x00863BF0 // FUNCTION: fn_10911 int UIEditCtrl2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 0) { + if (message != UM_DEFPUSH) { this->UIEditCtrl::SendMsg(sender, message, a, b, c, d); } else { if (g_windowMgr.IsLastFocus(g_windowMgr.GetHoverWindow())) { @@ -63,7 +64,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in char newline[3] = {'\r', '\n', '\0'}; g_serverLanguage->Insert(newline); } else { - this->UIWindow::SendMsg(sender, 0, a, b, c, d); + this->UIWindow::SendMsg(sender, UM_DEFPUSH, a, b, c, d); } return 0; case UM_SCROLLVERT: @@ -72,9 +73,9 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in const int previous = this->unknown_0158; scrolling[0] = 1; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_0158 = previous - this->geometry.height / this->unknown_0138 + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->unknown_0158 = previous - 1 + this->geometry.height / this->unknown_0138; } else { this->unknown_0158 = previous + a; @@ -809,7 +810,7 @@ UIEditCtrl5::~UIEditCtrl5() = default; // OFFSET: 0x00864140 // FUNCTION: fn_10913 int UIEditCtrl5::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 0) { + if (message != UM_DEFPUSH) { this->UIEditCtrl::SendMsg(sender, message, a, b, c, d); } else { if (g_windowMgr.IsLastFocus(g_windowMgr.GetHoverWindow())) { @@ -850,9 +851,9 @@ void UIEditCtrl3::OnWheel(int value) { } if (value < 0) { - this->SendMsg(this->unknown_0130, 7, 3, 0, 0, 0); + this->SendMsg(this->unknown_0130, UM_SCROLLVERT, 3, 0, 0, 0); } else { - this->SendMsg(this->unknown_0130, 7, -3, 0, 0, 0); + this->SendMsg(this->unknown_0130, UM_SCROLLVERT, -3, 0, 0, 0); } } @@ -967,9 +968,9 @@ void UIEditCtrl_OldList::Paint() { // FUNCTION: fn_10894 void UIEditCtrl_OldList::OnWheel(int value) { if (value < 0) { - this->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); } else { - this->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); } } @@ -978,7 +979,7 @@ void UIEditCtrl_OldList::OnWheel(int value) { void UIEditCtrlVarId::OnFinishEdit(int) { this->Synchronize(); this->Invalidate(); - this->SendMsg(this, 0, 0, 0, 0, 0); + this->SendMsg(this, UM_DEFPUSH, 0, 0, 0, 0); } // OFFSET: 0x0085FFA0 @@ -992,12 +993,12 @@ void UIEditCtrlVarId::OnWheel(int value) { // OFFSET: 0x00864CE0 // FUNCTION: fn_10915 int UIEditCtrlVarId::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 0) { + if (message != UM_DEFPUSH) { return UIEditCtrl::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (this->parent) { - this->parent->SendMsg(this, 6, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, 0, 0, 0); } return 0; @@ -1066,7 +1067,7 @@ void UIShowAndEditTimeCtrl::OnCreate(int, int) { // OFFSET: 0x008996B0 // FUNCTION: fn_11556 int UIShowAndEditTimeCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6 && argument1 == 184) { + if (message == UM_COMMAND && argument1 == ID_OK) { for (int index = 0; index < 2; ++index) { if (sender == this->fields[index]) { int value = std::atoi(this->fields[index]->Text()); diff --git a/Source/UI/Emotion/UIEmotionWnd.cpp b/Source/UI/Emotion/UIEmotionWnd.cpp index 6d65c6884..8a6d94780 100644 --- a/Source/UI/Emotion/UIEmotionWnd.cpp +++ b/Source/UI/Emotion/UIEmotionWnd.cpp @@ -1,5 +1,7 @@ #include "UI/Emotion/UIEmotionWnd.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/CashEmotionMgr.h" @@ -115,23 +117,23 @@ void UIEmotionWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_11647 int UIEmotionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0: + case UM_DEFPUSH: break; case UM_COMMAND: switch (argument1) { case ID_CLOSE: - g_windowMgr.CloseWindow(0x56); + g_windowMgr.CloseWindow(WID_EMOTIONWND); break; case ID_OPEN_EMOTIONLIST: if (static_cast(g_windowMgr.unknown_0384) == nullptr) { - g_windowMgr.EnsureWindow(0x57); + g_windowMgr.EnsureWindow(WID_CASHEMOTIONLISTWND); } else { - g_windowMgr.CloseWindow(0x57); + g_windowMgr.CloseWindow(WID_CASHEMOTIONLISTWND); } break; } break; - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(argument1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); diff --git a/Source/UI/Enchant/UIEnchantUI.cpp b/Source/UI/Enchant/UIEnchantUI.cpp index ca6b7be73..7ead6a02c 100644 --- a/Source/UI/Enchant/UIEnchantUI.cpp +++ b/Source/UI/Enchant/UIEnchantUI.cpp @@ -1,4 +1,5 @@ #include "UI/Enchant/EnchantUI.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Contents/EnchantMgr.h" #include "Render/Renderer.h" @@ -1443,7 +1444,7 @@ void CUIEnchantUI::OnSelectTarget(EnchantUI::CUITargetItem* item, const ITEM_INF void CUIEnchantUI::SetEnchantGroup(uint64_t group) { this->enchantInfo = CEnchantMgr::GetInstance()->GetEnchantInfo(group); if (!this->enchantInfo) { - g_windowMgr.CloseWindow(0x2716); + g_windowMgr.CloseWindow(WID_ENCHANTUI); return; } @@ -2811,5 +2812,5 @@ void CUIEnchantUI::OnCreate(int width, int height) { } void CUIEnchantUI::OnClickClose() { - g_windowMgr.CloseWindow(10006); + g_windowMgr.CloseWindow(WID_ENCHANTUI); } diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index 9ceaad769..0ca30fd46 100644 --- a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp +++ b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp @@ -1,4 +1,5 @@ #include "UI/EntryQueue/UIEntryQueueWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" @@ -54,8 +55,8 @@ void UIEntryQueueHelpWnd::OnProcess() { // OFFSET: 0x00BA42B0 // FUNCTION: fn_19683 int UIEntryQueueHelpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6 && a == 0) { - g_windowMgr.CloseWindow(211); + if (message == UM_COMMAND && a == 0) { + g_windowMgr.CloseWindow(WID_ENTRYQUEUEHELPWND); } return 0; @@ -95,7 +96,7 @@ int UIEntryQueueListBox::EntryValue(int index) { // FUNCTION: fn_19688 void UIEntryQueueListBox::OnLBtnUp(int x, int y) { if (this->selected != -1) { - this->parent->SendMsg(this, 135, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_LIST_SELECTION, this->geometry.id, this->selected, 0, 0); } } @@ -136,13 +137,13 @@ bool UIEntryQueueRequestWnd::Create() { } this->m_viewer->Clear(); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2127)), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(""), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2128)), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2129)), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2130)), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2131)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2127)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(""), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2128)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2129)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2130)), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2131)), 38, 0, 0); const std::string path = "유저인터페이스\\"; @@ -186,7 +187,7 @@ void UIEntryQueueRequestWnd::Paint() { std::memset(text, 0, sizeof(text)); const int remaining = 20 - static_cast(this->m_elapsed / 1000 % 60); if (remaining <= 0) { - this->SendMsg(nullptr, 6, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 1, 0, 0, 0); } std::sprintf(text, LookupMessage(2134), remaining); @@ -209,19 +210,19 @@ void UIEntryQueueRequestWnd::OnProcess() { // OFFSET: 0x00BA54A0 // FUNCTION: fn_19695 int UIEntryQueueRequestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { this->RecordResponse(static_cast(a), b, c, d); switch (a) { case 0: g_entryQueueMgr->SendAdmissionReply(1); - g_windowMgr.CloseWindow(209); - g_windowMgr.CloseWindow(210); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2132)), 0x64FFFF, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND); + g_windowMgr.CloseWindow(WID_ENTRYQUEUEREQUESTWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2132)), 0x64FFFF, 0, 0, 0); break; case 1: g_entryQueueMgr->SendAdmissionReply(2); - g_windowMgr.CloseWindow(209); - g_windowMgr.CloseWindow(210); + g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND); + g_windowMgr.CloseWindow(WID_ENTRYQUEUEREQUESTWND); return 0; } } @@ -301,14 +302,14 @@ void UIEntryQueueStandByWnd::OnProcess() { // OFFSET: 0x00BA5EA0 // FUNCTION: fn_19702 int UIEntryQueueStandByWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { this->RecordResponse(static_cast(a), b, c, d); switch (a) { case 0: g_entryQueueMgr->SendCancel(); break; case 1: - g_windowMgr.CloseWindow(209); + g_windowMgr.CloseWindow(WID_ENTRYQUEUESTANDBYWND); return 0; } } @@ -328,9 +329,9 @@ void UIEntryQueueStandByWnd::SetInfo(const char* queueName, int waiting, int ran if (this->m_viewer) { this->m_viewer->Clear(); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_queueText), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_waitingText), 38, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_rankingText), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->m_queueText), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->m_waitingText), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->m_rankingText), 38, 0, 0); } } @@ -520,14 +521,14 @@ int UIEntryQueueWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std break; } case 3: - if (!g_windowMgr.CloseWindow(211)) { - g_windowMgr.EnsureWindow(211); + if (!g_windowMgr.CloseWindow(WID_ENTRYQUEUEHELPWND)) { + g_windowMgr.EnsureWindow(WID_ENTRYQUEUEHELPWND); } return 0; case 4: - case 201: + case ID_CLOSE: this->RecordResponse(static_cast(a), b, c, d); - g_windowMgr.CloseWindow(157); + g_windowMgr.CloseWindow(WID_JOINTO_BATTLEFIELDWND); return 0; default: return 0; @@ -540,10 +541,10 @@ int UIEntryQueueWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std if (!this->saved->IsValid()) { this->saved->Reset(); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 135: + case UM_LIST_SELECTION: if (this->m_list) { const int value = this->m_list->EntryValue(static_cast(b)); std::map::iterator it = g_entryQueueList.find(value); @@ -655,23 +656,23 @@ void UIEntryQueueHelpWnd::OnCreate(int width, int height) { char message[0x104]; std::memset(message, 0, sizeof(message)); strcpy_s(message, sizeof(message), LookupMessage(2116)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2117)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2118)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2119)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2120)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2121)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2122)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2123)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); strcpy_s(message, sizeof(message), LookupMessage(2124)); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(message), 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(message), 38, 0, 0); const std::string path = "유저인터페이스\\"; diff --git a/Source/UI/Exchange/UIExchangeUI.cpp b/Source/UI/Exchange/UIExchangeUI.cpp index fe4712051..ef543762c 100644 --- a/Source/UI/Exchange/UIExchangeUI.cpp +++ b/Source/UI/Exchange/UIExchangeUI.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Exchange/UIExchangeUI.h" #include "UI/Window/UIEnums.h" @@ -217,7 +219,7 @@ void CUIExchangeUI::Cancel() { return; } - mode->SendMsg(0x35, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_EXCHANGE_ITEM, 0, 0, 0, 0); CUIImageButton* button = this->unknown_0118; button->disabled = 1; button->Invalidate(); @@ -233,10 +235,10 @@ void CUIExchangeUI::Conclude() { if (this->logCheckBox->checked) { std::string text = FormatOwnedString(LookupMessage(0x728), this->partnerName.c_str()); - g_modeMgr.gameMode->SendMsg(0x44, reinterpret_cast(text.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SCREENSHOT, reinterpret_cast(text.c_str()), 0, 0, 0); } - mode->SendMsg(0x36, 0, 0, 0, 0); + mode->SendMsg(MM_EXEC_EXCHANGE_ITEM, 0, 0, 0, 0); this->tradeButton->disabled = 1; this->tradeButton->Invalidate(); } @@ -258,8 +260,8 @@ void CUIExchangeUI::SubmitZeny() { amount = value < 0 ? 0 : value; } - mode->SendMsg(0x33, 0, g_session.unknown_5210 + amount, 0, 0); - mode->SendMsg(0x34, 0, 0, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, 0, g_session.unknown_5210 + amount, 0, 0); + mode->SendMsg(MM_CONCLUDE_EXCHANGE_ITEM, 0, 0, 0, 0); this->lockButton->disabled = 1; this->lockButton->Invalidate(); } else { @@ -290,22 +292,22 @@ void CUIExchangeUI::DragAndDrop(int x, int y, std::intptr_t value) { } if (this->firstList->unknown_00C4) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 1) { if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); } else { - g_windowMgr.ShowWindowById(15, 1); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); if (g_windowMgr.window_01EC != nullptr) { - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 5, 0, 0, 0); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 5, 0, 0, 0); } } } else { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } } @@ -508,8 +510,8 @@ int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode != nullptr) { - mode->SendMsg(0x33, mode->drag.id, mode->drag.quantity, 0, 0); - mode->SendMsg(0x12, 0, 0, 0, 0); + mode->SendMsg(MM_ADD_EXCHANGE_ITEM, mode->drag.id, mode->drag.quantity, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } break; } diff --git a/Source/UI/GameSettings/GameSettingsUI.cpp b/Source/UI/GameSettings/GameSettingsUI.cpp index 13583885f..db245693c 100644 --- a/Source/UI/GameSettings/GameSettingsUI.cpp +++ b/Source/UI/GameSettings/GameSettingsUI.cpp @@ -1,3 +1,6 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "UI/GameSettings/GameSettingsUI.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -1383,16 +1386,16 @@ void CUIGroup::Apply() { // FUNCTION: fn_15971 void CUIGroupEmblem::Apply() { g_serviceOptions.Set(0xF3, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xDC8)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xDC8)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00A40480 // FUNCTION: fn_15972 void CUIGroupLogInOut::Apply() { g_serviceOptions.Set(0xA5, 1); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x414)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x414)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00A404F0 @@ -1659,7 +1662,7 @@ void CUIGroupSound::SetBgmEnabled(bool enabled) { this->m_bgmSlider->Invalidate(); g_serviceOptions.Set(7, enabled); if (previous != enabled) { - g_modeMgr.gameMode->SendMsg(0x5A, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REFRESH_MUSIC, 0, 0, 0, 0); } } @@ -1683,16 +1686,16 @@ void CUIGroupSound::SetEffectVolume(int volume) { // FUNCTION: fn_15945 void CUIGroupEmblem::SetEnabled(bool enabled) { g_serviceOptions.Set(0xF3, enabled); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(enabled ? 0xDC7 : 0xDC8)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(enabled ? 0xDC7 : 0xDC8)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00A3F5C0 // FUNCTION: fn_15946 void CUIGroupLogInOut::SetEnabled(bool enabled) { g_serviceOptions.Set(0xA5, enabled); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(enabled ? 0x414 : 0x415)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(enabled ? 0x414 : 0x415)), 0x64FFFF, 0, 0, 0); } // OFFSET: 0x00A3F6B0 @@ -1954,13 +1957,13 @@ void CUIGameSettingsUI::OnApply() { // OFFSET: 0x00A3F170 // FUNCTION: fn_45481 void CUIGameSettingsUI::OnCloseButton() { - g_windowMgr.CloseWindow(10014); + g_windowMgr.CloseWindow(WID_GAMESETTINGSUI); } // OFFSET: 0x00A3F940 // FUNCTION: fn_45482 void CUIGameSettingsUI::OnTitleClose() { - g_windowMgr.CloseWindow(10014); + g_windowMgr.CloseWindow(WID_GAMESETTINGSUI); } // OFFSET: 0x00A40240 @@ -2034,7 +2037,7 @@ void CUIGameSettingsUI::SelectTab4() { // OFFSET: 0x00A41E50 // FUNCTION: fn_16004 void __stdcall OnFullscreenOptionChanged(int option) { - CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(0x271E)); + CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(WID_GAMESETTINGSUI)); if (wnd) { wnd->UpdateApplyButton(); } @@ -2043,7 +2046,7 @@ void __stdcall OnFullscreenOptionChanged(int option) { // OFFSET: 0x00A41FA0 // FUNCTION: fn_16008 void __stdcall OnTrilinearOptionChanged(int option) { - CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(0x271E)); + CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(WID_GAMESETTINGSUI)); if (wnd) { wnd->UpdateApplyButton(); } @@ -2052,7 +2055,7 @@ void __stdcall OnTrilinearOptionChanged(int option) { // OFFSET: 0x00A43000 // FUNCTION: fn_16022 void __stdcall OnSpriteDetailLevelChanged(int option) { - CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(0x271E)); + CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(WID_GAMESETTINGSUI)); if (wnd) { wnd->UpdateApplyButton(); } @@ -2061,7 +2064,7 @@ void __stdcall OnSpriteDetailLevelChanged(int option) { // OFFSET: 0x00A43040 // FUNCTION: fn_16023 void __stdcall OnTextureDetailLevelChanged(int option) { - CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(0x271E)); + CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(WID_GAMESETTINGSUI)); if (wnd) { wnd->UpdateApplyButton(); } @@ -2113,14 +2116,14 @@ void GameSettingsUI::CUIGroupTextureDetailLevel::OnInit() { // OFFSET: 0x00AA2760 // FUNCTION: fn_17216 void ToggleGameSettingsTab4() { - UIWindow* window = g_windowMgr.LookupWindow(0x271E); + UIWindow* window = g_windowMgr.LookupWindow(WID_GAMESETTINGSUI); if (!window) { - window = g_windowMgr.EnsureWindow(0x271E); + window = g_windowMgr.EnsureWindow(WID_GAMESETTINGSUI); } CUIGameSettingsUI* settings = static_cast(window); if (settings->IsTab4Selected()) { - g_windowMgr.CloseWindow(0x271E); + g_windowMgr.CloseWindow(WID_GAMESETTINGSUI); return; } @@ -2130,7 +2133,7 @@ void ToggleGameSettingsTab4() { // OFFSET: 0x00AAB070 // FUNCTION: fn_17277 void UIWindowMgr::RefreshGameSettingOption(int option) { - CUIGameSettingsUI* settings = static_cast(this->LookupWindow(0x271E)); + CUIGameSettingsUI* settings = static_cast(this->LookupWindow(WID_GAMESETTINGSUI)); if (settings) { settings->RefreshOption(option); } @@ -2139,7 +2142,7 @@ void UIWindowMgr::RefreshGameSettingOption(int option) { // OFFSET: 0x00AAB090 // FUNCTION: fn_17278 void UIWindowMgr::RefreshGameSettings() { - CUIGameSettingsUI* settings = static_cast(this->LookupWindow(0x271E)); + CUIGameSettingsUI* settings = static_cast(this->LookupWindow(WID_GAMESETTINGSUI)); if (settings) { settings->RefreshOptions(); } @@ -2148,7 +2151,7 @@ void UIWindowMgr::RefreshGameSettings() { // OFFSET: 0x00AAB0B0 // FUNCTION: fn_17279 void UIWindowMgr::RefreshGameSettingHotkeys() { - CUIGameSettingsUI* settings = static_cast(this->LookupWindow(0x271E)); + CUIGameSettingsUI* settings = static_cast(this->LookupWindow(WID_GAMESETTINGSUI)); if (settings) { settings->RefreshHotkeyLabels(); } @@ -2421,7 +2424,7 @@ void GameSettingsUI::CUIGroupGraphics::OnModeSelect(CUIComboItem* item, const Di auto node = list->data.begin(); std::advance(node, static_cast(list->selected)); this->m_pendingMode = *node; - CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(0x271E)); + CUIGameSettingsUI* wnd = dynamic_cast(g_windowMgr.LookupWindow(WID_GAMESETTINGSUI)); if (wnd) { wnd->UpdateApplyButton(); } @@ -4437,7 +4440,7 @@ void GameSettingsUI::CUIGraphicsPage::ApplySettings() { g_restartClient = true; GetRagConnection().Close(); if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } return; } @@ -5041,7 +5044,7 @@ void GameSettingsUI::CUIOptionItem::OnCreate(int width, int height) { this->m_label->Move(47, 6); this->m_label->SetOnClick([this]() { if (this->m_label->geometry.id > 0) { - if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(0x13B))) { + if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(WID_TIPBOXWND))) { tipbox->ShowTip(this->m_label->geometry.id); } } @@ -5088,7 +5091,7 @@ void GameSettingsUI::CUIOptionItem::OnCreate(int width, int height) { // FUNCTION: fn_45512 void GameSettingsUI::CUIOptionItem::OnClickLabel() { if (this->m_label->geometry.id > 0) { - if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(0x13B))) { + if (UITipboxWnd* tipbox = static_cast(g_windowMgr.EnsureWindow(WID_TIPBOXWND))) { tipbox->ShowTip(this->m_label->geometry.id); } } diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index a797db724..84c690811 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "UI/Guild/UIAgitWnd.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" @@ -38,12 +39,12 @@ void UIAgitMessageBox::Paint() { // OFFSET: 0x00961260 // FUNCTION: fn_13122 int UIAgitMessageBox::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { const int response = static_cast(a); this->RecordResponse(response, b, c, d); switch (response) { case ID_YES: - g_modeMgr.GetGameMode()->SendMsg(315, this->m_agitId, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_MOVE_GUILD_AGIT, this->m_agitId, 0, 0, 0); [[fallthrough]]; case ID_NO: g_windowMgr.Schedule(this); @@ -64,7 +65,7 @@ void UIListBoxAgit::OnCreate(int width, int height) { void UIListBoxAgit::OnLBtnDown(int x, int y) { if (this->parent) { UIListBox::OnLBtnDown(x, y); - this->parent->SendMsg(nullptr, 163, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_HIDE_AGIT_MENU, 0, 0, 0, 0); } } @@ -74,10 +75,10 @@ void UIListBoxAgit::OnRBtnDown(int x, int y) { if (this->parent) { UIListBox::OnLBtnDown(x, y); if (this->selected < 0) { - this->parent->SendMsg(nullptr, 163, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_HIDE_AGIT_MENU, 0, 0, 0, 0); return; } - this->parent->SendMsg(nullptr, 162, this->geometry.width + this->geometry.x - 3, this->geometry.y - y % this->lineHeight + y + 2, 0, 0); + this->parent->SendMsg(nullptr, UM_SHOW_AGIT_MENU, this->geometry.width + this->geometry.x - 3, this->geometry.y - y % this->lineHeight + y + 2, 0, 0); } } @@ -112,9 +113,9 @@ void UIListBoxAgitMenu::Paint() { // FUNCTION: fn_13093 void UIListBoxAgitMenu::OnLBtnDown(int x, int y) { UIListBox::OnLBtnDown(x, y); - this->SendMsg(nullptr, 48, this->selected, 0, 0, 0); + this->SendMsg(nullptr, UM_MENU_SELECTED, this->selected, 0, 0, 0); if (this->parent) { - this->parent->SendMsg(nullptr, 163, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_HIDE_AGIT_MENU, 0, 0, 0, 0); } } @@ -144,14 +145,14 @@ void UIListBoxAgitMenu::OnMouseHover(int x, int y) { // OFFSET: 0x00964F80 // FUNCTION: fn_13136 int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 48) { + if (message != UM_MENU_SELECTED) { return this->UIListBox::SendMsg(sender, message, a, b, c, d); } switch (a) { case 0: { if (g_session.GetSceneUnknown004C() == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3633)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3633)), 0xFF, 0, 0, 0); return 0; } @@ -182,7 +183,7 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s CMode* mode = g_modeMgr.GetGameMode(); GuildInfo* guildInfo = &g_guildInfo; uint16_t agitId = static_cast(guildInfo->GetUnknown0114(this->m_agitIndex)); - mode->SendMsg(316, agitId, 0, 0, 0); + mode->SendMsg(MM_REQ_AGIT_INVESTMENT, agitId, 0, 0, 0); break; } } diff --git a/Source/UI/Guild/UIGuildHelperWnd.cpp b/Source/UI/Guild/UIGuildHelperWnd.cpp index 9d223092b..06b5e5019 100644 --- a/Source/UI/Guild/UIGuildHelperWnd.cpp +++ b/Source/UI/Guild/UIGuildHelperWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Guild/UIGuildHelperWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -152,7 +154,7 @@ void UIGuildHelperWnd::StoreInfo() { // OFFSET: 0x009612E0 // FUNCTION: fn_13123 int UICreateGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a1, a2, a3, a4); } @@ -164,23 +166,23 @@ int UICreateGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s this->m_nameEdit->SelectAll(); if (name.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2080)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2080)), 0xFF, 0, 0, 0); } else if (_mbsstr(reinterpret_cast(this->m_nameEdit->Text()), reinterpret_cast(s_itemLinkOpening.c_str())) || _mbsstr(reinterpret_cast(this->m_nameEdit->Text()), reinterpret_cast(s_itemLinkClosing.c_str()))) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2812)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2812)), 0xFF, 0, 0, 0); } else if (this->m_mode == 0) { - mode->SendMsg(112, reinterpret_cast(name.c_str()), 0, 0, 0); + mode->SendMsg(MM_REQ_MAKE_GUILD, reinterpret_cast(name.c_str()), 0, 0, 0); } else { - mode->SendMsg(106, reinterpret_cast(name.c_str()), 0, 0, 0); - g_windowMgr.CloseWindow(215); + mode->SendMsg(MM_REQ_DISORGANIZE_GUILD, reinterpret_cast(name.c_str()), 0, 0, 0); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_1); } break; } case ID_CANCEL: if (this->m_mode == 0) { - g_windowMgr.CloseWindow(213); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_0); } else { - g_windowMgr.CloseWindow(215); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_1); } break; } @@ -195,13 +197,13 @@ int UIGuildBanReasonDescWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case UM_COMMAND: switch (a1) { case ID_OK: { - g_windowMgr.CloseWindow(76); + g_windowMgr.CloseWindow(WID_GUILDBANREASONDESCWND); CMode* mode = g_modeMgr.gameMode; - mode->SendMsg(111, reinterpret_cast(&this->m_target), reinterpret_cast(this->m_reasonEdit->Text()), 0, 0); + mode->SendMsg(MM_REQ_BAN_GUILD, reinterpret_cast(&this->m_target), reinterpret_cast(this->m_reasonEdit->Text()), 0, 0); break; } case ID_CANCEL: - g_windowMgr.CloseWindow(76); + g_windowMgr.CloseWindow(WID_GUILDBANREASONDESCWND); break; } return 0; @@ -224,18 +226,18 @@ int UIGuildHelperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s case UM_COMMAND: switch (a1) { case ID_OK: - g_windowMgr.CloseWindow(214); - g_windowMgr.CloseWindow(213); - g_windowMgr.CloseWindow(212); + g_windowMgr.CloseWindow(WID_GUILDTIPWND); + g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_0); + g_windowMgr.CloseWindow(WID_GUILDHELPERWND); break; case ID_HELP: - if (!g_windowMgr.CloseWindow(214)) { - g_windowMgr.EnsureWindow(214); + if (!g_windowMgr.CloseWindow(WID_GUILDTIPWND)) { + g_windowMgr.EnsureWindow(WID_GUILDTIPWND); } break; case 448: - if (!g_windowMgr.CloseWindow(213)) { - g_windowMgr.EnsureWindow(213); + if (!g_windowMgr.CloseWindow(WID_CREATEGUILDWND_MODE_0)) { + g_windowMgr.EnsureWindow(WID_CREATEGUILDWND_MODE_0); if (g_windowMgr.unknown_0438) { int x = 0; int y = 0; @@ -251,7 +253,7 @@ int UIGuildHelperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s if (!this->m_saved->IsValid()) { this->m_saved->Reset(); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Move(this->m_saved->x, this->m_saved->y); return 0; default: @@ -262,8 +264,8 @@ int UIGuildHelperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s // OFFSET: 0x00964C60 // FUNCTION: fn_13133 int UIGuildTipWnd::SendMsg(UIWindow*, int message, std::intptr_t a1, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 6 && a1 == 201) { - g_windowMgr.CloseWindow(214); + if (message == UM_COMMAND && a1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_GUILDTIPWND); } return 0; @@ -424,7 +426,7 @@ void UIGuildTipWnd::OnCreate(int width, int height) { std::vector tipList = g_guildTip.GetTipList(); for (const auto& tip : tipList) { for (unsigned int i = 0; i < tip.size(); ++i) { - this->m_textViewer->SendMsg(nullptr, 29, reinterpret_cast(tip[i].c_str()), 50, 0, 0); + this->m_textViewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(tip[i].c_str()), 50, 0, 0); } } } diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index a610c2599..818b50b4a 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -1,4 +1,6 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "UI/Guild/UIGuildWnd.h" #include "Client/Mode/CGameMode.h" @@ -138,7 +140,7 @@ void UIGuildWnd::OnLBtnDown(int x, int y) { this->Tab(); const int tab = x / 66; if (tab < 6 && current != tab) { - this->SendMsg(nullptr, 69, tab, 0, 0, 0); + this->SendMsg(nullptr, UM_CHANGE_GUILD_TAB, tab, 0, 0, 0); } } } @@ -201,13 +203,13 @@ void UIGuildMemberManageWnd::OnRBtnDown(int x, int y) { // OFFSET: 0x00960620 // FUNCTION: fn_13108 void UIGuildMemberManageWnd::OnRBtnUp(int, int) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } // OFFSET: 0x00960640 // FUNCTION: fn_13109 void UIGuildSkillWnd::OnRBtnUp(int, int) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } // OFFSET: 0x00960960 @@ -215,7 +217,7 @@ void UIGuildSkillWnd::OnRBtnUp(int, int) { void UIGuildBanishedMemberWnd::OnWheel(int delta) { if (this->m_scrollable != 0) { const int step = std::min(this->m_visibleRows - 1, 3); - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -224,7 +226,7 @@ void UIGuildBanishedMemberWnd::OnWheel(int delta) { void UIGuildMemberManageWnd::OnWheel(int delta) { if (this->m_scrollable != 0) { const int step = std::min(this->m_visibleRows - 1, 3); - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -233,7 +235,7 @@ void UIGuildMemberManageWnd::OnWheel(int delta) { void UIGuildPositionManageWnd::OnWheel(int delta) { if (this->m_scrollable != 0) { const int step = std::min(this->m_visibleRows - 1, 3); - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -242,7 +244,7 @@ void UIGuildPositionManageWnd::OnWheel(int delta) { void UIGuildSkillWnd::OnWheel(int delta) { if (this->m_scrollable != 0) { const int step = std::min(this->m_visibleRows - 1, 3); - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -251,7 +253,7 @@ void UIGuildSkillWnd::OnWheel(int delta) { void UIGuildTotalInfoWnd::OnWheel(int delta) { if (this->m_scrollable != 0) { const int step = std::min(this->m_visibleRows - 1, 3); - this->SendMsg(this->m_scrollBar, 7, delta < 0 ? step : -step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, delta < 0 ? step : -step, 0, 0, 0); } } @@ -591,7 +593,7 @@ __declspec(noinline) void UIGuildWnd::CreateTabs() { } if (g_guildInfo.unknown_00A4 == -1) { - g_modeMgr.gameMode->SendMsg(105, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENUINTERFACE, 0, 0, 0, 0); } const char* names[6]; @@ -646,28 +648,28 @@ int UIGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::in return 0; } - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); switch (a1) { case 0: - g_windowMgr.EnsureWindow(60); + g_windowMgr.EnsureWindow(WID_GUILDINFOMANAGEWND); return 0; case 1: - g_windowMgr.EnsureWindow(61); + g_windowMgr.EnsureWindow(WID_GUILDMEMBERMANAGEWND); return 0; case 2: - g_windowMgr.EnsureWindow(62); + g_windowMgr.EnsureWindow(WID_GUILDPOSITIONMANAGEWND); return 0; case 3: - g_windowMgr.EnsureWindow(63); + g_windowMgr.EnsureWindow(WID_GUILDSKILLWND); return 0; case 4: - g_windowMgr.EnsureWindow(64); + g_windowMgr.EnsureWindow(WID_GUILDBANISHEDMEMBERWND); return 0; case 5: - g_windowMgr.EnsureWindow(65); + g_windowMgr.EnsureWindow(WID_GUILDNOTICEWND); return 0; case 6: - g_windowMgr.EnsureWindow(66); + g_windowMgr.EnsureWindow(WID_GUILDTOTALINFOWND); return 0; } break; @@ -748,8 +750,8 @@ void UIGuildBanishedMemberWnd::OnLBtnDown(int x, int y) { int UIGuildBanishedMemberWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { case UM_COMMAND: - if (a1 == 201) { - g_windowMgr.CloseWindow(59); + if (a1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_GUILDWND); return 0; } break; @@ -758,10 +760,10 @@ int UIGuildBanishedMemberWnd::SendMsg(UIWindow* sender, int message, std::intptr case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { top = previous - this->m_visibleRows + 1; } else { - top = (message == 10 ? this->m_visibleRows - 1 : a1) + previous; + top = (message == UM_SCROLLVERTPAGEDOWN ? this->m_visibleRows - 1 : a1) + previous; } this->m_scrollTop = top; if (previous != top) { @@ -850,8 +852,8 @@ void UIGuildTotalInfoWnd::OnLBtnDown(int x, int y) { int UIGuildTotalInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { case UM_COMMAND: - if (a1 == 201) { - g_windowMgr.CloseWindow(59); + if (a1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_GUILDWND); } return 0; case UM_SCROLLVERT: @@ -859,10 +861,10 @@ int UIGuildTotalInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1 case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { top = previous - this->m_visibleRows + 1; } else { - top = (message == 10 ? this->m_visibleRows - 1 : a1) + previous; + top = (message == UM_SCROLLVERTPAGEDOWN ? this->m_visibleRows - 1 : a1) + previous; } this->m_scrollTop = top; if (previous != top) { @@ -881,11 +883,11 @@ int UIGuildTotalInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1 void UIGuildTotalInfoWnd::OnCreate(int, int) { this->CreateTabs(); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00D0 = 1; - g_modeMgr.gameMode->SendMsg(107, 5, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 5, 0, 0, 0); this->m_scrollTop = 0; this->m_hoverRow = 0; this->m_columns = 1; @@ -911,11 +913,11 @@ void UIGuildTotalInfoWnd::OnCreate(int, int) { void UIGuildBanishedMemberWnd::OnCreate(int, int) { this->CreateTabs(); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00CC = 1; - g_modeMgr.gameMode->SendMsg(107, 4, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 4, 0, 0, 0); this->m_scrollTop = 0; this->m_hoverRow = 0; this->m_columns = 1; @@ -949,15 +951,15 @@ void UIGuildInfoManageWnd::OnCreate(int, int) { this->m_allyRow = -1; this->m_hostileRow = -1; if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00CC = 1; - g_modeMgr.gameMode->SendMsg(107, 4, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 4, 0, 0, 0); g_guildInfo.unknown_00BC = 1; - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); g_guildInfo.unknown_00C0 = 1; - g_modeMgr.gameMode->SendMsg(107, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 1, 0, 0, 0); { const std::string prefix("유저인터페이스\\"); @@ -1042,7 +1044,7 @@ void UIGuildInfoManageWnd::OnRBtnUp(int x, int y) { if (count != 0) { this->m_allyRow = (y - 157) / 16; if (count > this->m_allyRow) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } } else if (y > 231 && y < 279) { @@ -1052,7 +1054,7 @@ void UIGuildInfoManageWnd::OnRBtnUp(int x, int y) { if (count != 0) { this->m_hostileRow = (y - 231) / 16; if (count > this->m_hostileRow) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } } else { @@ -1082,17 +1084,17 @@ void UIGuildInfoManageWnd::RefreshAgitList() { // OFFSET: 0x00962310 // FUNCTION: fn_13128 int UIGuildLeaveReasonDescWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a1, a2, a3, a4); } switch (a1) { case ID_OK: - g_modeMgr.gameMode->SendMsg(110, reinterpret_cast(this->m_reasonEdit->Text()), 0, 0, 0); - g_windowMgr.CloseWindow(75); + g_modeMgr.gameMode->SendMsg(MM_REQ_LEAVE_GUILD, reinterpret_cast(this->m_reasonEdit->Text()), 0, 0, 0); + g_windowMgr.CloseWindow(WID_GUILDLEAVEREASONDESCWND); break; case ID_CANCEL: - g_windowMgr.CloseWindow(75); + g_windowMgr.CloseWindow(WID_GUILDLEAVEREASONDESCWND); break; } @@ -1674,11 +1676,11 @@ void UIGuildTotalInfoWnd::Paint() { void UIGuildMemberManageWnd::OnCreate(int, int) { this->CreateTabs(); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00C0 = 1; - g_modeMgr.gameMode->SendMsg(107, 1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 1, 0, 0, 0); this->m_members = g_guildInfo.m_members; this->m_rowSpacing += 8; @@ -1774,7 +1776,7 @@ void UIAgitMessageBox::InitializeMessageBox(const char* text, int width, int hei viewer->backgroundColor = 0xFF000000 | (blue << 16) | (green << 8) | red; viewer->Invalidate(); this->AddChild(viewer); - viewer->SendMsg(nullptr, 29, reinterpret_cast(text), width / 6, 0, 0); + viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), width / 6, 0, 0); const std::string prefix("유저인터페이스\\"); const char* names[2][3] = {{"btn_ok", "btn_ok_a", "btn_ok_b"}, {"btn_cancel", "btn_cancel_a", "btn_cancel_b"}}; @@ -1968,7 +1970,7 @@ void UIGuildNoticeWnd::OnCreate(int, int) { this->CreateTabs(); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } this->m_titleEdit = new UIEditCtrlVarId(); @@ -2012,7 +2014,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s case UM_COMMAND: switch (a1) { case ID_CLOSE: - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); break; case ID_SEND_GUILD_NOTICE: { std::string body(this->m_bodyEdit->Text()); @@ -2020,7 +2022,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s g_windowMgr.Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); } else { if (g_guildInfo.unknown_00B4) { - g_modeMgr.gameMode->SendMsg(118, g_guildInfo.m_guildId, reinterpret_cast(this->m_titleEdit->Text()), reinterpret_cast(body.c_str()), 0); + g_modeMgr.gameMode->SendMsg(MM_GUILD_NOTICE, g_guildInfo.m_guildId, reinterpret_cast(this->m_titleEdit->Text()), reinterpret_cast(body.c_str()), 0); } this->InvalidateChildren(); } @@ -2045,13 +2047,13 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st case UM_COMMAND: switch (a1) { case ID_CLOSE: - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); return 0; case ID_OK: if (this->m_hoverIndex != -1) { CSkillInfo skill = this->SkillAt(this->m_hoverIndex); if (skill.level != 0) { - this->SendMsg(nullptr, 58, reinterpret_cast(&skill), 0, 0, 0); + this->SendMsg(nullptr, UM_USESKILL, reinterpret_cast(&skill), 0, 0, 0); } return 0; } @@ -2066,7 +2068,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st if (g_session.m_guildSkillPoint != 0) { CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 239); if (skill.available != 0) { - g_modeMgr.gameMode->SendMsg(67, skill.id, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_UPGRADE_SKILLLEVEL, skill.id, 0, 0, 0); } return 0; } @@ -2121,9 +2123,9 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { top = previous - this->m_visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { top = this->m_visibleRows - 1 + previous; } else { top = a1 + previous; @@ -2155,7 +2157,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st case UM_MAKEMENU: this->m_menuItems.clear(); if (g_windowMgr.unknown_0210 != 0) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->m_hoverIndex != -1) { CSkillInfo skill = this->SkillAt(this->m_hoverIndex); @@ -2165,12 +2167,12 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st } } if (!this->m_menuItems.empty()) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (std::size_t index = 0; index < this->m_menuItems.size(); ++index) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->m_menuItems[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_menuItems[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 63, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, WID_GUILDSKILLWND, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = std::max(1, g_mouse.x + 1); int maxX = g_renderer->viewport.width - menu->geometry.width; @@ -2193,9 +2195,9 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st if (skill.available != 0) { const int command = this->m_menuItems[a1].value; if (command == 3) { - g_windowMgr.EnsureWindow(46)->SendMsg(nullptr, 61, skill.id, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND)->SendMsg(nullptr, UM_SKILLDESCRIBE, skill.id, 0, 0, 0); } else if (command == 14) { - g_windowMgr.EnsureWindow(55)->SendMsg(nullptr, 68, skill.id, 0, 0, 0); + g_windowMgr.EnsureWindow(WID_SKILLNAMECHANGEWND)->SendMsg(nullptr, UM_SET_SKILL_INFO, skill.id, 0, 0, 0); } } return 0; @@ -2205,7 +2207,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st case UM_USESKILL: { const CSkillInfo* skill = reinterpret_cast(a1); if (skill->level != 0) { - g_modeMgr.gameMode->SendMsg(113, a1, g_session.UseLevel(skill->id), 0, 0); + g_modeMgr.gameMode->SendMsg(MM_USING_SKILL, a1, g_session.UseLevel(skill->id), 0, 0); } break; } @@ -2239,11 +2241,11 @@ UIListBoxAgitMenu::UIListBoxAgitMenu() : UIListBox() { void UIGuildSkillWnd::OnCreate(int, int height) { this->CreateTabs(); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00C8 = 1; - g_modeMgr.gameMode->SendMsg(107, 3, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 3, 0, 0, 0); this->m_scrollBar = new UIScrollBar(); this->m_scrollBar->Configure(this->geometry.width - 15, 41, 1, this->geometry.height - 70); this->AddChild(this->m_scrollBar); @@ -2326,7 +2328,7 @@ void UIGuildSkillWnd::OnCreate(int, int height) { this->AddChild(*button); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -2339,10 +2341,10 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { top = previous - this->m_visibleRows + 1; } else { - top = message == 10 ? this->m_visibleRows - 1 : a1; + top = message == UM_SCROLLVERTPAGEDOWN ? this->m_visibleRows - 1 : a1; top += previous; } this->m_scrollTop = top; @@ -2358,7 +2360,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr case ID_OK: if (this->m_positionMap.size() != 0) { reinterpret_cast&>(g_guildInfo.unknown_010C) = this->m_positionMap; - g_modeMgr.gameMode->SendMsg(104, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_CHANGE_GUILD_POSITIONINFO, 0, 0, 0, 0); this->m_positionMap.clear(); this->m_button->Move(-200, -200); this->m_button->SetDisabled(1); @@ -2369,7 +2371,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr } return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); return 0; case ID_CHECK: if (this->unknown_00D0[0] && this->unknown_00FC[0] && this->unknown_0128[0]) { @@ -2436,7 +2438,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr if (found) { position.tax = std::atoi(this->unknown_0154[row]->Text()); if (position.tax < 0 || position.tax > 50) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString(LookupMessage(3460), 50, 0).c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString(LookupMessage(3460), 50, 0).c_str()), 0xFF, 0, 0, 0); if (position.tax < 0) { position.tax = 0; } else if (position.tax > 50) { @@ -2586,7 +2588,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case ID_OK: if (!this->unknown_0180.empty()) { g_guildInfo.unknown_0104 = this->unknown_0180; - g_modeMgr.gameMode->SendMsg(103, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_CHANGE_MEMBERPOS, 0, 0, 0, 0); this->unknown_0180.clear(); UIButton* button = this->m_button; button->SetDisabled(1); @@ -2596,7 +2598,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } break; case ID_CLOSE: - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); return 0; case ID_CHECK: g_session.m_guildMemberListSort = !g_session.m_guildMemberListSort; @@ -2615,23 +2617,23 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->m_hoverRow = this->unknown_016C = this->m_scrollTop + row; this->Invalidate(); if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } - UIWindow* menu = g_windowMgr.EnsureWindow(26); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); index = 0; const int count = static_cast(g_guildInfo.m_positions.size()); for (; index < count; ++index) { char text[128]; std::sprintf(text, "%s", g_guildInfo.m_positions[index].c_str()); - menu->SendMsg(nullptr, 31, reinterpret_cast(text), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text), 0, 0, 0); } - menu->SendMsg(nullptr, 40, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); int height = index * 16; if (height > 80) { height = 80; } menu->Resize(150, height); - menu->SendMsg(nullptr, 83, 61, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, WID_GUILDMEMBERMANAGEWND, 0, 0, 0); int x = 88; int y = (this->m_rowSpacing + 36) * row + this->m_rowSpacing + 101; this->ToScreen(x, y); @@ -2646,9 +2648,9 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { top = previous - this->m_visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { top = this->m_visibleRows - 1 + previous; } else { top = a1 + previous; @@ -2663,7 +2665,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_MAKEMENU: this->unknown_0150.clear(); if (g_windowMgr.unknown_0210 != 0) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->m_hoverRow != -1) { GuildInfo::Member member; @@ -2705,12 +2707,12 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } } if (this->unknown_0150.size() != 0) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (std::size_t index = 0; index < this->unknown_0150.size(); ++index) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->unknown_0150[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->unknown_0150[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 61, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, WID_GUILDMEMBERMANAGEWND, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = std::max(1, g_mouse.x + 1); int maxX = g_renderer->viewport.width - menu->geometry.width; @@ -2730,7 +2732,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t GuildInfo::Member member; if ((this->GetMember(this->m_hoverRow, member) && member.name.find(g_guildNamelessTag, 0) != std::string::npos) || !g_playerNameDictionary->Contains(member.characterId)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3041)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3041)), 0xFF, 0, 0, 0); return 0; } @@ -2743,7 +2745,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t int accountId; int characterId; } request = {g_guildInfo.m_guildId, target.accountId, target.characterId}; - g_windowMgr.EnsureWindow(76)->SendMsg(nullptr, 34, reinterpret_cast(&request), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_GUILDBANREASONDESCWND)->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&request), 0, 0, 0); } break; } @@ -2751,21 +2753,21 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target) && target.accountId == static_cast(g_session.m_aid)) { *reinterpret_cast(g_session.unknown_0F54) = static_cast(static_cast(target.characterId)); - g_windowMgr.EnsureWindow(75); + g_windowMgr.EnsureWindow(WID_GUILDLEAVEREASONDESCWND); } break; } case MENUID_VIEW_GUILD_MEMBER_INFO: { GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target)) { - g_modeMgr.gameMode->SendMsg(109, target.accountId, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_OPEN_MEMBER_INFO, target.accountId, 0, 0, 0); } break; } case MENUID_INVITE_IN_PARTY: { GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target)) { - g_modeMgr.gameMode->SendMsg(59, reinterpret_cast(target.name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast(target.name.c_str()), 0, 0, 0); } break; } @@ -2779,7 +2781,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t relation = g_session.IsGuildMemberCharacter(static_cast(target.characterId)) == true ? "GuildMember" : nullptr; } const std::string filename = ShortcutFilename(target.characterId); - g_windowMgr.SendNotice(14, reinterpret_cast(target.name.c_str()), reinterpret_cast(relation), + g_windowMgr.SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(target.name.c_str()), reinterpret_cast(relation), reinterpret_cast(filename.c_str()), 0, 0); } break; @@ -2787,7 +2789,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case 58: { GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target) == true) { - g_modeMgr.GetGameMode()->SendMsg(268, reinterpret_cast(target.name.c_str()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast(target.name.c_str()), 0, 0, 0); } break; } @@ -2803,7 +2805,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->unknown_0180[static_cast(target.characterId)].positionId = target.positionId; g_guildInfo.unknown_0104.clear(); g_guildInfo.unknown_0104 = this->unknown_0180; - g_modeMgr.GetGameMode()->SendMsg(103, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_CHANGE_MEMBERPOS, 0, 0, 0, 0); } } break; @@ -2868,11 +2870,11 @@ void UIGuildPositionManageWnd::OnCreate(int, int) { this->CreateTabs(); this->m_positions = reinterpret_cast&>(g_guildInfo.unknown_00D4); if (std::strcmp(g_guildInfo.unknown_0018.c_str(), "") == 0) { - g_modeMgr.gameMode->SendMsg(107, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 0, 0, 0, 0); } g_guildInfo.unknown_00C4 = 1; - g_modeMgr.gameMode->SendMsg(107, 2, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_GUILD_MENU, 2, 0, 0, 0); this->m_scrollTop = 0; this->m_hoverIndex = 0; this->m_columns = 1; @@ -3001,7 +3003,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (it->unknown_0004 == 0) { if (row == this->m_allyRow) { if (it->unknown_0000 != 0) { - gameMode->SendMsg(127, it->unknown_0000, 0, 0, 0); + gameMode->SendMsg(MM_REQ_DELETE_RELATED_GUILD, it->unknown_0000, 0, 0, 0); } return 0; } @@ -3017,7 +3019,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (it->unknown_0004 == 1) { if (row == this->m_hostileRow) { if (it->unknown_0000 != 0) { - gameMode->SendMsg(127, it->unknown_0000, 1, 0, 0); + gameMode->SendMsg(MM_REQ_DELETE_RELATED_GUILD, it->unknown_0000, 1, 0, 0); } return 0; } @@ -3030,18 +3032,18 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_MAKEMENU: this->unknown_00E0.erase(this->unknown_00E0.begin(), this->unknown_00E0.end()); if (g_windowMgr.unknown_0210 != 0) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_guildInfo.unknown_00B4 != 0) { this->unknown_00E0.push_back(MiniPartyInfoEntry(LookupMessage(351), 27)); } if (this->unknown_00E0.size() != 0) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (std::size_t index = 0; index < this->unknown_00E0.size(); ++index) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->unknown_00E0[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->unknown_00E0[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 60, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, WID_GUILDINFOMANAGEWND, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = std::max(1, g_mouse.x + 1); int maxX = g_renderer->viewport.width - menu->geometry.width; @@ -3060,11 +3062,11 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_COMMAND: switch (a1) { case ID_CLOSE: - g_windowMgr.CloseWindow(59); + g_windowMgr.CloseWindow(WID_GUILDWND); return 0; case ID_CHANGE_GUILE_EMBLEM: { if (g_windowMgr.unknown_0214 != 0) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } this->unknown_00D8.clear(); char directory[256]; @@ -3077,13 +3079,13 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } - UIWindow* menu = g_windowMgr.EnsureWindow(26); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); for (std::list::iterator it = this->unknown_00D8.begin(); it != this->unknown_00D8.end(); ++it) { - menu->SendMsg(nullptr, 31, reinterpret_cast(it->c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(it->c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 40, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); menu->Resize(160, std::min(count * 16, 160)); - menu->SendMsg(nullptr, 83, 60, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, WID_GUILDINFOMANAGEWND, 0, 0, 0); int x = this->geometry.width - 163; int y = 86; this->ToScreen(x, y); @@ -3092,7 +3094,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } case 449: g_windowMgr.Confirm(LookupMessage(2564), 0, false, false, 0, "Message", 280, 120, 0); - g_windowMgr.EnsureWindow(215); + g_windowMgr.EnsureWindow(WID_CREATEGUILDWND_MODE_1); return 0; } break; @@ -3151,7 +3153,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->RefreshAgitList(); this->InvalidateChildren(); return 0; - case 162: + case UM_SHOW_AGIT_MENU: if (this->m_agitMenu) { this->m_agitMenu->Move(a1, a2); this->m_agitMenu->Show(1); @@ -3160,7 +3162,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } break; - case 163: + case UM_HIDE_AGIT_MENU: this->HideAgitMenu(); break; default: diff --git a/Source/UI/Guild/UIGuild_Storage_Log.cpp b/Source/UI/Guild/UIGuild_Storage_Log.cpp index b316b8446..718e218e2 100644 --- a/Source/UI/Guild/UIGuild_Storage_Log.cpp +++ b/Source/UI/Guild/UIGuild_Storage_Log.cpp @@ -1,4 +1,5 @@ #include "UI/Guild/UIGuild_Storage_Log.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "Resource/Bitmap/BitmapResource.h" @@ -45,7 +46,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_COMMAND: switch (a) { case ID_OK: - g_windowMgr.CloseWindow(253); + g_windowMgr.CloseWindow(WID_GUILD_STORAGE_LOG); break; case ID_NEXT: { @@ -66,7 +67,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->m_page = page + 1; this->unknown_0174 = 0; this->unknown_0188 = this->unknown_0184; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; } @@ -87,7 +88,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->m_offset = std::max(0u, offset); this->m_page = std::max(1u, page - 1); this->unknown_0188 = this->unknown_0184; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; } break; @@ -103,7 +104,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->unknown_0174 = 0; this->m_offset = 0; this->unknown_0188 = this->unknown_0184; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; case UM_REFRESH: diff --git a/Source/UI/Item/UIEquipmentPropertiesWnd.cpp b/Source/UI/Item/UIEquipmentPropertiesWnd.cpp index 2fb69540a..9e2a2efbd 100644 --- a/Source/UI/Item/UIEquipmentPropertiesWnd.cpp +++ b/Source/UI/Item/UIEquipmentPropertiesWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Item/UIEquipmentPropertiesWnd.h" #include "Contents/MessageTable.h" @@ -957,7 +959,7 @@ void CUIEquipmentPropertiesWnd::OnClickButton9() { // OFFSET: 0x00A0EF10 // FUNCTION: fn_45511 void CUIEquipmentPropertiesWnd::OnClickClose() { - g_windowMgr.CloseWindow(10001); + g_windowMgr.CloseWindow(WID_EQUIPMENTPROPERTIESWND); } // OFFSET: 0x00A0EF20 @@ -1063,7 +1065,7 @@ void CUIEquipmentPropertiesWnd::SetTab(const int& tab) { int CUIEquipmentPropertiesWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message == 60) { + if (message == UM_REFRESH) { this->SetTab(this->currentTab); } return 0; diff --git a/Source/UI/Item/UIMerchantItemLogWnd.cpp b/Source/UI/Item/UIMerchantItemLogWnd.cpp index bcecaeddd..50d5afa31 100644 --- a/Source/UI/Item/UIMerchantItemLogWnd.cpp +++ b/Source/UI/Item/UIMerchantItemLogWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Render/Text/FontCache.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -203,7 +204,7 @@ void UIMerchantItemLogWnd::OnRBtnDown(int x, int y) { if (item.unknown_0000[1] > 0) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 410fb8385..dac960f53 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -1,4 +1,7 @@ #include "Render/Text/FontCache.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Contents/Items/ItemType.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -97,7 +100,7 @@ void UIParaResultWnd::AddItem(const ITEM_INFO& item) { // OFFSET: 0x009A81F0 // FUNCTION: fn_13747 void UIParaItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -115,39 +118,39 @@ void UIParaItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { case TYPE_ARMORMB: case TYPE_ARMORTMB: case TYPE_GUN: - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; default: - g_windowMgr.ShowWindowById(15, 1); - dynamic_cast(g_windowMgr.LookupWindow(15))->SendMsg(nullptr, 13, 21, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + dynamic_cast(g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND))->SendMsg(nullptr, UM_SETSTATE, 21, 0, 0, 0); return; } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x009A82E0 // FUNCTION: fn_13748 void UIParaItemShopWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 4) { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - dynamic_cast(g_windowMgr.LookupWindow(15))->SendMsg(nullptr, 13, 22, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + dynamic_cast(g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND))->SendMsg(nullptr, UM_SETSTATE, 22, 0, 0, 0); } // OFFSET: 0x009A83B0 @@ -205,8 +208,8 @@ void UIParaResultWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->GetItemByIndex(this->unknown_00F8); if (item.unknown_0000[1] != 0) { g_modeMgr.GetGameMode(); - UIWindow* window = g_windowMgr.EnsureWindow(0xC); - window->SendMsg(nullptr, 0x18, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -261,7 +264,7 @@ void UIParaResultWnd::OnCreate(int width, int height) { this->visibleRows = (height - this->unknown_0100 - this->unknown_00FC - 17) / 32; this->columns = 1; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x009A9AB0 @@ -277,7 +280,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->saved->Reset(); } - this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_DROP: { @@ -295,9 +298,9 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case TYPE_GUN: { const int count = drag.unknown_03B6 == 1 ? g_session.GetItem1720Quantity(drag.id) : g_session.GetItem1720QuantityByItemId(drag.name.c_str()); if (count > 0) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(119)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(119)), 255, 0, 0, 0); return 0; } break; @@ -324,15 +327,15 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t char text[200]; std::memset(text, 0, sizeof(text)); sprintf_s(text, sizeof(text), LookupMessage(1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 255, 0, 0, 0); } const int available = item.unknown_0074[3] == 1 ? g_session.GetItem1718QuantityOf(item) : g_session.GetItem1718QuantityByItemId(item); if (available != -1 && available < a) { item.quantity = available; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2531)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2531)), 255, 0, 0, 0); } if (item.quantity > 0) { @@ -346,11 +349,11 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } if (!affordable) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); } else if (weight + g_session.m_weight > g_session.m_maxWeight) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2536)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2536)), 255, 0, 0, 0); } else { if (item.unknown_0074[3] == 1) { g_session.RemoveItem1718(item); @@ -360,12 +363,12 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_session.MergeItem1720ByName(item); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - dynamic_cast(g_windowMgr.LookupWindow(254))->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + dynamic_cast(g_windowMgr.LookupWindow(WID_PARAITEMSHOPWND))->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { @@ -375,16 +378,16 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case ID_OK: { ITEM_INFO item = g_session.GetItem1720At(0); if (item.unknown_0074[3] == 1) { - mode->SendMsg(263, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_PURCHASE_V2, 0, 0, 0, 0); } else { - mode->SendMsg(262, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_PURCHASE, 0, 0, 0, 0); } g_session.ClearTradeItems(); return 0; } case ID_CANCEL: - mode->SendMsg(292, 0, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_CLOSE, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); return 0; } @@ -445,7 +448,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->UpdateScrollBar(); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); ItemListChunkHeader header = *reinterpret_cast(bytes); unsigned offset = 6; @@ -454,14 +457,14 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t header = *reinterpret_cast(bytes + offset); offset += 6; if (header.type == 20701) { - UIWindow* window = g_windowMgr.EnsureWindow(22); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMSHOPWND); if (window) { - window->SendMsg(nullptr, 36, 0, 0, 0, 0); - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 36, 0, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SETTITLE, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; } @@ -487,7 +490,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_COMMAND: @@ -516,9 +519,9 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s lists->MergeItem1718ByName(item); } - dynamic_cast(g_windowMgr.LookupWindow(255))->SendMsg(nullptr, 23, 0, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + dynamic_cast(g_windowMgr.LookupWindow(WID_PARAITEMPURCHASEWND))->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } break; @@ -595,8 +598,8 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { - mode->SendMsg(292, 0, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_CLOSE, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_session.ClearTradeItems(); return 0; } @@ -605,7 +608,7 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std case UM_SETTITLE: this->showQuantity = 0; this->title->SetTextAutoWidth(LookupMessage(2530)); - this->SendMsg(nullptr, 14, 7, this->geometry.width, a, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->geometry.width, a, 0); return 0; case UM_RESIZE: if (a == 7) { diff --git a/Source/UI/Items/MergeItemWnd.cpp b/Source/UI/Items/MergeItemWnd.cpp index ad8ce7f11..922c1900f 100644 --- a/Source/UI/Items/MergeItemWnd.cpp +++ b/Source/UI/Items/MergeItemWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Render/Text/FontCache.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -217,7 +218,7 @@ void CMergeItemWnd::OnWheel(int delta) { if (delta >= 0) { step = -step; } - this->SendMsg(this->m_scrollBar, 7, step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, step, 0, 0, 0); } } @@ -358,7 +359,7 @@ int CMergeItemWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std: MergeItemCancelPacket packet; packet.id = 0x974; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); - g_windowMgr.CloseWindow(227); + g_windowMgr.CloseWindow(WID_MERGEITEMWND); break; } } @@ -394,7 +395,7 @@ bool CMergeItemWnd::RequestMerge() { } if (ids.size() < this->m_minSelection) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2170)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2170)), 0xFF, 0, 0, 0); return false; } diff --git a/Source/UI/Items/UIGameItem.cpp b/Source/UI/Items/UIGameItem.cpp index 3a3168c2c..fd9bae17c 100644 --- a/Source/UI/Items/UIGameItem.cpp +++ b/Source/UI/Items/UIGameItem.cpp @@ -1,4 +1,6 @@ #include "UI/Items/UIGameItem.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Text/ColoredText.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/ModeMgr.h" @@ -119,9 +121,9 @@ void CUIGameItem::OnLBtnDblClk(int, int) { } WindowManagerWindows& windows = g_windowMgr; - UIWindow* window = windows.EnsureWindow(12); + UIWindow* window = windows.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window != nullptr) { - window->SendMsg(nullptr, 24, reinterpret_cast(&this->itemInfo), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->itemInfo), 0, 0, 0); } } diff --git a/Source/UI/Items/UIIllustWnd.cpp b/Source/UI/Items/UIIllustWnd.cpp index ed4ebf39e..202eff18d 100644 --- a/Source/UI/Items/UIIllustWnd.cpp +++ b/Source/UI/Items/UIIllustWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UIIllustWnd.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" @@ -101,8 +102,8 @@ void UIMultiIllustWnd::OnMouseMove(int x, int y) { int UIIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 201) { - g_modeMgr.GetGameMode()->SendMsg(100, reinterpret_cast(""), -1, 1, 0); + if (argument1 == ID_CLOSE) { + g_modeMgr.GetGameMode()->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(""), -1, 1, 0); g_windowMgr.ReleaseCapture(); } return 0; @@ -161,8 +162,8 @@ int UIIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, int UIMultiIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 201) { - g_modeMgr.GetGameMode()->SendMsg(100, reinterpret_cast(""), -1, 0, 0); + if (argument1 == ID_CLOSE) { + g_modeMgr.GetGameMode()->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(""), -1, 0, 0); g_windowMgr.ReleaseCapture(); } return 0; diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index de5d0d226..ee910a0d9 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIEnums.h" #include "UI/Items/UIItemRepairWnd.h" @@ -225,11 +227,11 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std } case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { @@ -246,9 +248,9 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std UIListBox* list = this->m_list; if (list->LineCount() == 0) { - g_modeMgr.gameMode->SendMsg(174, -1, 0, 0, 0); - g_windowMgr.CloseWindow(107); - g_windowMgr.CloseWindow(107); + g_modeMgr.gameMode->SendMsg(MM_REPAIRITEM_SELECT_FROM_LIST, -1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); return 0; } @@ -256,27 +258,27 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std if (selected >= 0) { for (UIItemRepairEntry& entry : this->entries) { if (entry.index == this->indices[selected]) { - g_modeMgr.gameMode->SendMsg(174, reinterpret_cast(&entry), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REPAIRITEM_SELECT_FROM_LIST, reinterpret_cast(&entry), 0, 0, 0); break; } } - g_windowMgr.CloseWindow(107); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); return 0; } break; } case ID_CANCEL: - g_modeMgr.gameMode->SendMsg(174, -1, 0, 0, 0); - g_windowMgr.CloseWindow(107); + g_modeMgr.gameMode->SendMsg(MM_REPAIRITEM_SELECT_FROM_LIST, -1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ITEMREPAIRWND); return 0; } return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); UIItemRepairRecordHeader header; unsigned offset = 6; @@ -295,7 +297,7 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std UIItemRepairEntry entry; std::memcpy(&entry, bytes + offset, header.bytes); offset += header.bytes; - this->SendMsg(nullptr, 31, reinterpret_cast(&entry), 0, 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(&entry), 0, 0, 0); break; } @@ -318,7 +320,7 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std int UIMakeTargetResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: - g_windowMgr.CloseWindow(81); + g_windowMgr.CloseWindow(WID_MAKETARGETRESULTWND); return 0; case UM_SETCURITEM: diff --git a/Source/UI/Items/UIMakeTargetListWnd.cpp b/Source/UI/Items/UIMakeTargetListWnd.cpp index 09f666f04..35f8ba7a3 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.cpp +++ b/Source/UI/Items/UIMakeTargetListWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Items/UIMakeTargetListWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" @@ -65,11 +68,11 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { @@ -85,8 +88,8 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, UIListBox* list = this->m_list; if (list->LineCount() == 0) { - g_windowMgr.CloseWindow(79); - g_windowMgr.CloseWindow(79); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); return 0; } @@ -97,16 +100,16 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case JT_RUNE_KNIGHT_B: case JT_DRAGON_KNIGHT: { ITEM_INFO materials[3]; - g_modeMgr.GetGameMode()->SendMsg(130, this->itemIds[this->m_list->selected], reinterpret_cast(materials), 0, 0); - g_windowMgr.CloseWindow(79); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_MAKING_ITEM, this->itemIds[this->m_list->selected], reinterpret_cast(materials), 0, 0); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); return 0; } default: { - UIWindow* window = g_windowMgr.EnsureWindow(80); - window->SendMsg(this, 40, this->itemIds[this->m_list->selected], 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_MAKETARGETPROCESSWND); + window->SendMsg(this, UM_SETCURITEM, this->itemIds[this->m_list->selected], 0, 0, 0); window->Move(this->geometry.x, this->geometry.y); - g_windowMgr.CloseWindow(79); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); return 0; } } @@ -115,8 +118,8 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } case ID_CANCEL: { ITEM_INFO materials[3]; - g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast(materials), 0, 0); - g_windowMgr.CloseWindow(79); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_MAKING_ITEM, 0, reinterpret_cast(materials), 0, 0); + g_windowMgr.CloseWindow(WID_MAKETARGETLISTWND); return 0; } } @@ -124,7 +127,7 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); std::uint16_t marker; std::memcpy(&marker, bytes, sizeof(marker)); @@ -146,7 +149,7 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, int itemId = 0; std::memcpy(&itemId, bytes + offset, size); offset += size; - this->SendMsg(nullptr, 31, itemId, 0, 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, itemId, 0, 0, 0); } else { offset += size; } diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.cpp b/Source/UI/Items/UIMakeTargetProcessWnd.cpp index 5a7e26a41..00ad1986c 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.cpp +++ b/Source/UI/Items/UIMakeTargetProcessWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Items/UIMakeTargetProcessWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/ModeDragState.h" @@ -32,7 +34,7 @@ void UIMakeTargetProcessWnd::DragAndDrop(int x, int y, std::intptr_t value) { case ITEMID_IRON: case ITEMID_STEEL: case ITEMID_STAR_CRUMB: - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } @@ -55,14 +57,14 @@ void UIMakeTargetProcessWnd::DragAndDrop(int x, int y, std::intptr_t value) { this->materials[emptySlot].quantity = 1; g_session.RemoveItem1710(item.unknown_0000[1], 1); if (g_windowMgr.unknown_01D4) { - reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } this->Invalidate(); } } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x009A0690 @@ -163,7 +165,7 @@ void UIMakeTargetProcessWnd::Paint() { void UIMakeTargetProcessWnd::OnLBtnDown(int x, int y) { ITEM_INFO item = this->GetItemAt(x, y); if (item.unknown_0000[1] != 0) { - g_modeMgr.gameMode->SendMsg(134, reinterpret_cast(item.itemId.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_BEGIN_DRAG_FROM_METALPROCESSWND, reinterpret_cast(item.itemId.c_str()), 0, 0, 0); } else { this->UIFrameWnd::OnLBtnDown(x, y); } @@ -199,12 +201,12 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t switch (response) { case ID_OK: - g_modeMgr.GetGameMode()->SendMsg(130, this->makeType, reinterpret_cast(this->materials), 0, 0); - g_windowMgr.CloseWindow(80); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_MAKING_ITEM, this->makeType, reinterpret_cast(this->materials), 0, 0); + g_windowMgr.CloseWindow(WID_MAKETARGETPROCESSWND); return 0; case ID_CANCEL: { - g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast(this->materials), 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQ_MAKING_ITEM, 0, reinterpret_cast(this->materials), 0, 0); bool restored = false; for (int index = 0; index < 3; ++index) { if (this->materials[index].unknown_0000[1] > 0) { @@ -218,10 +220,10 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } if (g_windowMgr.unknown_01D4) { - reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, 23, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_01D4)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - g_windowMgr.CloseWindow(80); + g_windowMgr.CloseWindow(WID_MAKETARGETPROCESSWND); return 0; } } @@ -229,7 +231,7 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { #pragma pack(push, 1) struct ReplayTag { /* 0000 */ std::int16_t id; @@ -263,7 +265,7 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t if (tag.id == 22002) { std::memcpy(&this->makeType, bytes + offset, tag.bytes); offset += tag.bytes; - this->SendMsg(nullptr, 40, this->makeType, 0, 0, 0); + this->SendMsg(nullptr, UM_SETCURITEM, this->makeType, 0, 0, 0); } else { offset += tag.bytes; } diff --git a/Source/UI/Items/UISwapEquipmentWnd.cpp b/Source/UI/Items/UISwapEquipmentWnd.cpp index 9e37bde48..c9e066f86 100644 --- a/Source/UI/Items/UISwapEquipmentWnd.cpp +++ b/Source/UI/Items/UISwapEquipmentWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Items/UISwapEquipmentWnd.h" #include "UI/Window/UIEnums.h" @@ -51,7 +53,7 @@ UISwapEquipmentWnd::UISwapEquipmentWnd() // FUNCTION: fn_10390 void UISwapEquipmentWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -79,19 +81,19 @@ void UISwapEquipmentWnd::DragAndDrop(int x, int y, std::intptr_t value) { case 16: case 17: case 19: - mode->SendMsg(302, drag->id, item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_SWAP_EQUIP, drag->id, item.unknown_0000[2], 0, 0); break; default: if (equipped == 1) { - mode->SendMsg(305, reinterpret_cast(&item), 0, 0, 0); + mode->SendMsg(MM_SWAP_EQUIPMENT_BY_INDEX, reinterpret_cast(&item), 0, 0, 0); } else if (item.unknown_0000[2] != 0 && item.identified != 0 && item.unknown_0000[3] == 0) { - mode->SendMsg(302, drag->id, item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_SWAP_EQUIP, drag->id, item.unknown_0000[2], 0, 0); } break; } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x0082FD90 @@ -182,7 +184,7 @@ void UISwapEquipmentWnd::DrawEquipmentSlots() { void UISwapEquipmentWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->ItemAtPoint(x, y); if (item.unknown_0000[1] > 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -195,27 +197,27 @@ int UISwapEquipmentWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case ID_CANCEL: g_session.m_swapEquipmentMode = 0; if (g_windowMgr.unknown_01E0) { - g_windowMgr.unknown_01E0->SendMsg(nullptr, 6, 0x1FC, 0, 0, 0); + g_windowMgr.unknown_01E0->SendMsg(nullptr, UM_COMMAND, 0x1FC, 0, 0, 0); } break; case ID_CLOSE: g_windowMgr.CloseWindow(0x128); return 1; case 0x1FC: - if (g_windowMgr.LookupWindow(10011)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB9)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB9)), 0xFF, 0, 0, 0); return 1; } if (static_cast(g_modeMgr.GetGameMode())->unknown_0250) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB7)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB7)), 0xFF, 0, 0, 0); } else if (g_windowMgr.unknown_0304 || g_windowMgr.unknown_0308 || g_windowMgr.unknown_02FC) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBBA)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBBA)), 0xFF, 0, 0, 0); } else if (static_cast(g_modeMgr.GetGameMode())->scene->player->unknown_0264[3]) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBB8)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBB8)), 0xFF, 0, 0, 0); } else if (g_windowMgr.unknown_01F0 || g_windowMgr.unknown_01F8) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBBB)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBBB)), 0xFF, 0, 0, 0); } else { - g_modeMgr.GetGameMode()->SendMsg(0x130, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_SWAP_EQUIPMENT, 0, 0, 0, 0); } return 1; } @@ -377,7 +379,7 @@ void UISwapEquipmentWnd::Paint() { // FUNCTION: fn_10397 void UISwapEquipmentWnd::OnLBtnDblClk(int x, int y) { if (y < 17) { - this->SendMsg(this, 6, 0xCA, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_MINI, 0, 0, 0); } ITEM_INFO item = this->ItemAtPoint(x, y); @@ -385,9 +387,9 @@ void UISwapEquipmentWnd::OnLBtnDblClk(int x, int y) { const EquipSlots slots = g_session.GetEquipSlots(item.unknown_0000[3]); CMode* mode = g_modeMgr.gameMode; if (GetAsyncKeyState(VK_CONTROL)) { - mode->SendMsg(0x131, reinterpret_cast(&item), 0, 0, 0); + mode->SendMsg(MM_SWAP_EQUIPMENT_BY_INDEX, reinterpret_cast(&item), 0, 0, 0); } else { - mode->SendMsg(0x12F, slots.values[2], this->unknown_00BC == 2, 0, 0); + mode->SendMsg(MM_TAKE_OFF_SWAP_EQUIP, slots.values[2], this->unknown_00BC == 2, 0, 0); } } } diff --git a/Source/UI/Items/UIWeaponRefineWnd.cpp b/Source/UI/Items/UIWeaponRefineWnd.cpp index 8e1b27b4d..a54f5c2ac 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.cpp +++ b/Source/UI/Items/UIWeaponRefineWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Items/UIWeaponRefineWnd.h" +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" @@ -83,11 +85,11 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_COMMAND: { @@ -103,30 +105,30 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s UIListBox* list = this->m_list; if (list->LineCount() == 0) { - g_modeMgr.gameMode->SendMsg(182, -1, 0, 0, 0); - g_windowMgr.CloseWindow(111); - g_windowMgr.CloseWindow(111); + g_modeMgr.gameMode->SendMsg(MM_REFINEITEM_SELECT_FROM_LIST, -1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_WEAPONREFINEWND); + g_windowMgr.CloseWindow(WID_WEAPONREFINEWND); return 0; } const int selected = list->selected; if (selected >= 0) { - g_modeMgr.gameMode->SendMsg(182, this->indices[selected], 0, 0, 0); - g_windowMgr.CloseWindow(111); + g_modeMgr.gameMode->SendMsg(MM_REFINEITEM_SELECT_FROM_LIST, this->indices[selected], 0, 0, 0); + g_windowMgr.CloseWindow(WID_WEAPONREFINEWND); return 0; } break; } case ID_CANCEL: - g_modeMgr.gameMode->SendMsg(182, -1, 0, 0, 0); - g_windowMgr.CloseWindow(111); + g_modeMgr.gameMode->SendMsg(MM_REFINEITEM_SELECT_FROM_LIST, -1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_WEAPONREFINEWND); return 0; } return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const auto* bytes = reinterpret_cast(a); UIWeaponRefineRecordHeader header; unsigned offset = 6; @@ -145,7 +147,7 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s int values[2] = {}; std::memcpy(values, bytes + offset, header.bytes); offset += header.bytes; - this->SendMsg(nullptr, 31, values[0], values[1], 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, values[0], values[1], 0, 0); break; } diff --git a/Source/UI/Lists/UIComboBox.cpp b/Source/UI/Lists/UIComboBox.cpp index cd7a5df15..6f9d25473 100644 --- a/Source/UI/Lists/UIComboBox.cpp +++ b/Source/UI/Lists/UIComboBox.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Lists/UIComboBox.h" #include "UI/Lists/UIListBoxID.h" #include "UI/Lists/UIScrollBar.h" @@ -14,11 +15,11 @@ int UIComboBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, switch (message) { case UM_DEFPUSH: if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { - target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } return 0; @@ -99,11 +100,11 @@ int UIComboBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } const int lineId = this->lines[this->selected].id; - target->SendMsg(nullptr, 39, lineId, extra, 0, 0); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, lineId, extra, 0, 0); } if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } return 0; diff --git a/Source/UI/Lists/UIComboBoxDefWnd.cpp b/Source/UI/Lists/UIComboBoxDefWnd.cpp index b1abd079f..584c53301 100644 --- a/Source/UI/Lists/UIComboBoxDefWnd.cpp +++ b/Source/UI/Lists/UIComboBoxDefWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Replay.h" #include "UI/Window/WindowPolicy.h" @@ -124,7 +125,7 @@ void UIComboBoxDefWnd::Paint() { // OFFSET: 0x00890B50 // FUNCTION: fn_11434 void UIComboBoxDefWnd::OnLBtnUp(int, int) { - this->SendMsg(nullptr, 6, 273, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OPEN_MEMBER_POS_COMBO, 0, 0, 0); } // OFFSET: 0x0089F5C0 @@ -142,13 +143,13 @@ std::string UIComboBoxDefWnd::GetSelectedText() { // OFFSET: 0x008A25F0 // FUNCTION: fn_11641 void UIComboBoxDefWnd::AddOption(std::string text, std::uint32_t color) { - this->list->SendMsg(nullptr, 31, reinterpret_cast(text.c_str()), color, 0, 0); + this->list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text.c_str()), color, 0, 0); } // OFFSET: 0x008A2730 // FUNCTION: fn_11642 void UIComboBoxDefWnd::Select(int index) { - this->list->SendMsg(nullptr, 40, index, 0, 0, 0); + this->list->SendMsg(nullptr, UM_SETCURITEM, index, 0, 0, 0); this->label->SetText(this->list->lines[index].text.c_str(), 0); } @@ -168,7 +169,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st switch (message) { case UM_COMMAND: - if (value == 273) { + if (value == ID_OPEN_MEMBER_POS_COMBO) { this->expanded = this->expanded == 0; this->Resize( this->geometry.width, this->expanded ? (this->geometry.height + this->list->geometry.height) : (this->geometry.height - this->list->geometry.height) @@ -181,7 +182,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } if (this->parent) { - this->parent->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } @@ -193,8 +194,8 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } this->label->SetText(this->list->lines[value].text.c_str(), 0); - this->SendMsg(nullptr, 6, 273, 0, 0, 0); - this->parent->SendMsg(this, 39, value, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OPEN_MEMBER_POS_COMBO, 0, 0, 0); + this->parent->SendMsg(this, UM_COMBOBOX_SELECTED, value, 0, 0, 0); return 0; case UM_CHANGEMSG: if (value >= 0) { @@ -215,7 +216,7 @@ int UIItemStoreComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t switch (message) { case UM_COMMAND: - if (value == 273) { + if (value == ID_OPEN_MEMBER_POS_COMBO) { this->expanded = this->expanded == 0; if (this->expanded) { @@ -244,8 +245,8 @@ int UIItemStoreComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } this->label->SetText(this->list->lines[value].text.c_str(), 0); - this->SendMsg(nullptr, 6, 273, 0, 0, 0); - this->parent->SendMsg(this, 39, value, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OPEN_MEMBER_POS_COMBO, 0, 0, 0); + this->parent->SendMsg(this, UM_COMBOBOX_SELECTED, value, 0, 0, 0); return 0; default: return this->UIWindow::SendMsg(sender, message, a, b, c, d); @@ -342,8 +343,8 @@ void UINewComboBoxCtrl::OnCreate(int, int) { // OFFSET: 0x008994B0 // FUNCTION: fn_11555 int UINewComboBoxCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { - if (message != 39) { + if (message != UM_COMMAND) { + if (message != UM_COMBOBOX_SELECTED) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -358,7 +359,7 @@ int UINewComboBoxCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argu } this->selected = index; - this->parent->SendMsg(this, 39, index, 0, 0, 0); + this->parent->SendMsg(this, UM_COMBOBOX_SELECTED, index, 0, 0, 0); this->Invalidate(); this->parent->Invalidate(); if (this->Root()) { @@ -367,19 +368,19 @@ int UINewComboBoxCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t argu return 0; } - if (argument1 == 273) { + if (argument1 == ID_OPEN_MEMBER_POS_COMBO) { this->dropped = !this->dropped; if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } if (this->dropped) { - UIWindow* window = g_windowMgr.EnsureWindow(26); + UIWindow* window = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); const int count = static_cast(this->items.size()); for (int index = 0; index < count; ++index) { - window->SendMsg(nullptr, 31, reinterpret_cast(this->items[index].c_str()), 0, 0, 0); + window->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->items[index].c_str()), 0, 0, 0); } - window->SendMsg(nullptr, 40, this->selected, 0, 0, 0); + window->SendMsg(nullptr, UM_SETCURITEM, this->selected, 0, 0, 0); window->Resize(this->geometry.width, count * 16); static_cast(window)->SetOwner(this); int x = 0; diff --git a/Source/UI/Lists/UIComboBoxEx.cpp b/Source/UI/Lists/UIComboBoxEx.cpp index 24d440da9..273d11cdb 100644 --- a/Source/UI/Lists/UIComboBoxEx.cpp +++ b/Source/UI/Lists/UIComboBoxEx.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" @@ -91,12 +92,12 @@ void UIComboBoxEx::OnLBtnUp(int x, int y) { auto& windows = g_windowMgr; if (UIWindow* target = windows.LookupWindow(this->targetId)) { - target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } else if (this->parent) { - this->parent->SendMsg(nullptr, 39, this->selected, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } - windows.CloseWindow(26); + windows.CloseWindow(WID_COMBOBOXWND); } // OFFSET: 0x00895C30 @@ -140,11 +141,11 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i switch (message) { case UM_DEFPUSH: if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { - target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); + target->SendMsg(nullptr, UM_COMBOBOX_SELECTED, this->selected, 0, 0, 0); } if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } return 0; diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index ca7d5f4a7..0043a6b6c 100644 --- a/Source/UI/Lists/UIListBox.cpp +++ b/Source/UI/Lists/UIListBox.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Render/DeviceContext/DeviceContext.h" #include "Render/Text/TextContext.h" @@ -289,7 +290,7 @@ void UIListBox::OnLBtnDown(int x, int y) { // FUNCTION: fn_11403 void UIListBox::OnLBtnDblClk(int, int) { if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->selected, 0, 0); } } @@ -303,9 +304,9 @@ void UIListBox::OnRBtnDown(int, int) { void UIListBox::OnWheel(int value) { if (this->verticalOverflow != 0) { if (value < 0) { - this->SendMsg(this->verticalBar, 7, 3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 3, 0, 0, 0); } else { - this->SendMsg(this->verticalBar, 7, -3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -3, 0, 0, 0); } } } @@ -355,9 +356,9 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s switch (message) { case UM_DOWNPUSH: case UM_SETCURITEM: { - this->selected = message == 19 ? (this->selected + 1) : value; + this->selected = message == UM_DOWNPUSH ? (this->selected + 1) : value; - if (message == 40 && this->selected < 0) { + if (message == UM_SETCURITEM && this->selected < 0) { this->selected = 0; } @@ -369,17 +370,17 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s int top = this->topLine; - if (message == 40 && this->selected < top) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + if (message == UM_SETCURITEM && this->selected < top) { + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); top = this->topLine; } - const int edge = message == 19 ? (top - 1) : top; + const int edge = message == UM_DOWNPUSH ? (top - 1) : top; const int rows = this->geometry.height / this->lineHeight; - const int bottom = (edge + (message == 19 ? rows : (rows - 1))); + const int bottom = (edge + (message == UM_DOWNPUSH ? rows : (rows - 1))); if (this->selected > bottom) { - this->SendMsg(nullptr, 7, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0); } break; @@ -393,7 +394,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s } if (this->selected < this->topLine) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); } break; @@ -403,7 +404,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; const int visible = this->geometry.height / this->lineHeight; - const int delta = message == 9 ? (1 - visible) : message == 10 ? (visible - 1) : value; + const int delta = message == UM_SCROLLVERTPAGEUP ? (1 - visible) : message == UM_SCROLLVERTPAGEDOWN ? (visible - 1) : value; this->topLine = (previous + delta); if (this->topLine < 0) { @@ -431,7 +432,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s case UM_SCROLLHORZPAGEUP: case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; - const int delta = message == 11 ? -15 : message == 12 ? 15 : value; + const int delta = message == UM_SCROLLHORZPAGEUP ? -15 : message == UM_SCROLLHORZPAGEDOWN ? 15 : value; this->horizontalOffset = (previous + delta); if (this->horizontalOffset < 0) { @@ -457,8 +458,8 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s case UM_TEXT_LBTN_UP: if (argument3 > 0) { - if (UIWindow* window = g_windowMgr.LookupWindow(12)) { - window->SendMsg(nullptr, 24, argument3, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, argument3, 0, 0, 0); } } diff --git a/Source/UI/Lists/UIListBoxEx.cpp b/Source/UI/Lists/UIListBoxEx.cpp index 656558b03..5c905a3ac 100644 --- a/Source/UI/Lists/UIListBoxEx.cpp +++ b/Source/UI/Lists/UIListBoxEx.cpp @@ -1,5 +1,6 @@ #include "Render/DeviceContext/DeviceContext.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/SkinPalette.h" @@ -132,7 +133,7 @@ void UIListBoxEx::OnLBtnDown(int x, int y) { // FUNCTION: fn_11404 void UIListBoxEx::OnLBtnDblClk(int, int) { if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->selected, 0, 0); } } @@ -141,11 +142,11 @@ void UIListBoxEx::OnLBtnDblClk(int, int) { void UIListBoxEx::OnWheel(int value) { if (this->verticalOverflow != 0) { if (value < 0) { - this->SendMsg(this->verticalBar, 7, 3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 3, 0, 0, 0); return; } - this->SendMsg(this->verticalBar, 7, -3, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -3, 0, 0, 0); } } @@ -199,11 +200,11 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } if (this->selected < this->topLine) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); } if (this->selected > this->topLine + this->geometry.height / this->lineHeight - 1) { - this->SendMsg(nullptr, 7, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0); } break; @@ -214,7 +215,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } if (this->selected < this->topLine) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); } break; @@ -227,7 +228,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } if (this->selected > this->topLine + this->geometry.height / this->lineHeight - 1) { - this->SendMsg(nullptr, 7, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0); } break; @@ -237,7 +238,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; const int visible = this->geometry.height / this->lineHeight; - const int delta = message == 9 ? (1 - visible) : message == 10 ? (visible - 1) : value; + const int delta = message == UM_SCROLLVERTPAGEUP ? (1 - visible) : message == UM_SCROLLVERTPAGEDOWN ? (visible - 1) : value; this->topLine = previous + delta; if (this->topLine < 0) { @@ -268,7 +269,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in case UM_SCROLLHORZPAGEUP: case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; - const int delta = message == 11 ? -15 : message == 12 ? 15 : value; + const int delta = message == UM_SCROLLHORZPAGEUP ? -15 : message == UM_SCROLLHORZPAGEDOWN ? 15 : value; this->horizontalOffset = previous + delta; if (this->horizontalOffset < 0) { diff --git a/Source/UI/Lists/UIListBoxID.cpp b/Source/UI/Lists/UIListBoxID.cpp index 017a5c14b..650b64167 100644 --- a/Source/UI/Lists/UIListBoxID.cpp +++ b/Source/UI/Lists/UIListBoxID.cpp @@ -71,10 +71,10 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->selected = static_cast(this->lines.size() - 1); } if (this->selected < this->topLine) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); } if (this->selected > this->topLine + this->geometry.height / this->lineHeight - 1) { - this->SendMsg(nullptr, 7, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0); } this->Invalidate(); this->Refresh(); @@ -85,7 +85,7 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->selected = 0; } if (this->selected < this->topLine) { - this->SendMsg(nullptr, 7, -1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, -1, 0, 0, 0); } this->Invalidate(); this->Refresh(); @@ -96,7 +96,7 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->selected = static_cast(this->lines.size() - 1); } if (this->selected > this->geometry.height / this->lineHeight + this->topLine - 1) { - this->SendMsg(nullptr, 7, 1, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 1, 0, 0, 0); } this->Invalidate(); this->Refresh(); @@ -105,9 +105,9 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->topLine = previous - this->geometry.height / this->lineHeight + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->topLine = previous - 1 + this->geometry.height / this->lineHeight; } else { this->topLine = previous + argument1; @@ -135,9 +135,9 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; int delta = argument1; - if (message == 11) { + if (message == UM_SCROLLHORZPAGEUP) { delta = -15; - } else if (message == 12) { + } else if (message == UM_SCROLLHORZPAGEDOWN) { delta = 15; } this->horizontalOffset = previous + delta; diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index db6a52fa9..fbd5fd141 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Network/TextEncoding.h" #include "UI/Window/UIEnums.h" #include "Render/Text/FontCache.h" @@ -250,40 +252,40 @@ void UIScrollBar::OnLBtnDown(int x, int y) { case 0: switch (part) { case SB_UPBTN: - this->parent->SendMsg(this, 8, -this->horizontalStep, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLHORZ, -this->horizontalStep, 0, 0, 0); break; case SB_UPPAGE: - this->parent->SendMsg(this, 11, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLHORZPAGEUP, 0, 0, 0, 0); break; case SB_THUMB: g_windowMgr.SetCapture(this); this->state = 6; break; case SB_DNPAGE: - this->parent->SendMsg(this, 12, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLHORZPAGEDOWN, 0, 0, 0, 0); break; case SB_DNBTN: - this->parent->SendMsg(this, 8, this->horizontalStep, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLHORZ, this->horizontalStep, 0, 0, 0); break; } break; case 1: switch (part) { case SB_UPBTN: - this->parent->SendMsg(this, 7, -this->verticalStep, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLVERT, -this->verticalStep, 0, 0, 0); break; case SB_UPPAGE: - this->parent->SendMsg(this, 9, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); break; case SB_THUMB: g_windowMgr.SetCapture(this); this->state = 6; break; case SB_DNPAGE: - this->parent->SendMsg(this, 10, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); break; case SB_DNBTN: - this->parent->SendMsg(this, 7, this->verticalStep, 0, 0, 0); + this->parent->SendMsg(this, UM_SCROLLVERT, this->verticalStep, 0, 0, 0); break; } break; @@ -347,7 +349,7 @@ void UIScrollBar::OnMouseMove(int x, int y) { const int delta = (x - this->pressX) * (this->maximum + 1) / this->Travel() - this->dragAmount; if (delta != 0) { - this->dragAmount += this->parent->SendMsg(this, 8, delta, 0, 0, 0); + this->dragAmount += this->parent->SendMsg(this, UM_SCROLLHORZ, delta, 0, 0, 0); } break; } @@ -355,7 +357,7 @@ void UIScrollBar::OnMouseMove(int x, int y) { const int delta = (y - this->pressY) * (this->maximum + 1) / this->Travel() - this->dragAmount; if (delta != 0) { - this->dragAmount += this->parent->SendMsg(this, 7, delta, 0, 0, 0); + this->dragAmount += this->parent->SendMsg(this, UM_SCROLLVERT, delta, 0, 0, 0); } break; } @@ -545,7 +547,7 @@ void UITabControl::SelectTab(int index) { this->edit->Move(-100, -100); if (this->parent) { - this->parent->SendMsg(this, 22, this->unknown_007C, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->unknown_007C, 0, 0, 0); this->parent->Invalidate(); } @@ -850,7 +852,7 @@ void UIChatHisBox::OnLBtnDblClk(int, int) { const unsigned int index = static_cast(this->selected); if (index != static_cast(-1) && index < this->history.size() && this->history[index].size() > 0 && this->history[index].c_str() != nullptr) { - this->parent->SendMsg(this, 6, 347, reinterpret_cast(this->HistoryText(index)), 0, 0); + this->parent->SendMsg(this, UM_COMMAND, ID_NAME, reinterpret_cast(this->HistoryText(index)), 0, 0); } } @@ -957,7 +959,7 @@ void UIBasicItemCtrl::DragAndDrop(int, int, std::intptr_t argument3) { } } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x0087E080 @@ -978,13 +980,13 @@ void UIBasicSkillCtrl::DragAndDrop(int, int, std::intptr_t argument3) { } } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x0087E190 // FUNCTION: fn_11263 void UIBitmapButton2::DragAndDrop(int argument1, int argument2, std::intptr_t argument3) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(argument1, argument2, argument3); } else if (this->parent) { this->parent->DragAndDrop(argument1, argument2, argument3); @@ -1117,13 +1119,13 @@ void UITabControl::HideEdit() { // OFFSET: 0x00899A30 // FUNCTION: fn_11559 int UITabControl::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 0) { + if (message != UM_DEFPUSH) { return 0; } if (sender != this->edit || this->edit->geometry.x == -100) { if (this->parent) { - this->parent->SendMsg(this, 0, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_DEFPUSH, 0, 0, 0, 0); } return 0; } @@ -1472,7 +1474,7 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int switch (message) { case UM_DEFPUSH: if (sender == this->edit && this->editNode) { - this->SendMsg(nullptr, 110, 0, 1, 0, 0); + this->SendMsg(nullptr, UM_CHANGE_TVITEM_TEXT, 0, 1, 0, 0); } break; case UM_SCROLLVERT: @@ -1481,9 +1483,9 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->HideNodes(this->root->children); const int previous = this->unknown_00A8; const int visible = this->geometry.height / this->itemHeight; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_00A8 = previous - visible + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->unknown_00A8 = previous - 1 + visible; } else { this->unknown_00A8 = previous + static_cast(a); @@ -1508,18 +1510,18 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } case UM_UPPUSH: if (this->verticalOverflow) { - this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -1, 0, 0, 0); } break; case UM_DOWNPUSH: if (this->verticalOverflow) { - this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 1, 0, 0, 0); } break; case UM_TEXT_LBTN_DblClk: this->unknown_0088 = reinterpret_cast(a); if (a) { - this->parent->SendMsg(this, 97, a, sender->geometry.x + b, sender->geometry.height / 2 + sender->geometry.y, 0); + this->parent->SendMsg(this, UM_TEXT_LBTN_DblClk, a, sender->geometry.x + b, sender->geometry.height / 2 + sender->geometry.y, 0); } break; case UM_TEXT_LBTN_UP: @@ -1532,15 +1534,15 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int break; } - if (message == 99) { - this->parent->SendMsg(this, 99, a, sender->geometry.x + b, sender->geometry.height / 2 + sender->geometry.y, 0); + if (message == UM_TEXT_RBTN_UP) { + this->parent->SendMsg(this, UM_TEXT_RBTN_UP, a, sender->geometry.x + b, sender->geometry.height / 2 + sender->geometry.y, 0); break; } if (this->unknown_0088->children.size() != 0) { this->HideNodes(this->root->children); const int x = sender->geometry.x; - const int y = message == 98 ? sender->geometry.y - 6 : sender->geometry.y; + const int y = message == UM_TEXT_LBTN_UP ? sender->geometry.y - 6 : sender->geometry.y; UIWindow* button; if (this->unknown_0088->expanded == 0) { this->unknown_0088->expanded = 1; @@ -1553,7 +1555,7 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->Invalidate(); } - if (message == 98) { + if (message == UM_TEXT_LBTN_UP) { this->parent->SendMsg( this, 98, reinterpret_cast(this->unknown_0088), sender->geometry.x + b, sender->geometry.height / 2 + sender->geometry.y, 0 ); @@ -1628,7 +1630,7 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int if (g_windowMgr.GetHoverWindow() == this->edit) { const std::size_t length = std::strlen(this->edit->Text()); if (this->parent) { - this->parent->SendMsg(this, 110, reinterpret_cast(this->edit->Text()), length + 1, 0, 0); + this->parent->SendMsg(this, UM_CHANGE_TVITEM_TEXT, reinterpret_cast(this->edit->Text()), length + 1, 0, 0); } } } else { diff --git a/Source/UI/Lists/UITagListBox.cpp b/Source/UI/Lists/UITagListBox.cpp index cad622df4..dfedcd8ab 100644 --- a/Source/UI/Lists/UITagListBox.cpp +++ b/Source/UI/Lists/UITagListBox.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Lists/UITagListBox.h" @@ -323,13 +324,13 @@ int UITagListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 switch (message) { case UM_UPPUSH: if (this->verticalOverflow) { - this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -1, 0, 0, 0); return 0; } break; case UM_DOWNPUSH: if (this->verticalOverflow) { - this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 1, 0, 0, 0); return 0; } break; @@ -572,8 +573,8 @@ void UITagListBox::OnTagClick(std::intptr_t type, UIWindow* sender) { } case LINE_SEGMENT_ITEM: case LINE_SEGMENT_ITEM_LINK: - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&button->item), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&button->item), 0, 0, 0); } break; } @@ -669,7 +670,7 @@ void UITagListBox::AppendTaggedLines(std::string text, std::vector& for (std::vector::iterator tag = tags.begin(); tag != tags.end(); ++tag) { this->AddTagButton(*tag, static_cast(this->lines.size()) - firstLine); } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); } // OFFSET: 0x009B7A20 diff --git a/Source/UI/Menu/UIMenuIconWnd.cpp b/Source/UI/Menu/UIMenuIconWnd.cpp index d598efa85..5c90c398e 100644 --- a/Source/UI/Menu/UIMenuIconWnd.cpp +++ b/Source/UI/Menu/UIMenuIconWnd.cpp @@ -1,4 +1,6 @@ #include "Render/Renderer.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Menu/UIMenuIconWnd.h" @@ -187,7 +189,7 @@ void UIMenuIconWnd::OnCreate(int width, int height) { this->unknown_00D4->SetId(201); this->unknown_00D4->Enable(0); this->AddChild(this->unknown_00D4); - this->SendMsg(this, 6, g_session.m_showMenuIcon == true ? 510 : 201, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, g_session.m_showMenuIcon == true ? 510 : 201, 0, 0, 0); if (this->unknown_00B4.size() > 20) { this->Resize(220, 238); } @@ -361,14 +363,14 @@ 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 == 6) { + if (message == UM_COMMAND) { if (!Replay::Instance().AllowsEvent(argument1)) { switch (argument1) { case ID_CLOSE: g_session.m_showMenuIcon = false; this->Invalidate(); break; - case 286: { + case ID_NOTICE: { const int id = argument2; auto found = std::find(this->unknown_00C4.begin(), this->unknown_00C4.end(), id); if (argument3 > 0) { @@ -399,7 +401,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument case 373: this->ToggleWindow(static_cast(g_guildInfo.m_guildId) < 1 ? 212 : 59); break; - case 361: + case ID_QUEST: this->ToggleWindow(10008); break; case ID_MAP: @@ -407,12 +409,12 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument break; case 430: if (g_windowMgr.window_4F174) { - g_windowMgr.window_4F174->SendMsg(nullptr, 6, 201, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } else { - g_windowMgr.EnsureWindow(203); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } break; - case 193: + case ID_OPTION: this->ToggleWindow(155); break; case 399: @@ -437,12 +439,12 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->Invalidate(); break; case 476: - if (g_windowMgr.LookupWindow(295)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2992)), 255, 0, 0, 0); - } else if (g_windowMgr.LookupWindow(343)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3715)), 255, 0, 0, 0); - } else if (g_windowMgr.LookupWindow(10006)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3843)), 255, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_REFININGWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2992)), 255, 0, 0, 0); + } else if (g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3715)), 255, 0, 0, 0); + } else if (g_windowMgr.LookupWindow(WID_ENCHANTUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3843)), 255, 0, 0, 0); } else { this->ToggleWindow(263); } @@ -454,11 +456,11 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->ToggleWindow(315); break; case 512: - g_modeMgr.GetGameMode()->SendMsg(323, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REQUEST_CASH_SHOP, 0, 0, 0, 0); break; case 540: - if (g_windowMgr.LookupWindow(328)) { - g_windowMgr.CloseWindow(328); + if (g_windowMgr.LookupWindow(WID_CHECKATTENDANCEWND)) { + g_windowMgr.CloseWindow(WID_CHECKATTENDANCEWND); } else { MenuIconOpenUiPacket packet; packet.id = 0xA68; @@ -482,11 +484,11 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument break; } } - } else if (message == 60) { - this->SendMsg(nullptr, 6, g_session.m_showMenuIcon == true ? 201 : 510, 0, 0, 0); + } else if (message == UM_REFRESH) { + this->SendMsg(nullptr, UM_COMMAND, g_session.m_showMenuIcon == true ? 201 : 510, 0, 0, 0); } - if (message == 6 && argument1 == 376 && !Replay::Instance().AllowsEvent(argument1) && g_entryQueueMgr) { + if (message == UM_COMMAND && argument1 == 376 && !Replay::Instance().AllowsEvent(argument1) && g_entryQueueMgr) { if (reinterpret_cast(g_entryQueueMgr)[0x3C] == 1) { g_entryQueueMgr->SendRankingRequest(); } diff --git a/Source/UI/MiniPartyManager.cpp b/Source/UI/MiniPartyManager.cpp index d041929f1..1f08df249 100644 --- a/Source/UI/MiniPartyManager.cpp +++ b/Source/UI/MiniPartyManager.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/Messenger/ClientMessenger.h" #include "Contents/Messenger/MessengerMember.h" @@ -45,7 +47,7 @@ void UIWindowMgr::ArrangeMiniPartyWindows() { void UIWindowMgr::RearrangeMiniPartyWindows() { const int height = this->unknown_0480; int top = static_cast(static_cast(height) * 0.3f); - if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { top = window->geometry.height; } @@ -137,7 +139,7 @@ void UIWindowMgr::RebuildMiniPartyWindows() { window->SetSize(174, 52); window->m_cell = record.unknown_0008; this->AddMiniPartyWindow(window); - window->SendMsg(nullptr, 23, reinterpret_cast(&member), 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(&member), 0, 0, 0); g_session.AddRecord0734(record.id, record.unknown_0008); UIWindow* drag = this->unknown_0210; @@ -145,7 +147,7 @@ void UIWindowMgr::RebuildMiniPartyWindows() { *reinterpret_cast(reinterpret_cast(drag) + 0xCC) == record.unknown_0008) { const int x = drag->geometry.x; const int y = drag->geometry.y; - window->SendMsg(nullptr, 49, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); this->unknown_0210->Move(x, y); } } diff --git a/Source/UI/MiniPartyUsableArea.cpp b/Source/UI/MiniPartyUsableArea.cpp index 918ea5324..b6672be67 100644 --- a/Source/UI/MiniPartyUsableArea.cpp +++ b/Source/UI/MiniPartyUsableArea.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/MiniPartyGrid.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" @@ -7,7 +8,7 @@ RECT UIWindowMgr::GetMiniPartyUsableArea() { const int height = this->unknown_0480; int top = static_cast(height * 0.3f); - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { top = window->geometry.height; } diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp index fca2b2866..9ce164ebf 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp @@ -1,5 +1,7 @@ #include "Contents/MessageTable.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Language.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/UserData/NormalItemSlots.h" @@ -343,7 +345,7 @@ __forceinline void UIAdvenPartyBoardWnd::RefreshRows() { this->previous->Move(this->geometry.width / 2 - this->previous->geometry.width - halfWidth - 3, 319); this->next->Move(halfWidth + this->geometry.width / 2 + 3, 319); this->Registration(g_adventurerAgencyMgr->registered); - this->SendMsg(nullptr, 165, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_UPDATE_PARTY_PAGINATION, 0, 0, 0, 0); this->Invalidate(); this->InvalidateChildren(); } @@ -477,7 +479,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_REFRESH: this->RefreshRows(); return 0; - case 165: + case UM_UPDATE_PARTY_PAGINATION: this->UpdatePagination(); return 0; case UM_COMMAND: @@ -489,7 +491,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->page = (this->page - 1); if (this->searching == 1) { - this->SendMsg(nullptr, 6, 365, this->page, 246, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_PARTY_SEARCH, this->page, 246, 0); } else { this->LoadPage(this->page); } @@ -503,32 +505,32 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->next->Invalidate(); if (this->searching == 1) { - this->SendMsg(nullptr, 6, 365, this->page, 218, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_PARTY_SEARCH, this->page, 218, 0); } else { this->LoadPage(this->page); } break; - case 365: + case ID_PARTY_SEARCH: this->Search(static_cast(c)); break; case ID_CLOSE: - g_windowMgr.CloseWindow(324); + g_windowMgr.CloseWindow(WID_ADVENPARTYBOARDWND); break; - case 379: { + case ID_SELECT_PARTY_LISTING: { const auto& info = this->rows[static_cast(b)]->info; if (info.accountId == g_session.m_aid) { - g_windowMgr.CloseWindow(345); - auto* window = static_cast(g_windowMgr.EnsureWindow(323)); + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); + auto* window = static_cast(g_windowMgr.EnsureWindow(WID_REGISTERPARTYWND)); if (window) { window->SetInfo(info); g_windowMgr.Promote(window); } } else { - g_windowMgr.CloseWindow(323); - auto* window = static_cast(g_windowMgr.EnsureWindow(345)); + g_windowMgr.CloseWindow(WID_REGISTERPARTYWND); + auto* window = static_cast(g_windowMgr.EnsureWindow(WID_APPLYFORPARTYWND)); if (window) { window->SetInfo(info); @@ -538,9 +540,9 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a break; } - case 564: { - g_windowMgr.CloseWindow(345); - auto* window = static_cast(g_windowMgr.EnsureWindow(323)); + case ID_EDIT_OWN_PARTY_LISTING: { + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); + auto* window = static_cast(g_windowMgr.EnsureWindow(WID_REGISTERPARTYWND)); if (window) { window->SetInfo(this->ownParty->info); @@ -549,9 +551,9 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a break; } - case 565: { - g_windowMgr.CloseWindow(345); - UIWindow* window = g_windowMgr.EnsureWindow(323); + case ID_REGISTER_PARTY_LISTING: { + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); + UIWindow* window = g_windowMgr.EnsureWindow(WID_REGISTERPARTYWND); if (window) { g_windowMgr.Promote(window); @@ -562,7 +564,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case 410: g_adventurerAgencyMgr->RequestStop(); break; - case 415: + case ID_PARTY_RELOAD_FIRST_PAGE: this->page = 1; this->searching = 0; this->LoadPage(1); diff --git a/Source/UI/Party/UIApplyForPartyWnd.cpp b/Source/UI/Party/UIApplyForPartyWnd.cpp index bb6150b6e..fd56d8e09 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.cpp +++ b/Source/UI/Party/UIApplyForPartyWnd.cpp @@ -1,5 +1,7 @@ #include "Client/Session.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "File/ShortcutFilename.h" #include "Render/Renderer.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -155,12 +157,12 @@ int UIApplyForPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_COMMAND: switch (static_cast(a)) { case ID_CLOSE: - g_windowMgr.CloseWindow(345); + g_windowMgr.CloseWindow(WID_APPLYFORPARTYWND); break; - case 271: + case ID_APPLY: g_adventurerAgencyMgr->RequestInfo(this->info.accountId); break; - case 381: { + case ID_WHISPER_PARTY_LEADER: { const std::string name = this->info.characterName; const char* relationship = nullptr; @@ -171,7 +173,7 @@ int UIApplyForPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, const char* group = g_session.IsGuildMemberAccount(this->info.accountId) ? "GuildMember" : relationship; std::string code; code = ShortcutFilename(this->info.characterId); - g_windowMgr.SendNotice(14, reinterpret_cast(name.c_str()), reinterpret_cast(group), reinterpret_cast(code.c_str()), 0, 0); + g_windowMgr.SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(name.c_str()), reinterpret_cast(group), reinterpret_cast(code.c_str()), 0, 0); break; } } diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index 16e13e0ca..a56306d3f 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Party/UIMiniPartyWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" #include "Client/Mode/CGameMode.h" @@ -149,7 +152,7 @@ void UIMiniPartyInfoWnd::OnMouseHover(int, int) { // FUNCTION: fn_07734 void UIMiniPartyInfoWnd::OnRBtnUp(int, int) { if (!g_session.m_lockMouse) { - this->SendMsg(nullptr, 0x31, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } @@ -200,7 +203,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case UM_MAKEMENU: this->m_entries.clear(); if (g_windowMgr.unknown_0210) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } if (this->m_owner->GetMember().valid) { this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(2808)).c_str(), 58)); @@ -216,13 +219,13 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_entries.push_back(MiniPartyInfoEntry(std::string(LookupMessage(3102)).c_str(), 61)); } if (this->m_entries.size()) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); - menu->SendMsg(nullptr, 75, 0, 0, 0, 0); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); + menu->SendMsg(nullptr, UM_CLEAR_ITEM, 0, 0, 0, 0); for (unsigned index = 0; index < this->m_entries.size(); ++index) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->m_entries[index].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_entries[index].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 301, this->m_owner->m_cell, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 301, this->m_owner->m_cell, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = g_mouse.x + 1; int y = g_mouse.y + 1; if (x < 1) { @@ -251,27 +254,27 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } switch (this->m_entries[argument1].value) { case MENUID_SEND_MSG: - this->SendMsg(nullptr, 6, 231, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_SENDMSG, 0, 0, 0); return 0; case MENUID_TALKONLYTWO: - this->SendMsg(nullptr, 6, 232, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_TALK, 0, 0, 0); return 0; case MENUID_QUERYINFO: - this->SendMsg(nullptr, 6, 233, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_FRIEND_INFO, 0, 0, 0); return 0; case MENUID_EXPEL: case 19: - this->SendMsg(nullptr, 6, 235, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_DELETE_FRIEND, 0, 0, 0); return 0; case MENUID_LEAVE: - this->SendMsg(nullptr, 6, 236, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_LEAVE, 0, 0, 0); return 0; case MENUID_MAKE_WHISPER_WINDOW: this->SendMsg(nullptr, 71, 0, 0, 0, 0); return 0; case MENUID_INVITE_IN_PARTY: if (this->m_owner->m_cell != -1 && this->m_owner->GetMember().valid) { - g_modeMgr.gameMode->SendMsg(59, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_JOIN_GROUP, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); return 0; } break; @@ -279,19 +282,19 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (this->m_owner->m_cell != -1) { if (this->m_owner->GetMember().valid && this->m_owner->GetMember().offline == 0) { if (g_windowMgr.Confirm(LookupMessage(1533), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(260, this->m_owner->GetMember().accountId, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_GROUP_CHANGE_MASTER, this->m_owner->GetMember().accountId, 0, 0, 0); return 0; } } else { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1534)), 255, 3, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1534)), 255, 3, 0, 0); return 0; } } break; case 58: if (this->m_owner->GetMember().valid) { - g_modeMgr.gameMode->SendMsg(268, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); return 0; } break; @@ -337,12 +340,12 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case ID_PARTY_SETTING: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { - g_windowMgr.CloseWindow(208); + g_windowMgr.CloseWindow(WID_PARTYINVITATIONTOWND); } - if (!g_windowMgr.CloseWindow(53) && g_session.PartyCount()) { - g_windowMgr.EnsureWindow(53); + if (!g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT) && g_session.PartyCount()) { + g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } - g_windowMgr.CloseWindow(68); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); UIWindow* window = reinterpret_cast(g_windowMgr.unknown_030C); if (window) { int x = 0; @@ -357,7 +360,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (!g_session.m_lockMouse && this->m_owner->GetMember().valid) { if (!(this->m_owner->GetMember().name == g_session.DecodePlayerName())) { if (g_windowMgr.Confirm(LookupMessage(363), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(62, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_EXPEL_GROUP_MEMBER, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); return 0; } } @@ -367,7 +370,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (!g_session.m_lockMouse) { if (this->m_owner->GetMember().valid && this->m_owner->GetMember().name == g_session.DecodePlayerName()) { if (g_windowMgr.Confirm(LookupMessage(357), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(61, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_LEAVE_GROUP, 0, 0, 0, 0); return 0; } } @@ -433,7 +436,7 @@ int UIMiniPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (member && member->valid) { this->m_member = *member; if (this->m_infoWnd) { - this->m_infoWnd->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->m_infoWnd->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } } return 0; diff --git a/Source/UI/Party/UIPartyInfoWnd.cpp b/Source/UI/Party/UIPartyInfoWnd.cpp index 5933ba48e..0ac5e9aa4 100644 --- a/Source/UI/Party/UIPartyInfoWnd.cpp +++ b/Source/UI/Party/UIPartyInfoWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" #include "File/ShortcutFilename.h" @@ -147,5 +148,5 @@ void UIPartyInfoWnd::OnRBtnUp(int, int) { std::string code; code = ShortcutFilename(this->info.characterId); - g_windowMgr.SendNotice(14, reinterpret_cast(name.c_str()), reinterpret_cast(relationship), reinterpret_cast(code.c_str()), 0, 0); + g_windowMgr.SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(name.c_str()), reinterpret_cast(relationship), reinterpret_cast(code.c_str()), 0, 0); } diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index ca7f391d9..5b34e526a 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" @@ -281,14 +282,14 @@ int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, if (g_forbiddenWords.Contains(this->memo->Text()) == true) { char text[256] = {}; StringFormat(text, sizeof(text), _TRUNCATE, LookupMessage(3372)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); return 0; } this->NormalizeLevels(); if (std::atoi(this->minimum->Text()) > std::atoi(this->maximum->Text())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3516)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3516)), 0xFF, 0, 0, 0); return 0; } @@ -306,14 +307,14 @@ int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } else { char text[256] = {}; StringFormat(text, sizeof(text), _TRUNCATE, LookupMessage(3506)); - g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text), 0xFF, 0, 0, 0); } break; default: return 0; } - g_windowMgr.CloseWindow(323); + g_windowMgr.CloseWindow(WID_REGISTERPARTYWND); return 0; } diff --git a/Source/UI/Party/UIRequestJoinPartyMgr.cpp b/Source/UI/Party/UIRequestJoinPartyMgr.cpp index 9c811432c..da06f8275 100644 --- a/Source/UI/Party/UIRequestJoinPartyMgr.cpp +++ b/Source/UI/Party/UIRequestJoinPartyMgr.cpp @@ -1,4 +1,6 @@ #include "UI/Party/UIRequestJoinPartyMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindow.h" #include "UI/Window/WindowManagerWindows.h" @@ -64,11 +66,11 @@ void UIRequestJoinPartyMgr::Add(std::uint32_t accountId, std::uint32_t character request.job = job; request.level = level; - if (this->m_windows->LookupWindow(326)) { + if (this->m_windows->LookupWindow(WID_REQUESTJOINPARTYWND)) { this->m_pending.push_back(request); } else { - UIWindow* window = this->m_windows->EnsureWindow(326); - window->SendMsg(nullptr, 56, reinterpret_cast(&request), 0, 0, 0); + UIWindow* window = this->m_windows->EnsureWindow(WID_REQUESTJOINPARTYWND); + window->SendMsg(nullptr, UM_SET_JOIN_PARTY_MSG, reinterpret_cast(&request), 0, 0, 0); } } @@ -76,11 +78,11 @@ void UIRequestJoinPartyMgr::Add(std::uint32_t accountId, std::uint32_t character // FUNCTION: fn_09297 void UIRequestJoinPartyMgr::Advance() { if (this->m_pending.empty()) { - this->m_windows->CloseWindow(326); + this->m_windows->CloseWindow(WID_REQUESTJOINPARTYWND); } while (!this->m_pending.empty()) { - UIWindow* window = this->m_windows->LookupWindow(326); + UIWindow* window = this->m_windows->LookupWindow(WID_REQUESTJOINPARTYWND); if (!window) { return; @@ -90,7 +92,7 @@ void UIRequestJoinPartyMgr::Advance() { const bool blocked = std::find(this->m_blocked.begin(), this->m_blocked.end(), request.accountId) != this->m_blocked.end(); if (!blocked) { - window->SendMsg(nullptr, 56, reinterpret_cast(&request), 0, 0, 0); + window->SendMsg(nullptr, UM_SET_JOIN_PARTY_MSG, reinterpret_cast(&request), 0, 0, 0); this->m_pending.pop_front(); return; } @@ -98,7 +100,7 @@ void UIRequestJoinPartyMgr::Advance() { this->m_pending.pop_front(); if (this->m_pending.empty()) { - this->m_windows->CloseWindow(326); + this->m_windows->CloseWindow(WID_REQUESTJOINPARTYWND); } } } diff --git a/Source/UI/Party/UIRequestJoinPartyWnd.cpp b/Source/UI/Party/UIRequestJoinPartyWnd.cpp index e61cd5c9f..e7bda4285 100644 --- a/Source/UI/Party/UIRequestJoinPartyWnd.cpp +++ b/Source/UI/Party/UIRequestJoinPartyWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" @@ -83,7 +84,7 @@ void UIRequestJoinPartyWnd::OnCreate(int, int) { this->blockText->Invalidate(); this->AddChild(this->blockText); this->blockText->lineHeight = 15; - this->blockText->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3518)), 30, 0, 0); + this->blockText->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3518)), 30, 0, 0); this->AddBigCloseButton("", 0); } @@ -101,10 +102,10 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_COMMAND: switch (a) { case ID_CLOSE: - this->SendMsg(nullptr, 6, 542, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 542, 0, 0, 0); break; case 541: - g_modeMgr.gameMode->SendMsg(264, this->characterId, 1, reinterpret_cast(&this->accountId), 0); + g_modeMgr.gameMode->SendMsg(MM_PARTY_REQ_ACK_MASTER_TO_JOIN, this->characterId, 1, reinterpret_cast(&this->accountId), 0); g_requestJoinPartyMgr->Advance(); this->block->SetChecked(0); break; @@ -113,7 +114,7 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_requestJoinPartyMgr->Block(this->accountId); } - g_modeMgr.gameMode->SendMsg(264, this->characterId, 0, reinterpret_cast(&this->accountId), 0); + g_modeMgr.gameMode->SendMsg(MM_PARTY_REQ_ACK_MASTER_TO_JOIN, this->characterId, 0, reinterpret_cast(&this->accountId), 0); g_requestJoinPartyMgr->Advance(); this->block->SetChecked(0); break; @@ -143,7 +144,7 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->details->Clear(); char messageText[1024] = {}; _snprintf_s(messageText, sizeof(messageText), _TRUNCATE, LookupMessage(3378), request.name); - this->details->SendMsg(nullptr, 29, reinterpret_cast(messageText), 0, 0, 1); + this->details->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(messageText), 0, 0, 1); this->details->Move(43, this->details->lines.size() == 3 ? 20 : 30); this->InvalidateChildren(); diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index 4acd10b93..4bb7cd9f2 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/ProbabilityTable/UIProbabilityTable.h" #include "Network/TextEncoding.h" @@ -463,7 +464,7 @@ void CUIProbabilityTable::OnButtonClick() { // OFFSET: 0x00A4E010 // FUNCTION: fn_45473 void CUIProbabilityTable::OnClose() { - g_windowMgr.CloseWindow(0x271C); + g_windowMgr.CloseWindow(WID_PROBABILITYTABLE); } // OFFSET: 0x00A4DCA0 @@ -529,7 +530,7 @@ void CUIProbabilityTable::Search() { // OFFSET: 0x00A4E280 // FUNCTION: fn_16203 void CUIProbabilityTable::OnInit() { - UIWindow* anchor = g_windowMgr.LookupWindow(12); + UIWindow* anchor = g_windowMgr.LookupWindow(WID_ITEMCOLLECTIONWND); if (anchor) { this->Move(anchor->geometry.x + anchor->geometry.width, anchor->geometry.y); } else { diff --git a/Source/UI/Quest/UIOngoingQuestInfo.cpp b/Source/UI/Quest/UIOngoingQuestInfo.cpp index 3491f5789..8b7614297 100644 --- a/Source/UI/Quest/UIOngoingQuestInfo.cpp +++ b/Source/UI/Quest/UIOngoingQuestInfo.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Quest/UIOngoingQuestInfo.h" #include "Client/Input/InputCharset.h" @@ -191,7 +192,7 @@ void CUIOngoingQuestInfo::OnFirstAction() { // OFFSET: 0x00A55660 // FUNCTION: fn_45468 void CUIOngoingQuestInfo::OnClose() { - g_windowMgr.CloseWindow(10009); + g_windowMgr.CloseWindow(WID_ONGOINGQUESTINFO); } namespace OngoingQuestInfo { @@ -311,7 +312,7 @@ void CUIRewards::OnBindItem(CUIRewardItem* item, const CRewardItemData& data) { void CUIOngoingQuestInfo::OnInit() { const char* title = LookupMessage(0xD48); this->titleBar->SetTitle(title); - UIWindow* window = g_windowMgr.LookupWindow(0x2718); + UIWindow* window = g_windowMgr.LookupWindow(WID_RENEWQUESTUI); if (window) { this->Move(window->geometry.x + window->geometry.width, window->geometry.y); } else { diff --git a/Source/UI/Quest/UIQuestDisplay.cpp b/Source/UI/Quest/UIQuestDisplay.cpp index fc39bde00..40a27fa61 100644 --- a/Source/UI/Quest/UIQuestDisplay.cpp +++ b/Source/UI/Quest/UIQuestDisplay.cpp @@ -1,5 +1,7 @@ #include "UI/Chat/UINewChatWnd.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Quest/UIQuestDisplay.h" #include "Client/Input/Mouse.h" #include "Contents/MessageTable.h" @@ -194,7 +196,7 @@ void UIQuestDisplay::OnRBtnUp(int x, int y) { } if (this->m_selectedIndex != -1) { - this->SendMsg(nullptr, 49, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_MAKEMENU, 0, 0, 0, 0); } } @@ -253,12 +255,12 @@ int UIQuestDisplay::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->m_menuItems.push_back(MiniPartyInfoEntry(std::string(LookupMessage(351)).c_str(), 48)); } if (this->m_menuItems.size() != 0) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (size_t i = 0; i < this->m_menuItems.size(); ++i) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->m_menuItems[i].text.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->m_menuItems[i].text.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 204, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 204, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = std::max(g_mouse.x + 1, 1); int maxX = g_renderer->viewport.width - menu->geometry.width; diff --git a/Source/UI/Quest/UIRecommendedQuestInfo.cpp b/Source/UI/Quest/UIRecommendedQuestInfo.cpp index 2d6ede036..69fb8abae 100644 --- a/Source/UI/Quest/UIRecommendedQuestInfo.cpp +++ b/Source/UI/Quest/UIRecommendedQuestInfo.cpp @@ -1,4 +1,5 @@ #include "UI/Quest/UIRecommendedQuestInfo.h" +#include "UI/Window/WindowId.h" #include "Contents/MessageTable.h" #include "Contents/RenewQuestMgr.h" @@ -108,7 +109,7 @@ void CUIRecommendedQuestInfo::OnFirstAction() { // OFFSET: 0x00A58BB0 // FUNCTION: fn_45469 void CUIRecommendedQuestInfo::OnClose() { - g_windowMgr.CloseWindow(0x271A); + g_windowMgr.CloseWindow(WID_RECOMMENDEDQUESTINFO); } // OFFSET: 0x00A58BE0 @@ -116,7 +117,7 @@ void CUIRecommendedQuestInfo::OnClose() { void CUIRecommendedQuestInfo::OnInit() { const char* title = LookupMessage(0xD48); this->titleBar->SetTitle(title); - UIWindow* window = g_windowMgr.LookupWindow(0x2718); + UIWindow* window = g_windowMgr.LookupWindow(WID_RENEWQUESTUI); if (window) { this->Move(window->geometry.x + window->geometry.width, window->geometry.y); } else { diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index 6eafee936..5529adf51 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Quest/UIRenewQuestUI.h" #include "UI/Window/UIEnums.h" #include "Utility/EncryptedName.h" @@ -844,8 +846,8 @@ __declspec(noinline) bool CUIListBoxExquestId; if (this->questType == 2) { g_renewQuestMgr->SetRecommendedQuestActive(questId, active); - if (auto* window = static_cast(g_windowMgr.LookupWindow(0x2718))) { + if (auto* window = static_cast(g_windowMgr.LookupWindow(WID_RENEWQUESTUI))) { window->UpdateQuestLists(this->questType); } g_renewQuestMgr->SaveRecommendedActiveList(); @@ -891,7 +893,7 @@ void RenewQuestUI::CUIQuestItem::OnActiveStateChanged(bool active) { void RenewQuestUI::CUIQuestItem::OnSimpleView(bool simpleView) { g_renewQuestMgr->SetOngoingSimpleView(this->questId, simpleView); g_renewQuestMgr->SaveOngoingSimpleViewList(); - if (UIWindow* window = g_windowMgr.LookupWindow(204)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_QUESTDISPLAY)) { window->Invalidate(); } } @@ -948,7 +950,7 @@ template void CUIListBoxEx::ClearData // FUNCTION: fn_16612 void UIWindow::RecordWindowFlag(bool value) { this->RecordValues(6, 0xd5, value, 0, 0); - if (UIWindow* window = g_windowMgr.LookupWindow(0xcc)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_QUESTDISPLAY)) { window->Show(value); } } @@ -1084,12 +1086,12 @@ void RenewQuestUI::CUIQuestItem::SetSelected(bool selected) { int CUIRenewQuestUI::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_COMMAND: - if (a == 0xD5) { + if (a == ID_CHECK) { const bool checked = b != 0; this->checkBox->checked = checked; this->checkBox->Invalidate(); this->RecordValues(6, a, b != 0, 0, 0); - if (UIWindow* window = g_windowMgr.LookupWindow(0xCC)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_QUESTDISPLAY)) { window->Show(checked); } } @@ -1132,19 +1134,19 @@ void RenewQuestUI::CUIQuestList::OnSelectItem(CUIQuestItem* item, const unsigned } if (item->questType == 2) { - if (CUIRecommendedQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(0x271a)))) { + if (CUIRecommendedQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_RECOMMENDEDQUESTINFO)))) { info->SetQuest(item->questId); - if (UIWindow* other = g_windowMgr.LookupWindow(0x2719)) { + if (UIWindow* other = g_windowMgr.LookupWindow(WID_ONGOINGQUESTINFO)) { info->Move(other->geometry.x, other->geometry.y); - g_windowMgr.CloseWindow(0x2719); + g_windowMgr.CloseWindow(WID_ONGOINGQUESTINFO); } } } else { - if (CUIOngoingQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(0x2719)))) { + if (CUIOngoingQuestInfo* info = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_ONGOINGQUESTINFO)))) { info->SetQuest(item->questId); - if (UIWindow* other = g_windowMgr.LookupWindow(0x271a)) { + if (UIWindow* other = g_windowMgr.LookupWindow(WID_RECOMMENDEDQUESTINFO)) { info->Move(other->geometry.x, other->geometry.y); - g_windowMgr.CloseWindow(0x271a); + g_windowMgr.CloseWindow(WID_RECOMMENDEDQUESTINFO); } } } @@ -1817,7 +1819,7 @@ void CUIRenewQuestUI::OnCreate(int width, int height) { this->closeButton = new CUIImageButton(); this->closeButton->SetSize(42, 20); this->closeButton->Move(327, 442); - this->closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(0x2718); }); + this->closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(WID_RENEWQUESTUI); }); this->closeButton->disabled = 0; this->closeButton->Invalidate(); this->closeButton->SetImages( @@ -2215,7 +2217,7 @@ void CUIRenewQuestUI::OnSearchSubmit() { // OFFSET: 0x00A66100 // FUNCTION: fn_45519 void CUIRenewQuestUI::OnClose() { - g_windowMgr.CloseWindow(0x2718); + g_windowMgr.CloseWindow(WID_RENEWQUESTUI); } // OFFSET: 0x00A66370 @@ -2236,13 +2238,13 @@ CUIRenewQuestUI::CUIRenewQuestUI() // FUNCTION: fn_16624 void CUIRenewQuestUI::OnInit() { g_windowMgr.RecordWindowPacket(0x2718); - g_windowMgr.CloseWindow(0x8F); + g_windowMgr.CloseWindow(WID_NOTIFYQUESTWND); this->titleBar->SetTitle(LookupMessage(0xD48)); this->filterLabel->SetText(LookupMessage(0x7E3)); bool visible = false; - if (UIWindow* window = g_windowMgr.LookupWindow(0xCC)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_QUESTDISPLAY)) { visible = window->geometry.visible != 0; } this->checkBox->checked = visible; diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index 5c817c793..ec153d7db 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/DeviceContext/DCSurface.h" @@ -189,10 +190,10 @@ void UIOngoingQuestScrollWnd::Paint() { void UIOngoingQuestScrollWnd::OnWheel(int delta) { if (this->wheelScroll == 1) { if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 15, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -15, 0, 0, 0); } } @@ -254,8 +255,8 @@ int UIOngoingQuestScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 0xC9) { - g_windowMgr.CloseWindow(0x142); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_RENEWDETAILQUESTINFOWND); } break; case UM_REFRESHITEM: @@ -302,7 +303,7 @@ void UIOngoingQuestScrollWnd::SetQuest(unsigned int questId) { height = this->m_lineHeight; } else { for (unsigned int index = 0; index < quest.m_descriptions.size(); ++index) { - viewer->SendMsg(nullptr, 0x1D, reinterpret_cast(quest.m_descriptions[index].c_str()), 0, 0, 0); + viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(quest.m_descriptions[index].c_str()), 0, 0, 0); } height = viewer->ContentHeight(); } @@ -488,10 +489,10 @@ void UIRecommededQuestScrollWnd::Paint() { void UIRecommededQuestScrollWnd::OnWheel(int delta) { if (this->wheelScroll == 1) { if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 15, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -15, 0, 0, 0); } } @@ -499,8 +500,8 @@ void UIRecommededQuestScrollWnd::OnWheel(int delta) { // FUNCTION: fn_09955 int UIRecommededQuestScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6 && argument1 == 0xC9) { - g_windowMgr.CloseWindow(0x142); + if (message == UM_COMMAND && argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_RENEWDETAILQUESTINFOWND); } return UIScrollWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); @@ -543,7 +544,7 @@ void UIRecommededQuestScrollWnd::SetQuest(unsigned int questId) { for (int index = 0; index < 3; ++index) { for (const std::string& description : quest.m_descriptions[index]) { - viewers[index]->SendMsg(nullptr, 0x1D, reinterpret_cast(description.c_str()), 0, 0, 0); + viewers[index]->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(description.c_str()), 0, 0, 0); } } @@ -637,15 +638,15 @@ int UIRenewDetailQuestInfoWnd::SendMsg(UIWindow* sender, int message, std::intpt std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 0xC9) { - g_windowMgr.CloseWindow(0x142); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_RENEWDETAILQUESTINFOWND); } return 0; case UM_REFRESHITEM: if (this->m_recommended) { - this->m_recommendedWnd->SendMsg(this, 0x17, 0, 0, 0, 0); + this->m_recommendedWnd->SendMsg(this, UM_REFRESHITEM, 0, 0, 0, 0); } else { - this->m_ongoingWnd->SendMsg(this, 0x17, 0, 0, 0, 0); + this->m_ongoingWnd->SendMsg(this, UM_REFRESHITEM, 0, 0, 0, 0); } return 0; default: @@ -718,10 +719,10 @@ void UIRenewQuestWnd::OnCreate(int, int) { this->m_tabs->Move(0, 17); this->m_tabs->style = -1; this->AddChild(this->m_tabs); - this->m_tabs->SendMsg(this, 13, this->m_tab, 0, 0, 0); + this->m_tabs->SendMsg(this, UM_SETSTATE, this->m_tab, 0, 0, 0); if (!g_windowMgr.window_0428) { - g_windowMgr.EnsureWindow(204); + g_windowMgr.EnsureWindow(WID_QUESTDISPLAY); } this->m_optionCheckBox = this->AddStyledCheckBox(213, 10, 12, LookupMessage(2019), 38, 447, g_windowMgr.window_0428->geometry.visible != 0, nullptr, 12, 0x212121, "유저인터페이스\\renew_questui\\checkbox_on.bmp", "유저인터페이스\\renew_questui\\checkbox_off.bmp" @@ -766,7 +767,7 @@ void UIRenewQuestWnd::OnCreate(int, int) { this->AddChild(this->m_rows.icons[index]); } - this->SendMsg(this, 0x17, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x007FC870 @@ -853,7 +854,7 @@ void UIRenewQuestWnd::OnLBtnDown(int x, int y) { this->m_pressed = 1; this->m_selected = row; this->Invalidate(); - UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(0x142)); + UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(WID_RENEWDETAILQUESTINFOWND)); if (detail) { const std::vector& ids = this->m_questIds[this->m_tab]; const bool recommended = this->m_tab == 1; @@ -880,10 +881,10 @@ void UIRenewQuestWnd::OnLBtnUp(int x, int y) { void UIRenewQuestWnd::OnWheel(int delta) { if (this->m_scrollable) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 7, 3, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, 3, 0, 0, 0); return; } - this->SendMsg(this->m_scrollBar, 7, -3, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, -3, 0, 0, 0); } } @@ -1031,7 +1032,7 @@ void UIRenewQuestWnd::RefreshQuestLists(int type, unsigned int questId) { this->Invalidate(); } - UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(0x142)); + UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(WID_RENEWDETAILQUESTINFOWND)); if (detail) { const std::vector& current = this->m_questIds[this->m_tab]; const bool recommended = this->m_tab == 1; @@ -1057,7 +1058,7 @@ static void SetRecommendedQuestSummary(CRenewQuestMgr* mgr, unsigned int id, std // FUNCTION: fn_09981 int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 22 || argument1 == 0xD5) { + if (message == UM_TAB || argument1 == ID_CHECK) { this->RecordValues(message, argument1, argument2, argument3, argument4); } @@ -1065,7 +1066,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume case UM_COMMAND: switch (argument1) { case ID_CLOSE: - g_windowMgr.CloseWindow(0x141); + g_windowMgr.CloseWindow(WID_RENEWQUESTWND); return 0; case ID_CHECK: if (g_windowMgr.window_0428) { @@ -1088,7 +1089,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume if (this->m_tab == 1) { if (checkMessage == 1) { g_renewQuestMgr->SetRecommendedQuestActive(questId, argument2 != 0); - this->SendMsg(this, 0x17, 2, 0, 0, 0); + this->SendMsg(this, UM_REFRESHITEM, 2, 0, 0, 0); g_renewQuestMgr->SaveRecommendedActiveList(); return 0; } @@ -1130,7 +1131,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume if (it == recommended.end()) { it = recommended.begin(); } - UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(0x142)); + UIRenewDetailQuestInfoWnd* detail = static_cast(g_windowMgr.EnsureWindow(WID_RENEWDETAILQUESTINFOWND)); if (detail) { detail->SetQuest(*it, true); } @@ -1163,7 +1164,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume for (int tab = 0; tab <= 2; ++tab) { const std::vector& ids = this->m_questIds[tab]; if (std::find(ids.begin(), ids.end(), static_cast(argument2)) != ids.end()) { - this->SendMsg(this, 0x16, tab, 0, 0, 0); + this->SendMsg(this, UM_TAB, tab, 0, 0, 0); found = true; break; } @@ -1182,9 +1183,9 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; int delta = argument1; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { delta = -8; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { delta = 8; } this->m_scroll = previous + delta; diff --git a/Source/UI/Rodex/UIRodexComposeWnd.cpp b/Source/UI/Rodex/UIRodexComposeWnd.cpp index 22ee316f3..88f339783 100644 --- a/Source/UI/Rodex/UIRodexComposeWnd.cpp +++ b/Source/UI/Rodex/UIRodexComposeWnd.cpp @@ -1,4 +1,6 @@ #include "Render/Text/FontCache.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Rodex/UIRodexComposeWnd.h" @@ -228,7 +230,7 @@ void UIRodexComposeWnd::OnProcess() { void UIRodexComposeWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->GetItemAtPoint(x, y); if (std::atoi(item.itemId.c_str()) != 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -285,17 +287,17 @@ void UIRodexComposeWnd::DragAndDrop(int x, int y, std::intptr_t value) { CMode* mode = g_modeMgr.GetGameMode(); const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 1) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.window_01EC->SendMsg(nullptr, 13, 13, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, UM_SETSTATE, 13, 0, 0, 0); } // OFFSET: 0x007FF4A0 @@ -313,12 +315,12 @@ std::int64_t UIRodexComposeWnd::GetZeny() { int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 201) { - g_windowMgr.CloseWindow(264); - } else if (argument1 == 213) { + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_RODEXCOMPOSEWND); + } else if (argument1 == ID_CHECK) { if (this->unknown_00B4->Length() != 0 && this->unknown_00B4->Length() < 24) { if (g_navigationLinkParser->HasLink(this->unknown_00B4->Text())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); return 0; } @@ -336,45 +338,45 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } if (this->unknown_00B4->Length() >= 24) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA27)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA27)), 0x64FFFF, 0, 0, 0); } if (g_navigationLinkParser->HasLink(this->unknown_00B4->Text())) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAFC)), 0x64FFFF, 0, 0, 0); } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA23)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA23)), 0x64FFFF, 0, 0, 0); } - } else if (argument1 == 345) { + } else if (argument1 == ID_SEND) { if (this->unknown_00B4->Length() == 0 && this->unknown_00B8->Length() == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA23)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA23)), 0x64FFFF, 0, 0, 0); return 0; } if (this->unknown_00D0->Length() < 4 || this->unknown_00D0->Length() >= 51) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA24)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA24)), 0x64FFFF, 0, 0, 0); return 0; } if (this->m_contents->Length() >= 1001) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA44)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA44)), 0x64FFFF, 0, 0, 0); return 0; } const std::int64_t zeny = this->GetZeny(); if (zeny > 0) { if (zeny > g_session.m_zeny) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA35)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA35)), 0x64FFFF, 0, 0, 0); return 0; } if (zeny + this->unknown_00F8 > g_session.m_zeny) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA53)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA53)), 0x64FFFF, 0, 0, 0); return 0; } } if (this->unknown_00F8 > 0 && this->unknown_00F8 > g_session.m_zeny) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA53)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA53)), 0x64FFFF, 0, 0, 0); return 0; } if (this->unknown_00C8->GetText().length() <= 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA33)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA33)), 0x64FFFF, 0, 0, 0); return 0; } @@ -382,7 +384,7 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu if (g_navigationLinkParser->HasLink(this->m_contents->Text())) { this->m_contents->SetText(""); body.clear(); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBE2)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBE2)), 0xFF, 0, 0, 0); return 0; } @@ -402,7 +404,7 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu mail.title = this->unknown_00D0->Text(); mail.body = body; mail.zeny = static_cast(zeny); - g_modeMgr.GetGameMode()->SendMsg(0xC0, reinterpret_cast(&mail), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_SEND_MAIL, reinterpret_cast(&mail), 0, 0, 0); } return 0; case UM_REFRESHITEM: @@ -417,22 +419,22 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu return 0; case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - g_modeMgr.GetGameMode()->SendMsg(0xC3, mode->drag.id, mode->drag.quantity, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x12, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_ADD_MAIL_ITEM, mode->drag.id, mode->drag.quantity, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_TEXT_LBTN_UP: if (argument3 > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, argument3, 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, argument3, 0, 0, 0); } } return 0; case UM_DECITEM: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - g_modeMgr.GetGameMode()->SendMsg(0x126, mode->drag.id, mode->drag.quantity, 0, 0); - g_modeMgr.GetGameMode()->SendMsg(0x12, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_REMOVE_RODEX_ITEM, mode->drag.id, mode->drag.quantity, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } default: diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index de2e69b66..4e7479a0d 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Rodex/UIRodexInboxWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" @@ -160,7 +162,7 @@ void UIRodexInboxWnd::OnCreate(int width, int height) { } this->unknown_0138->Move(0xCF, 0x46); this->AddChild(this->unknown_0138); - this->unknown_0138->SendMsg(this, 13, 0, 0, 0, 0); + this->unknown_0138->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); this->unknown_0134 = new UIBmpRadioBtn(); this->unknown_0134->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); @@ -182,7 +184,7 @@ void UIRodexInboxWnd::OnCreate(int width, int height) { } this->unknown_0134->Move(0x13, 0x46); this->AddChild(this->unknown_0134); - this->unknown_0134->SendMsg(this, 13, 0, 0, 0, 0); + this->unknown_0134->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); this->unknown_0130 = new UIBmpRadioBtn(); this->unknown_0130->SetBitmap("유저인터페이스\\basic_interface\\rodexsystem\\renewal\\btn_listtab_empty_out.bmp", 0); @@ -204,17 +206,17 @@ void UIRodexInboxWnd::OnCreate(int width, int height) { } this->unknown_0130->Move(0x71, 0x46); this->AddChild(this->unknown_0130); - this->unknown_0130->SendMsg(this, 13, 0, 0, 0, 0); + this->unknown_0130->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); switch (g_rodexMailStore->unknown_0010) { case MAIL_INBOX_NORMAL: - this->unknown_0130->SendMsg(this, 13, 1, 0, 0, 0); + this->unknown_0130->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); break; case MAIL_INBOX_ACCOUNT: - this->unknown_0134->SendMsg(this, 13, 1, 0, 0, 0); + this->unknown_0134->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); break; case MAIL_INBOX_RETURNED: - this->unknown_0138->SendMsg(this, 13, 1, 0, 0, 0); + this->unknown_0138->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); break; } @@ -328,7 +330,7 @@ void UIRodexInboxWnd::OnCreate(int width, int height) { this->unknown_01C0[index]->textColor = 0x654939; this->unknown_01C0[index]->Move(x, 0x44); this->unknown_01C0[index]->value = 0x141; - this->unknown_01C0[index]->SendMsg(this, 13, 1 - index, 0, 0, 0); + this->unknown_01C0[index]->SendMsg(this, UM_SETSTATE, 1 - index, 0, 0, 0); this->AddChild(this->unknown_01C0[index]); } @@ -370,7 +372,7 @@ void UIRodexInboxWnd::OnCreate(int width, int height) { } this->unknown_01D0->Move(0xDF, 0x56); this->AddChild(this->unknown_01D0); - this->unknown_01D0->SendMsg(this, 13, 0, 0, 0, 0); + this->unknown_01D0->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); this->unknown_0134->Move(0x13, 0x56); this->unknown_0130->Move(0x57, 0x56); @@ -812,9 +814,9 @@ bool __stdcall RequestRodexMailAction(int type, std::int64_t mailId) { return false; } - g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(mailId), type, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETE_MAIL, static_cast(mailId), type, 0, 0); if (g_windowMgr.unknown_045C != 0) { - g_windowMgr.CloseWindow(265); + g_windowMgr.CloseWindow(WID_RODEXCONTENTSWND); } return true; } @@ -837,7 +839,7 @@ void UIRodexInboxWnd::RequestAllMailActions() { } if ((mail->second.unknown_0001 & 6) == 0) { - g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(entry->second), entry->first, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETE_MAIL, static_cast(entry->second), entry->first, 0, 0); ++requested; } else { ++skipped; @@ -852,7 +854,7 @@ void UIRodexInboxWnd::RequestAllMailActions() { for (std::map::iterator mail = mails->begin(); mail != mails->end(); ++mail) { if ((mail->second.unknown_0001 & 6) == 0) { - g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(mail->first), type, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETE_MAIL, static_cast(mail->first), type, 0, 0); ++requested; } else { ++skipped; @@ -861,10 +863,10 @@ void UIRodexInboxWnd::RequestAllMailActions() { } if (requested > 0 && g_windowMgr.unknown_045C != 0) { - g_windowMgr.CloseWindow(265); + g_windowMgr.CloseWindow(WID_RODEXCONTENTSWND); } if (skipped > 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); } } @@ -876,7 +878,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } CMode* mode = g_modeMgr.GetGameMode(); - if (g_rodexMailStore->unknown_001C == false && !(message == 6 && argument1 == 0xC9)) { + if (g_rodexMailStore->unknown_001C == false && !(message == UM_COMMAND && argument1 == ID_CLOSE)) { return 0; } @@ -888,18 +890,18 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume for (int i = 0; i < 2; ++i) { UIRadioBtn* radio = this->unknown_01C0[i]; if (radio == sender) { - radio->SendMsg(this, 13, 1, 0, 0, 0); + radio->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - radio->SendMsg(this, 13, 0, 0, 0, 0); + radio->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } this->Invalidate(); } else { - this->unknown_0130->SendMsg(this, 13, 0, 0, 0, 0); - this->unknown_0134->SendMsg(this, 13, 0, 0, 0, 0); - this->unknown_0138->SendMsg(this, 13, 0, 0, 0, 0); - this->unknown_01D0->SendMsg(this, 13, 0, 0, 0, 0); - sender->SendMsg(this, 13, 1, 0, 0, 0); + this->unknown_0130->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); + this->unknown_0134->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); + this->unknown_0138->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); + this->unknown_01D0->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); + sender->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); for (int i = 0; i < 6; ++i) { this->checks[i]->SetChecked(0); this->checks[i]->m_message = 0; @@ -918,7 +920,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; - case 0x13C: + case ID_PREV_PAGE: if (--this->unknown_019C < 0) { this->unknown_019C = 0; } else { @@ -930,7 +932,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Invalidate(); break; - case 0x13D: { + case ID_NEXT_PAGE: { if (this->unknown_01D4 == 1) { if (this->searchResults.size() > static_cast((this->unknown_019C + 1) * 6)) { this->ClearChecks(); @@ -967,14 +969,14 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume break; } - case 0x131: + case ID_SEND_MAIL: if (g_windowMgr.HasNavigationBlocker() != true) { - mode->SendMsg(0x10C, 0, 0, 0, 0); + mode->SendMsg(MM_OPEN_WRITE_RODEX, 0, 0, 0, 0); } break; case ID_CLOSE: - g_windowMgr.CloseWindow(0x107); + g_windowMgr.CloseWindow(WID_RODEXINBOXWND); break; case ID_DELETE: @@ -1000,7 +1002,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume success &= RequestRodexMailAction(entry->first, entry->second); } if (!success) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); } } } @@ -1028,7 +1030,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume success &= RequestRodexMailAction(g_rodexMailStore->unknown_0010, *id); } if (!success) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); } } } @@ -1041,11 +1043,11 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } else if (this->unknown_01C0[1]->geometry.unknown_0030 == 1) { this->SearchBySender(this->unknown_01C8->Text()); } - this->SendMsg(this->unknown_01D0, 6, 0xD7, 0, 0, 0); + this->SendMsg(this->unknown_01D0, UM_COMMAND, ID_RADIOBTN, 0, 0, 0); this->Invalidate(); break; - case 0xD5: { + case ID_CHECK: { int checked = 0; for (int i = 0; i < 6; ++i) { if (this->checks[i]->geometry.unknown_0030 > 0) { @@ -1209,19 +1211,19 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume if (mail != g_rodexMailStore->m_mails0.end() && (mail->second.unknown_0001 & 8) == 0 && mail->second.unknown_0004.size() != 0) { const std::pair title = RemoveLineBreakTag(mail->second.unknown_0024); if (title.first != true) { - mode->SendMsg(0x10C, reinterpret_cast(mail->second.unknown_0004.c_str()), 0, 0, 0); + mode->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast(mail->second.unknown_0004.c_str()), 0, 0, 0); } } } } else if (argument1 == 0x143) { std::map::iterator mail = g_rodexMailStore->m_mails0.find(argument2); if (mail != g_rodexMailStore->m_mails0.end() && mail->second.unknown_0194 == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF1B)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF1B)), 0xFF, 0, 0, 0); if (g_windowMgr.Confirm(LookupMessage(0xF1B), 2, false, false, 0, "Message", 280, 120, 0) == 0xBC) { break; } } - mode->SendMsg(0xC2, argument2, g_rodexMailStore->unknown_0010, 0, 0); + mode->SendMsg(MM_OPEN_MAIL, argument2, g_rodexMailStore->unknown_0010, 0, 0); } break; @@ -1234,7 +1236,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume case UM_DEFPUSH: if (this->unknown_01C8 == sender) { - this->SendMsg(this->unknown_01CC, 6, 0x141, 0, 0, 0); + this->SendMsg(this->unknown_01CC, UM_COMMAND, ID_SEARCH, 0, 0, 0); } break; diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index e826f84e8..084444975 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Items/RuneSystem.h" #include "Contents/MessageTable.h" @@ -44,7 +45,7 @@ void UIRune_Decom::Reset() { for (int index = 0; index < 2; ++index) { this->m_radioButtons[index]->Show(0); this->m_radioButtons[index]->Invalidate(); - this->m_radioButtons[index]->SendMsg(nullptr, 0x0D, this->m_decomType != index, 0, 0, 0); + this->m_radioButtons[index]->SendMsg(nullptr, UM_SETSTATE, this->m_decomType != index, 0, 0, 0); } this->Invalidate(); } @@ -265,7 +266,7 @@ void UIRuneSystemTab::OnLBtnDown(int x, int) { if (index < 3 && static_cast(this->geometry.unknown_0030) != index) { this->geometry.unknown_0030 = index; this->Invalidate(); - this->parent->SendMsg(this, 0x16, this->geometry.unknown_0030, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->geometry.unknown_0030, 0, 0, 0); } } @@ -287,7 +288,7 @@ void UIRuneSystem_tagListWnd::OnLBtnDown(int x, int) { if (tag) { g_runeSystemMgr->SetSelectTag(tag->m_id); g_runeSystemMgr->SendRequest(0xBCB, nullptr, -1); - this->parent->SendMsg(this, 0x3C, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); this->Invalidate(); } } @@ -302,10 +303,10 @@ void UIRuneSetReWard::OnLBtnUp(int x, int y) { } if (this->m_state == 3) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4200)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4200)), 0xFF, 0, 0, 0); } if (this->m_state == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4201)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4201)), 0xFF, 0, 0, 0); } if (this == g_windowMgr.Capture()) { @@ -584,7 +585,7 @@ int UIRuneSystemTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, st case UM_SETSTATE: this->geometry.unknown_0030 = argument1; this->Invalidate(); - this->parent->SendMsg(this, 0x16, this->geometry.unknown_0030, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->geometry.unknown_0030, 0, 0, 0); break; } @@ -630,9 +631,9 @@ void UIRune_Decom::SelectDecomType(unsigned int type) { if (this->m_decomType != type) { this->m_decomType = type; for (int index = 0; index < 2; ++index) { - this->m_radioButtons[index]->SendMsg(nullptr, 0x0D, 1, 0, 0, 0); + this->m_radioButtons[index]->SendMsg(nullptr, UM_SETSTATE, 1, 0, 0, 0); } - this->m_radioButtons[this->m_decomType]->SendMsg(nullptr, 0x0D, 0, 0, 0, 0); + this->m_radioButtons[this->m_decomType]->SendMsg(nullptr, UM_SETSTATE, 0, 0, 0, 0); this->m_decomList = g_runeSystemMgr->GetDecomList(this->m_itemId, this->m_decomType); this->Invalidate(); } @@ -730,7 +731,7 @@ void UIRuneSet_Info::RefreshDescription() { // FUNCTION: fn_10218 void UIRuneSet_Info::UpdateRewards() { for (UIRuneSetReWard* reward : this->m_rewards) { - reward->SendMsg(this, 0x66, 0, 0, 0, 0); + reward->SendMsg(this, UM_SETID, 0, 0, 0, 0); } if (this->m_runeSet && this->m_runeSet->m_reward.values[0] != 0) { @@ -738,15 +739,15 @@ void UIRuneSet_Info::UpdateRewards() { const std::int64_t itemId = this->m_runeSet->m_reward.values[index + 1]; if (itemId != 0) { if (index < this->m_runeSet->m_rewardStep) { - this->m_rewards[index]->SendMsg(this, 0x66, 3, static_cast(itemId), 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETID, 3, static_cast(itemId), 0, 0); } else if (index == 0) { - this->m_rewards[0]->SendMsg(this, 0x66, this->m_runeSet->IsActive() ? 2 : 1, static_cast(itemId), 0, 0); + this->m_rewards[0]->SendMsg(this, UM_SETID, this->m_runeSet->IsActive() ? 2 : 1, static_cast(itemId), 0, 0); } else { int state = 2; if ((index != 6 && this->m_runeSet->CountActiveSlots() <= index) || this->m_runeSet->FindLastReward(index + 1) > this->m_runeSet->m_rewardStep) { state = 1; } - this->m_rewards[index]->SendMsg(this, 0x66, state, static_cast(this->m_runeSet->m_reward.values[index + 1]), 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETID, state, static_cast(this->m_runeSet->m_reward.values[index + 1]), 0, 0); } } } @@ -900,7 +901,7 @@ void UIRuneSystemWnd::SelectTab() { } } - this->SendMsg(this, 0x3C, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x0081E7F0 @@ -929,9 +930,9 @@ void UIRuneSetReWard::OnRBtnDown(int, int) { ITEM_INFO item; item.SetItemId(this->m_itemId); item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -952,9 +953,9 @@ void UIRuneSystem_ActiveWnd::OnRBtnDown(int x, int y) { ITEM_INFO item; item.SetItemId(itemId); item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -971,9 +972,9 @@ void UIRune_Decom::OnRBtnDown(int x, int y) { ITEM_INFO item; item.SetItemId((*this->m_decomList)[index].m_itemId); item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1036,8 +1037,8 @@ int UIRuneSystem_DecomResultWnd::SendMsg(UIWindow*, int message, std::intptr_t a break; } case UM_COMMAND: - if (argument1 == 0xB8) { - g_windowMgr.CloseWindow(0x16A); + if (argument1 == ID_OK) { + g_windowMgr.CloseWindow(WID_RUNESYSTEM_DECOMRESULTWND); } break; } @@ -1622,7 +1623,7 @@ int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argumen case 0x253: case 0x254: if (!this->m_runeSet->IsRewardStep(argument1 - 0x24E)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4199)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4199)), 0xFF, 0, 0, 0); } else { g_runeSystemMgr->SendRequest(0xC16, this->m_runeSet, argument1 - 0x24D); } @@ -1732,11 +1733,11 @@ void UIRune_ViewInfo::OnCreate(int, int) { // OFFSET: 0x0081E5D0 // FUNCTION: fn_10228 int UIRune_Decom::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { - if (argument1 == 0xD7) { + if (message == UM_COMMAND) { + if (argument1 == ID_RADIOBTN) { this->SelectDecomType(argument2); } else if (argument1 == 0x197) { - g_windowMgr.CloseWindow(0x16A); + g_windowMgr.CloseWindow(WID_RUNESYSTEM_DECOMRESULTWND); if (!g_runeSystemMgr->IsRequestPending() && (!this->parent || this->parent->SendMsg(this, 0x6A, 50, 0, 0, 0) != 0) && this->m_ownedCount) { if (static_cast(g_session.m_weight) > static_cast(g_session.m_maxWeight) * 0.7f || g_session.GetList0Size() + g_session.CountItems17F0() + g_session.CountItems2B50() + 8 >= @@ -1754,7 +1755,7 @@ int UIRune_Decom::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } } } - } else if (message == 0x3C) { + } else if (message == UM_REFRESH) { this->SetItem(this->m_itemId); } @@ -1781,7 +1782,7 @@ void UIRune_Decom::OnCreate(int, int) { this->m_radioButtons[index]->Move(x, 0x153); const std::string text = FormatOwnedString(LookupMessage(4074), g_runeSystemMgr->GetDecomItem(index)); this->m_radioButtons[index]->SetText(text.c_str()); - this->m_radioButtons[index]->SendMsg(this, 0x0D, index, 0, 0, 0); + this->m_radioButtons[index]->SendMsg(this, UM_SETSTATE, index, 0, 0, 0); this->m_radioButtons[index]->SetBitmaps("유저인터페이스\\runesystem\\btn_radio_on.bmp", "유저인터페이스\\runesystem\\btn_radio_off.bmp"); this->m_radioButtons[index]->SetDisabledBitmap("유저인터페이스\\runesystem\\btn_radio_disable.bmp"); this->m_radioButtons[index]->value = index; @@ -1904,7 +1905,7 @@ void UIRuneSet_Info::OnCreate(int, int) { this->m_tab = new UIRuneSystemTab(); this->AddChild(this->m_tab); this->m_tab->SetSize(0xC4, 0x1A); - this->m_tab->SendMsg(this->m_tab, 0x16, 3, 0, 0, 0); + this->m_tab->SendMsg(this->m_tab, UM_TAB, 3, 0, 0, 0); this->m_tab->Move(0x180, 1); this->m_tab->m_label = "유저인터페이스\\runesystem\\runeset_tab_%d.bmp"; @@ -1958,12 +1959,12 @@ void UIRuneSet_Info::OnCreate(int, int) { this->m_rewards[index]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_pressed.tga", 2, 0); this->m_rewards[index]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_disabled.tga", 3, 0); this->m_rewards[index]->SetSize(this->m_rewards[index]->BitmapWidth(), this->m_rewards[index]->BitmapHeight()); - this->m_rewards[index]->SendMsg(this, 0x22, 0, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_empty.tga"), 0, 0); - this->m_rewards[index]->SendMsg(this, 0x22, 1, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_complete.tga"), 0, 0); - this->m_rewards[index]->SendMsg(this, 0x22, 2, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_disabled_mouseon.tga"), 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETINFO, 0, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_empty.tga"), 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETINFO, 1, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_complete.tga"), 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETINFO, 2, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_disabled_mouseon.tga"), 0, 0); this->m_rewards[index]->Move(rewardX[index], rewardY[index]); this->m_rewards[index]->SetId(rewardIds[index]); - this->m_rewards[index]->SendMsg(this, 0x66, 0, 0, 0, 0); + this->m_rewards[index]->SendMsg(this, UM_SETID, 0, 0, 0, 0); } this->m_rewards[6] = new UIRuneSetReWard(); @@ -1973,12 +1974,12 @@ void UIRuneSet_Info::OnCreate(int, int) { this->m_rewards[6]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_l_pressed.tga", 2, 0); this->m_rewards[6]->SetBitmap("유저인터페이스\\runesystem\\bt_reward_l_disabled.tga", 3, 0); this->m_rewards[6]->SetSize(this->m_rewards[6]->BitmapWidth(), this->m_rewards[6]->BitmapHeight()); - this->m_rewards[6]->SendMsg(this, 0x22, 0, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_empty.tga"), 0, 0); - this->m_rewards[6]->SendMsg(this, 0x22, 1, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_complete.tga"), 0, 0); - this->m_rewards[6]->SendMsg(this, 0x22, 2, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_disabled_mouseon.tga"), 0, 0); + this->m_rewards[6]->SendMsg(this, UM_SETINFO, 0, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_empty.tga"), 0, 0); + this->m_rewards[6]->SendMsg(this, UM_SETINFO, 1, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_complete.tga"), 0, 0); + this->m_rewards[6]->SendMsg(this, UM_SETINFO, 2, reinterpret_cast("유저인터페이스\\runesystem\\bt_reward_l_disabled_mouseon.tga"), 0, 0); this->m_rewards[6]->Move(0x179, 0xCF); this->m_rewards[6]->SetId(0x254); - this->m_rewards[6]->SendMsg(this, 0x66, 0, 0, 0, 0); + this->m_rewards[6]->SendMsg(this, UM_SETID, 0, 0, 0, 0); this->Refresh(); } @@ -2200,8 +2201,8 @@ void UIRune_Decom::Paint() { int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 0xC9) { - g_windowMgr.CloseWindow(0x169); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_RUNESYSTEMWND); } break; case UM_SCROLLVERT: @@ -2213,7 +2214,7 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; case UM_TAB: - g_windowMgr.CloseWindow(0x16A); + g_windowMgr.CloseWindow(WID_RUNESYSTEM_DECOMRESULTWND); this->SelectTab(); break; case UM_REFRESH: { @@ -2226,17 +2227,17 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume switch (this->m_tab->geometry.unknown_0030) { case 0: this->m_equipRuneSet->Invalidate(); - this->m_runeSetInfo->SendMsg(this, 0x3C, 0, 0, 0, 0); - this->m_lists[0]->SendMsg(this, 0x3C, g_runeSystemMgr->GetTag(-1)->GetRuneCount(0), 0, 0, 0); + this->m_runeSetInfo->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); + this->m_lists[0]->SendMsg(this, UM_REFRESH, g_runeSystemMgr->GetTag(-1)->GetRuneCount(0), 0, 0, 0); break; case 1: - this->m_runeInfo->SendMsg(this, 0x3C, 0, 0, 0, 0); - this->m_lists[1]->SendMsg(this, 0x3C, g_runeSystemMgr->GetTag(-1)->GetRuneCount(1), 0, 0, 0); + this->m_runeInfo->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); + this->m_lists[1]->SendMsg(this, UM_REFRESH, g_runeSystemMgr->GetTag(-1)->GetRuneCount(1), 0, 0, 0); break; case 2: { const int count = g_runeSystemMgr->UpdateOwnedDecomItems(); if (this->m_lists[2]->total == count) { - this->m_runeDecom->SendMsg(this, 0x3C, 0, 0, 0, 0); + this->m_runeDecom->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); break; } @@ -2257,7 +2258,7 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Invalidate(); break; } - case 0x61: + case UM_TEXT_LBTN_DblClk: if (g_runeSystemMgr->GetCurrentRune(0, argument2)) { g_windowMgr.Confirm("보상을 지급 받으시겠습니까?", 2, false, false, 0, "Message", 280, 120, 0); } @@ -2314,22 +2315,22 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume for (int index = 0; index < 7; ++index) { RuneSetData* runeSet = info->m_runeSet; if (runeSet->m_reward.values[0] == 0) { - info->m_rewards[index]->SendMsg(info, 0x66, 0, 0, 0, 0); + info->m_rewards[index]->SendMsg(info, UM_SETID, 0, 0, 0, 0); runeSet = info->m_runeSet; } const int itemId = static_cast(runeSet->m_reward.values[index + 1]); if (index < runeSet->m_rewardStep) { - info->m_rewards[index]->SendMsg(info, 0x66, 3, itemId, 0, 0); + info->m_rewards[index]->SendMsg(info, UM_SETID, 3, itemId, 0, 0); } else if (index == 0) { - info->m_rewards[0]->SendMsg(info, 0x66, runeSet->IsActive() ? 2 : 1, itemId, 0, 0); + info->m_rewards[0]->SendMsg(info, UM_SETID, runeSet->IsActive() ? 2 : 1, itemId, 0, 0); } else if (index == 6) { - info->m_rewards[6]->SendMsg(info, 0x66, slotCount == activeCount ? 2 : 1, itemId, 0, 0); + info->m_rewards[6]->SendMsg(info, UM_SETID, slotCount == activeCount ? 2 : 1, itemId, 0, 0); } else { - info->m_rewards[index]->SendMsg(info, 0x66, index < activeCount ? 2 : 1, itemId, 0, 0); + info->m_rewards[index]->SendMsg(info, UM_SETID, index < activeCount ? 2 : 1, itemId, 0, 0); } } - info->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + info->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); this->m_runeSetInfo->Invalidate(); break; } @@ -2378,7 +2379,7 @@ int UIRuneSystemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } break; - case 0xB2: + case UM_RUNE_REWARD_EFFECT: if (argument1 == 0xE0) { const vector3d positions[7] = {{712.0f, 144.0f, 0.0f}, {799.0f, 169.0f, 0.0f}, {853.0f, 244.0f, 0.0f}, {853.0f, 337.0f, 0.0f}, {799.0f, 412.0f, 0.0f}, {711.0f, 438.0f, 0.0f}, {712.0f, 290.0f, 0.0f}}; diff --git a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp index bcfbe4b19..512962467 100644 --- a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp +++ b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp @@ -1,4 +1,6 @@ #include "UI/SelectPackageItemBox/SelectPackageItemBox.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" @@ -598,7 +600,7 @@ void CUISelectPackageItemBox::OnCancel() { // OFFSET: 0x00A6FBD0 // FUNCTION: fn_45494 void CUISelectPackageItemBox::OnClickClose() { - g_windowMgr.CloseWindow(0x2731); + g_windowMgr.CloseWindow(WID_SELECTPACKAGEITEMBOX); } // OFFSET: 0x00A6FBE0 @@ -620,7 +622,7 @@ void CUISelectPackageItemBox::OnOk() { const int result = g_windowMgr .Confirm(FormatOwnedString(LookupMessage(3975), it->name.c_str()).c_str(), 2, true, false, 0, "Message", 280, 120, 0); if (result == 187) { - g_modeMgr.GetGameMode()->SendMsg(325, this->sourceIndex, this->packageId, index, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_USE_PACKAGEITEM, this->sourceIndex, this->packageId, index, 0); } } @@ -636,7 +638,7 @@ __declspec(noinline) void CUIListBoxExbuyingShop != 0) { if (g_windowMgr.unknown_0308 == 0) { - mode->SendMsg(272, this->ownerAid, 0, 0, 0); + mode->SendMsg(MM_REQ_CLICK_TO_BUYING_STORE, this->ownerAid, 0, 0, 0); } } else if (g_windowMgr.unknown_0418 == 0) { - mode->SendMsg(84, this->ownerAid, 0, 0, 0); + mode->SendMsg(MM_REQ_BUY_FROMMC, this->ownerAid, 0, 0, 0); } } @@ -61,10 +63,10 @@ void UIMerchantShopTitle::OnLBtnDblClk(int, int) { CMode* mode = g_modeMgr.GetGameMode(); if (this->buyingShop != 0) { if (g_windowMgr.unknown_0308 == 0) { - mode->SendMsg(272, this->ownerAid, 0, 0, 0); + mode->SendMsg(MM_REQ_CLICK_TO_BUYING_STORE, this->ownerAid, 0, 0, 0); } } else if (g_windowMgr.unknown_0418 == 0) { - mode->SendMsg(84, this->ownerAid, 0, 0, 0); + mode->SendMsg(MM_REQ_BUY_FROMMC, this->ownerAid, 0, 0, 0); } } @@ -82,7 +84,7 @@ void UIMerchantShopTitle::ResetCursor(int x, int y) { // FUNCTION: fn_10886 void UIMerchantShopTitle::OnRBtnDown(int, int) { if (g_serviceOptions.Get(167)) { - g_modeMgr.gameMode->SendMsg(245, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_RELEASE_QUEST_SH, 0, 0, 0, 0); g_session.unknown_1760.clear(); g_session.unknown_1748.clear(); } @@ -97,14 +99,14 @@ UIMerchantShopTitle::UIMerchantShopTitle(int buyingShop) : UIWindow(0), buyingSh // OFFSET: 0x00864DB0 // FUNCTION: fn_10918 int UIMerchantShopTitle::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { return 0; } - if (message == 28) { + if (message == UM_SETNAID) { this->ownerAid = a; return 0; } - if (message != 34) { + if (message != UM_SETINFO) { return UIWindow::SendMsg(sender, message, a, b, c, d); } diff --git a/Source/UI/Shortcuts/NormalItemSlotLoad.cpp b/Source/UI/Shortcuts/NormalItemSlotLoad.cpp index ffec9cf7a..d258a62aa 100644 --- a/Source/UI/Shortcuts/NormalItemSlotLoad.cpp +++ b/Source/UI/Shortcuts/NormalItemSlotLoad.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/UserData/CharacterLinkedUserDataMgr.h" #include "UI/Window/UIWindowMgr.h" @@ -54,7 +56,7 @@ void CCharacterLinkedUserDataMgr::LoadNormalItemSlots(Json::Value& data) { Json::Value& active = data["ItemSlotActive"]; itemSlotActive = active.isNull() ? true : active.asBool(); - UIWindow* window = g_windowMgr.LookupWindow(36); + UIWindow* window = g_windowMgr.LookupWindow(WID_SHORTCUTWND); if (!window) { return; @@ -66,6 +68,6 @@ void CCharacterLinkedUserDataMgr::LoadNormalItemSlots(Json::Value& data) { window->geometry.height = saved.height; g_windowMgr.ShowShortcutWindow(saved.show); - window->SendMsg(nullptr, 34, reinterpret_cast(&saved), 0, 0, 0); - window->SendMsg(nullptr, 6, itemSlotActive ? 588 : 589, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&saved), 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, itemSlotActive ? 588 : 589, 0, 0, 0); } diff --git a/Source/UI/Shortcuts/ShortcutActivation.cpp b/Source/UI/Shortcuts/ShortcutActivation.cpp index e69020cee..708860b83 100644 --- a/Source/UI/Shortcuts/ShortcutActivation.cpp +++ b/Source/UI/Shortcuts/ShortcutActivation.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/Skills/AutomaticSkills.h" #include "UI/Shortcuts/ShortcutActivation.h" @@ -25,5 +26,5 @@ void UIShortCutWnd::OnLBtnDblClk(int x, int y) { g_session.m_automaticSkills.DisableAll(); } - this->SendMsg(nullptr, 41, column, g_session.m_hotkeyPage, 0, 0); + this->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, column, g_session.m_hotkeyPage, 0, 0); } diff --git a/Source/UI/Shortcuts/ShortcutBindings.cpp b/Source/UI/Shortcuts/ShortcutBindings.cpp index e35da4c25..ebae349c6 100644 --- a/Source/UI/Shortcuts/ShortcutBindings.cpp +++ b/Source/UI/Shortcuts/ShortcutBindings.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" #include "Contents/Skills/SkillInfo.h" @@ -51,7 +52,7 @@ void CSession::AssignShortcut(unsigned char type, std::uint32_t id, int level, i this->m_secondaryShortcutSlots[destination] = {}; } - modeEvents->SendMsg(313, destination, bank, 0, 0); + modeEvents->SendMsg(MM_SHORTCUT_KEY_CHANGE, destination, bank, 0, 0); return; } @@ -91,7 +92,7 @@ void CSession::AssignShortcut(unsigned char type, std::uint32_t id, int level, i } else if (bank == 1) { this->m_secondaryShortcutSlots[index] = {}; } - modeEvents->SendMsg(313, index, bank, 0, 0); + modeEvents->SendMsg(MM_SHORTCUT_KEY_CHANGE, index, bank, 0, 0); } if (bank == 0) { @@ -104,7 +105,7 @@ void CSession::AssignShortcut(unsigned char type, std::uint32_t id, int level, i this->m_secondaryShortcutSlots[destination].itemId = id; } - modeEvents->SendMsg(313, destination, bank, 0, 0); + modeEvents->SendMsg(MM_SHORTCUT_KEY_CHANGE, destination, bank, 0, 0); } // OFFSET: 0x00E492D0 diff --git a/Source/UI/Shortcuts/ShortcutControls.cpp b/Source/UI/Shortcuts/ShortcutControls.cpp index 77c28d6f0..72cf265be 100644 --- a/Source/UI/Shortcuts/ShortcutControls.cpp +++ b/Source/UI/Shortcuts/ShortcutControls.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "Client/Session.h" #include "UI/Shortcuts/UIShortCutWnd.h" @@ -80,5 +81,5 @@ void UIShortCutWnd::OnCreate(int, int) { this->m_hideItems->Enable(1); this->AddChild(this->m_hideItems); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index 9151950ad..0c01849d0 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -1,4 +1,7 @@ #include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UINewSelectCharWnd.h" #include "Client/Session.h" #include "Contents/UserData/NormalItemSlots.h" @@ -478,7 +481,7 @@ void UIQuickSlotWnd::OnLBtnDblClk(int x, int y) { automatic.DisableAll(); } - this->SendMsg(nullptr, 41, slot, 0, 0, 0); + this->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, slot, 0, 0, 0); } // OFFSET: 0x00932E80 @@ -559,7 +562,7 @@ int UISeekPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen case ID_CLOSE: { std::int16_t packetType = 0x806; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packetType), &packetType); - g_windowMgr.CloseWindow(170); + g_windowMgr.CloseWindow(WID_JOBLISTWND); break; } case ID_MINI: @@ -574,9 +577,9 @@ int UISeekPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->m_rewriteButton->Move(this->geometry.width - 92, this->geometry.height - 24); this->Invalidate(); break; - case 284: - g_windowMgr.EnsureWindow(170); - if (auto* jobs = static_cast(g_windowMgr.LookupWindow(170))) { + case ID_CHARGE: + g_windowMgr.EnsureWindow(WID_JOBLISTWND); + if (auto* jobs = static_cast(g_windowMgr.LookupWindow(WID_JOBLISTWND))) { jobs->RefreshJobs(); } break; @@ -588,8 +591,8 @@ int UISeekPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->m_saved->Reset(); } this->Move(this->m_saved->x, this->m_saved->y); - this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->m_saved->width, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; } @@ -674,7 +677,7 @@ void UISelCharForUServerWnd::Paint() { int offsetX = 0; int offsetY = 0; if (g_session.IsDoramJob(slot.job) == true) { - const auto* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + const auto* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); int x = 0; int y = 0; int item = 0; diff --git a/Source/UI/Shortcuts/ShortcutDetails.cpp b/Source/UI/Shortcuts/ShortcutDetails.cpp index cc094c386..0f6e9f409 100644 --- a/Source/UI/Shortcuts/ShortcutDetails.cpp +++ b/Source/UI/Shortcuts/ShortcutDetails.cpp @@ -1,4 +1,6 @@ #include "Client/Session.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Shortcuts/UIShortCutWnd.h" #include "UI/Skill/UISkillDescribeWnd.h" #include "Render/DX7/RenderSystemDX7.h" @@ -41,8 +43,8 @@ void UIShortCutWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = LookupClientItem(g_session.m_inventoryItems, static_cast(slot->itemId), 1); if (item.unknown_0000[1] != 0) { - UIWindow* detail = g_windowMgr.EnsureWindow(12); - detail->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + UIWindow* detail = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + detail->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } return; @@ -54,13 +56,13 @@ void UIShortCutWnd::OnRBtnDown(int x, int y) { return; } - UIWindow* detail = g_windowMgr.EnsureWindow(46); + UIWindow* detail = g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND); if (detail) { if (static_cast(static_cast(detail)->m_skillId) == skill.id) { - g_windowMgr.CloseWindow(46); + g_windowMgr.CloseWindow(WID_SKILLDESCRIBEWND); } else { - detail->SendMsg(nullptr, 61, skill.id, 0, 0, 0); + detail->SendMsg(nullptr, UM_SKILLDESCRIBE, skill.id, 0, 0, 0); } } diff --git a/Source/UI/Shortcuts/ShortcutDrop.cpp b/Source/UI/Shortcuts/ShortcutDrop.cpp index fb2f1893a..515168c58 100644 --- a/Source/UI/Shortcuts/ShortcutDrop.cpp +++ b/Source/UI/Shortcuts/ShortcutDrop.cpp @@ -1,4 +1,6 @@ #include "Contents/Items/ItemType.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/ModeDragState.h" @@ -17,7 +19,7 @@ namespace { // INLINED __forceinline void Refresh(UIWindow& window) { - window.SendMsg(nullptr, 23, 0, 0, 0, 0); + window.SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); window.Invalidate(); } @@ -64,20 +66,20 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { if (column != -1) { if (9 * g_session.m_hotkeyPage + column == value.slot) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } CSkillInfo skill = g_session.LookupSkill(id); const int index = 9 * g_session.m_hotkeyPage + column; if (skill.level == 0 && skill.available == 0) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (grid.rows <= g_session.m_hotkeyPage) { if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } return; @@ -123,18 +125,18 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { Refresh(window); } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (value.source == 6 || value.source == 9) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, value.id); if (item.unknown_0000[1] == 0 || item.identified == 0) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } @@ -152,7 +154,7 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } return; @@ -185,7 +187,7 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { const int index = 9 * g_session.m_hotkeyPage + column; if (grid.rows <= g_session.m_hotkeyPage) { if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } return; @@ -203,7 +205,7 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } namespace { @@ -256,7 +258,7 @@ void UIQuickSlotWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Invalidate(); } } else if (value.slot != -1) { @@ -271,7 +273,7 @@ void UIQuickSlotWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } g_session.SetHotkeyEntry(1, 0, 0, value.slot); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Invalidate(); } } else if (value.source != 6 && value.source != 9) { @@ -301,7 +303,7 @@ void UIQuickSlotWnd::DragAndDrop(int x, int y, std::intptr_t argument) { if (slot != -1) { g_session.SetHotkeyEntry(0, item.GetItemId(), 0, slot); RemoveAlternate(g_session.m_requestTimers, value.slot, slot); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Invalidate(); } @@ -311,6 +313,6 @@ void UIQuickSlotWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } } - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } diff --git a/Source/UI/Shortcuts/ShortcutVisibility.cpp b/Source/UI/Shortcuts/ShortcutVisibility.cpp index f589ef48b..e2e2ae319 100644 --- a/Source/UI/Shortcuts/ShortcutVisibility.cpp +++ b/Source/UI/Shortcuts/ShortcutVisibility.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Client/Replay.h" #include "UI/Window/WindowId.h" #include "Contents/Configuration/ServiceOptions.h" @@ -10,8 +11,8 @@ namespace { // INLINED __forceinline void PromoteWindow(UIWindow* window) { - if ((g_windowMgr.modal != nullptr && g_windowMgr.window_4F174 != window) || g_windowMgr.LookupWindow(278) || g_windowMgr.LookupWindow(4) || - g_windowMgr.LookupWindow(199) || g_windowMgr.LookupWindow(200)) { + if ((g_windowMgr.modal != nullptr && g_windowMgr.window_4F174 != window) || g_windowMgr.LookupWindow(WID_NEWMAKECHARWND) || g_windowMgr.LookupWindow(WID_MAKECHARWND) || + g_windowMgr.LookupWindow(WID_SECONDPASSWORDINPUTWND) || g_windowMgr.LookupWindow(WID_SECONDPASSWORDEDITWND)) { return; } @@ -53,7 +54,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { this->unknown_003C = visible; if (!this->window_01C8) { - g_windowMgr.EnsureWindow(1); + g_windowMgr.EnsureWindow(WID_CHATWND); } this->window_01C8->Show(visible); @@ -69,7 +70,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { } case WID_ITEMDROPCNTWND: - g_windowMgr.EnsureWindow(15); + g_windowMgr.EnsureWindow(WID_ITEMDROPCNTWND); if (this->window_01EC->geometry.visible != visible) { this->window_01EC->Show(visible); @@ -87,7 +88,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { } this->m_normalItemSlotWindow.show = visible; - g_windowMgr.EnsureWindow(36); + g_windowMgr.EnsureWindow(WID_SHORTCUTWND); this->window_01E8->Show(visible); if (visible != 0) { @@ -95,10 +96,10 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { } if (g_serviceOptions.Get(0x10E)) { - g_windowMgr.EnsureWindow(159); + g_windowMgr.EnsureWindow(WID_QUIKSLOTWND); } - if (UIWindow* companion = g_windowMgr.LookupWindow(159)) { + if (UIWindow* companion = g_windowMgr.LookupWindow(WID_QUIKSLOTWND)) { companion->Show(visible); if (visible != 0) { @@ -116,7 +117,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return true; } - g_windowMgr.EnsureWindow(46); + g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND); if (!this->window_0230) { return true; @@ -136,7 +137,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { } case WID_MINIMAPWND: - g_windowMgr.LookupWindow(273)->Show(visible); + g_windowMgr.LookupWindow(WID_MINIMAPWND)->Show(visible); return true; case WID_ROUNDBOXTOOLTIPWND: @@ -147,7 +148,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return true; } - g_windowMgr.EnsureWindow(276); + g_windowMgr.EnsureWindow(WID_ROUNDBOXTOOLTIPWND); if (!this->window_4F1E4) { return true; diff --git a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp index e284fea7a..f0401681e 100644 --- a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp +++ b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Shortcuts/UIQuickSlotWnd.h" #include "UI/Window/UIEnums.h" @@ -140,12 +142,12 @@ void UIQuickSlotWnd::OnRBtnDown(int x, int y) { const QuickSlotEntry entry = this->m_entries[index]; if (entry.skill) { WindowManagerWindows& windows = g_windowMgr; - UIWindow* detail = windows.EnsureWindow(46); + UIWindow* detail = windows.EnsureWindow(WID_SKILLDESCRIBEWND); if (detail) { if (*reinterpret_cast(reinterpret_cast(detail) + 0x104) == entry.id) { - windows.CloseWindow(46); + windows.CloseWindow(WID_SKILLDESCRIBEWND); } else { - detail->SendMsg(nullptr, 61, entry.id, 0, 0, 0); + detail->SendMsg(nullptr, UM_SKILLDESCRIBE, entry.id, 0, 0, 0); } } @@ -167,8 +169,8 @@ void UIQuickSlotWnd::OnRBtnDown(int x, int y) { } else if (entry.id != 0) { ITEM_INFO item = LookupClientItem(g_session.m_inventoryItems, static_cast(entry.id), 1); if (item.unknown_0000[1] > 0) { - UIWindow* detail = g_windowMgr.EnsureWindow(12); - detail->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + UIWindow* detail = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + detail->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -247,7 +249,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (!this->m_saved->IsValid()) { this->m_saved->Reset(); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Move(this->m_saved->x, this->m_saved->y); return 0; @@ -262,31 +264,31 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen if (item.unknown_0000[1] != 0) { CMode* mode = g_modeMgr.GetGameMode(); switch (item.unknown_0000[0]) { - case 0: - case 1: - case 2: - mode->SendMsg(0x1B, item.unknown_0000[1], 0, 0, 0); + case UM_DEFPUSH: + case UM_CANCELPUSH: + case UM_TOGGLEPUSH: + mode->SendMsg(MM_USEITEM, item.unknown_0000[1], 0, 0, 0); break; - case 10: - case 16: - case 17: - case 19: + case UM_SCROLLVERTPAGEDOWN: + case UM_OPENCHATWND: + case UM_LOADINGPERCENT: + case UM_DOWNPUSH: if (item.unknown_0000[3] == 0x8000) { - mode->SendMsg(0x14, 0xF, 0, 0, 0); - mode->SendMsg(0x57, item.unknown_0000[1], item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_TAKE_OFF_EQUIP, 0xF, 0, 0, 0); + mode->SendMsg(MM_WEAR_EQUIP_ARROW, item.unknown_0000[1], item.unknown_0000[2], 0, 0); } break; - case 18: + case UM_UPPUSH: if (*reinterpret_cast(&g_session.unknown_16F4[4]) >= 0) { const std::string text = FormatOwnedString(LookupMessage(0x4CA), item.DisplayName(0).c_str()); if (g_windowMgr.Confirm(text.c_str(), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - mode->SendMsg(0x1B, item.unknown_0000[1], 0, 0, 0); + mode->SendMsg(MM_USEITEM, item.unknown_0000[1], 0, 0, 0); } } break; default: if (item.unknown_0000[2] != 0 && item.unknown_0000[3] == 0 && item.identified != 0) { - mode->SendMsg(0x13, item.unknown_0000[1], item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_EQUIP, item.unknown_0000[1], item.unknown_0000[2], 0, 0); } break; } @@ -296,7 +298,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen CSkillInfo skill = g_session.LookupSkill(entry.id); if (skill.level != 0 && skill.available != 0) { - g_modeMgr.gameMode->SendMsg(0x71, reinterpret_cast(&skill), entry.count, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_USING_SKILL, reinterpret_cast(&skill), entry.count, 0, 0); } return 0; } diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index de4e00db6..fc2b28e54 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -1,4 +1,7 @@ #include "Contents/Items/ItemType.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Client/Input/Mouse.h" @@ -129,7 +132,7 @@ void UIShortCutWnd::Show(int visible) { this->geometry.visible = visible; if (visible) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Invalidate(); g_windowMgr.StoreSnapRectangle(this); } else { @@ -164,26 +167,26 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { --this->m_grid.rows; } - this->SendMsg(nullptr, 14, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 0, 0, 0, 0); return; case ID_PLUS: if (this->geometry.visible == 0) { - g_windowMgr.ShowWindowById(36, 1); + g_windowMgr.ShowWindowById(WID_SHORTCUTWND, 1); return; } ++this->m_grid.rows; if (this->m_grid.rows > 4) { this->m_grid.rows = 1; - g_windowMgr.ShowWindowById(36, 0); + g_windowMgr.ShowWindowById(WID_SHORTCUTWND, 0); } - this->SendMsg(nullptr, 14, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 0, 0, 0, 0); return; case ID_CLOSE: - g_windowMgr.ShowWindowById(36, 0); + g_windowMgr.ShowWindowById(WID_SHORTCUTWND, 0); return; case 549: { @@ -196,7 +199,7 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { record.main.clear(); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return; } @@ -208,7 +211,7 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { this->m_hideItems->Enable(0); this->m_hideItems->SetDisabled(1); this->m_hideItems->Invalidate(); - this->SendMsg(nullptr, 14, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 0, 0, 0, 0); return; case 588: @@ -219,7 +222,7 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { this->m_hideItems->Enable(1); this->m_hideItems->SetDisabled(0); this->m_hideItems->Invalidate(); - this->SendMsg(nullptr, 14, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 0, 0, 0, 0); return; default: @@ -322,7 +325,7 @@ __forceinline void UIShortCutWnd::RestoreLayout(NormalItemSlotWindow* value) { this->m_grid.rows = height / 33; this->PlaceRowButtons(); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->Move(this->m_saved->x, this->m_saved->y); } @@ -341,7 +344,7 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { level = (std::min)(static_cast(slot.unknown_0005), skill.level); } - mode->SendMsg(113, reinterpret_cast(&skill), level, 0, 0); + mode->SendMsg(MM_USING_SKILL, reinterpret_cast(&skill), level, 0, 0); } return; @@ -358,7 +361,7 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { case TYPE_SCHANGE: case TYPE_SPECIAL: if (item.GetItemId() != 12802 || g_windowMgr.Confirm(LookupMessage(2373), 2, false, false, 0, "Message", 280, 120, 0) != 188) { - mode->SendMsg(27, item.unknown_0000[1], 0, 0, 0); + mode->SendMsg(MM_USEITEM, item.unknown_0000[1], 0, 0, 0); } break; @@ -368,7 +371,7 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { const int result = g_windowMgr.Confirm(FormatOwnedString(LookupMessage(1226), item.DisplayName(0).c_str()).c_str(), 2, false, false, 0, "Message", 280, 120, 0); if (result == 187) { - mode->SendMsg(27, item.unknown_0000[1], 0, 0, 0); + mode->SendMsg(MM_USEITEM, item.unknown_0000[1], 0, 0, 0); } } @@ -379,14 +382,14 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { case TYPE_THROWWEAPON: case 19: if (item.unknown_0000[3] == 0x8000) { - mode->SendMsg(87, item.unknown_0000[1], item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_EQUIP_ARROW, item.unknown_0000[1], item.unknown_0000[2], 0, 0); } break; default: if (item.unknown_0000[2] != 0 && item.unknown_0000[3] == 0 && item.identified != 0) { - mode->SendMsg(19, item.unknown_0000[1], item.unknown_0000[2], 0, 0); + mode->SendMsg(MM_WEAR_EQUIP, item.unknown_0000[1], item.unknown_0000[2], 0, 0); } break; @@ -466,9 +469,9 @@ int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->ResizeRows(); return 0; - case 143: + case UM_ROTATE_SHORTCUT_ROWS: if (RotateCooldownRows(g_session.m_requestTimers, static_cast(a), static_cast(b), g_session.unknown_06FC, g_session.unknown_06A8)) { - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } return 0; @@ -496,7 +499,7 @@ void UINewChatWnd::Move(int x, int y) { this->m_inputY = this->m_inputOffsetY + screenY; if (UIWindow* window = reinterpret_cast(g_windowMgr.unknown_03F0)) { - window->SendMsg(this, 6, 197, this->geometry.width + x, this->geometry.height + y, 0); + window->SendMsg(this, UM_COMMAND, ID_DIALOG, this->geometry.width + x, this->geometry.height + y, 0); } } @@ -683,24 +686,24 @@ void UIRoMapWnd::OnLBtnUp(int x, int y) { if (!this->unknown_01FC.empty()) { if (g_windowMgr.unknown_0214 != 0) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } if (!this->unknown_01FC.empty()) { - UIWindow* menu = g_windowMgr.EnsureWindow(26); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); int width = 0; for (std::vector::iterator name = this->unknown_01FC.begin(); name != this->unknown_01FC.end(); ++name) { const int textWidth = this->TextWidth(name->c_str(), 0, 0, 14, 0, 0); if (width < textWidth) { width = textWidth; } - menu->SendMsg(nullptr, 31, reinterpret_cast(name->c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(name->c_str()), 0, 0, 0); } const int height = static_cast((std::min)(this->unknown_01FC.size() * 16, 160u)); - menu->SendMsg(nullptr, 40, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); menu->Resize(width, height); - menu->SendMsg(nullptr, 83, 140, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 140, 0, 0, 0); const int menuY = this->geometry.height - (y + 1) - height >= 0 ? y + 1 : this->geometry.height - height; const int menuX = this->geometry.width - (x + 2) - width >= 0 ? x + 2 : this->geometry.width - width; @@ -868,12 +871,12 @@ void UISubChatMiniWnd::OnCreate(int, int) { // OFFSET: 0x0093CA50 // FUNCTION: fn_12762 int UISubChatMiniWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d); } switch (a) { - case 197: + case ID_DIALOG: this->Move(b, c - this->m_offsetY); break; case ID_MINI: @@ -886,7 +889,7 @@ int UISubChatMiniWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // OFFSET: 0x0093CAB0 // FUNCTION: fn_12763 int UIWindowCallBtnWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 6) { + if (message == UM_COMMAND) { g_windowMgr.EnsureWindow(a); } return 0; @@ -917,7 +920,7 @@ void UISubChatMiniWnd::OnLBtnDown(int x, int) { } else { g_subChatMiniSecondCollapsed = !g_subChatMiniSecondCollapsed; } - this->SendMsg(this, 6, 271, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_APPLY, 0, 0, 0); this->Invalidate(); } @@ -958,8 +961,8 @@ void UINewChatWnd::SaveChatLogs() { if ((*tab)->SaveChatLog(path)) { std::string message(path); message += " is Saved."; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); } } } @@ -977,8 +980,8 @@ void UINewChatWnd::SaveChatLogs() { if (window->ChatBox()->SaveChatLog(path)) { std::string message(path); message += " is Saved."; - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); } } } @@ -998,8 +1001,8 @@ void UINewChatWnd::RefreshTabs(bool arrange) { } } - if (UIWindow* window = g_windowMgr.LookupWindow(132)) { - window->SendMsg(this, 6, 193, this->m_currentTab, 1, 2); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_currentTab, 1, 2); } this->m_tabControl->Invalidate(); @@ -1032,13 +1035,13 @@ void UIMemorialDunWnd::ArrangeButtons() { int UIMemorialDunWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_DEFPUSH: { - this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, this->m_message0, 0, 0, 0); return 0; } case UM_COMMAND: { switch (argument1) { case ID_OK: - g_windowMgr.CloseWindow(137); + g_windowMgr.CloseWindow(WID_MEMORIALDUNWND); return 0; case ID_CANCEL: { MemorialDungeonCommandPacket packet; @@ -1059,7 +1062,7 @@ int UIMemorialDunWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; case ID_DELETE: if (g_session.unknown_5464 != 0) { - g_modeMgr.GetGameMode()->SendMsg(0x132, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_MEMORIALDUNGEON_COMMAND, 0, 0, 0, 0); } return 0; } @@ -1112,7 +1115,7 @@ bool UINavigationWnd::LoadRoute(int index) { } this->FillRouteList(); - this->SendMsg(this, 6, 190, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_BUTTON2, 0, 0, 0); return true; } @@ -1216,33 +1219,33 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume rectangle.right = span + 0x32; rectangle.bottom = this->m_inputHeight + 10; this->FillSurface(0xFFFF00FF, &rectangle); - if (UIWindow* window = g_windowMgr.LookupWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_index, 0, 2); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_index, 0, 2); } return 0; } if (ChatWindow() != nullptr) { - ChatWindow()->SendMsg(this, 0, 0, 0, 0, 0); + ChatWindow()->SendMsg(this, UM_DEFPUSH, 0, 0, 0, 0); return 0; } return 0; case UM_PAGEUPPUSH: if (this->m_chatBox->verticalOverflow != 0) { - this->m_chatBox->SendMsg(nullptr, 9, 0, 0, 0, 0); + this->m_chatBox->SendMsg(nullptr, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); return 0; } return 0; case UM_PAGEDOWNPUSH: if (this->m_chatBox->verticalOverflow != 0) { - this->m_chatBox->SendMsg(nullptr, 10, 0, 0, 0, 0); + this->m_chatBox->SendMsg(nullptr, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); return 0; } return 0; case UM_COMMAND: switch (argument1) { case ID_OPTION: - if (UIWindow* window = g_windowMgr.EnsureWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_index, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_index, 0, 0); return 0; } return 0; @@ -1264,8 +1267,8 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } g_windowMgr.ReleaseRetainedWindow(this->m_index); - if (UIWindow* window = g_windowMgr.LookupWindow(0x84)) { - window->SendMsg(this, 6, 0xC1, this->m_index, 0, 1); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BATTLEMSGOPTIONWND)) { + window->SendMsg(this, UM_COMMAND, ID_OPTION, this->m_index, 0, 1); } std::map& retained = g_windowMgr.retainedWindows; if (this->m_index != static_cast(retained.size())) { @@ -1285,7 +1288,7 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; case ID_STICK_ON: if (ChatWindow() != nullptr) { - ChatWindow()->SendMsg(this, 0x76, 0, 0, 0, 0); + ChatWindow()->SendMsg(this, UM_ATTACH_CHAT_TAB, 0, 0, 0, 0); return 0; } return 0; diff --git a/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp b/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp index 4e4684d4e..0c013b0b3 100644 --- a/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp +++ b/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/SkillDelayInfo/SkillDelayInfo.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -454,7 +456,7 @@ void CUISkillDelayInfo::OnButtonClick() { // OFFSET: 0x00A77B00 // FUNCTION: fn_45472 void CUISkillDelayInfo::OnClose() { - g_windowMgr.CloseWindow(0x272E); + g_windowMgr.CloseWindow(WID_SKILLDELAYINFO); } // OFFSET: 0x00A77B10 @@ -518,7 +520,7 @@ void CUITime::SetTime(int milliseconds) { // OFFSET: 0x00A78190 // FUNCTION: fn_16888 int CUISkillDelayInfo::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 60) { + if (message != UM_REFRESH) { return CUIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (this->skillId != 7999) { @@ -683,7 +685,7 @@ void CUISkillDelayInfo::OnCreate(int width, int height) { CUIImageButton* closeButton = new CUIImageButton(); closeButton->SetSize(11, 11); closeButton->Move(331, 3); - closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(10030); }); + closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(WID_SKILLDELAYINFO); }); closeButton->disabled = 0; closeButton->Invalidate(); closeButton->SetImages( diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index e8ddfffd0..83937dd0c 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -1,4 +1,7 @@ #include "Client/Replay.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Window/WindowPolicy.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -138,7 +141,7 @@ void UI2ndCostumeCheckBox::OnLBtnDown(int x, int y) { // FUNCTION: fn_10355 void UISlotForSelectWnd::OnLBtnDown(int x, int y) { if (this->parent) { - this->parent->SendMsg(nullptr, 6, this->geometry.id, x, y, 0); + this->parent->SendMsg(nullptr, UM_COMMAND, this->geometry.id, x, y, 0); } } @@ -157,7 +160,7 @@ void UIStylingShopButton::OnLBtnUp(int, int) { if (id == 185 && g_modeMgr.gameMode && g_modeMgr.gameMode->cursorType == 2) { const char* text = LookupMessage(17); if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } } else { if (id == 184 || id == 321) { @@ -166,11 +169,11 @@ void UIStylingShopButton::OnLBtnUp(int, int) { parent = this->parent; } - parent->SendMsg(this, 6, id, this->m_argument, 0, 0); + parent->SendMsg(this, UM_COMMAND, id, this->m_argument, 0, 0); } } } else { - g_modeMgr.gameMode->SendMsg(0, this->geometry.id, this->m_argument, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, this->geometry.id, this->m_argument, 0, 0); } this->Invalidate(); @@ -224,17 +227,17 @@ void UIStylingShopWnd::OnProcess() { // OFFSET: 0x0082A330 // FUNCTION: fn_10360 void UIAccBitmapButton::OnRBtnUp(int, int) { - this->parent->SendMsg(this, 101, this->geometry.id, this->m_argument, 0, 0); + this->parent->SendMsg(this, UM_BMP_RBTN_UP, this->geometry.id, this->m_argument, 0, 0); } // OFFSET: 0x0082CCB0 // FUNCTION: fn_10366 int UI2ndCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - if (argument1 == 213) { + if (argument1 == ID_CHECK) { if (sender == this->m_showCheckBox) { if (this->m_display && this->m_hideCheckBox && this->m_showCheckBox->geometry.unknown_0030 != 0) { this->m_display->job = 1; @@ -259,7 +262,7 @@ int UI2ndCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume // OFFSET: 0x0082CD70 // FUNCTION: fn_10367 int UIAccessoryCusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -270,7 +273,7 @@ int UIAccessoryCusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu // OFFSET: 0x0082D100 // FUNCTION: fn_10369 int UIBasicStylingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -316,8 +319,8 @@ int UIBasicStylingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu // OFFSET: 0x0082D3A0 // FUNCTION: fn_10370 int UICostumeChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - UIWindow* preview = g_windowMgr.LookupWindow(281); - if (message != 6) { + UIWindow* preview = g_windowMgr.LookupWindow(WID_STYLINGSHOPWND); + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -364,18 +367,18 @@ int UICostumeChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg // OFFSET: 0x0082D980 // FUNCTION: fn_10372 int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { if (message != 121) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(281)); + UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)); if (this->m_slots[this->m_selectedSlot]) { UIDisplayCharacter* display = this->m_slots[this->m_selectedSlot]->m_display; for (std::map::iterator it = shop->m_tabs.begin(); it != shop->m_tabs.end(); ++it) { if (it->first->geometry.id == 496 && it->second->geometry.visible == 1) { shop->m_preview->CopyStyle(display); - shop->SendMsg(nullptr, 6, 200, 0, 0, 0); + shop->SendMsg(nullptr, UM_COMMAND, ID_BASE, 0, 0, 0); } } shop->Invalidate(); @@ -423,7 +426,7 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 case ID_LEFT: for (int i = 0; i < 2; ++i) { if (sender == this->unknown_009C[i] || sender == this->unknown_00A4[i]) { - this->m_slots[i]->m_display->SendMsg(nullptr, 6, argument1, 0, 0, 0); + this->m_slots[i]->m_display->SendMsg(nullptr, UM_COMMAND, argument1, 0, 0, 0); } } break; @@ -437,11 +440,11 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 // OFFSET: 0x0082DC60 // FUNCTION: fn_10373 int UIShowInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } - if (argument1 == 189) { + if (argument1 == ID_BUTTON1) { this->Invalidate(); } @@ -451,7 +454,7 @@ int UIShowInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // OFFSET: 0x0082DC90 // FUNCTION: fn_10374 int UISlotOfMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -579,7 +582,7 @@ __declspec(noinline) void UIStylingshopTabParentWnd::UpdateFavoriteButton(const return; } - UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(281)); + UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)); if (!shop) { return; } @@ -830,7 +833,7 @@ void UIShowInfoWnd::ArrangeCheckBoxes(const int& layout) { // OFFSET: 0x0082E500 // FUNCTION: fn_10378 __declspec(noinline) void ToggleStylingAccessory(int itemId, int slot) { - UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(281)); + UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)); UIStylingshopTabParentWnd* tab = nullptr; for (auto it = shop->m_tabs.begin(); it != shop->m_tabs.end(); ++it) { if (it->first->geometry.id == 497) { @@ -1097,8 +1100,8 @@ void UIShowInfoWnd::UpdateChangedStyles() { // OFFSET: 0x0082D550 // FUNCTION: fn_10371 int UIDisplayCharacter::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(281)); - if (message != 6) { + UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)); + if (message != UM_COMMAND) { return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -1341,10 +1344,10 @@ UIStylingShopWnd::UIStylingShopWnd() // FUNCTION: fn_10368 int UIAccessoryShowCase::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { char table[64]; - UIWindow* shop = g_windowMgr.LookupWindow(281); + UIWindow* shop = g_windowMgr.LookupWindow(WID_STYLINGSHOPWND); switch (message) { case UM_COMMAND: - if (argument1 == 189 && sender) { + if (argument1 == ID_BUTTON1 && sender) { UIAccBitmapButton* button = static_cast(sender); for (unsigned int i = 0; i < this->m_itemFrames.size(); ++i) { this->m_itemFrames[i]->SetBitmap(i == button->Argument() - 1 ? "유저인터페이스\\styleshop\\shadow_item_on.bmp" : "유저인터페이스\\styleshop\\shadow_item_off.bmp"); @@ -1395,9 +1398,9 @@ int UIAccessoryShowCase::SendMsg(UIWindow* sender, int message, std::intptr_t ar item.SetItemId(button->m_itemId); item.SetName(desc.identifiedName); item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } break; @@ -1414,7 +1417,7 @@ int UIAccessoryShowCase::SendMsg(UIWindow* sender, int message, std::intptr_t ar // OFFSET: 0x0082DCC0 // FUNCTION: fn_10375 int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -1429,7 +1432,7 @@ int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum for (it = this->m_tabs.begin(); it != this->m_tabs.end(); ++it) { if (it->second->geometry.visible == 1) { if (it->first->geometry.id != 496) { - static_cast(g_windowMgr.LookupWindow(281))->m_preview->CopyStyle(it->second->m_display); + static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND))->m_preview->CopyStyle(it->second->m_display); } break; } @@ -1456,7 +1459,7 @@ int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } break; case ID_CLOSE: - g_windowMgr.CloseWindow(281); + g_windowMgr.CloseWindow(WID_STYLINGSHOPWND); break; case ID_BUY: if (this->m_buyButton->Argument() == 0 && @@ -1791,7 +1794,7 @@ void UIShowInfoWnd::DrawPayments() { } } - UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(281)); + UIStylingShopWnd* shop = static_cast(g_windowMgr.LookupWindow(WID_STYLINGSHOPWND)); if (!shop) { return; } @@ -2447,7 +2450,7 @@ void UIBasicStylingWnd::OnCreate(int, int) { defaultButton->SetId(495); this->AddChild(defaultButton); this->m_defaultPaletteButton = defaultButton; - g_windowMgr.LookupWindow(281); + g_windowMgr.LookupWindow(WID_STYLINGSHOPWND); this->m_showInfo = new (std::nothrow) UIShowInfoWnd(); this->m_showInfo->SetSize(this->geometry.width - this->m_display->geometry.width, this->geometry.height); diff --git a/Source/UI/Text/NavigationLink.cpp b/Source/UI/Text/NavigationLink.cpp index 4cdbc88fc..cca5c1bf8 100644 --- a/Source/UI/Text/NavigationLink.cpp +++ b/Source/UI/Text/NavigationLink.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Text/NavigationLink.h" #include "Client/Mode/CMode.h" @@ -1214,9 +1216,9 @@ void ShowTextButtonItem(UITextButton* button) { item.unknown_0000[0] = static_cast(index); item.itemId = itemId; item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(0xC); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 0x18, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -1232,7 +1234,7 @@ void ShowTextButtonTip(UITextButton* button) { } const int tip = std::atoi(button->GetLine(0).c_str()); - UITipboxWnd* window = static_cast(g_windowMgr.EnsureWindow(0x13B)); + UITipboxWnd* window = static_cast(g_windowMgr.EnsureWindow(WID_TIPBOXWND)); if (window) { window->ShowTip(tip); } @@ -1703,9 +1705,9 @@ void UIItemImage::OnRBtnDown(int, int) { ITEM_INFO item; item.itemId = this->m_itemId; item.identified = 1; - UIWindow* window = g_windowMgr.EnsureWindow(0xC); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 0x18, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -1738,7 +1740,7 @@ bool NavigationLinkParser::HasUnownedItemLink(std::string text) { continue; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xE8D)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE8D)), 0xFF, 0, 0, 0); return true; } } diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index f87e83fac..c3aac7dfc 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -1,4 +1,5 @@ #include "Script/LuaScript.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" @@ -62,7 +63,7 @@ void UIAchListWnd::SelectAchievement(int index) { if (static_cast(index) < this->ids.size()) { id = this->ids[index]; } - this->parent->SendMsg(this, 135, id, 0, 0, 0); + this->parent->SendMsg(this, UM_LIST_SELECTION, id, 0, 0, 0); } this->Invalidate(); @@ -271,7 +272,7 @@ void UIAchUpperWnd::OnCreate(int, int) { *slot = new UIRadioBtn(); (*slot)->SetSize(12, 12); (*slot)->Move(150, y); - (*slot)->SendMsg(this, 13, index == this->selected, 0, 0, 0); + (*slot)->SendMsg(this, UM_SETSTATE, index == this->selected, 0, 0, 0); this->AddChild(*slot); ++index; ++slot; @@ -683,7 +684,7 @@ void UIToolTipBitmapWnd::OnRBtnDown(int x, int y) { ITEM_INFO item; item.SetItemId(this->itemId); item.identified = 1; - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -713,7 +714,7 @@ void UIAchievementWnd::SelectAchievement(int id) { list->scrollBar->SetPosition(list->unknown_008C); if (list->parent) { - list->parent->SendMsg(list, 135, static_cast(list->selectedIndex) < list->ids.size() ? list->ids[list->selectedIndex] : -1, 0, 0, 0); + list->parent->SendMsg(list, UM_LIST_SELECTION, static_cast(list->selectedIndex) < list->ids.size() ? list->ids[list->selectedIndex] : -1, 0, 0, 0); } list->Invalidate(); @@ -727,11 +728,11 @@ void UIAchListWnd::OnWheel(int delta) { } if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 3, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 3, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -3, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -3, 0, 0, 0); } // OFFSET: 0x007B7DD0 @@ -742,11 +743,11 @@ void UIAchTab::OnWheel(int delta) { } if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 1, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 1, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -1, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -1, 0, 0, 0); } // OFFSET: 0x007B7E10 @@ -839,7 +840,7 @@ void UIAchTab::Refresh() { // OFFSET: 0x007B8170 // FUNCTION: fn_09245 int UIAchSummaryWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 98 && argument1 != -1 && this->parent) { + if (message == UM_TEXT_LBTN_UP && argument1 != -1 && this->parent) { static_cast(this->parent)->SelectAchievement(argument1); } @@ -860,10 +861,10 @@ int UIAchTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intp } const int previous = this->scrollPos; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->scrollPos = previous - this->visibleSubs + 1; } else { - if (message == 10) { + if (message == UM_SCROLLVERTPAGEDOWN) { argument1 = this->visibleSubs - 1; } this->scrollPos = previous + argument1; @@ -880,17 +881,17 @@ int UIAchTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intp // OFFSET: 0x007B8230 // FUNCTION: fn_09247 int UIAchUpperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 6 && argument1 == 215) { + if (message == UM_COMMAND && argument1 == ID_RADIOBTN) { for (int index = 0; index < 2; ++index) { this->buttons[index]->Invalidate(); if (sender == this->buttons[index]) { - this->buttons[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->buttons[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->selected = index; if (this->parent) { - this->parent->SendMsg(this, 22, -1, -1, 0, 0); + this->parent->SendMsg(this, UM_TAB, -1, -1, 0, 0); } } else { - this->buttons[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->buttons[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } } @@ -911,7 +912,7 @@ int UIAchViewWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.packetType), &packet); } break; - case 145: + case UM_SELECT_ACHIEVEMENT: if (argument1 != -1 && this->parent) { static_cast(this->parent)->SelectAchievement(argument1); return 0; @@ -966,7 +967,7 @@ void UIAchListWnd::SetAchievements(std::map* achievements, this->UpdateScroll(); this->selectedIndex = 0; if (this->parent) { - this->parent->SendMsg(this, 135, this->ids.empty() ? -1 : this->ids[0], 0, 0, 0); + this->parent->SendMsg(this, UM_LIST_SELECTION, this->ids.empty() ? -1 : this->ids[0], 0, 0, 0); } this->Invalidate(); @@ -1023,7 +1024,7 @@ void UIAchievementWnd::SelectTab(int group, int sub) { this->list->SetAchievements(&this->achievements, this->upper->selected); } - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x007B8FA0 @@ -1158,7 +1159,7 @@ int UIAchTracingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume break; } case 479: { - UIWindow* window = g_windowMgr.EnsureWindow(270); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ACHIEVEMENTWND); if (window) { static_cast(window)->SelectAchievement(argument2); this->Invalidate(); @@ -1244,7 +1245,7 @@ int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: switch (message) { case UM_COMMAND: if (g_session.ToggleTrackedAchievement(this->ids[this->unknown_008C + argument1])) { - UIWindow* window = g_windowMgr.EnsureWindow(271); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ACHTRACINGWND); if (window) { window->Invalidate(); } @@ -1254,10 +1255,10 @@ int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_008C; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_008C = previous - this->rowCount + 1; } else { - if (message == 10) { + if (message == UM_SCROLLVERTPAGEDOWN) { argument1 = this->rowCount - 1; } this->unknown_008C = previous + argument1; @@ -1281,8 +1282,8 @@ int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: int UIAchievementWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 201) { - g_windowMgr.CloseWindow(270); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_ACHIEVEMENTWND); this->Invalidate(); return 0; } @@ -1298,7 +1299,7 @@ int UIAchievementWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->Invalidate(); return 0; - case 135: { + case UM_LIST_SELECTION: { UIAchViewWnd* view = this->view; if (this->achievements.find(argument1) == this->achievements.end()) { view->achievementId = -1; @@ -1412,7 +1413,7 @@ void UIAchViewWnd::UpdateInfo() { if (this->info) { const SessionRecord6144 record = g_session.FindRecord6144(this->achievementId); - this->description->SendMsg(nullptr, 29, reinterpret_cast(this->info->unknown_0030.c_str()), 50, 0, 0); + this->description->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->info->unknown_0030.c_str()), 50, 0, 0); const bool hasReward = this->info->unknown_0054 > 0 || this->info->unknown_0050 > 0 || this->info->unknown_004C > 0; if (hasReward && record.unknown_0030 == 0) { @@ -1434,13 +1435,13 @@ void UIAchViewWnd::UpdateInfo() { const int progress = record.unknown_0004[index]; const int target = this->info->rewards[index].unknown_0018; const std::string text = FormatOwnedString("%s ( %d / %d )", this->info->rewards[index].text.c_str(), progress, target); - condition->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 56, 0, 0); + condition->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 56, 0, 0); this->gauges[index]->Show(1); this->gauges[index]->value = progress; this->gauges[index]->maximum = target; this->gauges[index]->Invalidate(); } else { - condition->SendMsg(nullptr, 29, reinterpret_cast(this->info->rewards[index].text.c_str()), 56, 0, 0); + condition->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->info->rewards[index].text.c_str()), 56, 0, 0); this->gauges[index]->Show(0); } diff --git a/Source/UI/Text/UITagTextViewer.cpp b/Source/UI/Text/UITagTextViewer.cpp index 4336c809b..f5f94e2c3 100644 --- a/Source/UI/Text/UITagTextViewer.cpp +++ b/Source/UI/Text/UITagTextViewer.cpp @@ -86,9 +86,9 @@ void UITagTextViewer::OnProcess() { // FUNCTION: fn_10527 void TagTextViewer::UIScroll::OnWheel(int delta) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 10, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 9, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } } @@ -129,7 +129,7 @@ void UITagTextViewer::Resize(int width, int height) { UIWindow::Resize(width, height); this->m_scrollBar->Resize(this->m_scrollBar->geometry.width, height); this->m_scrollBar->Move(width - this->m_scrollBar->geometry.width, 0); - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x0083F1C0 @@ -139,19 +139,19 @@ int TagTextViewer::UIScroll::SendMsg( ) { switch (message) { case UM_UPPUSH: - this->SendMsg(this->m_scrollBar, 9, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); break; case UM_DOWNPUSH: - this->SendMsg(this->m_scrollBar, 10, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); break; case UM_SCROLLVERT: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollPos; int delta = argument1; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { delta = -10; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { delta = 10; } this->m_scrollPos = previous + delta; @@ -201,11 +201,11 @@ int UITagTextViewer::SendMsg( case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollPos; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_scrollPos = previous - 30; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_scrollPos = previous + 30; - } else if (message == 7) { + } else if (message == UM_SCROLLVERT) { this->m_scrollPos = previous + static_cast(argument1); } diff --git a/Source/UI/Text/UITextViewer.cpp b/Source/UI/Text/UITextViewer.cpp index c6c09ca1d..f83c4543c 100644 --- a/Source/UI/Text/UITextViewer.cpp +++ b/Source/UI/Text/UITextViewer.cpp @@ -130,7 +130,7 @@ void UIAchTV::OnLBtnDown(int, int) { const int id = this->geometry.id; if (id != -1 && this->parent) { - this->parent->SendMsg(nullptr, 145, id, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_SELECT_ACHIEVEMENT, id, 0, 0, 0); } } @@ -146,7 +146,7 @@ void UIAchTab::OnLBtnDown(int x, int y) { this->unknown_007C = a; this->unknown_0080 = b; if (this->parent) { - this->parent->SendMsg(this, 22, a, b, 0, 0); + this->parent->SendMsg(this, UM_TAB, a, b, 0, 0); this->parent->Invalidate(); } @@ -281,13 +281,13 @@ int UITextViewEX::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 switch (message) { case UM_UPPUSH: if (this->verticalOverflow != 0) { - this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -1, 0, 0, 0); } return 0; case UM_DOWNPUSH: if (this->verticalOverflow != 0) { - this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 1, 0, 0, 0); } return 0; @@ -295,9 +295,9 @@ int UITextViewEX::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->topLine = previous - this->geometry.height / this->lineHeight + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->topLine = previous + this->geometry.height / this->lineHeight - 1; } else { this->topLine = previous + static_cast(argument1); diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index fbbfb6830..e9bf69b14 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -1,4 +1,5 @@ #include "UI/Chat/UINewChatWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Contents/Items/ItemNaming.h" #include "Render/Text/TextContext.h" @@ -104,7 +105,7 @@ bool UITextViewer::AddItemLinks(std::string text, unsigned addedLines) { this->links.push_back(button); } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); return true; } @@ -151,7 +152,7 @@ bool UITextViewer::AddNaviLinks(std::string text, unsigned addedLines) { this->links.push_back(button); } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); return true; } @@ -253,7 +254,7 @@ bool UITextViewer::AddQuestLinks(std::string text, unsigned addedLines) { this->links.push_back(button); } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); return true; } @@ -350,7 +351,7 @@ void UITextViewer::AddTipLinks(std::string text, unsigned addedLines) { } } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); } } @@ -396,7 +397,7 @@ bool UITextViewer::AddUrlLinks(std::string text, unsigned addedLines) { this->links.push_back(button); } - this->SendMsg(nullptr, 7, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SCROLLVERT, 0, 0, 0, 0); return true; } diff --git a/Source/UI/Text/UITextViewerMessages.cpp b/Source/UI/Text/UITextViewerMessages.cpp index 6a459f358..0654b80d7 100644 --- a/Source/UI/Text/UITextViewerMessages.cpp +++ b/Source/UI/Text/UITextViewerMessages.cpp @@ -1,4 +1,5 @@ #include "UI/Chat/UINewChatWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Mode/CGameMode.h" @@ -111,8 +112,8 @@ __forceinline void UITextViewer::Activate(UITextButton* button, int id) { item.unknown_0060 = 0; item.itemId = button->GetLine(0); - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } break; @@ -121,7 +122,7 @@ __forceinline void UITextViewer::Activate(UITextButton* button, int id) { if (button && button->GetLinesCount() != 0) { const std::string& tip = button->GetLine(0); - if (UIWindow* window = g_windowMgr.EnsureWindow(315)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_TIPBOXWND)) { static_cast(window)->ShowTip(std::atoi(tip.c_str())); } } @@ -210,14 +211,14 @@ int UITextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 switch (message) { case UM_UPPUSH: if (this->verticalOverflow != 0) { - this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -1, 0, 0, 0); } return 0; case UM_DOWNPUSH: if (this->verticalOverflow != 0) { - this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 1, 0, 0, 0); } return 0; @@ -368,15 +369,15 @@ int UITextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 item.unknown_0000[0] = static_cast(idValue); item.unknown_0060 = 0; item.itemId = button->GetLine(0); - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } break; case LINE_SEGMENT_TIPBOX: if (button && button->GetLinesCount() != 0) { const std::string& tip = button->GetLine(0); - if (UIWindow* window = g_windowMgr.EnsureWindow(315)) { + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_TIPBOXWND)) { static_cast(window)->ShowTip(std::atoi(tip.c_str())); } } diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index c694e20b4..b98f76b0e 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -1,4 +1,7 @@ #include "UI/UIBartermarketWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" @@ -58,7 +61,7 @@ UIExpandedBartermarketWnd::UIExpandedBartermarketWnd() // OFFSET: 0x00840B30 // FUNCTION: fn_10545 void UIBarterItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -66,23 +69,23 @@ void UIBarterItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 31) { if (g_session.IsEquipItemType(drag->type) == true || g_session.IsShadowItemType(drag->type) == true) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - if (UIWindow* window = g_windowMgr.LookupWindow(15)) { - window->SendMsg(nullptr, 13, 24, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND)) { + window->SendMsg(nullptr, UM_SETSTATE, 24, 0, 0, 0); } } else { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } } // OFFSET: 0x00840C00 // FUNCTION: fn_10546 void UIBartermarketWnd::DragAndDrop(int x, int y, std::intptr_t value) { - if (g_windowMgr.LookupWindow(10011)) { + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { UIWindow::DragAndDrop(x, y, value); return; } @@ -90,19 +93,19 @@ void UIBartermarketWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 4) { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } return; } if (drag->quantity == 1) { - this->SendMsg(nullptr, 38, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - if (UIWindow* window = g_windowMgr.LookupWindow(15)) { - window->SendMsg(nullptr, 13, 23, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND)) { + window->SendMsg(nullptr, UM_SETSTATE, 23, 0, 0, 0); } } @@ -235,13 +238,13 @@ void UIExpandedBarterItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t va const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 31) { if (g_session.IsEquipItemType(drag->type) == true || g_session.IsShadowItemType(drag->type) == true) { - this->SendMsg(0, 38, 0, 0, 0, 0); + this->SendMsg(0, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.LookupWindow(15)->SendMsg(0, 13, 26, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND)->SendMsg(0, UM_SETSTATE, 26, 0, 0, 0); } else { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } } @@ -250,15 +253,15 @@ void UIExpandedBarterItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t va void UIExpandedBartermarketWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source != 32) { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } if (drag->quantity == 1) { - this->SendMsg(0, 38, 0, 0, 0, 0); + this->SendMsg(0, UM_DROP, 0, 0, 0, 0); return; } - g_windowMgr.ShowWindowById(15, 1); - g_windowMgr.LookupWindow(15)->SendMsg(0, 13, 25, 0, 0, 0); + g_windowMgr.ShowWindowById(WID_ITEMDROPCNTWND, 1); + g_windowMgr.LookupWindow(WID_ITEMDROPCNTWND)->SendMsg(0, UM_SETSTATE, 25, 0, 0, 0); } // OFFSET: 0x00845F60 @@ -388,7 +391,7 @@ void UIExpandedBarterItemPurchaseWnd::OnWheel(int delta) { if (step > 3) { step = 3; } - this->SendMsg(this->scrollBar, 7, delta > 0 ? -step : step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, delta > 0 ? -step : step, 0, 0, 0); } } @@ -400,7 +403,7 @@ void UIExpandedBartermarketWnd::OnWheel(int delta) { if (step > 3) { step = 3; } - this->SendMsg(this->scrollBar, 7, delta > 0 ? -step : step, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, delta > 0 ? -step : step, 0, 0, 0); } } @@ -492,8 +495,8 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); std::pair found = g_expandedBarterMarketItemMgr->FindItem(mode->drag.unknown_03B0); if (!found.first) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -517,25 +520,25 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: } if (missing) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3665)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3665)), 255, 0, 0, 0); return 0; } } if (g_session.IsEquipItemType(mode->drag.type) == true) { if (g_expandedBarterMarketItemMgr->HasEntryByName(mode->drag.name) == true) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(119)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(119)), 255, 0, 0, 0); return 0; } } else if (g_session.IsShadowItemType(mode->drag.type) == true) { if (g_expandedBarterMarketItemMgr->HasEntryByName(mode->drag.name) == true) { - mode->SendMsg(18, 0, 0, 0, 0); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3569)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3569)), 255, 0, 0, 0); return 0; } } @@ -544,15 +547,15 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: char buffer[200]; std::memset(buffer, 0, sizeof(buffer)); StringFormat(buffer, sizeof(buffer), static_cast(-1), LookupMessage(3692), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 255, 0, 0, 0); return 0; } const int factor = static_cast(g_expandedBarterMarketItemMgr->GetItemFactorById(mode->drag.unknown_03B0)); if (factor < 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -560,35 +563,35 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: const int available = g_session.m_maxWeight - g_session.m_weight; const float remaining = static_cast(available) - g_expandedBarterMarketItemMgr->GetWeightedTotal(); if (static_cast(remaining) / factor < mode->drag.quantity) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } } if (static_cast<__int64>(mode->drag.quantity * found.second.field_8) + g_expandedBarterMarketItemMgr->total > g_session.m_zeny) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(55)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } g_expandedBarterMarketItemMgr->AddEntry(found.second); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - g_windowMgr.LookupWindow(341)->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + g_windowMgr.LookupWindow(WID_EXPANDEDBARTERMARKETWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } case UM_COMMAND: { CMode* mode = g_modeMgr.GetGameMode(); - if (a == 184) { + if (a == ID_OK) { if (this->Purchase()) { - mode->SendMsg(321, 0, 0, 0, 0); - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_EXPANDED_BARTER_MARKET_PURCHASE, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_expandedBarterMarketItemMgr->Clear(); } - } else if (a == 185) { - mode->SendMsg(40, 0, 0, 0, 0); + } else if (a == ID_CANCEL) { + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_expandedBarterMarketItemMgr->Clear(); } return 0; @@ -626,10 +629,10 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_00C4 = previous - this->rowCount + 1; } else { - if (message == 10) { + if (message == UM_SCROLLVERTPAGEDOWN) { a = this->rowCount - 1; } this->unknown_00C4 = a + previous; @@ -668,10 +671,10 @@ int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intpt if (found.first) { found.second.value = mode->drag.quantity; g_expandedBarterMarketItemMgr->RemoveEntry(found.second); - g_windowMgr.LookupWindow(342)->SendMsg(nullptr, 23, 0, 0, 0, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + g_windowMgr.LookupWindow(WID_EXPANDEDBARTERITEMPURCHASEWND)->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -710,10 +713,10 @@ int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intpt case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_00C4 = previous - this->rowCount + 1; } else { - if (message == 10) { + if (message == UM_SCROLLVERTPAGEDOWN) { a = this->rowCount - 1; } this->unknown_00C4 = a + previous; @@ -835,10 +838,10 @@ void UIBartermarketWnd::OnLBtnDown(int x, int y) { void UIBarterItemPurchaseWnd::OnRBtnDown(int x, int y) { std::pair found = this->GetBarterItemOrPriceAt(x, y); if (found.first == true) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); ITEM_INFO item = found.second.ToItemInfo(); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -848,10 +851,10 @@ void UIBarterItemPurchaseWnd::OnRBtnDown(int x, int y) { void UIBartermarketWnd::OnRBtnDown(int x, int y) { std::pair found = this->GetBarterItemOrPriceAt(x, y); if (found.first) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); ITEM_INFO item = found.second.ToItemInfo(); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -923,8 +926,8 @@ void UIExpandedBartermarketWnd::OnLBtnDown(int x, int y) { std::pair found = this->GetEntryAt(x, y); if (found.first == true) { if (found.second.value == 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3557)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3557)), 255, 0, 0, 0); } else if (CGameMode* mode = static_cast(g_modeMgr.GetGameMode())) { mode->drag.BeginBarterEntry(31, found.second, 1, -1); } @@ -936,10 +939,10 @@ void UIExpandedBartermarketWnd::OnLBtnDown(int x, int y) { void UIExpandedBarterItemPurchaseWnd::OnRBtnDown(int x, int y) { std::pair found = this->GetEntryOrChunkAt(x, y); if (found.first == true) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); ITEM_INFO item = found.second.ToItemInfo(); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -949,10 +952,10 @@ void UIExpandedBarterItemPurchaseWnd::OnRBtnDown(int x, int y) { void UIExpandedBartermarketWnd::OnRBtnDown(int x, int y) { std::pair found = this->GetEntryOrChunkAt(x, y); if (found.first == true) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); ITEM_INFO item = found.second.ToItemInfo(); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } } @@ -1169,28 +1172,28 @@ bool UIBarterItemPurchaseWnd::Purchase() { } if (count > g_session.unknown_7FBC + 100) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } std::map* required = g_barterMarketItemMgr->GetTotals(); for (std::map::iterator it = required->begin(); it != required->end(); ++it) { if (this->GetInventoryItemCount(it->first) < it->second) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3556)), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3556)), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } } for (std::map::iterator it = totals.begin(); it != totals.end(); ++it) { if (it->second + this->GetInventoryItemCount(std::atoi(it->first.c_str())) > 30000) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const std::string text = FormatOwnedString(LookupMessage(3567), 30000); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } } @@ -1239,7 +1242,7 @@ void UIBarterItemPurchaseWnd::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - 38) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00843FA0 @@ -1254,7 +1257,7 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ if (!this->saved->IsValid()) { this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; } @@ -1267,32 +1270,32 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::pair found = g_barterMarketItemMgr->FindItem(mode->drag.unknown_03B0); if (found.first == false) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } found.second.value = mode->drag.quantity; if (g_session.HasItemId(found.second.field_2c)) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3665)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3665)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } if (g_barterMarketItemMgr->HasItemByName(mode->drag.name)) { int notice = 0; if (g_session.IsEquipItemType(mode->drag.type)) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); notice = 119; } else if (g_session.IsShadowItemType(mode->drag.type)) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); notice = 3569; } if (notice != 0) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(notice)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(notice)), 255, 0, 0, 0); return 0; } } @@ -1300,15 +1303,15 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ if (mode->drag.quantity + g_barterMarketItemMgr->GetAllItemValueByName(mode->drag.name) > 30000) { char buffer[200] = {}; StringFormat(buffer, 200, static_cast(-1), LookupMessage(1704), 30000); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(buffer), 255, 0, 0, 0); return 0; } const int amountById = g_barterMarketItemMgr->GetAmountById(mode->drag.unknown_03B0); if (amountById < 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -1316,18 +1319,18 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ const int available = g_session.m_maxWeight - g_session.m_weight; const float remaining = static_cast(available) - g_barterMarketItemMgr->GetTotalAmount(); if (static_cast(remaining) / amountById < mode->drag.quantity) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(56)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(56)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } } g_barterMarketItemMgr->AddItem(found.second); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - if (UIWindow* window = g_windowMgr.LookupWindow(334)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BARTERMARKETWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -1337,16 +1340,16 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - if (a == 184) { + if (a == ID_OK) { if (!this->Purchase()) { return 0; } - mode->SendMsg(308, 0, 0, 0, 0); - } else if (a != 185) { + mode->SendMsg(MM_NPC_BARTER_MARKET_PURCHASE, 0, 0, 0, 0); + } else if (a != ID_CANCEL) { return 0; } - mode->SendMsg(40, 0, 0, 0, 0); + mode->SendMsg(MM_RELEASE_QUEST, 0, 0, 0, 0); g_barterMarketItemMgr->Clear(); return 0; } @@ -1445,7 +1448,7 @@ void UIExpandedBarterItemPurchaseWnd::OnCreate(int width, int height) { this->rowCount = (height - 46) / 64; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x008446D0 @@ -1460,7 +1463,7 @@ int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s if (!this->saved->IsValid()) { this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; } @@ -1473,18 +1476,18 @@ int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s std::pair found = g_barterMarketItemMgr->FindAllItem(mode->drag.unknown_03B0); if (found.first == false) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3554)), 255, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } found.second.value = mode->drag.quantity; g_barterMarketItemMgr->RemoveItem(found.second); - if (UIWindow* window = g_windowMgr.LookupWindow(335)) { - window->SendMsg(nullptr, 23, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_BARTERITEMPURCHASEWND)) { + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); - mode->SendMsg(18, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return 0; } @@ -1553,7 +1556,7 @@ void UIBartermarketWnd::OnCreate(int width, int height) { this->columns = 1; this->visibleRows = (height - this->unknown_0104 - 17) / 32; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x00845220 @@ -1582,16 +1585,16 @@ bool UIExpandedBarterItemPurchaseWnd::Purchase() { } if (count > g_session.unknown_7FBC + 100) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } if (!g_expandedBarterMarketItemMgr->HasRequiredItems()) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3556)), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3556)), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } @@ -1608,10 +1611,10 @@ bool UIExpandedBarterItemPurchaseWnd::Purchase() { } if (it->second + owned > 30000) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); const std::string text = FormatOwnedString(LookupMessage(3691), 30000); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 255, 0, 0, 0); - this->SendMsg(nullptr, 6, 185, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 255, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; } } @@ -1636,7 +1639,7 @@ void UIExpandedBartermarketWnd::OnCreate(int width, int height) { this->rowCount = (height - 46) / 64; - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x008426E0 diff --git a/Source/UI/UICaptchaRegisterWnd.cpp b/Source/UI/UICaptchaRegisterWnd.cpp index d370bb840..53236ab36 100644 --- a/Source/UI/UICaptchaRegisterWnd.cpp +++ b/Source/UI/UICaptchaRegisterWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UICaptchaRegisterWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Application/Launcher.h" @@ -144,7 +145,7 @@ int UICaptchaRegisterWnd::SendMsg( this->m_captchaBitmap->Invalidate(); this->Invalidate(); } else { - g_windowMgr.SendNotice(1, reinterpret_cast("image size error"), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("image size error"), 0xFF, 0, 0, 0); } } } @@ -153,13 +154,13 @@ int UICaptchaRegisterWnd::SendMsg( break; case UM_COMMAND: switch (a1) { - case 345: + case ID_SEND: if (this->m_editCtrl->Length() < 4) { g_windowMgr.Confirm(LookupMessage(2872), 0, 1, 0, 0, "Message", 280, 120, 0); } else if (this->m_selectedFile.empty()) { g_windowMgr.Confirm(LookupMessage(2874), 0, 1, 0, 0, "Message", 280, 120, 0); } else if (this->m_decompressedSize == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast("compress data size error"), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast("compress data size error"), 0xFF, 0, 0, 0); } else { const int result = g_windowMgr.Confirm(FormatOwnedString(LookupMessage(2873), this->m_editCtrl->Text()).c_str(), 2, 0, 0, 0, "Message", 280, 120, 0); @@ -179,7 +180,7 @@ int UICaptchaRegisterWnd::SendMsg( } break; case ID_CLOSE: - g_windowMgr.CloseWindow(284); + g_windowMgr.CloseWindow(WID_CAPTCHAREGISTERWND); break; } break; diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 47b1f4026..2616faa97 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Render/Text/FontCache.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -200,9 +201,9 @@ void UIChangeMaterialWnd::OnRBtnUp(int x, int y) { return; } - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(item), 0, 0, 0); } } @@ -210,9 +211,9 @@ void UIChangeMaterialWnd::OnRBtnUp(int x, int y) { // FUNCTION: fn_03889 void UIChangeMaterialWnd_List::OnWheel(int argument) { if (argument < 0) { - this->SendMsg(this->m_scrollBar, 10, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 9, 0, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } } @@ -351,7 +352,7 @@ void UIChangeMaterialWnd_List::SetSelectedIndex(int index) { this->m_selectedIndex = index; this->m_previousScrollOffset = this->m_scrollOffset; this->Invalidate(); - this->parent->SendMsg(nullptr, 23, reinterpret_cast(this->GetEntry(index)), 0, 0, 0); + this->parent->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(this->GetEntry(index)), 0, 0, 0); } // OFFSET: 0x005E3C30 @@ -362,7 +363,7 @@ int UIChangeMaterialWnd::SendMsg( switch (message) { case UM_DEFPUSH: if (sender == reinterpret_cast(this->unknown_00B8) && reinterpret_cast(this->unknown_00B8) == g_windowMgr.GetHoverWindow()) { - this->unknown_00B4->SendMsg(nullptr, 6, 0x141, reinterpret_cast(this->unknown_00B8->Text()), 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_COMMAND, ID_SEARCH, reinterpret_cast(this->unknown_00B8->Text()), 0, 0); } break; case UM_COMMAND: @@ -371,26 +372,26 @@ int UIChangeMaterialWnd::SendMsg( this->SendChangeMaterial(); break; case ID_CLOSE: - g_windowMgr.CloseWindow(0x158); + g_windowMgr.CloseWindow(WID_CHANGEMATERIALWND); break; case ID_SEARCH: - this->unknown_00B4->SendMsg(nullptr, 6, 0x141, reinterpret_cast(this->unknown_00B8->Text()), 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_COMMAND, ID_SEARCH, reinterpret_cast(this->unknown_00B8->Text()), 0, 0); break; case 0x16c: this->unknown_00B4->SortItems(argument2 > 0); break; case 0x19f: - this->unknown_00B4->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; default: break; } break; case UM_UPPUSH: - this->unknown_00B4->SendMsg(nullptr, 0x12, 0, 0, 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); break; case UM_DOWNPUSH: - this->unknown_00B4->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); break; case UM_REFRESHITEM: if (argument1 != 0) { @@ -463,9 +464,9 @@ int UIChangeMaterialWnd_List::SendMsg( case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollOffset; int delta = static_cast(argument1); - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { delta = -1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { delta = 1; } this->m_scrollOffset = previous + delta; @@ -758,7 +759,7 @@ void UIChangeMaterialWnd::OnCreate(int width, int height) { this->unknown_00B4->SetSize(186, 216); this->unknown_00B4->Move(310, 41); this->AddChild(this->unknown_00B4); - this->unknown_00B4->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->unknown_00B4->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x005E1E20 diff --git a/Source/UI/UICheckAttendanceWnd.cpp b/Source/UI/UICheckAttendanceWnd.cpp index c67048c71..c688aedce 100644 --- a/Source/UI/UICheckAttendanceWnd.cpp +++ b/Source/UI/UICheckAttendanceWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "Render/Text/FontCache.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -245,7 +247,7 @@ void UICheckAttendanceWnd::OnLBtnDown(int x, int y) { void UICheckAttendanceWnd::OnLBtnUp(int x, int y) { const int slot = this->SlotAt(x, y); if (slot == this->m_checkedDays) { - this->SendMsg(nullptr, 6, 184, slot, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OK, slot, 0, 0); } } @@ -265,7 +267,7 @@ void UICheckAttendanceWnd_Banner::OnLBtnUp(int x, int y) { if (this->m_current < this->m_entries.size()) { const AttendanceBanner& entry = this->m_entries[this->m_current]; if (entry.action == 318) { - g_modeMgr.gameMode->SendMsg(323, entry.argument, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQUEST_CASH_SHOP, entry.argument, 0, 0, 0); } else { g_windowMgr.EnsureWindow(entry.action); } @@ -319,7 +321,7 @@ void UICheckAttendanceWnd::OnProcess() { void UICheckAttendanceWnd_Banner::OnProcess() { if (this->m_lastSwitch + 5000 < timeGetTime()) { const unsigned int next = this->m_current + 1 < this->m_entries.size() ? this->m_current + 1 : 0; - this->SendMsg(this->m_buttons[next], 6, 215, 0, 0, 0); + this->SendMsg(this->m_buttons[next], UM_COMMAND, ID_RADIOBTN, 0, 0, 0); } } @@ -331,7 +333,7 @@ void UICheckAttendanceWnd::OnRBtnDown(int x, int y) { return; } - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (!window) { return; } @@ -339,7 +341,7 @@ void UICheckAttendanceWnd::OnRBtnDown(int x, int y) { ITEM_INFO item; item.SetItemId(g_checkAttendanceMgr->GetReward(slot + 1).first); item.identified = 1; - window->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } // OFFSET: 0x007DE0C0 @@ -353,7 +355,7 @@ void UICheckAttendanceWnd_Banner::CreateButtons() { button->SetBitmap("유저인터페이스\\check_attendance\\btn_ad_off.bmp", 1); button->SetBitmap("유저인터페이스\\check_attendance\\btn_ad_on.bmp", 2); button->Move(this->geometry.width + (index - static_cast(this->m_entries.size())) * 12 - 12, 41); - button->SendMsg(this, 13, index == static_cast(this->m_current), 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, index == static_cast(this->m_current), 0, 0, 0); this->AddChild(button); this->m_buttons.emplace_back(button); ++index; @@ -393,7 +395,7 @@ int UICheckAttendanceWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } break; case ID_CLOSE: - g_windowMgr.CloseWindow(328); + g_windowMgr.CloseWindow(WID_CHECKATTENDANCEWND); break; } } @@ -405,13 +407,13 @@ int UICheckAttendanceWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a int UICheckAttendanceWnd_Banner::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message == 6 && argument1 == 215) { + if (message == UM_COMMAND && argument1 == ID_RADIOBTN) { for (unsigned int index = 0; index < this->m_buttons.size(); ++index) { if (sender == this->m_buttons[index]) { - this->m_buttons[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_buttons[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_current = index; } else { - this->m_buttons[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_buttons[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } this->m_lastSwitch = timeGetTime(); diff --git a/Source/UI/UIGradeEnchantWnd.cpp b/Source/UI/UIGradeEnchantWnd.cpp index fd17261bf..b4561e760 100644 --- a/Source/UI/UIGradeEnchantWnd.cpp +++ b/Source/UI/UIGradeEnchantWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Resource/Bitmap/BitmapResource.h" #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Shop/ItemDrawing.h" @@ -97,10 +100,10 @@ UIGradeEnchant_BtnStart::UIGradeEnchant_BtnStart() : UIBitmapButton() { void UIGradeEnchantWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (x >= 53 && x <= 99 && y >= 114 && y <= 160 && drag->source == 1) { - this->SendMsg(this, 23, drag->id, 0, 0, 0); + this->SendMsg(this, UM_REFRESHITEM, drag->id, 0, 0, 0); } - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x007E7560 @@ -428,19 +431,19 @@ void UIGradeEnchantWnd::OnProcess() { if (this->state == 2 && now >= this->unknown_00E0 + 3000) { switch (this->result) { case ENCHANTGRADE_UPGRADE_SUCCESS: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3702)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3702)), 0xFFFF00, 0, 0, 0); break; case ENCHANTGRADE_UPGRADE_FAILED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3703)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3703)), 0xFFFF00, 0, 0, 0); break; case ENCHANTGRADE_UPGRADE_DOWNGRADE: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3704)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3704)), 0xFFFF00, 0, 0, 0); break; case ENCHANTGRADE_UPGRADE_BREAK: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3705)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3705)), 0xFFFF00, 0, 0, 0); break; case ENCHANTGRADE_UPGRADE_PROTECTED: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3706)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3706)), 0xFFFF00, 0, 0, 0); break; } this->ResetItem(); @@ -477,27 +480,27 @@ void UIGradeEnchantWnd::OnRBtnUp(int x, int y) { if (this->state == 1) { const int row = MaterialRowAt(x, y); if (row >= 0 && static_cast(row) < this->materials.size()) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { ITEM_INFO material = LookupClientItem(g_session.m_inventoryItems, this->materials[row].itemId, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&material), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&material), 0, 0, 0); } return; } if (x >= 195 && x <= 219 && y >= 228 && y <= 252) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { ITEM_INFO blessing = LookupClientItem(g_session.m_inventoryItems, this->info.unknown_0000, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&blessing), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&blessing), 0, 0, 0); } } } if (this->item.unknown_0000[1] > 0 && x >= 53 && x <= 99 && y >= 114 && y <= 160) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&this->item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->item), 0, 0, 0); } } } @@ -535,7 +538,7 @@ int UIGradeEnchantWnd::SendMsg( GradeEnchantClosePacket packet; packet.id = 0xB5C; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); - g_windowMgr.CloseWindow(343); + g_windowMgr.CloseWindow(WID_GRADEENCHANTWND); break; } case ID_UP: @@ -558,7 +561,7 @@ int UIGradeEnchantWnd::SendMsg( if (this->state == 0 || this->state == 1) { const ITEM_INFO dropped = LookupClientItemByIdentity(g_session.m_inventoryItems, argument1); if (g_session.HasItem61B8(dropped.unknown_0000[1]) == 1) { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return -1; } diff --git a/Source/UI/UIHotkeyGuideWnd.cpp b/Source/UI/UIHotkeyGuideWnd.cpp index ec8bbbe65..5d070da34 100644 --- a/Source/UI/UIHotkeyGuideWnd.cpp +++ b/Source/UI/UIHotkeyGuideWnd.cpp @@ -1,4 +1,5 @@ #include "Script/LuaScript.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "UI/Window/UIWindowMgr.h" @@ -289,17 +290,17 @@ void UIHotkeyGuideWnd::OnProcess() { // OFFSET: 0x0096C260 // FUNCTION: fn_13167 int UIHotkeyGuideWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { switch (a) { case 342: { - UIWindow* window = g_windowMgr.EnsureWindow(156); + UIWindow* window = g_windowMgr.EnsureWindow(WID_HOTKEYWND); if (window) { - window->SendMsg(this, 22, 1, 0, 0, 0); + window->SendMsg(this, UM_TAB, 1, 0, 0, 0); } } [[fallthrough]]; case ID_CLOSE: - g_windowMgr.CloseWindow(303); + g_windowMgr.CloseWindow(WID_HOTKEYGUIDEWND); } } diff --git a/Source/UI/UIItemReformWnd.cpp b/Source/UI/UIItemReformWnd.cpp index b1a948f61..78a25014d 100644 --- a/Source/UI/UIItemReformWnd.cpp +++ b/Source/UI/UIItemReformWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/UIItemReformWnd.h" #include "UI/Window/UIEnums.h" @@ -234,7 +236,7 @@ void UIItemReformWnd_List::OnLBtnUp(int x, int y) { if (index < count && this->selectedIndex != index) { this->selectedIndex = index; if (this->parent) { - this->parent->SendMsg(nullptr, 6, 336, reinterpret_cast(&this->items[index]), 0, 0); + this->parent->SendMsg(nullptr, UM_COMMAND, ID_SELECT_ITEM, reinterpret_cast(&this->items[index]), 0, 0); } this->Invalidate(); } @@ -244,7 +246,7 @@ void UIItemReformWnd_List::OnLBtnUp(int x, int y) { // FUNCTION: fn_04118 void UIItemReformWnd_DetailBtn::OnMouseEnter() { if (this->parent) { - this->parent->SendMsg(this, 167, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_SHOW_ITEM_REFORM_DETAIL, 0, 0, 0, 0); } } @@ -276,7 +278,7 @@ void UIItemReformWnd_List::OnMouseHover(int x, int y) { // FUNCTION: fn_04121 void UIItemReformWnd_DetailBtn::OnMouseLeave() { if (this->parent) { - this->parent->SendMsg(this, 168, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_HIDE_ITEM_REFORM_DETAIL, 0, 0, 0, 0); } } @@ -293,8 +295,8 @@ void UIItemReformWnd::OnProcess() { // FUNCTION: fn_04124 void UIItemReformWnd_Item::OnRBtnDown(int x, int y) { if (this->item) { - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, reinterpret_cast(this->item), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(this->item), 0, 0, 0); } } } @@ -305,8 +307,8 @@ void UIItemReformWnd_List::OnRBtnUp(int x, int y) { const unsigned int count = this->items.size(); const unsigned int index = std::max(0u, std::min(y / this->itemHeight + this->scrollPosition, count - 1)); if (index < count) { - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(this, 24, reinterpret_cast(&this->items[index]), 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(this, UM_ITEMEXPLANATION, reinterpret_cast(&this->items[index]), 0, 0, 0); } } } @@ -315,9 +317,9 @@ void UIItemReformWnd_List::OnRBtnUp(int x, int y) { // FUNCTION: fn_04127 void UIItemReformWnd_List::OnWheel(int delta) { if (delta < 0) { - this->SendMsg(this->scrollBar, 10, 0, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } else { - this->SendMsg(this->scrollBar, 9, 0, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } } @@ -445,7 +447,7 @@ int UIItemReformWnd::SendMsg( switch (message) { case UM_REFRESHITEM: this->reformItem.SetItemId(argument1); - if (this->list->SendMsg(this, 23, argument1, 0, 0, 0) == -1) { + if (this->list->SendMsg(this, UM_REFRESHITEM, argument1, 0, 0, 0) == -1) { this->warning = LookupMessage(3856); } this->Invalidate(); @@ -462,21 +464,21 @@ int UIItemReformWnd::SendMsg( } break; case ID_CLOSE: - g_windowMgr.CloseWindow(348); + g_windowMgr.CloseWindow(WID_ITEMREFORMWND); break; - case 336: + case ID_SELECT_ITEM: this->SelectItem(reinterpret_cast(argument2)); break; } break; - case 167: + case UM_SHOW_ITEM_REFORM_DETAIL: if (sender == this->detailButton && !this->detailMsg) { this->detailMsg = new UIItemReformWnd_DetailMsg(); this->detailMsg->SetText(this->information); g_windowMgr.AddRendered(this->detailMsg); } break; - case 168: + case UM_HIDE_ITEM_REFORM_DETAIL: if (sender == this->detailButton && this->detailMsg) { g_windowMgr.Schedule(this->detailMsg); this->detailMsg = nullptr; @@ -496,9 +498,9 @@ int UIItemReformWnd_List::SendMsg( case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const unsigned int previous = this->scrollPosition; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { argument1 = -1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { argument1 = 1; } this->scrollPosition = previous + argument1; diff --git a/Source/UI/UILapineBoxWnd.cpp b/Source/UI/UILapineBoxWnd.cpp index 3c4a9bcef..f355d3688 100644 --- a/Source/UI/UILapineBoxWnd.cpp +++ b/Source/UI/UILapineBoxWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/UILapineScrollBar.h" #include "UI/Window/UIEnums.h" @@ -58,7 +60,7 @@ void UIIngredientInfoWnd::OnLBtnDblClk(int, int) { UILapineBox_IngredientListWnd* list = static_cast(this->parent); UILapineBoxWnd* box = static_cast(list->parent); if (box->items.size() < static_cast(box->maxItems)) { - if (list->SendMsg(list, 0x68, id, 0, 0, 0) >= 0) { + if (list->SendMsg(list, UM_DECITEM, id, 0, 0, 0) >= 0) { box->AddIngredient(id, this->quantity); } } @@ -80,7 +82,7 @@ void UIIngredientInfoWnd::OnLBtnUp(int, int) { this->Invalidate(); if (this->parent) { - this->parent->SendMsg(this, 6, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, 0, 0, 0, 0); } } } @@ -107,7 +109,7 @@ void UILapineBoxWnd::OnLBtnDblClk(int x, int y) { if (item.unknown_0000[1] != 0) { if (this->ingredientList->AddIngredient(item.unknown_0000[1]) == 1) { - this->SendMsg(this, 0x68, item.unknown_0000[1], 0, 0, 0); + this->SendMsg(this, UM_DECITEM, item.unknown_0000[1], 0, 0, 0); } } @@ -191,8 +193,8 @@ void UILapineBoxWnd::OnProcess() { // FUNCTION: fn_04168 void UIIngredientInfoWnd::OnRBtnDown(int, int) { if (this->item.unknown_0000[1] > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); - window->SendMsg(this, 0x18, reinterpret_cast(&this->item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + window->SendMsg(this, UM_ITEMEXPLANATION, reinterpret_cast(&this->item), 0, 0, 0); } } @@ -261,26 +263,26 @@ bool UILapineBox_IngredientListWnd::CanUseIngredient(std::uint32_t identity) { const int required = material->quantity; if (required > item.quantity) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(FormatOwnedString(LookupMessage(0xB52), required).c_str()), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(FormatOwnedString(LookupMessage(0xB52), required).c_str()), 0, 0, 0); return false; } if (this->minRefine > item.unknown_0060) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xB53)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xB53)), 0, 0, 0); return false; } if (this->maxRefine < item.unknown_0060) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xE3C)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xE3C)), 0, 0, 0); return false; } if (this->minRefine != 0 && this->minRefine < item.unknown_0060) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xE3D)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xE3D)), 0, 0, 0); } if (Equipment(item) && !item.IsApprenticeItem() && !item.HasSpecialCard()) { const int* cards = reinterpret_cast(item.unknown_001C); for (int index = 0; index < ItemSlotsCount(item); ++index) { if (index < 4 && cards[index] > 0) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xE3E)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xE3E)), 0, 0, 0); return true; } } @@ -306,8 +308,8 @@ void UILapineBoxWnd::OnRBtnDown(int x, int y) { this->ReadMaterial(&item, x, y); if (static_cast(item.unknown_0000[1]) > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); - window->SendMsg(nullptr, 0x18, reinterpret_cast(&item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } item.~ITEM_INFO(); @@ -325,9 +327,9 @@ void UIIngredientInfoWnd::OnWheel(int argument) { void UILapineBox_IngredientListWnd::OnWheel(int argument) { if (this->wheelScroll == 1) { if (argument < 0) { - this->SendMsg(this->scrollBar, 7, 15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 15, 0, 0, 0); } else { - this->SendMsg(this->scrollBar, 7, -15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -15, 0, 0, 0); } } } @@ -338,10 +340,10 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: switch (message) { case UM_COMMAND: switch (a) { - case 0xC9: - g_windowMgr.CloseWindow(0x122); + case ID_CLOSE: + g_windowMgr.CloseWindow(WID_LAPINEBOXWND); break; - case 0x1F7: { + case ID_LAPINE_COMBINE_ITEMS: { RandomCombineItemPacket* packet = new (std::nothrow) RandomCombineItemPacket; packet->id = ID_CZ_REQ_RANDOM_COMBINE_ITEM; const std::int16_t materialsLength = static_cast(this->items.size() * 4); @@ -368,7 +370,7 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: delete[] payload; break; } - case 0x1F9: { + case ID_LAPINE_ADD_INGREDIENT: { const std::vector& entries = this->ingredientList->items; const auto selected = std::find_if(entries.begin(), entries.end(), [](UIIngredientInfoWnd* entry) { return entry->selected == 1; @@ -377,7 +379,7 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: if (selected != entries.end()) { UIIngredientInfoWnd* entry = *selected; - if (entry != nullptr && entry->insufficient != 1 && this->ingredientList->SendMsg(this, 0x68, entry->item.unknown_0000[1], 0, 0, 0) >= 0) { + if (entry != nullptr && entry->insufficient != 1 && this->ingredientList->SendMsg(this, UM_DECITEM, entry->item.unknown_0000[1], 0, 0, 0) >= 0) { this->AddIngredient(entry->item.unknown_0000[1], entry->quantity); } } @@ -430,7 +432,7 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i (*it)->Show(0); } } - this->SendMsg(this, 0x57, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); break; case UM_COMMAND: @@ -471,12 +473,12 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i const int need = found->quantity; if (selected->item.quantity < need) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(FormatOwnedString(LookupMessage(0xB52), need).c_str()), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(FormatOwnedString(LookupMessage(0xB52), need).c_str()), 0, 0, 0); return -1; } if (selected->item.unknown_0060 < found->unknown_0060) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xB53)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xB53)), 0, 0, 0); return -1; } @@ -487,7 +489,7 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i (*it)->insufficient = 1; (*it)->Invalidate(); } - this->SendMsg(this, 0x57, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); break; } @@ -543,7 +545,7 @@ void UILapineBoxWnd::SetIngredient(int id) { g_session.m_hotkeyScript->CallTable("tblLapineDdukddakBox", "get_max_need_refine", "d>d", id, &maxRefine); this->ingredientList->maxRefine = maxRefine; - this->ingredientList->SendMsg(this, 0x17, 0, 0, 0, 0); + this->ingredientList->SendMsg(this, UM_REFRESHITEM, 0, 0, 0, 0); g_session.m_hotkeyScript->CallTable("tblLapineDdukddakBox", "get_need_item_count", "d>d", id, &this->maxItems); diff --git a/Source/UI/UILapineScrollBar.cpp b/Source/UI/UILapineScrollBar.cpp index a781da99e..0dfbedfab 100644 --- a/Source/UI/UILapineScrollBar.cpp +++ b/Source/UI/UILapineScrollBar.cpp @@ -1,4 +1,6 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" #include "Render/Text/TextContext.h" #include "UI/UIIngredientInfoWnd.h" #include "UI/UILapineScrollBar.h" @@ -129,12 +131,12 @@ void UILapineBoxWnd::DragAndDrop(int, int, std::intptr_t value) { CMode* mode = g_modeMgr.GetGameMode(); const ModeDragState* drag = reinterpret_cast(value); if (this->items.size() < static_cast(this->maxItems) && drag->source == 27) { - const int result = this->ingredientList->SendMsg(this, 104, drag->id, 0, 0, 0); + const int result = this->ingredientList->SendMsg(this, UM_DECITEM, drag->id, 0, 0, 0); if (result >= 0) { this->AddIngredient(drag->id, drag->quantity); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x005FF8B0 @@ -144,10 +146,10 @@ void UILapineBox_IngredientListWnd::DragAndDrop(int, int, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 26) { if (this->AddIngredient(drag->id) == 1) { - this->parent->SendMsg(this, 104, drag->id, 0, 0, 0); + this->parent->SendMsg(this, UM_DECITEM, drag->id, 0, 0, 0); } } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x005FF920 @@ -358,7 +360,7 @@ unsigned char UILapineBox_IngredientListWnd::AddIngredient(std::uint32_t id) { info->Invalidate(); this->items.push_back(info); - this->SendMsg(this, 87, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); return 1; } diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 0ca3e26c7..9d3585e35 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/CMode.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -173,14 +175,14 @@ void UILapineUpgradeBoxWnd::Paint() { void UILapineUpgradeBoxWnd::DragAndDrop(int x, int y, std::intptr_t value) { CMode* mode = g_modeMgr.GetGameMode(); if (this->item.unknown_0000[1] > 0) { - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return; } const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 27) { - this->SendMsg(this, 31, drag->id, 0, 0, 0); + this->SendMsg(this, UM_ADDITEM, drag->id, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00603650 @@ -201,7 +203,7 @@ void UILapineUpgradeBox_IngredientInfoWnd::Move(int x, int y) { // FUNCTION: fn_04203 void UILapineUpgradeBoxWnd::OnLBtnDblClk(int x, int y) { if (static_cast(x - 101) <= 24 && static_cast(y - 165) <= 24 && this->item.unknown_0000[1] != 0) { - this->SendMsg(this, 104, this->item.unknown_0000[1], 0, 0, 0); + this->SendMsg(this, UM_DECITEM, this->item.unknown_0000[1], 0, 0, 0); } } @@ -209,7 +211,7 @@ void UILapineUpgradeBoxWnd::OnLBtnDblClk(int x, int y) { // FUNCTION: fn_04204 void UILapineUpgradeBox_IngredientInfoWnd::OnLBtnDblClk(int x, int y) { if (this->item.unknown_0000[1] > 0) { - this->parent->SendMsg(this, 104, this->item.unknown_0000[1], 0, 0, 0); + this->parent->SendMsg(this, UM_DECITEM, this->item.unknown_0000[1], 0, 0, 0); } } @@ -238,7 +240,7 @@ void UILapineUpgradeBox_IngredientInfoWnd::OnLBtnUp(int x, int y) { this->selected = 1; this->Invalidate(); if (this->parent) { - this->parent->SendMsg(this, 6, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, 0, 0, 0, 0); } } @@ -254,8 +256,8 @@ void UILapineUpgradeBox_IngredientInfoWnd::OnWheel(int argument) { // FUNCTION: fn_04211 void UILapineUpgradeBoxWnd::OnRBtnDown(int x, int y) { if (static_cast(x - 101) <= 24 && static_cast(y - 165) <= 24 && this->item.unknown_0000[1] > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); - window->SendMsg(nullptr, 24, reinterpret_cast(&this->item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->item), 0, 0, 0); } } @@ -263,8 +265,8 @@ void UILapineUpgradeBoxWnd::OnRBtnDown(int x, int y) { // FUNCTION: fn_04212 void UILapineUpgradeBox_IngredientInfoWnd::OnRBtnDown(int x, int y) { if (this->item.unknown_0000[1] > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); - window->SendMsg(this, 24, reinterpret_cast(&this->item), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); + window->SendMsg(this, UM_ITEMEXPLANATION, reinterpret_cast(&this->item), 0, 0, 0); } } @@ -300,7 +302,7 @@ void UILapineUpgradeBoxWnd::SetIngredient(int id) { g_session.m_hotkeyScript->CallTable("tblLapineUpgradeBox", "get_min_need_option", "d>d", id, &this->minOptionCount); this->ingredientList->minOptionCount = this->minOptionCount; g_session.m_hotkeyScript->CallTable("tblLapineUpgradeBox", "set_resource_item_list", "d", id); - this->ingredientList->SendMsg(this, 0x17, 0, 0, 0, 0); + this->ingredientList->SendMsg(this, UM_REFRESHITEM, 0, 0, 0, 0); const char* source = nullptr; g_session.m_hotkeyScript->CallTable("tblLapineUpgradeBox", "get_need_source_string", "d>s", id, &source); @@ -315,9 +317,9 @@ void UILapineUpgradeBox_IngredientListWnd::DragAndDrop(int x, int y, std::intptr CMode* mode = g_modeMgr.GetGameMode(); const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 26) { - this->SendMsg(this, 31, drag->id, 0, 0, 0); + this->SendMsg(this, UM_ADDITEM, drag->id, 0, 0, 0); } - mode->SendMsg(18, 0, 0, 0, 0); + mode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x00604680 @@ -349,11 +351,11 @@ int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, (*it)->Show(0); } } - this->SendMsg(this, 0x57, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); break; case UM_ADDITEM: - this->parent->SendMsg(this, 0x68, a, 0, 0, 0); + this->parent->SendMsg(this, UM_DECITEM, a, 0, 0, 0); break; case UM_SETPOS: { @@ -375,7 +377,7 @@ int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, } case UM_DECITEM: - this->parent->SendMsg(this, 0x1F, a, 0, 0, 0); + this->parent->SendMsg(this, UM_ADDITEM, a, 0, 0, 0); break; } @@ -393,9 +395,9 @@ void UILapineUpgradeBox_IngredientListWnd::Paint() { void UILapineUpgradeBox_IngredientListWnd::OnWheel(int argument) { if (this->wheelScroll == 1) { if (argument < 0) { - this->SendMsg(this->scrollBar, 7, 15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 15, 0, 0, 0); } else { - this->SendMsg(this->scrollBar, 7, -15, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -15, 0, 0, 0); } } } @@ -524,7 +526,7 @@ bool UILapineUpgradeBox_IngredientListWnd::AddIngredient(std::uint32_t identity) this->AddScrollChild(entry); entry->Invalidate(); this->items.push_back(entry); - this->SendMsg(this, 0x57, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); return true; } @@ -579,7 +581,7 @@ bool UILapineUpgradeBox_IngredientListWnd::CanUseIngredient(std::uint32_t identi } if (this->minRefine != 0 && this->minRefine < item.unknown_0060) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xE3D)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xE3D)), 0, 0, 0); } if (Equipment(item) && !item.IsApprenticeItem() && !item.HasSpecialCard()) { @@ -587,7 +589,7 @@ bool UILapineUpgradeBox_IngredientListWnd::CanUseIngredient(std::uint32_t identi std::uint32_t card = 0; std::memcpy(&card, item.unknown_001C + offset, sizeof(card)); if (card != 0) { - this->parent->SendMsg(this, 0x6F, reinterpret_cast(LookupMessage(0xE3E)), 0, 0, 0); + this->parent->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(LookupMessage(0xE3E)), 0, 0, 0); break; } } @@ -598,7 +600,7 @@ bool UILapineUpgradeBox_IngredientListWnd::CanUseIngredient(std::uint32_t identi } entry->Show(0); - this->SendMsg(this, 0x57, 0, 0, 0, 0); + this->SendMsg(this, UM_SETPOS, 0, 0, 0, 0); return true; } @@ -612,17 +614,17 @@ int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(302); + g_windowMgr.CloseWindow(WID_LAPINEUPGRADEBOXWND); return 0; - case 505: { + case ID_LAPINE_ADD_INGREDIENT: { UILapineUpgradeBox_IngredientInfoWnd* selected = this->ingredientList->FindSelected(); if (selected) { - this->SendMsg(this, 31, selected->item.unknown_0000[1], 0, 0, 0); + this->SendMsg(this, UM_ADDITEM, selected->item.unknown_0000[1], 0, 0, 0); return 0; } break; } - case 509: + case ID_LAPINE_START_UPGRADE: if (this->item.unknown_0000[1] != 0) { LapineUpgradeStartPacket packet; packet.id = 0xAB6; @@ -665,7 +667,7 @@ int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case UM_DECITEM: if (this->item.unknown_0000[1] != 0 && this->item.unknown_0000[1] == a) { this->item = ITEM_INFO(); - this->SendMsg(this, 111, reinterpret_cast(""), 0, 0, 0); + this->SendMsg(this, UM_RECEIVE_MSG, reinterpret_cast(""), 0, 0, 0); this->Invalidate(); this->ingredientList->AddIngredient(static_cast(a)); return 0; diff --git a/Source/UI/UIMacroDetectorWnd.cpp b/Source/UI/UIMacroDetectorWnd.cpp index b9e393d13..58a928382 100644 --- a/Source/UI/UIMacroDetectorWnd.cpp +++ b/Source/UI/UIMacroDetectorWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Input/InputCharset.h" #include "UI/UIMacroDetectorWnd.h" #include "Client/Input/Language.h" @@ -93,8 +95,8 @@ void UIMacroDetectorWnd::InitImageData(unsigned short size) { // OFFSET: 0x007EDCF0 // FUNCTION: fn_09820 int UICaptchaPreviewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6 && a == 201) { - g_windowMgr.CloseWindow(288); + if (message == UM_COMMAND && a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_CAPTCHAPREVIEWWND); } return UIWindow::SendMsg(sender, message, a, b, c, d); } @@ -102,11 +104,11 @@ int UICaptchaPreviewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, // OFFSET: 0x007EDD40 // FUNCTION: fn_09821 int UIMacroDetectorWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 0) { - this->SendMsg(this, 6, 345, 0, 0, 0); - } else if (message == 6) { + if (message == UM_DEFPUSH) { + this->SendMsg(this, UM_COMMAND, ID_SEND, 0, 0, 0); + } else if (message == UM_COMMAND) { if (a == 201) { - g_windowMgr.CloseWindow(284); + g_windowMgr.CloseWindow(WID_CAPTCHAREGISTERWND); } else if (a == 345 && this->m_editCtrl->Length() != 0 && this->m_lastAnswer != this->m_editCtrl->Text()) { CaptchaAnswerPacket packet; packet.id = 0xA5C; diff --git a/Source/UI/UIMacroReport.cpp b/Source/UI/UIMacroReport.cpp index 101abda2d..88d901cfd 100644 --- a/Source/UI/UIMacroReport.cpp +++ b/Source/UI/UIMacroReport.cpp @@ -1,4 +1,5 @@ #include "UI/UIMacroReport.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" @@ -103,7 +104,7 @@ void CUIMacroReport::SendReport() { strncpy_s(packet.message, sizeof(packet.message), message.c_str(), _TRUNCATE); } GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); - g_windowMgr.CloseWindow(10005); + g_windowMgr.CloseWindow(WID_MACROREPORT); } // OFFSET: 0x00A47C30 @@ -251,7 +252,7 @@ void CUIMacroReport::OnCreate(int width, int height) { CUIImageButton* closeButton = new CUIImageButton(); closeButton->SetSize(11, 11); closeButton->Move(217, 3); - closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(10005); }); + closeButton->SetOnClick([this]() { g_windowMgr.CloseWindow(WID_MACROREPORT); }); closeButton->disabled = 0; closeButton->Invalidate(); { @@ -349,7 +350,7 @@ void CUIMacroReport::OnCreate(int width, int height) { this->unknown_00EC = new CUIImageButton(); this->unknown_00EC->SetSize(58, 20); this->unknown_00EC->Move(117, 165); - this->unknown_00EC->SetOnClick([this]() { g_windowMgr.CloseWindow(10005); }); + this->unknown_00EC->SetOnClick([this]() { g_windowMgr.CloseWindow(WID_MACROREPORT); }); this->unknown_00EC->disabled = 0; this->unknown_00EC->Invalidate(); { diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index f4720ee8e..f9c4904a8 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIMacroUserInfoWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" @@ -292,9 +293,9 @@ void UIMacroReporterWnd::OnProcess() { void UIMacroReporterWnd::OnWheel(int delta) { if (this->m_scrollable == 1) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 7, 3, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, 3, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 7, -3, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, -3, 0, 0, 0); } } } @@ -374,7 +375,7 @@ bool UIMacroReporterWnd::ValidateTarget(unsigned char notify) { std::string text = this->m_target; if (text.empty() || text.size() - 4 > 4) { if (notify == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); } return false; } @@ -387,7 +388,7 @@ bool UIMacroReporterWnd::ValidateTarget(unsigned char notify) { if (value == 0 && text.compare(digits) != 0) { if (notify == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); } return false; } @@ -402,7 +403,7 @@ bool UIMacroReporterWnd::ValidateTarget(unsigned char notify) { if (text.compare(number) != 0) { if (notify == 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s", LookupMessage(4011)).c_str()), 0xFF, 0, 0, 0); } return false; } @@ -415,8 +416,8 @@ bool UIMacroReporterWnd::ValidateTarget(unsigned char notify) { int UIMacroUserInfoWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message == 6 && argument1 == 201) { - g_windowMgr.CloseWindow(287); + if (message == UM_COMMAND && argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_MACROUSERINFOWND); } return this->UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -492,7 +493,7 @@ void UIMacroReporterWnd::OnCreate(int, int) { static_cast(this->m_tabs[index])->SetText(labels[index].c_str()); static_cast(this->m_tabs[index])->SetId(215); static_cast(this->m_tabs[index])->value = index; - static_cast(this->m_tabs[index])->SendMsg(this, 13, index == this->m_mode, 0, 0, 0); + static_cast(this->m_tabs[index])->SendMsg(this, UM_SETSTATE, index == this->m_mode, 0, 0, 0); if (const char* tooltip = tooltips[index].c_str()) { static_cast(this->m_tabs[index])->tooltip = tooltip; } @@ -505,7 +506,7 @@ void UIMacroReporterWnd::OnCreate(int, int) { static_cast(this->m_tabs[index])->SetText(labels[index].c_str()); static_cast(this->m_tabs[index])->SetId(215); static_cast(this->m_tabs[index])->value = index; - static_cast(this->m_tabs[index])->SendMsg(this, 13, index == this->m_mode, 0, 0, 0); + static_cast(this->m_tabs[index])->SendMsg(this, UM_SETSTATE, index == this->m_mode, 0, 0, 0); if (const char* tooltip = tooltips[index].c_str()) { static_cast(this->m_tabs[index])->tooltip = tooltip; } @@ -598,7 +599,7 @@ int UIMacroReporterWnd::SendMsg( case UM_COMMAND: switch (argument1) { case ID_CLOSE: - g_windowMgr.CloseWindow(286); + g_windowMgr.CloseWindow(WID_MACROREPORTERWND); break; case ID_DELETE: { @@ -735,9 +736,9 @@ int UIMacroReporterWnd::SendMsg( this->m_mode = argument2; for (int index = 0; index < 4; ++index) { - this->m_tabs[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_tabs[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } - sender->SendMsg(this, 13, 1, 0, 0, 0); + sender->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); UIEditCtrl* edit = static_cast(this->m_edit); if (sender == this->m_tabs[1]) { @@ -837,8 +838,8 @@ int UIMacroReporterWnd::SendMsg( } } - if (!g_windowMgr.CloseWindow(287)) { - UIMacroUserInfoWnd* info = static_cast(g_windowMgr.EnsureWindow(287)); + if (!g_windowMgr.CloseWindow(WID_MACROUSERINFOWND)) { + UIMacroUserInfoWnd* info = static_cast(g_windowMgr.EnsureWindow(WID_MACROUSERINFOWND)); info->Move(this->geometry.x + 15, this->geometry.y + row * 22 + 78); const unsigned short job = entry->unknown_001C; std::string name = entry->name; @@ -853,9 +854,9 @@ int UIMacroReporterWnd::SendMsg( case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->m_firstRow = previous - this->m_visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->m_firstRow = previous + (this->m_visibleRows - 1); } else { this->m_firstRow = previous + argument1; diff --git a/Source/UI/UIPreviewEquipWnd.cpp b/Source/UI/UIPreviewEquipWnd.cpp index 3fbef3f5b..137e814b0 100644 --- a/Source/UI/UIPreviewEquipWnd.cpp +++ b/Source/UI/UIPreviewEquipWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIPreviewEquipWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" @@ -174,10 +175,10 @@ void UIPreviewEquipWnd::SyncFromPlayer() { // OFFSET: 0x007F3EF0 // FUNCTION: fn_09886 int UIPreviewEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message == 6) { + if (message == UM_COMMAND) { switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(0x126); + g_windowMgr.CloseWindow(WID_PREVIEWEQUIPWND); break; case ID_RESET: this->SyncFromPlayer(); @@ -197,7 +198,7 @@ int UIPreviewEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Invalidate(); break; } - } else if (message == 0x17) { + } else if (message == UM_REFRESHITEM) { if (a != 0) { const ITEM_INFO* item = reinterpret_cast(a); switch (item->unknown_0000[2]) { @@ -288,7 +289,7 @@ int UIPreviewEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; } } - } else if (message == 0x22) { + } else if (message == UM_SETINFO) { this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index c03b5ddf1..06c50960f 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Window/UINewSelectCharWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/UIRefiningWnd.h" @@ -136,9 +139,9 @@ void UIRefiningWnd::OnCreate(int width, int height) { void UIRefiningWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (static_cast(x - 109) <= 46 && static_cast(y - 201) <= 46 && drag->source == 1) { - this->SendMsg(this, 23, drag->id, 0, 0, 0); + this->SendMsg(this, UM_REFRESHITEM, drag->id, 0, 0, 0); } - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x007F52D0 @@ -684,22 +687,22 @@ void UIRefiningWnd::OnRBtnUp(int x, int y) { if (this->state == 1) { if (this->selectedMaterial != -1 && x >= 81 && x <= 105 && y >= 150 && y <= 174) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (!window) { return; } ITEM_INFO info = LookupClientItem(g_session.m_inventoryItems, this->materials[this->selectedMaterial].itemId, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&info), 0, 0, 0); return; } if (this->catalystEnabled == 1 && x >= 161 && x <= 185 && y >= 150 && y <= 174) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (!window) { return; } ITEM_INFO info = LookupClientItem(g_session.m_inventoryItems, this->catalystItemId, 0); - window->SendMsg(nullptr, 24, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&info), 0, 0, 0); return; } @@ -708,9 +711,9 @@ void UIRefiningWnd::OnRBtnUp(int x, int y) { if (static_cast(slot) < this->materials.size()) { ITEM_INFO info = LookupClientItem(g_session.m_inventoryItems, this->materials[slot].itemId, 0); if (info.unknown_0000[1] > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&info), 0, 0, 0); } } return; @@ -722,9 +725,9 @@ void UIRefiningWnd::OnRBtnUp(int x, int y) { } ITEM_INFO info = LookupClientItem(g_session.m_inventoryItems, this->catalystItemId, 0); if (info.unknown_0000[1] > 0) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&info), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&info), 0, 0, 0); } } return; @@ -733,9 +736,9 @@ void UIRefiningWnd::OnRBtnUp(int x, int y) { } if (this->item.unknown_0000[1] > 0 && static_cast(x - 109) <= 46 && static_cast(y - 201) <= 46) { - UIWindow* window = g_windowMgr.EnsureWindow(12); + UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND); if (window) { - window->SendMsg(nullptr, 24, reinterpret_cast(&this->item), 0, 0, 0); + window->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&this->item), 0, 0, 0); } } } @@ -807,7 +810,7 @@ int UIRefiningWnd::SendMsg( RefiningClosePacket packet; packet.id = 0xAA4; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); - g_windowMgr.CloseWindow(295); + g_windowMgr.CloseWindow(WID_REFININGWND); } break; case 519: @@ -821,7 +824,7 @@ int UIRefiningWnd::SendMsg( } break; case 520: - this->SendMsg(this, 6, 184, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); break; } break; @@ -829,7 +832,7 @@ int UIRefiningWnd::SendMsg( if (this->state == 0 || this->state == 1) { const ITEM_INFO info = LookupClientItemByIdentity(g_session.m_inventoryItems, argument1); if (g_session.HasItem61B8(info.unknown_0000[1]) == 1) { - g_modeMgr.GetGameMode()->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); return -1; } @@ -1000,14 +1003,14 @@ void UIRefiningWnd::SetState(int state, int result) { } break; case 3: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(498)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(498)), 0xFFFF00, 0, 0, 0); break; case 5: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1537)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(1537)), 0xFFFF00, 0, 0, 0); break; case 4: case 6: - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(499)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(499)), 0xFFFF00, 0, 0, 0); break; } diff --git a/Source/UI/UIReputeWnd.cpp b/Source/UI/UIReputeWnd.cpp index 7d702a94b..114bb9202 100644 --- a/Source/UI/UIReputeWnd.cpp +++ b/Source/UI/UIReputeWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Window/UIEnums.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindowMgr.h" #include "UI/UIReputeWnd.h" #include "Contents/MessageTable.h" @@ -249,12 +251,12 @@ int UIReputeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in break; case ID_CLOSE: this->ClearUpdated(); - g_windowMgr.CloseWindow(346); + g_windowMgr.CloseWindow(WID_REPUTEWND); break; case ID_SEARCH: { std::string keyword(this->m_searchEdit->Text() ? this->m_searchEdit->Text() : ""); if (keyword.size() == 0) { - this->SendMsg(this->m_groupCombo, 39, 0, 0, 0, 0); + this->SendMsg(this->m_groupCombo, UM_COMBOBOX_SELECTED, 0, 0, 0, 0); } else { this->ClearUpdated(); this->m_reputes.clear(); @@ -279,10 +281,10 @@ int UIReputeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } this->m_groupCombo->Select(index); - this->SendMsg(this->m_groupCombo, 39, 0, 0, 0, 0); + this->SendMsg(this->m_groupCombo, UM_COMBOBOX_SELECTED, 0, 0, 0, 0); } break; - case 136: { + case UM_REFRESH_REPUTE_FILTER: { std::string keyword(this->m_searchEdit->Text() ? this->m_searchEdit->Text() : ""); if (keyword.size() == 0) { std::string group = this->m_groupCombo->GetSelectedText(); diff --git a/Source/UI/UIRoundBoxTooltipWnd.cpp b/Source/UI/UIRoundBoxTooltipWnd.cpp index 9b770fb44..4b26e16b1 100644 --- a/Source/UI/UIRoundBoxTooltipWnd.cpp +++ b/Source/UI/UIRoundBoxTooltipWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/UIRoundBoxTooltipWnd.h" #include "Client/Input/Mouse.h" @@ -79,7 +81,7 @@ void UIRoundBoxTooltipWnd::Paint() { // OFFSET: 0x0099A430 // FUNCTION: fn_13543 int UIColoringTextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 29) { + if (message != UM_SETTEXT) { return UIListBox::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -96,11 +98,11 @@ int UIColoringTextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t a // OFFSET: 0x0099A5E0 // FUNCTION: fn_13544 int UIRoundBoxTooltipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { - if (argument1 == 201) { - g_windowMgr.CloseWindow(276); + if (message == UM_COMMAND) { + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_ROUNDBOXTOOLTIPWND); } - } else if (message == 147) { + } else if (message == UM_SET_ITEM_MOVE_TOOLTIP) { if (argument1 != 0) { std::string text; std::string longest; @@ -182,7 +184,7 @@ int UIRoundBoxTooltipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } if (text.empty()) { - g_windowMgr.ShowWindowById(276, 0); + g_windowMgr.ShowWindowById(WID_ROUNDBOXTOOLTIPWND, 0); return 0; } @@ -192,7 +194,7 @@ int UIRoundBoxTooltipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a 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_mouse.x + 26, g_mouse.y); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 0, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 0, 0, 0); } } else { return this->UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); diff --git a/Source/UI/UIScrollWnd.cpp b/Source/UI/UIScrollWnd.cpp index 2710faa20..52ac91dc4 100644 --- a/Source/UI/UIScrollWnd.cpp +++ b/Source/UI/UIScrollWnd.cpp @@ -283,10 +283,10 @@ __declspec(noinline) void UIScrollWnd::OnCreate(int width, int height) { void UIScrollWnd::OnWheel(int delta) { if (this->wheelScroll == 1) { if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 3, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 3, 0, 0, 0); return; } - this->SendMsg(this->scrollBar, 7, -3, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -3, 0, 0, 0); } } @@ -443,9 +443,9 @@ int UIScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scrollPosition; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { delta = -1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { delta = 1; } this->scrollPosition = previous + delta; @@ -464,9 +464,9 @@ int UIScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_SCROLLHORZPAGEUP: case UM_SCROLLHORZPAGEDOWN: { const int previous = this->unknown_009C; - if (message == 11) { + if (message == UM_SCROLLHORZPAGEUP) { delta = -1; - } else if (message == 12) { + } else if (message == UM_SCROLLHORZPAGEDOWN) { delta = 1; } this->unknown_009C = previous + delta; diff --git a/Source/UI/UISlotBitmap.cpp b/Source/UI/UISlotBitmap.cpp index ec99b99df..206dfa964 100644 --- a/Source/UI/UISlotBitmap.cpp +++ b/Source/UI/UISlotBitmap.cpp @@ -24,7 +24,7 @@ void UISlotBitmap::OnCreate(int, int) { // FUNCTION: fn_10833 void UISlotBitmap::OnLBtnDblClk(int, int) { if (this->parent) { - this->parent->SendMsg(this, 6, 184, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, ID_OK, 0, 0, 0); } } @@ -32,8 +32,8 @@ void UISlotBitmap::OnLBtnDblClk(int, int) { // FUNCTION: fn_10846 void UISlotBitmap::OnLBtnDown(int, int) { if (this->parent) { - this->parent->SendMsg(this, 13, this->slot, 0, 0, 0); - this->parent->SendMsg(this, 6, this->geometry.id, 0, 0, 0); + this->parent->SendMsg(this, UM_SETSTATE, this->slot, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, 0, 0, 0); } } @@ -41,8 +41,8 @@ void UISlotBitmap::OnLBtnDown(int, int) { // FUNCTION: fn_10887 void UISlotBitmap::OnRBtnDown(int, int) { if (this->parent) { - this->parent->SendMsg(this, 13, this->slot, 0, 0, 0); - this->parent->SendMsg(this, 6, this->geometry.id, 226, 0, 0); + this->parent->SendMsg(this, UM_SETSTATE, this->slot, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, 226, 0, 0); } } @@ -51,8 +51,8 @@ void UISlotBitmap::OnRBtnDown(int, int) { int UISlotBitmap::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 203 && this->parent) { - this->parent->SendMsg(this, 6, 203, this->slot, 0, 0); + if (argument1 == ID_MAKE && this->parent) { + this->parent->SendMsg(this, UM_COMMAND, ID_MAKE, this->slot, 0, 0); } return 0; case UM_SETSTATE: diff --git a/Source/UI/Window/FrameFocus.cpp b/Source/UI/Window/FrameFocus.cpp index 3be39589b..0599829f6 100644 --- a/Source/UI/Window/FrameFocus.cpp +++ b/Source/UI/Window/FrameFocus.cpp @@ -1,4 +1,6 @@ #include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Lists/UIDropDownBox.h" @@ -231,13 +233,13 @@ bool UIWindowMgr::HasTitleAtActorCell(std::uint32_t aid) { void UIWindowMgr::CancelActiveDialog() { UIWindow* window = this->window_03DC ? this->window_03DC : this->unknown_03B0; if (window) { - window->SendMsg(nullptr, 20, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_LEFTPUSH, 0, 0, 0, 0); return; } for (auto entry = this->rendered.begin(); entry != this->rendered.end(); ++entry) { if ((*entry)->IsFrameWnd()) { - (*entry)->SendMsg(nullptr, 20, 0, 0, 0, 0); + (*entry)->SendMsg(nullptr, UM_LEFTPUSH, 0, 0, 0, 0); } } } diff --git a/Source/UI/Window/UIAccountLimitedToolWnd.cpp b/Source/UI/Window/UIAccountLimitedToolWnd.cpp index cb8ef4ce2..1f26b662b 100644 --- a/Source/UI/Window/UIAccountLimitedToolWnd.cpp +++ b/Source/UI/Window/UIAccountLimitedToolWnd.cpp @@ -2,6 +2,7 @@ #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" #include "Network/Connection/Connection.h" @@ -185,11 +186,11 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ switch (argument1) { case 2: if (argument2 == 1) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2518)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2518)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } } else { this->m_viewer->SendMsg( @@ -198,7 +199,7 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } this->m_edits[0]->SetText(""); this->m_accountIdText->SetText("", 0); @@ -221,11 +222,11 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ case 1: switch (argument2) { case 3: { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2516)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2516)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } UIBitmapButton* addButton = this->m_buttons[1]; addButton->SetDisabled(1); @@ -236,11 +237,11 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ break; } case 1: { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2516)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2516)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } UIBitmapButton* addButton = this->m_buttons[1]; addButton->SetDisabled(1); @@ -256,12 +257,12 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::atoi(this->m_edits[4]->Text()), std::atoi(this->m_edits[5]->Text()), std::atoi(this->m_edits[6]->Text()), std::atoi(this->m_edits[7]->Text()), std::atoi(this->m_edits[8]->Text()), std::atoi(this->m_edits[9]->Text()), std::atoi(this->m_edits[10]->Text()), std::atoi(this->m_edits[11]->Text()) ); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 60, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2515)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2515)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } UIBitmapButton* deleteButton = this->m_buttons[2]; deleteButton->SetDisabled(0); @@ -304,16 +305,16 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ break; } case ID_CLOSE: - g_modeMgr.GetGameMode()->SendMsg(319, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_CLOSE_ACCOUNT_LIMITED_TOOL, 0, 0, 0, 0); break; case ID_SEARCH: { const std::string name = this->m_edits[0]->Text(); if (name.empty()) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2512)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2512)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } this->m_edits[0]->SelectAll(); } else if (name.size() < 50) { @@ -327,11 +328,11 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } case 561: { if (std::atoi(this->m_edits[1]->Text()) < 1) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2508)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2508)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } this->m_edits[1]->SelectAll(); return 0; @@ -340,22 +341,22 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ const AccountLimitedRange ranges[5] = {{23, 999}, {1, 12}, {1, 31}, {0, 23}, {0, 59}}; for (int i = 2; i < 12; ++i) { if (this->m_edits[i]->Length() == 0) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2509)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2509)), 60, 0, 0); UITextViewer* viewer = this->m_viewer; if (viewer->verticalOverflow != 0) { const int lineCount = viewer->LineCount(); - viewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + viewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); this->m_edits[i]->SelectAll(); return 0; } const AccountLimitedRange& range = ranges[i % 5 - 2]; if (std::atoi(this->m_edits[i]->Text()) < range.minimum || std::atoi(this->m_edits[i]->Text()) > range.maximum) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2510)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2510)), 60, 0, 0); UITextViewer* rangeViewer = this->m_viewer; if (rangeViewer->verticalOverflow != 0) { const int lineCount = rangeViewer->LineCount(); - rangeViewer->SendMsg(nullptr, 7, lineCount, 0, 0, 0); + rangeViewer->SendMsg(nullptr, UM_SCROLLVERT, lineCount, 0, 0, 0); } this->m_edits[i]->SelectAll(); return 0; @@ -364,7 +365,7 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } if (std::atoi(this->m_edits[12]->Text()) > 14) { - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3917)), 60, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3917)), 60, 0, 0); this->m_edits[12]->SelectAll(); return 0; } diff --git a/Source/UI/Window/UIBalloonOpenBtn.cpp b/Source/UI/Window/UIBalloonOpenBtn.cpp index d9bfbdc71..d200c1781 100644 --- a/Source/UI/Window/UIBalloonOpenBtn.cpp +++ b/Source/UI/Window/UIBalloonOpenBtn.cpp @@ -1,4 +1,6 @@ #include "UI/Window/UIBalloonOpenBtn.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Contents/SpecialPopupMgr.h" @@ -25,7 +27,7 @@ void UIBalloonOpenBtn::OnProcess() { if (this->m_balloon) { const std::int64_t elapsed = static_cast(timeGetTime()) - this->m_openTime; if (elapsed > this->m_openDelay) { - g_windowMgr.CloseWindow(0x166); + g_windowMgr.CloseWindow(WID_BALLOONOPENBTN); } } } @@ -40,7 +42,7 @@ UIBalloonOpenBtn::UIBalloonOpenBtn() // OFFSET: 0x00950200 // FUNCTION: fn_12939 int UIBalloonOpenBtn::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6 && argument1 == 510) { + if (message == UM_COMMAND && argument1 == 510) { if (argument2 > 0) { this->m_balloonId = static_cast(argument2); } @@ -57,7 +59,7 @@ int UIBalloonOpenBtn::SendMsg(UIWindow* sender, int message, std::intptr_t argum PopupData* popup = g_specialPopupMgr->GetPopup(this->m_balloonId); if (popup == nullptr) { const std::string text = FormatOwnedString("balloon No GetPopupData : %d ", this->m_balloonId); - g_windowMgr.SendNotice(1, reinterpret_cast(text.c_str()), 0xFFFF0000, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFFFF0000, 0, 0, 0); return 0; } diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index aad204676..1febfcfa6 100644 --- a/Source/UI/Window/UIBasicInfoWnd.cpp +++ b/Source/UI/Window/UIBasicInfoWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UINewSelectCharWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UIBasicInfoWnd.h" #include "Client/Mode/CMode.h" @@ -115,7 +116,7 @@ void UIBasicInfoWnd::SetHeight(int height) { } } - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { int screenX = 0; int screenY = 0; this->ToScreen(screenX, screenY); @@ -180,7 +181,7 @@ void UIBasicInfoWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_13493 void UIBasicInfoWnd::OnLBtnDblClk(int x, int y) { if (y < 17) { - this->SendMsg(this, 6, 202, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_MINI, 0, 0, 0); } } @@ -188,7 +189,7 @@ void UIBasicInfoWnd::OnLBtnDblClk(int x, int y) { // FUNCTION: fn_13496 void UIBasicInfoWnd::OnMouseMove(int x, int y) { UIFrameWnd::OnMouseMove(x, y); - if (UIWindow* window = g_windowMgr.LookupWindow(307)) { + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { int screenX = 0; int screenY = 0; this->ToScreen(screenX, screenY); @@ -221,30 +222,30 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen switch (message) { case UM_COMMAND: switch (argument1) { - case 192: - if (!g_windowMgr.CloseWindow(11)) { - g_windowMgr.EnsureWindow(11); + case ID_STATUS: + if (!g_windowMgr.CloseWindow(WID_STATUSWND)) { + g_windowMgr.EnsureWindow(WID_STATUSWND); } break; - case 193: - if (!g_windowMgr.CloseWindow(155)) { - g_windowMgr.EnsureWindow(155); + case ID_OPTION: + if (!g_windowMgr.CloseWindow(WID_ESCOPTIONWND)) { + g_windowMgr.EnsureWindow(WID_ESCOPTIONWND); } break; - case 194: - if (!g_windowMgr.CloseWindow(8)) { - g_windowMgr.EnsureWindow(8); + case ID_ITEMS: + if (!g_windowMgr.CloseWindow(WID_ITEMWND)) { + g_windowMgr.EnsureWindow(WID_ITEMWND); } break; - case 195: { - UIEquipWnd* equip = dynamic_cast(g_windowMgr.LookupWindow(10)); + case ID_EQUIP: { + UIEquipWnd* equip = dynamic_cast(g_windowMgr.LookupWindow(WID_EQUIPWND)); if (equip) { if (equip->m_page == 0) { - g_windowMgr.CloseWindow(10); + g_windowMgr.CloseWindow(WID_EQUIPWND); return 0; } } else { - equip = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(10))); + equip = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_EQUIPWND))); if (!equip) { return 0; } @@ -253,17 +254,17 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen equip->m_tabs->SelectTab(0); break; } - case 196: - if (!g_windowMgr.CloseWindow(37)) { - g_windowMgr.EnsureWindow(37); + case ID_SKILL: + if (!g_windowMgr.CloseWindow(WID_SKILLLISTWND)) { + g_windowMgr.EnsureWindow(WID_SKILLLISTWND); } break; - case 199: - if (!g_windowMgr.CloseWindow(69)) { - g_windowMgr.EnsureWindow(69); + case ID_FRIEND: + if (!g_windowMgr.CloseWindow(WID_MESSENGERWND)) { + g_windowMgr.EnsureWindow(WID_MESSENGERWND); } break; - case 202: { + case ID_MINI: { const int height = this->geometry.height; this->SetHeight(height == this->collapsedHeight ? this->expandedHeight : this->collapsedHeight); g_windowMgr.StoreSnapRectangle(this); @@ -275,63 +276,63 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen break; } case 214: - if (!g_windowMgr.CloseWindow(27) && !g_windowMgr.window_027C) { + if (!g_windowMgr.CloseWindow(WID_CHATROOMMAKEWND) && !g_windowMgr.window_027C) { if (!g_windowMgr.unknown_02FC && !g_windowMgr.unknown_0304) { - g_windowMgr.EnsureWindow(27); + g_windowMgr.EnsureWindow(WID_CHATROOMMAKEWND); } else { g_windowMgr.Confirm(LookupMessage(587), 0, true, false, 0, "Message", 280, 120, 0); } } break; - case 219: - if (!g_windowMgr.CloseWindow(140)) { - g_windowMgr.EnsureWindow(140); + case ID_MAP: + if (!g_windowMgr.CloseWindow(WID_ROMAPWND)) { + g_windowMgr.EnsureWindow(WID_ROMAPWND); } break; case 222: - g_windowMgr.CloseWindow(11); + g_windowMgr.CloseWindow(WID_STATUSWND); g_windowMgr.CloseWindow(13); - g_windowMgr.CloseWindow(8); - g_windowMgr.CloseWindow(10008); - g_windowMgr.CloseWindow(10); - g_windowMgr.CloseWindow(69); - g_windowMgr.CloseWindow(27); - g_windowMgr.CloseWindow(30); - g_windowMgr.CloseWindow(37); - g_windowMgr.CloseWindow(38); - g_windowMgr.CloseWindow(88); - g_windowMgr.CloseWindow(86); - g_windowMgr.CloseWindow(87); - g_windowMgr.CloseWindow(40); - g_windowMgr.CloseWindow(59); - g_windowMgr.ShowWindowById(36, 0); + g_windowMgr.CloseWindow(WID_ITEMWND); + g_windowMgr.CloseWindow(WID_RENEWQUESTUI); + g_windowMgr.CloseWindow(WID_EQUIPWND); + g_windowMgr.CloseWindow(WID_MESSENGERWND); + g_windowMgr.CloseWindow(WID_CHATROOMMAKEWND); + g_windowMgr.CloseWindow(WID_CHATROOMCHANGEWND); + g_windowMgr.CloseWindow(WID_SKILLLISTWND); + g_windowMgr.CloseWindow(WID_TIPOFTHEDAYWND); + g_windowMgr.CloseWindow(WID_PETINFOWND); + g_windowMgr.CloseWindow(WID_EMOTIONWND); + g_windowMgr.CloseWindow(WID_CASHEMOTIONLISTWND); + g_windowMgr.CloseWindow(WID_MERCHANTITEMWND); + g_windowMgr.CloseWindow(WID_GUILDWND); + g_windowMgr.ShowWindowById(WID_SHORTCUTWND, 0); this->SetHeight(this->collapsedHeight); g_windowMgr.StoreSnapRectangle(this); break; case 247: - if (!g_windowMgr.LookupWindow(227) && !g_windowMgr.CloseWindow(40) && g_session.unknown_5C1C > 0) { - g_windowMgr.EnsureWindow(40); + if (!g_windowMgr.LookupWindow(WID_MERGEITEMWND) && !g_windowMgr.CloseWindow(WID_MERCHANTITEMWND) && g_session.unknown_5C1C > 0) { + g_windowMgr.EnsureWindow(WID_MERCHANTITEMWND); } break; - case 361: - if (!g_windowMgr.CloseWindow(10008)) { - g_windowMgr.EnsureWindow(10008); + case ID_QUEST: + if (!g_windowMgr.CloseWindow(WID_RENEWQUESTUI)) { + g_windowMgr.EnsureWindow(WID_RENEWQUESTUI); } break; case 373: - if (!g_windowMgr.CloseWindow(59)) { - g_windowMgr.EnsureWindow(59); + if (!g_windowMgr.CloseWindow(WID_GUILDWND)) { + g_windowMgr.EnsureWindow(WID_GUILDWND); } break; case 578: { - UIEquipWnd* equip = dynamic_cast(g_windowMgr.LookupWindow(10)); + UIEquipWnd* equip = dynamic_cast(g_windowMgr.LookupWindow(WID_EQUIPWND)); if (equip) { if (equip->m_page == 1) { - g_windowMgr.CloseWindow(10); + g_windowMgr.CloseWindow(WID_EQUIPWND); return 0; } } else { - equip = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(10))); + equip = dynamic_cast(static_cast(g_windowMgr.EnsureWindow(WID_EQUIPWND))); if (!equip) { return 0; } diff --git a/Source/UI/Window/UIBattleMsgOptionWnd.cpp b/Source/UI/Window/UIBattleMsgOptionWnd.cpp index 37c42b310..8a5ed2708 100644 --- a/Source/UI/Window/UIBattleMsgOptionWnd.cpp +++ b/Source/UI/Window/UIBattleMsgOptionWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UIBattleMsgOptionWnd.h" @@ -27,7 +28,7 @@ void UIBattleMsgOptionWnd::OnWheel(int delta) { if (delta >= 0) { step = -step; } - this->SendMsg(this->m_scrollBar, 7, step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, step, 0, 0, 0); } } @@ -248,7 +249,7 @@ int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case ID_OPTION: { if (this->unknown_0108 == b && this->unknown_0110 == (c != 0)) { if (d != 2) { - g_windowMgr.CloseWindow(132); + g_windowMgr.CloseWindow(WID_BATTLEMSGOPTIONWND); return 0; } } else if (d == 1) { @@ -277,7 +278,7 @@ int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } case ID_CLOSE: - g_windowMgr.CloseWindow(132); + g_windowMgr.CloseWindow(WID_BATTLEMSGOPTIONWND); return 0; case ID_CHECK: this->unknown_010C = b; @@ -295,9 +296,9 @@ int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { this->unknown_00C4 = previous - this->m_visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { this->unknown_00C4 = previous + this->m_visibleRows - 1; } else { this->unknown_00C4 = previous + static_cast(a); diff --git a/Source/UI/Window/UIBitmapTab.cpp b/Source/UI/Window/UIBitmapTab.cpp index e7f2f1012..97189c343 100644 --- a/Source/UI/Window/UIBitmapTab.cpp +++ b/Source/UI/Window/UIBitmapTab.cpp @@ -34,7 +34,7 @@ void UIBitmapTab::OnLBtnDown(int, int y) { if (this->geometry.unknown_0030 != index) { this->geometry.unknown_0030 = index; this->Invalidate(); - this->parent->SendMsg(this, 22, this->geometry.unknown_0030, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->geometry.unknown_0030, 0, 0, 0); } return; diff --git a/Source/UI/Window/UIChangeNameWnd.cpp b/Source/UI/Window/UIChangeNameWnd.cpp index 68b8a36b7..7c43b404d 100644 --- a/Source/UI/Window/UIChangeNameWnd.cpp +++ b/Source/UI/Window/UIChangeNameWnd.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIChangeNameWnd.h" #include "UI/Window/UIEnums.h" @@ -72,7 +73,7 @@ void UIChangeNameWnd::OnCreate(int, int) { this->AddChild(this->m_cancelButton); } - g_modeMgr.gameMode->SendMsg(10014, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GET_MAKING_CHAR_NAME, 0, 0, 0, 0); this->m_edit = new UIBitmapEditCtrl(); this->m_edit->SetBitmapName("유저인터페이스\\login_interface\\name-edit.bmp"); this->m_edit->SetSize(this->m_edit->geometry.width, this->m_edit->geometry.height); @@ -95,7 +96,7 @@ UIChangeNameWnd::UIChangeNameWnd() int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { case UM_DEFPUSH: - this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, this->m_message0, 0, 0, 0); break; case UM_COMMAND: switch (a) { diff --git a/Source/UI/Window/UICollectionSystemWnd.cpp b/Source/UI/Window/UICollectionSystemWnd.cpp index 1fa9a1c42..44db83190 100644 --- a/Source/UI/Window/UICollectionSystemWnd.cpp +++ b/Source/UI/Window/UICollectionSystemWnd.cpp @@ -1,4 +1,7 @@ #include "Render/DeviceContext/DCSurface.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UICollectionSystemWnd.h" #include "Client/Mode/ModeMgr.h" @@ -68,7 +71,7 @@ void CUICollectionSystemWnd::Paint() { void CUICollectionSystemWnd::OnLBtnDown(int, int) { if (this->unknown_00BC == 0) { this->unknown_00BC = 1; - g_modeMgr.GetGameMode()->SendMsg(282, this->unknown_00B8, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_TRYCOLLECTION, this->unknown_00B8, 0, 0, 0); } } @@ -83,7 +86,7 @@ void CUICollectionSystemWnd::OnProcess() { this->m_lastTick = now; } if (static_cast(now - this->m_lastTick) > 2000) { - g_windowMgr.CloseWindow(196); + g_windowMgr.CloseWindow(WID_COLLECTIONSYSTEMWND); } } } @@ -91,7 +94,7 @@ void CUICollectionSystemWnd::OnProcess() { // OFFSET: 0x00934740 // FUNCTION: fn_12741 int CUICollectionSystemWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t b, std::intptr_t, std::intptr_t) { - if (message == 80) { + if (message == UM_SET_TARGET) { if (a == 0) { this->unknown_00B8 = b; return 0; diff --git a/Source/UI/Window/UIEnums.h b/Source/UI/Window/UIEnums.h index 413989a57..a5265fdc8 100644 --- a/Source/UI/Window/UIEnums.h +++ b/Source/UI/Window/UIEnums.h @@ -105,6 +105,54 @@ enum UIMESSAGE : int { UM_RECEIVE_MSG = 111, UM_ENDPUSH = 114, UM_ADDCHAT2 = 115, + UM_LOADINGPERCENT = 17, + UM_IME_SET_CANDIDATE = 65, + UM_UPDATE_RECORD_TIME = 116, + UM_DETACH_CHAT_TAB = 117, + UM_ATTACH_CHAT_TAB = 118, + UM_SET_BUYING_SHOP_ZENY = 119, + UM_SET_CASHSHOP_BALANCE = 120, + UM_REFRESH_PAGES = 121, + UM_UPDATE_CASHSHOP_BALANCE = 122, + UM_REPLAY_FRAMED_DATA = 123, + UM_LIST_SELECTION = 135, + UM_REFRESH_REPUTE_FILTER = 136, + UM_SET_PET_EVOLUTION_MATERIALS = 142, + UM_ROTATE_SHORTCUT_ROWS = 143, + UM_SELECT_ACHIEVEMENT = 145, + UM_SET_ITEM_MOVE_TOOLTIP = 147, + UM_OPEN_VIDEO = 150, + UM_TOGGLE_VIDEO_PAUSE = 151, + UM_INSERT_ITEM_LINK = 153, + UM_RESOLVE_PLAYER_TAGS = 154, + UM_SET_CASHSHOP_TOTAL_PRICE = 155, + UM_SET_MODAL = 156, + UM_SET_MESSAGE_PROTECTED = 157, + UM_IS_MESSAGE_PROTECTED = 158, + UM_SET_VIDEO_VOLUME = 159, + UM_REFRESH_EXTRA_SKILL_TAB = 161, + UM_SHOW_AGIT_MENU = 162, + UM_HIDE_AGIT_MENU = 163, + UM_SELECT_CASHSHOP_TAB = 164, + UM_UPDATE_PARTY_PAGINATION = 165, + UM_CANCEL_NPC_CHOICE = 166, + UM_SHOW_ITEM_REFORM_DETAIL = 167, + UM_HIDE_ITEM_REFORM_DETAIL = 168, + UM_CASH_EMOTION_SELECT_PACK = 171, + UM_CASH_EMOTION_ACTIVATE = 174, + UM_CASH_EMOTION_SELECT = 175, + UM_CASH_EMOTION_KEY = 176, + UM_RUNE_REWARD_EFFECT = 178, + UM_RESET_ITEM_SORT = 246, + UM_SORT_ITEMS = 364, + UM_SEARCH_ITEMS = 365, + UM_SET_CHARACTER_SLOT_STYLE = 431, + UM_MINIMAP_SET_PLAYER_POS = 481, + UM_MINIMAP_SET_BOSS_POS = 482, + UM_MINIMAP_SET_MARK_POS = 483, + UM_MINIMAP_SET_MARK_COUNT = 484, + UM_MINIMAP_ADD_QUEST_MARK = 485, + UM_MINIMAP_CLEAR_QUEST_MARKS = 486, }; enum UIID : int { @@ -231,6 +279,52 @@ enum UIID : int { ID_BOOKMARK = 356, ID_STICK_ON = 357, ID_RESET = 363, + ID_BUTTON2 = 190, + ID_DIALOG = 197, + ID_REPORT_RODEX = 310, + ID_STICK_OFF = 358, + ID_QUEST = 361, + ID_SORT_ITEMS = 364, + ID_PARTY_SEARCH = 365, + ID_OPEN_HOTKEY = 370, + ID_RETURN_TO_CHARACTER_SELECT = 371, + ID_RETURN_TO_LOGIN = 372, + ID_ADD_CHAT_TAB = 374, + ID_TOGGLE_PARTY_MOUSE_LOCK = 377, + ID_SELECT_PARTY_LISTING = 379, + ID_WHISPER_PARTY_LEADER = 381, + ID_SELECT_REPLAY = 400, + ID_PAUSE_REPLAY = 401, + ID_RESUME_REPLAY = 402, + ID_RESTART_REPLAY = 403, + ID_EXIT_REPLAY = 404, + ID_INCREASE_REPLAY_SPEED = 405, + ID_DECREASE_REPLAY_SPEED = 406, + ID_ROULETTE_GENERATE = 409, + ID_ROULETTE_RECEIVE_ITEM = 410, + ID_PARTY_RELOAD_FIRST_PAGE = 415, + ID_START_REPLAY_RECORDING = 420, + ID_STOP_REPLAY_RECORDING = 421, + ID_CONFIRM_REPLAY_RECORDING_PATH = 422, + ID_REPLAY_RECORDING_OPTIONS = 423, + ID_CANCEL_REPLAY_RECORDING_OPTIONS = 424, + ID_CLOSE_REPLAY_RECORDING = 425, + ID_OPEN_PARTY_SETTINGS = 445, + ID_LEAVE_PARTY = 446, + ID_OPEN_PARTY_INVITATION = 447, + ID_OPEN_GAME_SETTINGS = 458, + ID_LAPINE_COMBINE_ITEMS = 503, + ID_LAPINE_ADD_INGREDIENT = 505, + ID_CLOSE_OFFLINE_STORE = 506, + ID_TOGGLE_ITEM_TRADE_LOCK = 507, + ID_LAPINE_START_UPGRADE = 509, + ID_CLOSE_VIDEO = 521, + ID_RESTORE_PARTY_LIST = 523, + ID_TOGGLE_PARTY_BOARD = 544, + ID_EXTEND_INVENTORY = 545, + ID_RESTORE_STORE_INFO = 560, + ID_EDIT_OWN_PARTY_LISTING = 564, + ID_REGISTER_PARTY_LISTING = 565, }; enum MENUID : int { @@ -284,6 +378,7 @@ enum UIMANAGERMESSAGE : int { UIM_IME_CLOSECANDIDATE = 10, UIM_MAKE_WHISPER_WINDOW = 14, UIM_PUSHINTOCHATHISTORY2 = 19, + UIM_RESOLVE_PLAYER_TAGS = 154, }; enum SCROLLBARPART : int { diff --git a/Source/UI/Window/UIEscOptionWnd.cpp b/Source/UI/Window/UIEscOptionWnd.cpp index 59687c0d9..f8863f639 100644 --- a/Source/UI/Window/UIEscOptionWnd.cpp +++ b/Source/UI/Window/UIEscOptionWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEscOptionWnd.h" #include "UI/Window/UIEnums.h" @@ -88,35 +90,35 @@ UIEscOptionWnd::UIEscOptionWnd() // FUNCTION: fn_12744 int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { CMode* mode = g_modeMgr.GetGameMode(); - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } switch (argument1) { - case 0x172: - if (!g_windowMgr.CloseWindow(0x9C)) { - g_windowMgr.EnsureWindow(0x9C); + case ID_OPEN_HOTKEY: + if (!g_windowMgr.CloseWindow(WID_HOTKEYWND)) { + g_windowMgr.EnsureWindow(WID_HOTKEYWND); } break; case ID_QUIT: - g_windowMgr.CloseWindow(0x9B); - mode->SendMsg(0x58, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); + mode->SendMsg(MM_QUIT_GAME, 0, 0, 0, 0); break; - case 0x161: - mode->SendMsg(0xFA, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0x9B); + case ID_REBIRTH: + mode->SendMsg(MM_REBIRTH, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); break; - case 0x173: + case ID_RETURN_TO_CHARACTER_SELECT: g_characterLinkedUserDataMgr->Save(); g_adventurerAgencyMgr->RequestStop(); - mode->SendMsg(0x19, 1, 0, 0, 0); - g_windowMgr.CloseWindow(0x9B); - g_windowMgr.CloseWindow(0xA4); - g_windowMgr.CloseWindow(0x10D); + mode->SendMsg(MM_RESTART, 1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); + g_windowMgr.CloseWindow(WID_SEEKPARTYWND); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); break; - case 0x1CA: - if (!g_windowMgr.CloseWindow(0x271E)) { - g_windowMgr.EnsureWindow(0x271E); + case ID_OPEN_GAME_SETTINGS: + if (!g_windowMgr.CloseWindow(WID_GAMESETTINGSUI)) { + g_windowMgr.EnsureWindow(WID_GAMESETTINGSUI); } break; case 0x1C9: @@ -124,14 +126,14 @@ int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen g_windowMgr.EnsureWindow(0xEC); } break; - case 0x174: + case ID_RETURN_TO_LOGIN: if (g_windowMgr.Confirm(LookupMessage(0x60C), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - mode->SendMsg(0x19, 0, 0, 0, 0); - g_windowMgr.CloseWindow(0x9B); + mode->SendMsg(MM_RESTART, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); } break; case ID_CANCEL: - g_windowMgr.CloseWindow(0x9B); + g_windowMgr.CloseWindow(WID_ESCOPTIONWND); break; } return 0; diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 354f78755..6afd039fe 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -1,4 +1,6 @@ #include "Client/Mode/CMode.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "Client/Session.h" @@ -207,18 +209,18 @@ int UIFrameWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int switch (message) { case UM_DEFPUSH: if (this->m_message0) { - this->SendMsg(this, 6, this->m_message0, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, this->m_message0, 0, 0, 0); } break; case UM_CANCELPUSH: if (this->m_message1) { - this->SendMsg(this, 6, this->m_message1, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, this->m_message1, 0, 0, 0); } break; case UM_TEXT_LBTN_UP: if (c > 0) { - if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { - window->SendMsg(nullptr, 24, c, 0, 0, 0); + if (UIWindow* window = g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)) { + window->SendMsg(nullptr, UM_ITEMEXPLANATION, c, 0, 0, 0); } } break; @@ -402,7 +404,7 @@ UICheckBox* UIFrameWnd::AddCheckBox(int id, int width, int height, const char* t void UIReplayListBox::OnLBtnDown(int x, int y) { this->selected = this->LineAt(x, y); this->Invalidate(); - this->parent->SendMsg(nullptr, 80, 0, 0, 0, 0); + this->parent->SendMsg(nullptr, UM_SET_TARGET, 0, 0, 0, 0); } // OFFSET: 0x008BA500 @@ -422,10 +424,10 @@ void UIReplayButton::OnLBtnUp(int x, int y) { } else { this->geometry.unknown_0030 = 1; if (this->parent) { - this->parent->SendMsg(this, 6, this->geometry.id, this->m_argument, 0, 0); - this->parent->SendMsg(nullptr, 35, 0, 0, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->m_argument, 0, 0); + this->parent->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } else { - g_modeMgr.gameMode->SendMsg(0, this->geometry.id, this->m_argument, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, this->geometry.id, this->m_argument, 0, 0); } } @@ -461,12 +463,12 @@ int UIAllyGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case UM_COMMAND: switch (a) { case ID_OK: - g_windowMgr.CloseWindow(72); - g_modeMgr.gameMode->SendMsg(120, this->identity, 1, 0, 0); + g_windowMgr.CloseWindow(WID_ALLYGUILDACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_ALLY_GUILD, this->identity, 1, 0, 0); break; case ID_CANCEL: - g_windowMgr.CloseWindow(72); - g_modeMgr.gameMode->SendMsg(120, this->identity, 0, 0, 0); + g_windowMgr.CloseWindow(WID_ALLYGUILDACCEPTWND); + g_modeMgr.gameMode->SendMsg(MM_ALLY_GUILD, this->identity, 0, 0, 0); break; } @@ -478,7 +480,7 @@ int UIAllyGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a text += ")"; text += LookupMessage(393); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(text.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text.c_str()), 38, 0, 0); return 0; } default: @@ -497,19 +499,19 @@ struct PACKET_CZ_BANK_TRANSACTION { // OFFSET: 0x008BB5F0 // FUNCTION: fn_11799 int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } int step; switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(0x113); + g_windowMgr.CloseWindow(WID_BANK_NEWWND); return 0; - case 0x117: + case ID_UP: step = 1; break; - case 0x118: + case ID_DOWN: step = -1; break; case 0x185: @@ -522,7 +524,7 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: case 0x1CE: { PACKET_CZ_BANK_TRANSACTION packet; if (g_modeMgr.GetGameMode() && static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen() == true) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x9B9)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x9B9)), 255, 0, 0, 0); return 0; } const long long amount = this->TransactionAmount(1); @@ -530,10 +532,10 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } if (g_session.m_zeny < amount) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x998)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x998)), 255, 0, 0, 0); this->m_status = LookupMessage(0xAE1); } else if (g_session.m_bankBalance + amount > 0x7FFFFFFFLL) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xAE3)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xAE3)), 255, 0, 0, 0); this->m_status = LookupMessage(0xADF); } else { packet.amount = static_cast(amount); @@ -547,7 +549,7 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: case 0x1CF: { PACKET_CZ_BANK_TRANSACTION packet; if (g_modeMgr.GetGameMode() && static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen() == true) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x9B9)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x9B9)), 255, 0, 0, 0); return 0; } const long long amount = this->TransactionAmount(0); @@ -555,10 +557,10 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } if (g_session.m_bankBalance < amount) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x997)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x997)), 255, 0, 0, 0); this->m_status = LookupMessage(0xAE2); } else if (static_cast(g_session.m_zeny + static_cast(amount)) > 0x7FFFFFFFu) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x99B)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x99B)), 255, 0, 0, 0); this->m_status = LookupMessage(0xAE3); } else { packet.amount = static_cast(amount); @@ -609,7 +611,7 @@ int UICntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intpt this->m_event = static_cast(a); return 0; case UM_COMMAND: - if (a == 184) { + if (a == ID_OK) { CMode* mode = g_modeMgr.gameMode; mode->SendMsg(this->m_event, std::atoi(this->m_edit->Text()), 0, 0, 0); } @@ -662,7 +664,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: if (this->saved->IsValid() == 0) { this->saved->Reset(); } - this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; case UM_COMMAND: @@ -673,7 +675,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } if (g_navigationLinkParser->HasLink(std::string(this->edit->Text()))) { this->edit->SetText(""); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3042)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3042)), 255, 0, 0, 0); return 0; } @@ -695,7 +697,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } if (g_serviceType == 1 && !ValidateCharacterName(buffer)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(190)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(190)), 255, 0, 0, 0); return 0; } @@ -718,12 +720,12 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } else if (talkType == 51) { talkType = 52; } - g_modeMgr.gameMode->SendMsg(42, talkType, reinterpret_cast(parts), 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, talkType, reinterpret_cast(parts), 0, 0); } } else { g_windowMgr.unknown_04DC = buffer; const std::string name = this->memberList->lines[this->memberList->selected]; - g_modeMgr.gameMode->SendMsg(11, reinterpret_cast(name.c_str()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_WHISPERMSG, reinterpret_cast(name.c_str()), 0, 0, 0); } this->edit->PushHistory(); @@ -732,9 +734,9 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } case ID_CLOSE: - g_modeMgr.gameMode->SendMsg(48, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_REQ_EXIT_ROOM, 0, 0, 0, 0); return 0; - case 347: + case ID_NAME: g_windowMgr.SelectWhisperName(reinterpret_cast(b)); return 0; default: @@ -748,7 +750,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } const std::string name = this->memberList->lines[this->memberList->selected]; - mode->SendMsg(47, reinterpret_cast(name.c_str()), 0, 0, 0); + mode->SendMsg(MM_REQ_EXPEL_MEMBER, reinterpret_cast(name.c_str()), 0, 0, 0); return 0; } case 1: { @@ -756,11 +758,11 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } const std::string name = this->memberList->lines[this->memberList->selected]; - mode->SendMsg(46, reinterpret_cast(name.c_str()), 0, 0, 0); + mode->SendMsg(MM_REQ_ROLE_CHANGE, reinterpret_cast(name.c_str()), 0, 0, 0); return 0; } case 2: - g_windowMgr.EnsureWindow(30)->SendMsg(nullptr, 34, reinterpret_cast(&mode->unknown_03C8), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_CHATROOMCHANGEWND)->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&mode->unknown_03C8), 0, 0, 0); return 0; case 3: g_windowMgr.Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); @@ -783,7 +785,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: case UM_MAKEMENU: { this->unknown_0114.clear(); if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(18); + g_windowMgr.CloseWindow(WID_MENUWND); } { @@ -829,12 +831,12 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } if (!this->unknown_0114.empty()) { - UIWindow* menu = g_windowMgr.EnsureWindow(18); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_MENUWND); for (unsigned index = 0; index < this->unknown_0114.size(); ++index) { - menu->SendMsg(nullptr, 31, reinterpret_cast(this->unknown_0114[index].first.c_str()), 0, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->unknown_0114[index].first.c_str()), 0, 0, 0); } - menu->SendMsg(nullptr, 83, 28, 0, 0, 0); - menu->SendMsg(nullptr, 30, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 28, 0, 0, 0); + menu->SendMsg(nullptr, UM_ADJUSTSIZE, 0, 0, 0, 0); int x = g_mouse.x + 1; int y = g_mouse.y + 1; @@ -981,12 +983,12 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } case UM_PAGEUPPUSH: if (this->history->verticalOverflow != 0) { - this->history->SendMsg(nullptr, 9, 0, 0, 0, 0); + this->history->SendMsg(nullptr, UM_SCROLLVERTPAGEUP, 0, 0, 0, 0); } return 0; case UM_PAGEDOWNPUSH: if (this->history->verticalOverflow != 0) { - this->history->SendMsg(nullptr, 10, 0, 0, 0, 0); + this->history->SendMsg(nullptr, UM_SCROLLVERTPAGEDOWN, 0, 0, 0, 0); } return 0; case UM_RESIZE: { @@ -1020,14 +1022,14 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_windowMgr.StoreSnapRectangle(this); return 0; } - case 123: { + case UM_REPLAY_FRAMED_DATA: { const unsigned char* data = reinterpret_cast(a); const unsigned size = static_cast(b); ChatRoomRecordHeader header; std::memcpy(&header, data, sizeof(header)); if (header.tag == 0x5014) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(64)), 0xFFFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(64)), 0xFFFF00, 0, 0, 0); ChatRoomTitleInfo* settings = reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_03C8); unsigned offset = 6; while (offset < size) { @@ -1075,15 +1077,15 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: std::memcpy(&this->roomStatus.roomId, data + offset, header.size); offset += header.size; settings->id = this->roomStatus.roomId; - this->SendMsg(nullptr, 34, reinterpret_cast(settings), 0, 0, 0); + this->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(settings), 0, 0, 0); break; case 0x501E: { char value[260]; std::memset(value, 0, sizeof(value)); std::memcpy(value, data + offset, header.size); offset += header.size; - this->SendMsg(nullptr, 43, 0, 0, 0, 0); - this->SendMsg(nullptr, 44, reinterpret_cast(value), 0, 0, 0); + this->SendMsg(nullptr, UM_CLEARMEMBER, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_ADDMEMBER, reinterpret_cast(value), 0, 0, 0); break; } case 0x501F: { @@ -1091,7 +1093,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: std::memset(value, 0, sizeof(value)); std::memcpy(value, data + offset, header.size); offset += header.size; - this->SendMsg(nullptr, 44, reinterpret_cast(value), 1, 0, 0); + this->SendMsg(nullptr, UM_ADDMEMBER, reinterpret_cast(value), 1, 0, 0); break; } default: diff --git a/Source/UI/Window/UIHotKeyWnd.cpp b/Source/UI/Window/UIHotKeyWnd.cpp index 7269afd5c..c33da4c6d 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -1,5 +1,7 @@ #include "Contents/Hotkeys/InterfaceHotkey.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/Text/FontCache.h" @@ -211,7 +213,7 @@ void UIHotKeyWnd::SaveHotkeys() { char message[500]; std::memset(message, 0, sizeof(message)); StringFormat(message, sizeof(message), static_cast(-1), "%s", LookupMessage(3572)); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF, 1, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF, 1, 0, 0); } } @@ -679,12 +681,12 @@ int UIHotKeyWnd::CheckHotkeyConflict() { int UIHotKeyWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message == 6) { + if (message == UM_COMMAND) { switch (argument1) { case ID_OK: ++g_userHotkeyMgr->m_changes; this->SaveHotkeys(); - g_windowMgr.CloseWindow(156); + g_windowMgr.CloseWindow(WID_HOTKEYWND); return 0; case ID_CANCEL: this->m_selectedRow = -1; @@ -694,7 +696,7 @@ int UIHotKeyWnd::SendMsg( this->Invalidate(); return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(156); + g_windowMgr.CloseWindow(WID_HOTKEYWND); return 0; case ID_CHECK: if (sender != this->unknown_0108) { @@ -731,8 +733,8 @@ int UIHotKeyWnd::SendMsg( } } - if (message == 22) { - if (sender == g_windowMgr.LookupWindow(303)) { + if (message == UM_TAB) { + if (sender == g_windowMgr.LookupWindow(WID_HOTKEYGUIDEWND)) { this->unknown_0100->SelectTab(static_cast(argument1)); return 0; } diff --git a/Source/UI/Window/UIJobListWnd.cpp b/Source/UI/Window/UIJobListWnd.cpp index fcd28ac40..696ffcc7b 100644 --- a/Source/UI/Window/UIJobListWnd.cpp +++ b/Source/UI/Window/UIJobListWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIJobListWnd.h" #include "UI/Window/UIEnums.h" @@ -84,8 +85,8 @@ void UIJobListWnd::StoreInfo() { // OFFSET: 0x00935610 // FUNCTION: fn_12746 int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { - if (message != 34) { + if (message != UM_COMMAND) { + if (message != UM_SETINFO) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -94,8 +95,8 @@ int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 this->m_saved->Reset(); } this->Move(this->m_saved->x, this->m_saved->y); - this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->m_saved->width, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; } @@ -134,7 +135,7 @@ int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } [[fallthrough]]; case ID_CLOSE: - g_windowMgr.CloseWindow(170); + g_windowMgr.CloseWindow(WID_JOBLISTWND); break; } diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 517d89b14..bbf599e05 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -1,4 +1,7 @@ #include "Render/DeviceContext/DCSurface.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Render/Text/FontCache.h" #include "Contents/Items/ItemDescription.h" @@ -163,7 +166,7 @@ UIMakeCharWnd::UIMakeCharWnd() this->m_nameEdit = nullptr; this->m_info.sex = static_cast(g_session.m_sex); - const int* preset = reinterpret_cast(g_modeMgr.gameMode->SendMsg(10016, 0, 0, 0, 0)); + const int* preset = reinterpret_cast(g_modeMgr.gameMode->SendMsg(LMM_GET_CHAR_PARAM, 0, 0, 0, 0)); this->m_info.stats[0] = static_cast(preset[0]); this->m_info.stats[1] = static_cast(preset[1]); this->m_info.stats[2] = static_cast(preset[2]); @@ -439,25 +442,25 @@ long long UIBank_NewWnd::TransactionAmount(unsigned char deposit) { const long long excess = cash + balance > 0x7FFFFFFF ? cash + balance - 0x7FFFFFFF : 0; if (deposit) { if (balance >= 0x7FFFFFFF) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2787)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2787)), 255, 0, 0, 0); this->m_status = LookupMessage(2783); return 0; } if (g_session.m_zeny == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2770)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2770)), 255, 0, 0, 0); this->m_status = LookupMessage(2780); return 0; } const long long amount = cash - excess; if (amount < 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2465)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2465)), 255, 0, 0, 0); this->m_status = LookupMessage(2780); return 0; } return amount; } if (balance == 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2770)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2770)), 255, 0, 0, 0); this->m_status = LookupMessage(2780); return 0; } @@ -465,23 +468,23 @@ long long UIBank_NewWnd::TransactionAmount(unsigned char deposit) { return cash + amount > 0x7FFFFFFF ? static_cast(0x7FFFFFFF - g_session.m_zeny) : amount; } if (text.empty()) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2779)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2779)), 255, 0, 0, 0); this->m_status = LookupMessage(2781); return 0; } if (!this->IsNumeric(text)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2488)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2488)), 255, 0, 0, 0); this->m_status = LookupMessage(2782); return 0; } const long long amount = _atoi64(text.c_str()); if (amount > 0x7FFFFFFF) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2768)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2768)), 255, 0, 0, 0); this->m_status = LookupMessage(2783); return 0; } if (amount < 1) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2769)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2769)), 255, 0, 0, 0); this->m_status = LookupMessage(2784); return 0; } @@ -654,7 +657,7 @@ void UIMessageBox::Configure( this->viewer->backgroundColor = Palette(ResourceMgr::Instance(), 2, 2) | 0xFF000000u; this->viewer->Invalidate(); this->AddChild(this->viewer); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->messageText.data()), static_cast(static_cast(width) / 7.5), 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->messageText.data()), static_cast(static_cast(width) / 7.5), 0, 0); this->m_message0 = type == 2 ? 188 : 185; const std::string prefix("유저인터페이스\\"); @@ -753,7 +756,7 @@ void UIMessageBox::OnProcess() { if (previous != this->remaining) { this->FormatCountdown(); this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->messageText.data()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->messageText.data()), 38, 0, 0); } } @@ -761,7 +764,7 @@ void UIMessageBox::OnProcess() { // FUNCTION: fn_11808 int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 156: + case UM_SET_MODAL: this->modal = static_cast(a); return 0; case UM_SETCOUNTMSG: @@ -769,7 +772,7 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return 0; case UM_CHANGEMSG: this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, a, 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, a, 38, 0, 0); return 0; case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); @@ -792,10 +795,10 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; - case 157: + case UM_SET_MESSAGE_PROTECTED: this->protectedMessage = a > 0; return 0; - case 158: + case UM_IS_MESSAGE_PROTECTED: return this->protectedMessage == 1; default: return UIFrameWnd::SendMsg(sender, message, a, b, c, d); @@ -805,7 +808,7 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i // OFFSET: 0x008BFB70 // FUNCTION: fn_11809 int UIMessageBoxAutoreturn::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } @@ -854,14 +857,14 @@ int UITalkboxTrapInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t TalkboxTrapRequest request; request.target = this->target; request.text = this->edit->Text(); - g_modeMgr.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_USE_SKILL_TOGROUND_WITH_TALKBOX, reinterpret_cast(&request), 0, 0, 0); } [[fallthrough]]; case ID_CANCEL: g_windowMgr.Schedule(this); } return 0; - case 68: + case UM_SET_SKILL_INFO: this->target = *reinterpret_cast(a); return 0; default: @@ -964,11 +967,11 @@ int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->Invalidate(); return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(125); + g_windowMgr.CloseWindow(WID_MERINFOWND); return 0; case ID_OPEN_MERSKILLLIST: - if (!g_windowMgr.CloseWindow(126)) { - g_windowMgr.EnsureWindow(126); + if (!g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_1)) { + g_windowMgr.EnsureWindow(WID_SKILLLISTWND_SKILLTAB_1); return 0; } @@ -977,9 +980,9 @@ int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i CMode* mode = g_modeMgr.GetGameMode(); if (g_windowMgr.Confirm(LookupMessage(1370), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - mode->SendMsg(186, 2, 0, 0, 0); - g_windowMgr.CloseWindow(125); - g_windowMgr.CloseWindow(126); + mode->SendMsg(MM_COMMAND_MER, 2, 0, 0, 0); + g_windowMgr.CloseWindow(WID_MERINFOWND); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_1); g_session.ResetMercenaryStats(); g_session.unknown_56B0 = 0; return 0; @@ -1290,7 +1293,7 @@ void UIReplayRECControlWnd::ApplyMode() { g_windowMgr.SetFocus(this->window_0134); } - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } // OFFSET: 0x008B9790 @@ -1330,7 +1333,7 @@ void UINoticeWnd::Paint() { int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_DEFPUSH: - this->SendMsg(nullptr, 6, 184, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_OK, 0, 0, 0); return 0; case UM_COMMAND: switch (a) { @@ -1357,7 +1360,7 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in std::fwrite(&position, 1, 1, file); std::fclose(file); - g_windowMgr.CloseWindow(93); + g_windowMgr.CloseWindow(WID_NOTICEWND); break; } case ID_NEXT: @@ -1389,9 +1392,9 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in const int previous = this->m_scroll; std::intptr_t delta = a; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { delta = -1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { delta = 1; } @@ -1417,9 +1420,9 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in // FUNCTION: fn_11793 void UINoticeWnd::OnWheel(int delta) { if (delta < 0) { - this->SendMsg(this->m_scrollBar, 7, 6, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, 6, 0, 0, 0); } else { - this->SendMsg(this->m_scrollBar, 7, -6, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, -6, 0, 0, 0); } } @@ -1614,7 +1617,7 @@ void UIMakeCharWnd::InitHairControls() { // OFFSET: 0x008B0B60 // FUNCTION: fn_11743 void UIMakeCharWnd::OnCreate(int, int) { - g_modeMgr.gameMode->SendMsg(10014, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GET_MAKING_CHAR_NAME, 0, 0, 0, 0); this->m_nameEdit = new UIBitmapEditCtrl(); this->m_nameEdit->SetBitmapName("유저인터페이스\\login_interface\\name-edit.bmp"); this->m_nameEdit->SetSize(this->m_nameEdit->geometry.width, this->m_nameEdit->geometry.height); @@ -2094,7 +2097,7 @@ void UIMessageBoxAutoreturn::OnProcess() { std::sprintf(text, this->format.c_str(), this->remaining); this->messageText = text; this->viewer->Clear(); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->messageText.data()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->messageText.data()), 38, 0, 0); } const unsigned duration = this->seconds * 1000; @@ -2305,10 +2308,10 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; case UM_COMMAND: switch (a) { - case 420: + case ID_START_REPLAY_RECORDING: if (!this->replayPathEnabled) { this->mode = 1; - g_modeMgr.gameMode->SendMsg(274, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_START_REPLAY_RECORDING, 0, 0, 0, 0); this->ApplyMode(); return 0; } @@ -2316,12 +2319,12 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->mode = 3; this->ApplyMode(); return 0; - case 421: + case ID_STOP_REPLAY_RECORDING: this->mode = 0; this->ApplyMode(); - g_modeMgr.gameMode->SendMsg(275, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_STOP_REPLAY_RECORDING, 0, 0, 0, 0); return 0; - case 422: { + case ID_CONFIRM_REPLAY_RECORDING_PATH: { auto* edit = static_cast(this->window_0134); int error; @@ -2334,7 +2337,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ReplayFileList::Instance().SetPath(edit->Text()); g_windowMgr.SetFocus(nullptr); edit->SetText(""); - g_modeMgr.gameMode->SendMsg(274, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_START_REPLAY_RECORDING, 0, 0, 0, 0); if (Replay::Instance().state == 1) { return 0; @@ -2348,17 +2351,17 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); return 0; } - case 423: + case ID_REPLAY_RECORDING_OPTIONS: this->mode = 2; this->ApplyMode(); return 0; - case 424: + case ID_CANCEL_REPLAY_RECORDING_OPTIONS: this->mode = 0; this->ApplyMode(); return 0; - case 425: + case ID_CLOSE_REPLAY_RECORDING: this->mode = 0; - g_windowMgr.CloseWindow(198); + g_windowMgr.CloseWindow(WID_REPLAYRECCONTROLWND); return 0; case ID_CHECK: if (sender == this->window_0128) { @@ -2416,7 +2419,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t default: return 0; } - case 116: + case UM_UPDATE_RECORD_TIME: this->UpdateRecordTime(); return 0; case UM_SETPOS: @@ -2427,7 +2430,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Invalidate(); this->InvalidateChildren(); return 0; - case 123: + case UM_REPLAY_FRAMED_DATA: case 251: return 0; default: @@ -2528,8 +2531,8 @@ void UIChatRoomWnd::SaveChatLog() { if (this->history->SaveChatLog(path)) { std::string message = path; message.append(" is Saved.", 10); - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message.c_str()), 0xFF00, 0, 0, 0); } } @@ -2758,28 +2761,28 @@ int UIReplayControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg switch (message) { case UM_COMMAND: switch (argument1) { - case 401: - g_modeMgr.gameMode->SendMsg(276, 0, 0, 0, 0); + case ID_PAUSE_REPLAY: + g_modeMgr.gameMode->SendMsg(MM_PAUSE_REPLAY, 0, 0, 0, 0); return 0; - case 402: - g_modeMgr.gameMode->SendMsg(277, 0, 0, 0, 0); + case ID_RESUME_REPLAY: + g_modeMgr.gameMode->SendMsg(MM_RESUME_REPLAY, 0, 0, 0, 0); return 0; - case 403: - g_modeMgr.gameMode->SendMsg(278, 0, 0, 0, 0); + case ID_RESTART_REPLAY: + g_modeMgr.gameMode->SendMsg(MM_RESTART_REPLAY, 0, 0, 0, 0); Replay::Instance().speed = 1.0f; return 0; - case 404: + case ID_EXIT_REPLAY: g_windowMgr.Schedule(this); - g_modeMgr.gameMode->SendMsg(281, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_EXIT_REPLAY, 0, 0, 0, 0); Replay::Instance().speed = 1.0f; return 0; - case 405: - g_modeMgr.gameMode->SendMsg(279, 0, 0, 0, 0); - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + case ID_INCREASE_REPLAY_SPEED: + g_modeMgr.gameMode->SendMsg(MM_INCREASE_REPLAY_SPEED, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return 0; - case 406: - g_modeMgr.gameMode->SendMsg(280, 0, 0, 0, 0); - this->SendMsg(nullptr, 60, 0, 0, 0, 0); + case ID_DECREASE_REPLAY_SPEED: + g_modeMgr.gameMode->SendMsg(MM_DECREASE_REPLAY_SPEED, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); return 0; } return 0; @@ -2853,27 +2856,27 @@ bool UIReplayControlWnd::RefreshInfo() { int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_SETCURITEM: - this->m_list->SendMsg(nullptr, 40, a, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_SETCURITEM, a, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; case UM_COMMAND: switch (a) { case ID_CANCEL: - case 400: + case ID_SELECT_REPLAY: Replay::Instance().SetState(1); g_windowMgr.Schedule(this); - g_modeMgr.gameMode->SendMsg(10025, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_REPLAY_SELECT_SERVER, 0, 0, 0, 0); return 0; case ID_OK: if (this->m_list->selected != -1) { @@ -2881,7 +2884,7 @@ int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Invalidate(); if (ReplayFileList::Instance().Open(32, 0, 0) == 1) { if (Replay::Instance().MatchesService(g_serviceMode)) { - g_modeMgr.gameMode->SendMsg(10027, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_START_REPLAY, 0, 0, 0, 0); g_windowMgr.Schedule(this); g_soundMgr->PlayWave("버튼소리.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); return 0; @@ -2895,14 +2898,14 @@ int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t break; case ID_EXIT: if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; } break; } break; - case 80: + case UM_SET_TARGET: this->UpdateInfo(); this->Invalidate(); return 0; @@ -3000,15 +3003,15 @@ bool UISelectReplayDataWnd::UpdateInfo() { int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { case UM_SETCURITEM: - this->m_serverList->SendMsg(nullptr, 40, this->m_selectedServer, 0, 0, 0); + this->m_serverList->SendMsg(nullptr, UM_SETCURITEM, this->m_selectedServer, 0, 0, 0); return 0; case UM_UPPUSH: - this->m_serverList->SendMsg(nullptr, 18, 0, 0, 0, 0); + this->m_serverList->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_DOWNPUSH: - this->m_serverList->SendMsg(nullptr, 19, 0, 0, 0, 0); + this->m_serverList->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; - case 80: { + case UM_SET_TARGET: { this->m_event = a; this->m_valueName = reinterpret_cast(b); const char* name = this->m_valueName.c_str(); @@ -3029,11 +3032,11 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } case UM_COMMAND: switch (a) { - case 400: + case ID_SELECT_REPLAY: reinterpret_cast(ReplayFileList::Instance()).SetBaseFrame(reinterpret_cast(&Replay::Instance())); ReplayFileList::Instance().unknown_011C = g_session.m_aid; ReplayFileList::Instance().unknown_0120 = g_session.SyncUnknown0E98(); - g_modeMgr.gameMode->SendMsg(10026, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SELECT_REPLAY_DATA, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; case ID_OK: @@ -3054,11 +3057,11 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; case ID_CANCEL: g_windowMgr.Schedule(this); - g_modeMgr.gameMode->SendMsg(10006, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_CANCEL, 0, 0, 0, 0); return 0; case ID_EXIT: if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; } @@ -3355,12 +3358,12 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int thread_local EncryptedName soundName(soundSource); g_soundMgr->PlayWave(soundName.Text(), 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); if (this->passwordEdit->Length() >= 6 && this->idEdit->Length() >= 4) { - g_modeMgr.gameMode->SendMsg(10000, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_CONNECT_TO_ACSVR, 0, 0, 0, 0); StringFormat(g_launchAccountPassword, 24, static_cast(-1), "%s", this->idEdit->Text()); - g_modeMgr.gameMode->SendMsg(10007, reinterpret_cast(this->passwordEdit->Text()), 0, 0, 0); - g_modeMgr.gameMode->SendMsg(10008, reinterpret_cast(this->idEdit->Text()), 0, 0, 0); - g_modeMgr.gameMode->SendMsg(10038, reinterpret_cast(this->unknown_00EC), 0, 0, 0); - g_windowMgr.CloseWindow(3); + g_modeMgr.gameMode->SendMsg(LMM_PASSWORD, reinterpret_cast(this->passwordEdit->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_ID, reinterpret_cast(this->idEdit->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SET_LOGIN_EXTRA, reinterpret_cast(this->unknown_00EC), 0, 0, 0); + g_windowMgr.CloseWindow(WID_LOGINWND); this->SaveLogin(); } else if (this->idEdit->Length() < 4) { g_windowMgr.Confirm(FormatOwnedString(LookupMessage(3029), 4).c_str(), 0, true, false, 0, "Message", 280, 120, 0); @@ -3371,7 +3374,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } case ID_CANCEL: g_loginCancelRequested = 1; - g_modeMgr.gameMode->SendMsg(10018, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GOTOSELECTACCOUNT, 0, 0, 0, 0); break; case ID_EXIT: this->SaveLogin(); @@ -3383,23 +3386,23 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->saveId = b; this->SaveLogin(); break; - case 229: { + case ID_CLASSCOMBO: { if (g_windowMgr.unknown_0214 != nullptr) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } - UIWindow* list = g_windowMgr.EnsureWindow(26); + UIWindow* list = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); this->unknown_00E4 = 1; const int count = static_cast(this->unknown_00D8.size()); for (unsigned int index = 0; index < this->unknown_00D8.size(); ++index) { - list->SendMsg(nullptr, 31, reinterpret_cast(this->unknown_00D8[index].c_str()), 0, 0, 0); + list->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(this->unknown_00D8[index].c_str()), 0, 0, 0); } - list->SendMsg(nullptr, 40, 0, 0, 0, 0); + list->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); int height = count * 16; if (height > 48) { height = 48; } list->Resize(74, height); - list->SendMsg(nullptr, 83, 3, 0, 0, 0); + list->SendMsg(nullptr, UM_SET_CALLER_WID, 3, 0, 0, 0); int x = 60; int y = 96; this->ToScreen(x, y); @@ -3416,14 +3419,14 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int break; } return 0; - case 88: + case UM_ENABLE_CANCEL: return 0; default: return UIFrameWnd::SendMsg(sender, message, a, b, c, d); } quit: - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; } @@ -3435,7 +3438,7 @@ int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: case UM_COMMAND: { if (a == 185) { if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); } } else if (a == 382) { @@ -3443,9 +3446,9 @@ int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: thread_local EncryptedName soundName(soundSource); g_soundMgr->PlayWave(soundName.Text(), 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); if (this->unknown_00B4->Length() == 8) { - g_modeMgr.gameMode->SendMsg(10024, reinterpret_cast(this->unknown_00B4->Text()), 0, 0, 0); - g_modeMgr.gameMode->SendMsg(39, 0, 0, 0, 0); - g_windowMgr.CloseWindow(180); + g_modeMgr.gameMode->SendMsg(LMM_SET_AUTH_CODE, reinterpret_cast(this->unknown_00B4->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SEND_LOGIN_AUTH_CODE, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_LOGINOTPWND); } else { g_windowMgr.Confirm(LookupMessage(3249), 0, true, false, 0, "Message", 280, 120, 0); } @@ -3653,7 +3656,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: std::sprintf(text, LookupMessage(2977), this->nameEdit->Text()); if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { - g_modeMgr.GetGameMode()->SendMsg(185, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_MER_RENAME, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(name, this->nameEdit->Text()); this->Invalidate(); return 0; @@ -3668,7 +3671,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } case ID_CLOSE: - g_windowMgr.CloseWindow(113); + g_windowMgr.CloseWindow(WID_HOMUNINFOWND); return 0; case ID_CHECK: if (sender == this->unknown_00D4) { @@ -3680,8 +3683,8 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; case ID_OPEN_HOMUNSKILLLIST: - if (!g_windowMgr.CloseWindow(114)) { - g_windowMgr.EnsureWindow(114); + if (!g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_0)) { + g_windowMgr.EnsureWindow(WID_SKILLLISTWND_SKILLTAB_0); } return 0; case ID_FEED_TO_HOMUN: @@ -3692,9 +3695,9 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case ID_DELETE_HOMUN: { CMode* mode = g_modeMgr.GetGameMode(); if (g_windowMgr.Confirm(LookupMessage(955), 2, false, false, 0, "Message", 280, 120, 0) == 187) { - mode->SendMsg(184, 2, 0, 0, 0); - g_windowMgr.CloseWindow(113); - g_windowMgr.CloseWindow(114); + mode->SendMsg(MM_COMMAND_HOMUN, 2, 0, 0, 0); + g_windowMgr.CloseWindow(WID_HOMUNINFOWND); + g_windowMgr.CloseWindow(WID_SKILLLISTWND_SKILLTAB_0); g_session.ClearHomunStatus(); g_session.unknown_5614 = 0; } @@ -3703,10 +3706,10 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: case 488: { CMode* mode = g_modeMgr.GetGameMode(); if (sender == this->unknown_00D0 && b == 187) { - if (g_windowMgr.LookupWindow(10011)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3551)), 255, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3551)), 255, 0, 0, 0); } else { - mode->SendMsg(184, 1, 0, 0, 0); + mode->SendMsg(MM_COMMAND_HOMUN, 1, 0, 0, 0); } } g_windowMgr.Schedule(this->unknown_00D0); @@ -3809,40 +3812,40 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i switch (a) { case 467: if (g_windowMgr.unknown_0458) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2985)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2985)), 255, 0, 0, 0); break; } this->window_00C4 = new UINormalMB(); this->window_00C4->Create(this, LookupMessage(601), 2, true, nullptr, 280, 120, nullptr); g_windowMgr.AddRendered(this->window_00C4); - g_windowMgr.CloseWindow(260); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; case 468: - mode->SendMsg(150, 2, 0, 0, 0); - g_windowMgr.CloseWindow(260); + mode->SendMsg(MM_COMMAND_PET, 2, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; case 469: - mode->SendMsg(150, 4, 0, 0, 0); - g_windowMgr.CloseWindow(260); + mode->SendMsg(MM_COMMAND_PET, 4, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; case 470: - mode->SendMsg(150, 3, 0, 0, 0); - g_windowMgr.CloseWindow(260); + mode->SendMsg(MM_COMMAND_PET, 3, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; case 471: if (g_session.m_petFriendly > 900) { - g_windowMgr.CloseWindow(260); - UIWindow* window = g_windowMgr.EnsureWindow(261); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); + UIWindow* window = g_windowMgr.EnsureWindow(WID_PETEVOLUTIONWND); const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).GetItemId(); - window->SendMsg(nullptr, 142, petEgg, b, 0, 0); - this->SendMsg(nullptr, 6, 201, 0, 0, 0); - g_windowMgr.CloseWindow(260); + window->SendMsg(nullptr, UM_SET_PET_EVOLUTION_MATERIALS, petEgg, b, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; } - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2576)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2576)), 255, 0, 0, 0); break; } - g_windowMgr.CloseWindow(260); + g_windowMgr.CloseWindow(WID_COMBOBOXIDWND); return 0; } case UM_COMMAND: @@ -3862,7 +3865,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i std::sprintf(text, LookupMessage(2931), this->nameEdit->Text()); if (g_windowMgr.Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { - g_modeMgr.GetGameMode()->SendMsg(145, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_PET_RENAME, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(g_session.unknown_1018, this->nameEdit->Text()); this->Invalidate(); return 0; @@ -3876,7 +3879,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; case ID_CLOSE: - g_windowMgr.CloseWindow(88); + g_windowMgr.CloseWindow(WID_PETINFOWND); return 0; case ID_CHECK: if (sender == this->unknown_00E8) { @@ -3888,7 +3891,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; case 268: { - UIWindow* menu = g_windowMgr.EnsureWindow(260); + UIWindow* menu = g_windowMgr.EnsureWindow(WID_COMBOBOXIDWND); std::string feed; std::string performance; std::string returnToEgg; @@ -3897,10 +3900,10 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i performance = LookupMessage(593); returnToEgg = LookupMessage(594); unequip = LookupMessage(595); - menu->SendMsg(nullptr, 31, reinterpret_cast(feed.c_str()), 467, 0, 0); - menu->SendMsg(nullptr, 31, reinterpret_cast(performance.c_str()), 468, 0, 0); - menu->SendMsg(nullptr, 31, reinterpret_cast(unequip.c_str()), 469, 0, 0); - menu->SendMsg(nullptr, 31, reinterpret_cast(returnToEgg.c_str()), 470, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(feed.c_str()), 467, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(performance.c_str()), 468, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(unequip.c_str()), 469, 0, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(returnToEgg.c_str()), 470, 0, 0); const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).GetItemId(); const std::pair> targets = g_petEvolutionMgr->GetEvolutionTargets(petEgg); if (targets.first == true) { @@ -3913,12 +3916,12 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } else { text = static_cast(FormatOwnedString(LookupMessage(2568), name)); } - menu->SendMsg(nullptr, 31, reinterpret_cast(text.c_str()), 471, *it, 0); + menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(text.c_str()), 471, *it, 0); } } - menu->SendMsg(nullptr, 40, 0, 0, 0, 0); + menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); menu->Resize(110, (static_cast(targets.second.size()) + 4) * 16); - menu->SendMsg(nullptr, 83, 88, 0, 0, 0); + menu->SendMsg(nullptr, UM_SET_CALLER_WID, 88, 0, 0, 0); int x = 160; int y = 44; this->ToScreen(x, y); @@ -3928,12 +3931,12 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 488: { CMode* mode = g_modeMgr.GetGameMode(); if (sender == this->window_00C4 && b == 187) { - if (g_windowMgr.LookupWindow(10011)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3550)), 255, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_EXCHANGEUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3550)), 255, 0, 0, 0); this->window_00C4 = nullptr; return 0; } - mode->SendMsg(150, 1, 0, 0, 0); + mode->SendMsg(MM_COMMAND_PET, 1, 0, 0, 0); } this->window_00C4 = nullptr; return 0; @@ -4173,7 +4176,7 @@ void UIMessageBoxAutoreturn::Configure(const char* text, int timeout) { this->viewer->backgroundColor = RGB(red, green, blue) | 0xFF000000u; this->viewer->Invalidate(); this->AddChild(this->viewer); - this->viewer->SendMsg(nullptr, 29, reinterpret_cast(this->messageText.c_str()), 38, 0, 0); + this->viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->messageText.c_str()), 38, 0, 0); this->gauge = new UIBarGraph2(); this->gauge->SetSize(240, 15); @@ -4257,7 +4260,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } - g_modeMgr.gameMode->SendMsg(10005, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SENDCHARINFO, 0, 0, 0, 0); g_windowMgr.Schedule(this); goto create; } @@ -4270,7 +4273,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; create: - g_modeMgr.gameMode->SendMsg(10015, reinterpret_cast(this->m_nameEdit->Text()), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SET_MAKING_CHAR_NAME, reinterpret_cast(this->m_nameEdit->Text()), 0, 0, 0); int values[8]; values[0] = this->m_info.stats[0]; values[1] = this->m_info.stats[1]; @@ -4280,14 +4283,14 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: values[5] = this->m_info.stats[5]; values[6] = this->m_info.headPalette; values[7] = this->m_info.head; - g_modeMgr.gameMode->SendMsg(10017, reinterpret_cast(values), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SET_CHAR_PARAM, reinterpret_cast(values), 0, 0, 0); return 0; } case ID_CANCEL: g_windowMgr.Schedule(this); - g_modeMgr.gameMode->SendMsg(0, 10004, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, 10004, 0, 0, 0); return 0; - case 227: { + case ID_LEFT: { int action = this->m_view.action + 1; if (action >= this->m_view.unknown_0148 + 8) { action = this->m_view.unknown_0148; @@ -4296,7 +4299,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->Invalidate(); return 0; } - case 226: + case ID_RIGHT: if (--this->m_view.action < this->m_view.unknown_0148) { this->m_view.action = this->m_view.unknown_0148 + 7; } @@ -4309,7 +4312,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: char name[25] = {}; std::strcpy(name, this->m_nameEdit->Text()); std::memcpy(this->m_info.name, name, sizeof(this->m_info.name)); - this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, this->m_message0, 0, 0, 0); return 0; } case UM_SCROLLHORZ: @@ -4318,9 +4321,9 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: const int sex = this->m_info.sex; if (sender == this->unknown_02CC) { const int previous = this->unknown_02D4; - if (message == 11) { + if (message == UM_SCROLLHORZPAGEUP) { this->unknown_02D4 = previous - 1; - } else if (message == 12) { + } else if (message == UM_SCROLLHORZPAGEDOWN) { this->unknown_02D4 = previous + 1; } else { this->unknown_02D4 = a + previous; @@ -4348,9 +4351,9 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: if (sender == this->unknown_02D0) { const int previous = this->unknown_02D8; - if (message == 11) { + if (message == UM_SCROLLHORZPAGEUP) { this->unknown_02D8 = previous - 1; - } else if (message == 12) { + } else if (message == UM_SCROLLHORZPAGEDOWN) { this->unknown_02D8 = previous + 1; } else { this->unknown_02D8 = a + previous; @@ -4381,7 +4384,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // OFFSET: 0x008AF190 // FUNCTION: fn_11742 void UILoginWnd::OnCreate(int, int) { - this->unknown_00BC = g_windowMgr.EnsureWindow(325); + this->unknown_00BC = g_windowMgr.EnsureWindow(WID_RPIMAGEWND2); UIRPImageWnd2* backgroundWindow = static_cast(this->unknown_00BC); const char backgroundSource[] = {'\xA7', '\x04', '\x51', '\x5F', '\x61', '\xF1', '\x26', '\xDE', '\xA1', '\x4F', '\x51', '\x69', '\x1C', '\x85', '\xBF', '\x7F', '\x08', '\xCC', '\xF8', '\xCB', '\xFE', '\x56', '\x8D', '\x67', '\x02', '\xD9', '\xF7', '\xC4', '\xC2', '\x5A', '\xBF', '\x71', '\x00', '\xF4', '\xFD', '\xCA', '\xC6', '\x56', @@ -4556,7 +4559,7 @@ void UILoginWnd::OnCreate(int, int) { this->unknown_00E8->Clear(); this->unknown_00E8->AddOption(LookupMessage(3250), 0); this->unknown_00E8->Select(0); - this->SendMsg(this->unknown_00E8, 39, 0, 0, 0, 0); + this->SendMsg(this->unknown_00E8, UM_COMBOBOX_SELECTED, 0, 0, 0, 0); this->idEdit->maximum = 24; this->passwordEdit->maximum = 24; diff --git a/Source/UI/Window/UIMiniBtnWnd.cpp b/Source/UI/Window/UIMiniBtnWnd.cpp index 57240b91c..16032f5b3 100644 --- a/Source/UI/Window/UIMiniBtnWnd.cpp +++ b/Source/UI/Window/UIMiniBtnWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIMiniBtnWnd.h" +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -37,7 +38,7 @@ void UIMiniBtnWnd::OnLBtnDown(int, int) { if (window) { window->Show(visible); - window->SendMsg(this, 6, 271, visible, 0, 0); + window->SendMsg(this, UM_COMMAND, ID_APPLY, visible, 0, 0); } this->Invalidate(); } @@ -56,7 +57,7 @@ void UIMiniBtnWnd::Toggle() { if (window) { window->Show(visible); - window->SendMsg(this, 6, 271, visible, 0, 0); + window->SendMsg(this, UM_COMMAND, ID_APPLY, visible, 0, 0); } this->Invalidate(); } diff --git a/Source/UI/Window/UINavigationHelpWnd.cpp b/Source/UI/Window/UINavigationHelpWnd.cpp index 0a467e81d..fdb5a32ac 100644 --- a/Source/UI/Window/UINavigationHelpWnd.cpp +++ b/Source/UI/Window/UINavigationHelpWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UINavigationHelpWnd.h" #include "Contents/MessageTable.h" @@ -16,36 +18,36 @@ void UINavigationHelpWnd::OnCreate(int width, int height) { this->m_viewer->backgroundRed = 0xd2; this->AddChild(this->m_viewer); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2241)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2242)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2243)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2244)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2245)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2246)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2247)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2248)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2249)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2250)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2251)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2252)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2253)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2254)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2255)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(2256)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3216)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(" "), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3217)), 0x30, 0, 0); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(LookupMessage(3218)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2241)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2242)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2243)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2244)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2245)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2246)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2247)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2248)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2249)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2250)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2251)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2252)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2253)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2254)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2255)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(2256)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3216)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(" "), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3217)), 0x30, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(LookupMessage(3218)), 0x30, 0, 0); this->AddCloseButton(LookupMessage(2202), 0); } @@ -60,8 +62,8 @@ void UINavigationHelpWnd::Paint() { // OFFSET: 0x009359D0 // FUNCTION: fn_12748 int UINavigationHelpWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 6 && a == 201) { - g_windowMgr.CloseWindow(229); + if (message == UM_COMMAND && a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_NAVIGATIONHELPWND); } return 0; } diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index d15ca88fa..4baa888cd 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UINavigationWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Application/Launcher.h" @@ -168,7 +169,7 @@ void UINavigationWnd::OnCreate(int width, int height) { // FUNCTION: fn_12702 void UINavigationWnd::OnLBtnUp(int x, int y) { if (static_cast(x - 8) <= 126 && static_cast(y - 39) <= 126) { - this->SendMsg(this, 6, 429, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, 429, 0, 0, 0); } this->UIFrameWnd::OnLBtnUp(x, y); } @@ -298,60 +299,60 @@ void UINavigationWnd::RefreshRouteList() { return; } - this->SendMsg(nullptr, 31, 441, reinterpret_cast(LookupMessage(0x8B2)), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(LookupMessage(0x8B2)), 0, 0); char text[100]; std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B3), g_navigationManager.GetRouteResult(), nodeCount); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); int lineOffset; if (target.type == 2) { CNavi_Object* npc = static_cast(target.object); std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B4), npc->GetInfo()->GetTitle(), npc->GetInfo()->GetName()); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); std::memset(text, 0, sizeof(text)); NaviCell cellX; NaviCell cellY; std::sprintf(text, LookupMessage(0x8B5), npc->GetName(), npc->GetCell(&cellX)->x, npc->GetCell(&cellY)->y); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); lineOffset = 5; } else if (target.type == 3) { CNavi_Object* mob = static_cast(target.object); std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B4), mob->GetInfo()->GetTitle(), mob->GetInfo()->GetName()); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); std::string kind; kind = LookupMessage(mob->GetType() == 301 ? 0x8B6 : 0x8B7); std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B8), mob->GetName(), kind.c_str()); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); lineOffset = 5; } else if (target.type == 1) { CNaviInfo* map = static_cast(target.object); std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B4), map->GetTitle(), map->GetName()); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); lineOffset = 4; } else if (target.type == 0) { CNaviInfo* map = static_cast(target.object); std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8B4), map->GetTitle(), map->GetName()); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); std::memset(text, 0, sizeof(text)); NaviCell cellX; NaviCell cellY; std::sprintf(text, LookupMessage(0x8B9), g_navigationManager.GetDestinationCell(&cellX)->x, g_navigationManager.GetDestinationCell(&cellY)->y); - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); lineOffset = 5; } else { return; } - this->SendMsg(nullptr, 31, 441, reinterpret_cast(LookupMessage(0x8BA)), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(LookupMessage(0x8BA)), 0, 0); this->m_searchPanel->SetLineOffset(lineOffset); CNavi_Link* previous = nullptr; @@ -383,7 +384,7 @@ void UINavigationWnd::RefreshRouteList() { node->GetCell(&cellY)->y ); } - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); previous = node; } @@ -408,7 +409,7 @@ void UINavigationWnd::RefreshRouteList() { } else { std::sprintf(text, LookupMessage(0x8BE), nodeCount, destination.c_str()); } - this->SendMsg(nullptr, 31, 441, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 441, reinterpret_cast(text), 0, 0); if (g_navigationManager.GetSelectedNode() == -1) { if (g_navigationManager.GetRouteFlag()) { @@ -624,7 +625,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Invalidate(); return 0; case UM_COMMAND: - if (argument1 != 0x150 && argument1 != 0x1B9) { + if (argument1 != ID_SELECT_ITEM && argument1 != 0x1B9) { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); } @@ -638,7 +639,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume result = g_navigationManager.Navigate(target.x, target.y); } if (result >= 0) { - this->SendMsg(this, 6, 0xBD, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_BUTTON1, 0, 0, 0); this->RefreshRouteList(); if (g_windowMgr.modal) { static_cast(g_windowMgr.modal)->RefreshWorldMapMarks(); @@ -652,7 +653,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume if (this->m_titleBar->Length() != 0) { g_navigationManager.unknown_1264 = this->m_titleBar->Text(); g_navigationManager.RefreshSearch(); - this->SendMsg(this, 6, 0xBE, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_BUTTON2, 0, 0, 0); if (g_windowMgr.modal) { static_cast(g_windowMgr.modal)->RefreshWorldMapLevels(); return 0; @@ -728,17 +729,17 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume g_windowMgr.Schedule(this); g_windowMgr.window_4F174 = nullptr; return 0; - case 0xBD: + case ID_BUTTON1: g_navigationManager.unknown_125C = 1; this->LayoutTabs(); return 0; - case 0xBE: + case ID_BUTTON2: g_navigationManager.unknown_125C = 0; this->LayoutTabs(); return 0; case 0xBF: { if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(0x1A); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } this->ClearHistory(); @@ -747,15 +748,15 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume EnumerateFileNames(this->m_history, directory.c_str(), "txt"); const int count = static_cast(this->m_history.size()); if (count != 0) { - UIWindow* historyWindow = g_windowMgr.EnsureWindow(0x1A); + UIWindow* historyWindow = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); for (std::vector::iterator it = this->m_history.begin(); it != this->m_history.end(); ++it) { - historyWindow->SendMsg(nullptr, 0x1F, reinterpret_cast(it->c_str()), 0, 0, 0); + historyWindow->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(it->c_str()), 0, 0, 0); } const int height = (std::min)(0xA0, count * 0x10); - historyWindow->SendMsg(nullptr, 0x28, 0, 0, 0, 0); + historyWindow->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); historyWindow->Resize(0xA0, height); - historyWindow->SendMsg(nullptr, 0x53, 0xCB, 0, 0, 0); + historyWindow->SendMsg(nullptr, UM_SET_CALLER_WID, 0xCB, 0, 0, 0); int x = this->geometry.width - 0xA5; int y = 0x24; @@ -779,8 +780,8 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; case ID_HELP: - if (!g_windowMgr.CloseWindow(0xE5)) { - g_windowMgr.EnsureWindow(0xE5); + if (!g_windowMgr.CloseWindow(WID_NAVIGATIONHELPWND)) { + g_windowMgr.EnsureWindow(WID_NAVIGATIONHELPWND); return 0; } break; @@ -808,7 +809,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume g_navigationManager.unknown_1260 = static_cast(argument1); this->Invalidate(); if (g_replayAnimationScaling != 0) { - this->unknown_00EC->SendMsg(nullptr, 0x39, argument1, 0, 0, 0); + this->unknown_00EC->SendMsg(nullptr, UM_CHANGEMSG, argument1, 0, 0, 0); return 0; } break; @@ -829,7 +830,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } case UM_DEFPUSH: if (this->m_titleBar == sender && this->m_titleBar->Length() > 0) { - this->SendMsg(this->m_titleBar, 6, 0x141, 0, 0, 0); + this->SendMsg(this->m_titleBar, UM_COMMAND, ID_SEARCH, 0, 0, 0); return 0; } case UM_RESIZE: @@ -858,7 +859,7 @@ void UINavigationWnd::FillRouteList() { char text[64]; std::memset(text, 0, sizeof(text)); std::sprintf(text, LookupMessage(0x8AE), g_navigationManager.StateCount()); - this->SendMsg(nullptr, 0x1F, 0x150, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 0x150, reinterpret_cast(text), 0, 0); this->m_routePanel->SetLineOffset(1); for (int index = 0; index < g_navigationManager.StateCount(); ++index) { @@ -897,7 +898,7 @@ void UINavigationWnd::FillRouteList() { std::sprintf(text, LookupMessage(0x976), state.name.c_str(), info->GetName(), state.x, state.y); } } - this->SendMsg(nullptr, 0x1F, 0x150, reinterpret_cast(text), 0, 0); + this->SendMsg(nullptr, UM_ADDITEM, 0x150, reinterpret_cast(text), 0, 0); } } diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index 8056e1714..7ce8a5d90 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UINewMakeCharWnd.h" @@ -37,7 +38,7 @@ UINewMakeCharWnd::UINewMakeCharWnd() m_raceViews() { this->geometry.unknown_0034 = 0; - const int* preset = reinterpret_cast(g_modeMgr.gameMode->SendMsg(10016, 0, 0, 0, 0)); + const int* preset = reinterpret_cast(g_modeMgr.gameMode->SendMsg(LMM_GET_CHAR_PARAM, 0, 0, 0, 0)); this->m_stats[0] = static_cast(preset[0]); this->m_stats[1] = static_cast(preset[1]); this->m_stats[2] = static_cast(preset[2]); @@ -303,7 +304,7 @@ void UIHairStyleButton::OnCreate(int width, int height) { this->m_preview = new (std::nothrow) UIHairBitmap(); this->m_preview->SetSize(36, 37); this->AddChild(this->m_preview); - this->SendMsg(nullptr, 40, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); } // OFFSET: 0x007DBFD0 @@ -475,7 +476,7 @@ void UINewMakeCharWnd::OnCreate(int width, int height) { this->m_hairStyleButtons[index]->Move((index % 4) * 0x26 + 0x25E, (index / 4) * 0x25 + 0x3B); this->AddChild(this->m_hairStyleButtons[index]); if (index == 0) { - this->m_hairStyleButtons[0]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_hairStyleButtons[0]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } } @@ -501,7 +502,7 @@ void UINewMakeCharWnd::OnCreate(int width, int height) { sprintf(name, "유저인터페이스\\make_character_ver2\\color%02d_on.bmp", index + 1); button->SetBitmap(name, 2); if (index == 0) { - button->SendMsg(this, 13, 1, 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } button->m_value = 0x1EF; button->Move((index % 5) * 0x1B + 0x26B, (index / 5) * 0x18 + 0x132); @@ -521,7 +522,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum char name[25] = {}; strcpy(name, this->m_nameEdit->Text()); memcpy(this->m_name, name, sizeof(this->m_name)); - this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, this->m_message0, 0, 0, 0); return 0; } case UM_COMMAND: @@ -579,7 +580,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; } - g_modeMgr.gameMode->SendMsg(0x2715, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_SENDCHARINFO, 0, 0, 0, 0); g_windowMgr.Schedule(this); } else { if (hasControlCharacter || allowed == 0) { @@ -594,7 +595,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } CMode* mode = g_modeMgr.gameMode; - mode->SendMsg(0x271F, reinterpret_cast(this->m_nameEdit->Text()), 0, 0, 0); + mode->SendMsg(LMM_SET_MAKING_CHAR_NAME, reinterpret_cast(this->m_nameEdit->Text()), 0, 0, 0); int payload[8]; payload[0] = this->m_stats[0]; payload[1] = this->m_stats[1]; @@ -604,7 +605,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum payload[5] = this->m_stats[5]; payload[6] = this->m_headPalette; payload[7] = this->m_head; - mode->SendMsg(0x2721, reinterpret_cast(payload), 0, 0, 0); + mode->SendMsg(LMM_SET_CHAR_PARAM, reinterpret_cast(payload), 0, 0, 0); return 0; } @@ -614,7 +615,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum case ID_CANCEL: g_windowMgr.Schedule(this); - g_modeMgr.gameMode->SendMsg(0, 0x2714, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, 0x2714, 0, 0, 0); return 0; case ID_SLOT: @@ -622,9 +623,9 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum for (int index = 0; index < 2; ++index) { if (sender == this->m_raceViews[index]) { this->m_race = index; - this->m_raceViews[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_raceViews[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); } else { - this->m_raceViews[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_raceViews[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } this->m_raceViews[index]->Invalidate(); } @@ -632,9 +633,9 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (sender == this->m_raceViews[this->m_race]) { this->m_head = 1; for (int index = 0; index < 24; ++index) { - this->m_hairStyleButtons[index]->SendMsg(this, 13, index == 0, 0, 0, 0); + this->m_hairStyleButtons[index]->SendMsg(this, UM_SETSTATE, index == 0, 0, 0, 0); this->m_hairStyleButtons[index]->m_race = this->m_race; - this->m_hairStyleButtons[index]->SendMsg(nullptr, 0x28, 0, 0, 0, 0); + this->m_hairStyleButtons[index]->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); } if (this->m_race == 0) { @@ -651,14 +652,14 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (argument2 == 0x1EF) { for (int index = 0; index < 9; ++index) { if (sender == this->m_hairColorButtons[index]) { - this->m_hairColorButtons[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_hairColorButtons[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_headPalette = static_cast(index); if (this->m_headPalette < 0) { this->m_headPalette = 8; } this->UpdatePreviewResources(); } else { - this->m_hairColorButtons[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_hairColorButtons[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } } @@ -690,14 +691,14 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum if (index >= (g_session.IsDoramJob(this->m_job) == true ? 6 : 0x17)) { return 0; } - this->m_hairStyleButtons[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_hairStyleButtons[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_head = static_cast(index + 1); if (this->m_head < 0) { this->m_head = 0; } this->UpdatePreviewResources(); } else { - this->m_hairStyleButtons[index]->SendMsg(this, 13, 0, 0, 0, 0); + this->m_hairStyleButtons[index]->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); } } return 0; @@ -724,7 +725,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum for (int index = 0; index < 24; ++index) { this->m_hairStyleButtons[index]->m_sex = this->m_sex; - this->m_hairStyleButtons[index]->SendMsg(nullptr, 0x28, 0, 0, 0, 0); + this->m_hairStyleButtons[index]->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); } this->UpdatePreviewResources(); return 0; diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index 19e38f384..008d50c8f 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Contents/MessageTable.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" @@ -182,7 +184,7 @@ void UINewSelectCharWnd::OnCreate(int width, int height) { button->SetSlot(slot, -1); this->AddChild(button); this->m_slotButtons2[index] = button; - button->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, index == this->m_pageSlot, 0, 0, 0); } UIStaticBitmap* info = new UIStaticBitmap(); @@ -376,7 +378,7 @@ void UINewSelectCharWnd::OnCreate(int width, int height) { } for (int index = 0; index < this->m_totalSlots; ++index) { - CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (character == nullptr) { continue; } @@ -390,7 +392,7 @@ void UINewSelectCharWnd::OnCreate(int width, int height) { std::memset(message, 0, sizeof(message)); std::sprintf(message, LookupMessage(0x974), index, 0x9C41); g_windowMgr.Confirm(message, 0, true, false, 0, "Message", 0x118, 0x78, 0); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); break; } @@ -460,7 +462,7 @@ void UINewSelectCharWnd::OnCreate(int width, int height) { this->AddChild(name); this->m_characterWindows[column] = name; - const CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + const CharacterInfo* character = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (character != nullptr) { name->SetTextFitted(character->name); name->Move(x + 0x58 - this->TextWidth(name->GetText().c_str(), 0, 0, 0xC, 0, 0) / 2, y + 0xBD); @@ -482,7 +484,7 @@ void UINewSelectCharWnd::Paint() { continue; } - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, slot, 0, 0, 0)); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, slot, 0, 0, 0)); const int column = slot % this->m_slotsPerPage; if (g_session.m_premiumSlotCount > 0 && slot >= g_session.m_normalSlotCount && slot < g_session.m_normalSlotCount + g_session.m_premiumSlotCount) { this->DrawTextAt(column * 163 + 136, 50, "Premium ", 0, 1, 15, 0xFF, 0, 0); @@ -534,7 +536,7 @@ void UINewSelectCharWnd::Paint() { } } - const CharacterInfo* selected = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + const CharacterInfo* selected = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); if (selected && selected->deleteDate > 0) { Timestamp deleteDate(selected->deleteDate); if (deleteDate.IsBeforeNow() == 1) { @@ -557,14 +559,14 @@ void __stdcall Nullsub244(int, int) { void UINewSelectCharWnd::OnProcess() { if (g_mouse.buttons[0] == 3) { if (g_windowMgr.unknown_0210 != 0) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } } if (g_mouse.buttons[0] != 0) { this->Invalidate(); } - UIWindow* wnd = g_windowMgr.LookupWindow(93); + UIWindow* wnd = g_windowMgr.LookupWindow(WID_NOTICEWND); if (wnd) { g_windowMgr.Promote(wnd); } @@ -578,7 +580,7 @@ void UINewSelectCharWnd::OnProcess() { // OFFSET: 0x007D77D0 // FUNCTION: fn_09594 int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (g_windowMgr.unknown_03BC != nullptr || g_windowMgr.unknown_03B8 != nullptr || g_windowMgr.LookupWindow(0x116) != nullptr) { + if (g_windowMgr.unknown_03BC != nullptr || g_windowMgr.unknown_03B8 != nullptr || g_windowMgr.LookupWindow(WID_NEWMAKECHARWND) != nullptr) { return 0; } @@ -591,9 +593,9 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } CharacterInfo* info = - reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); if (info == nullptr) { - this->SendMsg(nullptr, 6, 0xCB, this->m_pageSlot, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MAKE, this->m_pageSlot, 0, 0); break; } @@ -617,7 +619,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } g_soundMgr->PlayWave("버튼소리.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); - g_modeMgr.gameMode->SendMsg(0, 0x2712, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, 0x2712, 0, 0, 0); this->m_unknown13C = true; if (this->m_windowFC != nullptr) { UIBitmapButton* button = static_cast(this->m_windowFC); @@ -631,21 +633,21 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg g_accountLinkedUserDataMgr->Save(); if (g_session.m_loginModeFlag == 1) { if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(0x271B, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GOTO_LOGIN, 0, 0, 0, 0); } } else if (g_windowMgr.Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); g_windowMgr.Schedule(this); } break; case ID_MAKE: if (this->m_pageSlot != argument2) { this->m_pageSlot = argument2; - this->SendMsg(this->m_slotButtons2[argument2], 6, 0xCC, 0, 0, 0); + this->SendMsg(this->m_slotButtons2[argument2], UM_COMMAND, ID_SLOT, 0, 0, 0); } if (this->m_slotStatus[static_cast(g_selectedSlotIndex)] == 1 && static_cast(g_selectedSlotIndex) < g_session.m_producibleSlotCount && - g_windowMgr.EnsureWindow(0x116) != nullptr) { - g_windowMgr.CloseWindow(0x115); + g_windowMgr.EnsureWindow(WID_NEWMAKECHARWND) != nullptr) { + g_windowMgr.CloseWindow(WID_NEWSELECTCHARWND); } break; case ID_SLOT: { @@ -656,16 +658,16 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg for (int index = 0; index < this->m_slotsPerPage; ++index) { UIWindow* button = this->m_slotButtons2[index]; if (sender != button) { - button->SendMsg(this, 13, 0, 0, 0, 0); + button->SendMsg(this, UM_SETSTATE, 0, 0, 0, 0); continue; } this->m_pageSlot = index; g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + index); - this->m_slotButtons2[index]->SendMsg(this, 13, 1, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); if (argument2 != 0xE2 && this->m_slotStatus[static_cast(g_selectedSlotIndex)] != 0 && static_cast(this->m_slotButtons2[index])->unknown_0128 == 0) { - this->SendMsg(nullptr, 6, 0xCB, this->m_pageSlot, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MAKE, this->m_pageSlot, 0, 0); break; } } @@ -673,7 +675,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (argument2 == 0xE2) { bool shown = false; const CharacterInfo* info = - reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); const int selected = static_cast(g_selectedSlotIndex); if (this->m_unknown138 != selected && selected < this->m_maxCharacters) { if (info == nullptr) { @@ -704,7 +706,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } const CharacterInfo* info = - reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); const BlockedCharacterEntry* blocked = reinterpret_cast(&g_session.unknown_07F4[0x40]); for (int index = 0; index < g_session.unknown_59D0; ++index) { if (info->gid == blocked[index].gid) { @@ -719,7 +721,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg if (g_windowMgr.Confirm(LookupMessage(0x13), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { this->m_unknown118 = true; if (g_windowMgr.RunEmailAddress() == 0xB8) { - g_modeMgr.gameMode->SendMsg(0, 0x271A, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_COMMAND, 0x271A, 0, 0, 0); g_windowMgr.Schedule(this); } this->m_unknown118 = false; @@ -730,7 +732,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case ID_NOTICE: { char text[260]; std::memset(text, 0, sizeof(text)); - g_modeMgr.gameMode->SendMsg(0x2724, reinterpret_cast(text), 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GET_BILLING_INFO, reinterpret_cast(text), 0, 0, 0); g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 0x118, 0x78, 0); break; } @@ -775,7 +777,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg button->SetSlot(-1, index); this->m_characterWindows[column]->SetText("", 0); if (index < static_cast(g_session.m_producibleSlotCount)) { - button->SendMsg(nullptr, 0x1AF, 0, 0, 0, 0); + button->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 0, 0, 0, 0); } else { button->SetDisabled(1); button->Invalidate(); @@ -784,8 +786,8 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } button->SetSlot(index, -1); - button->SendMsg(nullptr, 0x1AF, 1, 0, 0, 0); - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + button->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 1, 0, 0, 0); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (info != nullptr) { this->m_characterWindows[column]->SetTextFitted(info->name); UIStaticText* name = this->m_characterWindows[column]; @@ -841,7 +843,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg button->SetSlot(-1, index); this->m_characterWindows[column]->SetText("", 0); if (index < static_cast(g_session.m_producibleSlotCount)) { - button->SendMsg(nullptr, 0x1AF, 0, 0, 0, 0); + button->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 0, 0, 0, 0); } else { button->SetDisabled(1); button->Invalidate(); @@ -850,8 +852,8 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } button->SetSlot(index, -1); - button->SendMsg(nullptr, 0x1AF, 1, 0, 0, 0); - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + button->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 1, 0, 0, 0); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (info != nullptr) { this->m_characterWindows[column]->SetTextFitted(info->name); UIStaticText* name = this->m_characterWindows[column]; @@ -868,18 +870,18 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } case ID_CHANGE_NAME: { if (g_windowMgr.window_03DC != nullptr) { - g_windowMgr.CloseWindow(0x80); + g_windowMgr.CloseWindow(WID_CHANGENAMEWND); } - const std::intptr_t info = g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0); - UIWindow* window = g_windowMgr.EnsureWindow(0x80); + const std::intptr_t info = g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0); + UIWindow* window = g_windowMgr.EnsureWindow(WID_CHANGENAMEWND); if (window != nullptr) { - window->SendMsg(nullptr, 0x22, info, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, info, 0, 0, 0); } break; } case ID_CHANGE_NAME_SUCCESS: { CharacterInfo* info = - reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); if (info->gid != g_renameGid) { break; } @@ -900,7 +902,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } const CharacterInfo* info = - reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); + reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, static_cast(g_selectedSlotIndex), 0, 0, 0)); CharacterGidPacket packet; packet.id = 0x827; packet.gid = info->gid; @@ -915,12 +917,12 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } case 0x1A0: - g_windowMgr.EnsureWindow(200); - g_windowMgr.unknown_03BC->SendMsg(nullptr, 6, 0x124, 0, 0, 0); - g_windowMgr.unknown_03BC->SendMsg(nullptr, 6, 0xB8, 1, 0, 0); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDEDITWND); + g_windowMgr.unknown_03BC->SendMsg(nullptr, UM_COMMAND, ID_CHANGE_STORE_PASSWORD, 0, 0, 0); + g_windowMgr.unknown_03BC->SendMsg(nullptr, UM_COMMAND, ID_OK, 1, 0, 0); break; case 0x1A1: - g_windowMgr.EnsureWindow(200); + g_windowMgr.EnsureWindow(WID_SECONDPASSWORDEDITWND); break; case 0x1A2: { CharacterGidPacket packet; @@ -935,7 +937,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 0x1B1: { const unsigned char selected = static_cast(g_selectedSlotIndex); if (g_windowMgr.Confirm(LookupMessage(0x7E0), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, this->m_unknown138, 0, 0, 0)); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, this->m_unknown138, 0, 0, 0)); if (info != nullptr) { CharacterMovePacket packet; packet.id = 0x8D4; @@ -950,15 +952,15 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } case 0x1B2: this->m_slotButtons2[0]->OnLBtnDown(0, 0); - this->SendMsg(nullptr, 6, 0x1B0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 0x1B0, 0, 0, 0); break; case 0x1B3: this->m_slotButtons2[1]->OnLBtnDown(0, 0); - this->SendMsg(nullptr, 6, 0x1B0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 0x1B0, 0, 0, 0); break; case 0x1B4: this->m_slotButtons2[2]->OnLBtnDown(0, 0); - this->SendMsg(nullptr, 6, 0x1B0, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 0x1B0, 0, 0, 0); break; } break; @@ -972,7 +974,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_windowMgr.HasModalWindow() != 1 && this->m_unknown118 != true) { const int previous = this->m_pageSlot; @@ -982,11 +984,11 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_pageSlot = previous; break; } - this->SendMsg(nullptr, 6, 0x13C, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_PREV_PAGE, 0, 0, 0); this->m_pageSlot += this->m_slotsPerPage; } for (int index = 0; index < this->m_slotsPerPage; ++index) { - this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(this, UM_SETSTATE, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); this->UpdateCharacterInfo(); @@ -998,7 +1000,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_windowMgr.HasModalWindow() != 1 && this->m_unknown118 != true) { const int previous = this->m_pageSlot; @@ -1009,12 +1011,12 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } if (this->m_pageSlot >= this->m_slotsPerPage) { if (this->m_page < this->m_pageCount - 1) { - this->SendMsg(nullptr, 6, 0x13D, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_NEXT_PAGE, 0, 0, 0); } this->m_pageSlot %= this->m_slotsPerPage * this->m_page; } for (int index = 0; index < this->m_slotsPerPage; ++index) { - this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(this, UM_SETSTATE, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); this->UpdateCharacterInfo(); @@ -1026,7 +1028,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_windowMgr.HasModalWindow() != 1 && this->m_unknown118 != true) { if (--this->m_pageSlot < 0) { @@ -1034,11 +1036,11 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_pageSlot = 0; break; } - this->SendMsg(nullptr, 6, 0x13C, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_PREV_PAGE, 0, 0, 0); this->m_pageSlot = this->m_slotsPerPage - 1; } for (int index = 0; index < this->m_slotsPerPage; ++index) { - this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(this, UM_SETSTATE, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); this->UpdateCharacterInfo(); @@ -1050,7 +1052,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } if (g_windowMgr.unknown_0210 != nullptr) { - g_windowMgr.CloseWindow(0x12); + g_windowMgr.CloseWindow(WID_MENUWND); } if (g_windowMgr.HasModalWindow() != 1 && this->m_unknown118 != true) { const int previous = this->m_pageSlot; @@ -1061,12 +1063,12 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } if (this->m_pageSlot >= this->m_slotsPerPage) { if (this->m_page < this->m_pageCount - 1) { - this->SendMsg(nullptr, 6, 0x13D, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_NEXT_PAGE, 0, 0, 0); } this->m_pageSlot %= this->m_slotsPerPage * this->m_page; } for (int index = 0; index < this->m_slotsPerPage; ++index) { - this->m_slotButtons2[index]->SendMsg(this, 13, index == this->m_pageSlot, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(this, UM_SETSTATE, index == this->m_pageSlot, 0, 0, 0); } g_selectedSlotIndex = static_cast(this->m_page * this->m_slotsPerPage + this->m_pageSlot); this->UpdateCharacterInfo(); @@ -1074,7 +1076,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; case UM_DELETE: - this->SendMsg(nullptr, 6, 0xD3, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_DELETE, 0, 0, 0); break; default: return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); @@ -1113,7 +1115,7 @@ __declspec(noinline) void UINewSelectCharWnd::UpdateDeleteButtons() { return; } - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, slot, 0, 0, 0)); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, slot, 0, 0, 0)); if (!info) { return; } @@ -1150,9 +1152,9 @@ void UINewSelectCharWnd::UpdateSlotButtons() { static_cast(this->m_slotButtons2[index])->SetSlot(this->m_slotStatus[slot] ? -1 : slot, slot); if (slot < g_session.m_producibleSlotCount && this->m_slotStatus[slot] == 1 && slot < g_session.m_validSlotCount) { - this->m_slotButtons2[index]->SendMsg(nullptr, 431, 0, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 0, 0, 0, 0); } else { - this->m_slotButtons2[index]->SendMsg(nullptr, 431, 1, 0, 0, 0); + this->m_slotButtons2[index]->SendMsg(nullptr, UM_SET_CHARACTER_SLOT_STYLE, 1, 0, 0, 0); } } @@ -1167,7 +1169,7 @@ void UINewSelectCharWnd::UpdateCharacterInfo() { return; } - const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, current, 0, 0, 0)); + const CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, current, 0, 0, 0)); if (info) { static_cast(this->m_slotButtons[0])->SetTextFitted(g_session.GetJobName(info->job, info->sex)); static_cast(this->m_slotButtons[1])->SetTextFitted(FormatOwnedString("%d", info->level).c_str()); diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index 9cc93033e..f6baea513 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -1,4 +1,7 @@ #include "Contents/Jobs/JobId.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Render/DeviceContext/DCSurface.h" #include "UI/Window/UINewSkillListWnd.h" @@ -114,7 +117,7 @@ void UINewSkillListWnd::StoreInfo() { // OFFSET: 0x009B2C60 // FUNCTION: fn_13821 void UINewSkillListWnd::OnWheel(int delta) { - UIWindow* window = g_windowMgr.LookupWindow(46); + UIWindow* window = g_windowMgr.LookupWindow(WID_SKILLDESCRIBEWND); if (window && window->geometry.visible) { static_cast(window)->m_scrollBar->OnWheel(delta); return; @@ -128,7 +131,7 @@ void UINewSkillListWnd::OnWheel(int delta) { if (delta >= 0) { step = -step; } - this->SendMsg(this->m_scrollBar, 7, step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, step, 0, 0, 0); } } @@ -144,7 +147,7 @@ void UINewSkillListWnd::ApplySkillPoints() { const int next = skill->unknown_0030 + 1; if (next <= value) { for (int count = value - next + 1; count != 0; --count) { - g_modeMgr.gameMode->SendMsg(0x43, id, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_UPGRADE_SKILLLEVEL, id, 0, 0, 0); } } } @@ -157,7 +160,7 @@ void UINewSkillListWnd::ApplySkillPoints() { for (auto it = pending.begin(); it != pending.end(); ++it, ++current) { if (current->available != 0 && current->id == it->id && current->level < it->level) { for (int i = 0; i < it->level - current->level; ++i) { - g_modeMgr.gameMode->SendMsg(0x43, current->id, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_UPGRADE_SKILLLEVEL, current->id, 0, 0, 0); } } } @@ -885,7 +888,7 @@ void UINewSkillListWnd::OnCreate(int width, int height) { if (!g_session.m_skillBundle.extraIds.empty()) { this->m_tabs->SetFlag(static_cast(this->m_tabs->labels.size()) - 1, true); } - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); } // OFFSET: 0x009B2160 @@ -973,7 +976,7 @@ void UINewSkillListWnd::OnLBtnDblClk(int x, int y) { } else { automatic.DisableAll(); } - this->SendMsg(nullptr, 58, reinterpret_cast(&skill), 0, 0, 0); + this->SendMsg(nullptr, UM_USESKILL, reinterpret_cast(&skill), 0, 0, 0); } } @@ -1096,18 +1099,18 @@ void UINewSkillListWnd::OnRBtnUp(int x, int y) { } const CSkillInfo& skill = **selected; - UISkillDescribeWnd* describe = static_cast(g_windowMgr.LookupWindow(46)); + UISkillDescribeWnd* describe = static_cast(g_windowMgr.LookupWindow(WID_SKILLDESCRIBEWND)); if (describe && (describe->m_skillId == static_cast(skill.id) || !skill.available)) { - g_windowMgr.CloseWindow(46); + g_windowMgr.CloseWindow(WID_SKILLDESCRIBEWND); return; } - UIWindow* window = g_windowMgr.EnsureWindow(46); + UIWindow* window = g_windowMgr.EnsureWindow(WID_SKILLDESCRIBEWND); if (!window) { return; } - window->SendMsg(nullptr, 61, skill.id, skill.unknown_0018, skill.level, 1); + window->SendMsg(nullptr, UM_SKILLDESCRIBE, skill.id, skill.unknown_0018, skill.level, 1); int originX = 0; int originY = 0; @@ -1124,7 +1127,7 @@ void UINewSkillListWnd::OnRBtnUp(int x, int y) { } window->Move(left, top); - g_windowMgr.ShowWindowById(46, 1); + g_windowMgr.ShowWindowById(WID_SKILLDESCRIBEWND, 1); } // OFFSET: 0x009B2CD0 @@ -1307,9 +1310,9 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->m_saved->Reset(); } if (gate != 0) { - this->SendMsg(nullptr, 14, 3, 330, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, 330, this->m_saved->height, 0); } else { - this->SendMsg(nullptr, 14, 3, 560, 400, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, 560, 400, 0); } return 0; case UM_RESIZE: @@ -1339,30 +1342,30 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(37); + g_windowMgr.CloseWindow(WID_SKILLLISTWND); return 0; case ID_APPLY: if (g_windowMgr.Confirm(LookupMessage(1377), 2, false, false, 0, "Message", 280, 120, 0) == 187) { this->ApplySkillPoints(); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); if (ChatWindow()) { g_windowMgr.SetFocus(ChatWindow()->m_suggestions); return 0; } } break; - case 363: + case ID_RESET: this->ResetLists(); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; case ID_MINI: this->StoreInfo(); this->m_needsRedraw = 1; gate = gate == 0; if (gate != 0) { - this->SendMsg(nullptr, 14, 3, 330, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, 330, this->m_saved->height, 0); } else { - this->SendMsg(nullptr, 14, 3, 560, 400, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, 560, 400, 0); } return 0; case ID_CHECK: { @@ -1391,7 +1394,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 216: { + case ID_PLUS: { const int tab = this->m_tab; int next = 0; if (tab + 1 != this->m_tabs->TabCount()) { @@ -1457,10 +1460,10 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; int next; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { next = previous - this->m_visibleRows + 1; } else { - if (message == 10) { + if (message == UM_SCROLLVERTPAGEDOWN) { a = this->m_visibleRows - 1; } next = a + previous; @@ -1477,12 +1480,12 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s case UM_USESKILL: { const CSkillInfo* skill = reinterpret_cast(a); if (skill->level != 0) { - gameMode->SendMsg(113, a, g_session.UseLevel(skill->id), 0, 0); + gameMode->SendMsg(MM_USING_SKILL, a, g_session.UseLevel(skill->id), 0, 0); return 0; } break; } - case 161: + case UM_REFRESH_EXTRA_SKILL_TAB: if (!this->IsExtraTab(this->m_tab)) { this->m_tabs->SetFlag(this->m_tabs->TabCount() - 1, !g_session.m_skillBundle.extraIds.empty()); this->m_tabs->Invalidate(); @@ -1550,7 +1553,7 @@ bool UINewSkillListWnd::IncreaseSkillLevel(int skillId) { if (static_cast(info->unknown_002C) <= 0) { const char* name = info->DisplayName(*g_session.m_hotkeyScript); - g_windowMgr.SendNotice(1, reinterpret_cast(FormatString(LookupMessage(0xDCB), name)), 0xFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatString(LookupMessage(0xDCB), name)), 0xFF, 0, 0, 0); return false; } diff --git a/Source/UI/Window/UINormalMB.cpp b/Source/UI/Window/UINormalMB.cpp index 5bf523513..0c47c9447 100644 --- a/Source/UI/Window/UINormalMB.cpp +++ b/Source/UI/Window/UINormalMB.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Window/UINormalMB.h" #include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" @@ -35,7 +36,7 @@ int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int action->second(); } else { if (this->m_owner) { - this->m_owner->SendMsg(this, 6, 488, id, 0, 0); + this->m_owner->SendMsg(this, UM_COMMAND, 488, id, 0, 0); } if (this->m_keepOpen) { @@ -50,7 +51,7 @@ int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int case UM_CHANGEMSG: this->m_viewer->Clear(); - this->m_viewer->SendMsg(nullptr, 29, a, 38, 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, a, 38, 0, 0); return 0; default: @@ -104,7 +105,7 @@ void UINormalMB::Create(UIWindow* owner, const char* text, int type, bool defaul this->m_viewer->backgroundColor = RGB(red, green, blue) | 0xFF000000u; this->m_viewer->Invalidate(); this->AddChild(this->m_viewer); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(this->m_message.c_str()), static_cast(width / 7.5), 0, 0); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(this->m_message.c_str()), static_cast(width / 7.5), 0, 0); switch (type) { case 4: diff --git a/Source/UI/Window/UINoteWnd.cpp b/Source/UI/Window/UINoteWnd.cpp index 9ffe594ee..30cfa34ec 100644 --- a/Source/UI/Window/UINoteWnd.cpp +++ b/Source/UI/Window/UINoteWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UINoteWnd.h" +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "UI/Buttons/UIBasicButton.h" #include "UI/Lists/UIScrollBar.h" @@ -56,9 +57,9 @@ void UINoteWnd_Scroll::OnLBtnUp(int x, int y) { void UINoteWnd_Scroll::OnWheel(int delta) { if (this->wheelScroll == 1) { if (delta < 0) { - this->SendMsg(this->scrollBar, 7, 12, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, 12, 0, 0, 0); } else { - this->SendMsg(this->scrollBar, 7, -12, 0, 0, 0); + this->SendMsg(this->scrollBar, UM_SCROLLVERT, -12, 0, 0, 0); } } } @@ -72,11 +73,11 @@ UINoteWnd::UINoteWnd() // OFFSET: 0x00950840 // FUNCTION: fn_12944 int UINoteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { - if (argument1 == 201) { + if (message == UM_COMMAND) { + if (argument1 == ID_CLOSE) { g_windowMgr.CloseWindow(this->geometry.id); } - } else if (message == 0x22) { + } else if (message == UM_SETINFO) { UINoteWnd_Scroll* scroll = this->m_scroll; const std::string text = LookupMessage(static_cast(argument1)); UIStaticText_LF* label = new UIStaticText_LF(0); diff --git a/Source/UI/Window/UIOpenMailBoxWnd.cpp b/Source/UI/Window/UIOpenMailBoxWnd.cpp index f7e0980cd..892a3f9ad 100644 --- a/Source/UI/Window/UIOpenMailBoxWnd.cpp +++ b/Source/UI/Window/UIOpenMailBoxWnd.cpp @@ -1,4 +1,6 @@ #include "UI/Window/UIOpenMailBoxWnd.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Buttons/UIBitmapButton.h" #include "Contents/MessageTable.h" #include "UI/Window/UIWindowMgr.h" @@ -29,7 +31,7 @@ void UIOpenMailBoxWnd::Paint() { // OFFSET: 0x00950A60 // FUNCTION: fn_12945 int UIOpenMailBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 6) { + if (message != UM_COMMAND) { return this->UIWindow::SendMsg(sender, message, a, b, c, d); } @@ -37,28 +39,28 @@ int UIOpenMailBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st return 0; } - if (g_windowMgr.LookupWindow(295)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2992)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_REFININGWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2992)), 0xFF, 0, 0, 0); return 0; } - if (g_windowMgr.LookupWindow(343)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3715)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_GRADEENCHANTWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3715)), 0xFF, 0, 0, 0); return 0; } - if (g_windowMgr.LookupWindow(10006)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3843)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_ENCHANTUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(3843)), 0xFF, 0, 0, 0); return 0; } - if (g_windowMgr.LookupWindow(361)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(4054)), 0xFF, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(4054)), 0xFF, 0, 0, 0); return 0; } - if (!g_windowMgr.CloseWindow(263)) { - g_windowMgr.EnsureWindow(263); + if (!g_windowMgr.CloseWindow(WID_RODEXINBOXWND)) { + g_windowMgr.EnsureWindow(WID_RODEXINBOXWND); } return 0; diff --git a/Source/UI/Window/UIPartyBookingHelpWnd.cpp b/Source/UI/Window/UIPartyBookingHelpWnd.cpp index c57984af4..375d9e9f1 100644 --- a/Source/UI/Window/UIPartyBookingHelpWnd.cpp +++ b/Source/UI/Window/UIPartyBookingHelpWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIPartyBookingHelpWnd.h" #include "Client/Session.h" @@ -28,7 +30,7 @@ void UIPartyBookingHelpWnd::OnCreate(int width, int height) { if (help.size()) { char* text = new char[help.size() + 4]; sprintf(text, "%s%s", g_serverLanguage->Prefix(true), help.c_str()); - this->m_viewer->SendMsg(nullptr, 29, reinterpret_cast(text), 0, 1, 1); + this->m_viewer->SendMsg(nullptr, UM_SETTEXT, reinterpret_cast(text), 0, 1, 1); } } } @@ -43,11 +45,11 @@ void UIPartyBookingHelpWnd::Paint() { // OFFSET: 0x00938810 // FUNCTION: fn_12751 int UIPartyBookingHelpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } if (argument1 == 201) { - g_windowMgr.CloseWindow(173); + g_windowMgr.CloseWindow(WID_PARTYBOOKINGHELPWND); } return 0; } diff --git a/Source/UI/Window/UIPetEvolutionWnd.cpp b/Source/UI/Window/UIPetEvolutionWnd.cpp index 174b60113..23613a708 100644 --- a/Source/UI/Window/UIPetEvolutionWnd.cpp +++ b/Source/UI/Window/UIPetEvolutionWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIPetEvolutionWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" @@ -135,12 +136,12 @@ namespace { int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_COMMAND: - if (argument1 == 184) { + if (argument1 == ID_OK) { std::vector materials; for (auto it = this->m_materials.begin(); it != this->m_materials.end(); ++it) { ITEM_INFO item = LookupClientItem(g_session.m_inventoryItems, it->first, 1); if (item.quantity < it->second) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2574)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2574)), 255, 0, 0, 0); return 0; } materials.push_back(static_cast(item.unknown_0000[1])); @@ -148,7 +149,7 @@ int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } if (g_session.unknown_1038 != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2607)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2607)), 255, 0, 0, 0); return 0; } @@ -161,9 +162,9 @@ int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu packet.evolvedEggId = this->m_evolvedEggId; std::memcpy(packet.materials, materials.data(), count * 2); GetRagConnection().Send(static_cast(length), &packet); - g_windowMgr.CloseWindow(261); - } else if (argument1 == 185 || argument1 == 201) { - g_windowMgr.CloseWindow(261); + g_windowMgr.CloseWindow(WID_PETEVOLUTIONWND); + } else if (argument1 == ID_CANCEL || argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_PETEVOLUTIONWND); } break; @@ -171,11 +172,11 @@ int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu ITEM_INFO item; item.SetItemId(argument1); item.identified = 1; - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); break; } - case 142: { + case UM_SET_PET_EVOLUTION_MATERIALS: { this->m_materials.clear(); this->m_petEggId = argument1; this->m_evolvedEggId = argument2; diff --git a/Source/UI/Window/UIRebirthWnd.cpp b/Source/UI/Window/UIRebirthWnd.cpp index 22d92e437..fb8307666 100644 --- a/Source/UI/Window/UIRebirthWnd.cpp +++ b/Source/UI/Window/UIRebirthWnd.cpp @@ -1,4 +1,7 @@ #include "UI/Window/UIRebirthWnd.h" +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" @@ -41,30 +44,30 @@ void UIRebirthWnd::OnCreate(int width, int height) { // FUNCTION: fn_12753 int UIRebirthWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { CMode* mode = g_modeMgr.GetGameMode(); - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } switch (argument1) { case ID_CANCEL: - g_windowMgr.CloseWindow(129); + g_windowMgr.CloseWindow(WID_REBIRTHWND); break; case ID_RESTART: - mode->SendMsg(25, 0, 0, 0, 0); - g_windowMgr.CloseWindow(129); + mode->SendMsg(MM_RESTART, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REBIRTHWND); break; case ID_QUIT: - g_windowMgr.CloseWindow(129); - mode->SendMsg(88, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REBIRTHWND); + mode->SendMsg(MM_QUIT_GAME, 0, 0, 0, 0); break; case ID_TO_CHARACTER_SELECT: - mode->SendMsg(25, 1, 0, 0, 0); - g_windowMgr.CloseWindow(129); - g_windowMgr.CloseWindow(269); + mode->SendMsg(MM_RESTART, 1, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REBIRTHWND); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); break; case ID_REBIRTH: - mode->SendMsg(250, 0, 0, 0, 0); - g_windowMgr.CloseWindow(129); + mode->SendMsg(MM_REBIRTH, 0, 0, 0, 0); + g_windowMgr.CloseWindow(WID_REBIRTHWND); break; } return 0; diff --git a/Source/UI/Window/UIResizer.cpp b/Source/UI/Window/UIResizer.cpp index 0672f331e..5eaf192a7 100644 --- a/Source/UI/Window/UIResizer.cpp +++ b/Source/UI/Window/UIResizer.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Resource/Bitmap/BitmapResource.h" @@ -105,7 +106,7 @@ void UIResizer::OnMouseMove(int x, int y) { break; } - this->parent->SendMsg(this, 14, this->direction, width, height, 0); + this->parent->SendMsg(this, UM_RESIZE, this->direction, width, height, 0); } // OFFSET: 0x0085FA20 diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index 745d3b3da..24d73686e 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIRoMapWnd.h" #include "UI/Window/UIEnums.h" #include "Script/LuaScript.h" @@ -102,7 +104,7 @@ void UIRoMapWnd::UpdateNavigationButtons() { // FUNCTION: fn_12725 void UIRoMapWnd::OnRBtnUp(int, int) { if (g_windowMgr.unknown_0214 != 0) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } this->unknown_0208 = 0; @@ -283,7 +285,7 @@ void UIRoMapWnd::DrawFieldLabels() { // OFFSET: 0x0091A7D0 // FUNCTION: fn_12601 void UIRoMapWnd::DrawRecordBorders() { - const std::string mapName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(9, 0, 0, 0, 0)); + const std::string mapName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); for (std::list::const_iterator it = this->m_records.begin(); it != this->m_records.end(); ++it) { if (g_worldViewMgr.currentWorld != it->worldIndex) { continue; @@ -419,7 +421,7 @@ void UIRoMapWnd::DrawMarks() { // OFFSET: 0x0091B170 // FUNCTION: fn_12604 void UIRoMapWnd::DrawRecordFaces(int) { - const std::string mapName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(9, 0, 0, 0, 0)); + const std::string mapName = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); const int faceSize = g_worldViewMgr.screenScale * 2 + 8; std::string image = "유저인터페이스\\worldview_interface\\wv_face1.bmp"; for (std::list::const_iterator it = this->m_records.begin(); it != this->m_records.end(); ++it) { @@ -476,7 +478,7 @@ void UIRoMapWnd::RefreshPartyRecords() { } } } else { - std::string map = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(9, 0, 0, 0, 0)); + std::string map = reinterpret_cast(g_modeMgr.GetGameMode()->SendMsg(MM_QUERYRSWNAME, 0, 0, 0, 0)); WorldViewRecord record; record.name = map; std::string name = g_session.DecodePlayerName(); @@ -729,18 +731,18 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_COMMAND: switch (argument1) { case ID_CLOSE: - g_windowMgr.CloseWindow(140); + g_windowMgr.CloseWindow(WID_ROMAPWND); return 0; - case 192: + case ID_STATUS: this->m_showLabels = !this->m_showLabels; this->m_labelCheck->geometry.unknown_0030 = this->m_showLabels; this->m_labelCheck->Invalidate(); this->Invalidate(); return 0; - case 200: - g_windowMgr.EnsureWindow(203); + case ID_BASE: + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); if (g_windowMgr.window_4F174) { - g_windowMgr.window_4F174->SendMsg(nullptr, 6, 200, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, UM_COMMAND, ID_BASE, 0, 0, 0); } this->UpdateNavigationButtons(); return 0; @@ -769,7 +771,7 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } g_navigationManager.unknown_1254 = false; g_navigationManager.SearchNavigation(name, 0, false); - if (g_windowMgr.LookupWindow(203)) { + if (g_windowMgr.LookupWindow(WID_NAVIGATIONV4WND)) { static_cast(g_windowMgr.window_4F174)->SelectRoute(0); static_cast(g_windowMgr.window_4F174)->SelectRouteNode(0); } @@ -789,7 +791,7 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, case UM_DEFPUSH: if (sender == this->m_searchEdit) { if (this->m_searchEdit->Length() > 0) { - this->SendMsg(this->m_searchEdit, 6, 321, 0, 0, 0); + this->SendMsg(this->m_searchEdit, UM_COMMAND, ID_SEARCH, 0, 0, 0); return 0; } } diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index ae27088dd..2733888c4 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Render/Text/FontCache.h" #include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" @@ -234,16 +236,16 @@ void UIRodexContentsWnd::OnMouseHover(int x, int y) { void UIRodexContentsWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->GetItemAtPoint(x, y); if (std::atoi(item.itemId.c_str()) != 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } // OFFSET: 0x008029E0 // FUNCTION: fn_10025 int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { + if (message == UM_COMMAND) { switch (argument1) { - case 0xBD: + case ID_BUTTON1: if (this->m_items.size() != 0) { if (g_modeMgr.GetGameMode() && static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen() == 1) { break; @@ -259,7 +261,7 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); } break; - case 0xBE: + case ID_BUTTON2: if (this->m_zeny > 0) { if (g_modeMgr.GetGameMode() && static_cast(g_modeMgr.GetGameMode())->IsMenuWindowOpen() == 1) { break; @@ -276,10 +278,10 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; case ID_CLOSE: - g_windowMgr.CloseWindow(265); + g_windowMgr.CloseWindow(WID_RODEXCONTENTSWND); g_rodexMailStore->currentMailId = 0; if (g_windowMgr.unknown_0454) { - reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, 60, 0, 0, 0, 0); + reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } break; case ID_DELETE: { @@ -299,24 +301,24 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } if ((mail->second.unknown_0001 & 6) != 0) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xA34)), 0x64FFFF, 0, 0, 0); break; } if (g_windowMgr.Confirm(LookupMessage(0x164), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { - g_modeMgr.GetGameMode()->SendMsg(0xC4, static_cast(g_rodexMailStore->currentMailId), g_rodexMailStore->unknown_0010, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_DELETE_MAIL, static_cast(g_rodexMailStore->currentMailId), g_rodexMailStore->unknown_0010, 0, 0); if (g_windowMgr.unknown_045C != 0) { - g_windowMgr.CloseWindow(265); + g_windowMgr.CloseWindow(WID_RODEXCONTENTSWND); } } break; } case ID_SEND_MAIL: if (this->unknown_010C != 1) { - g_modeMgr.GetGameMode()->SendMsg(0x10C, reinterpret_cast(this->m_title.c_str()), 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_OPEN_WRITE_RODEX, reinterpret_cast(this->m_title.c_str()), 0, 0, 0); } break; - case 0x136: { + case ID_REPORT_RODEX: { RodexMailReportPacket packet; packet.packetType = 0xB98; packet.mailId = static_cast(g_rodexMailStore->currentMailId); @@ -324,7 +326,7 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } } - } else if (message == 23) { + } else if (message == UM_REFRESHITEM) { this->m_items.clear(); for (int i = 0; i < 5; ++i) { ITEM_INFO item = g_session.GetItem5C68(i); @@ -333,7 +335,7 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } } this->Invalidate(); - } else if (message == 106) { + } else if (message == UM_SET_DISABLE) { if (this->unknown_010C && this->unknown_0108) { UIBasicButton* button = this->unknown_0108; button->SetDisabled(1); @@ -380,7 +382,7 @@ void UIRodexContentsWnd::SetMailContents(std::string title, std::string sender, if (text.find("") == std::string::npos && text.find("") == std::string::npos) { this->m_contents->SetText(text.c_str()); } else { - this->m_contents->SendMsg(nullptr, 0x99, reinterpret_cast(text.c_str()), 0, 0, 0); + this->m_contents->SendMsg(nullptr, UM_INSERT_ITEM_LINK, reinterpret_cast(text.c_str()), 0, 0, 0); } this->m_contents->SetTagColor(0xD630A9); @@ -420,7 +422,7 @@ void UIRodexContentsWnd::SetMailContents(std::string title, std::string sender, } if (this->unknown_010C == 1) { - this->SendMsg(nullptr, 106, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_SET_DISABLE, 0, 0, 0, 0); } } diff --git a/Source/UI/Window/UIRoulletteWnd.cpp b/Source/UI/Window/UIRoulletteWnd.cpp index 2dc125ff8..808b3a941 100644 --- a/Source/UI/Window/UIRoulletteWnd.cpp +++ b/Source/UI/Window/UIRoulletteWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIRoulletteWnd.h" #include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" @@ -301,7 +302,7 @@ void UIRoulletteWnd::OnProcess() { this->m_startSprite->SetState(3); this->m_startSprite->Move(-100, -100); this->m_startSprite->SetTooltip(""); - this->SendMsg(nullptr, 6, 409, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_ROULETTE_GENERATE, 0, 0, 0); this->m_startButton->SetState(2); } @@ -315,7 +316,7 @@ void UIRoulletteWnd::OnProcess() { this->m_prizeSprite->SetState(3); this->m_prizeSprite->Move(-100, -100); this->m_prizeSprite->SetTooltip(""); - this->SendMsg(nullptr, 6, 410, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_ROULETTE_RECEIVE_ITEM, 0, 0, 0); this->m_prizeButton->SetState(2); } @@ -350,26 +351,26 @@ void UIRoulletteWnd::OnRBtnDown(int x, int y) { } if (item.quantity != 0) { - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 24, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } // OFFSET: 0x0080CB90 // FUNCTION: fn_10092 int UIRoulletteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 6) { + if (message == UM_COMMAND) { switch (argument1) { case ID_CLOSE: if (g_rouletteMgr->m_spinning == 0) { if (g_windowMgr.unknown_0464 != nullptr) { - g_windowMgr.CloseWindow(269); + g_windowMgr.CloseWindow(WID_ROULLETTEWND); return 0; } } else { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2640)), 0x6464FF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(2640)), 0x6464FF, 0, 0, 0); } break; - case 409: + case ID_ROULETTE_GENERATE: if (this->m_enabled == 1) { RouletteGeneratePacket packet; packet.id = ID_CZ_REQ_GENERATE_ROULETTE; @@ -378,7 +379,7 @@ int UIRoulletteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen return 0; } break; - case 410: + case ID_ROULETTE_RECEIVE_ITEM: if (g_rouletteMgr->m_resultShown == 1) { RouletteReceiveItemPacket packet; packet.id = ID_CZ_RECV_ROULETTE_ITEM; @@ -391,7 +392,7 @@ int UIRoulletteWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen return 0; } - if (message == 60) { + if (message == UM_REFRESH) { this->Invalidate(); return 0; } diff --git a/Source/UI/Window/UISecondCostumeWnd.cpp b/Source/UI/Window/UISecondCostumeWnd.cpp index 0c9de16b6..96bac7ce7 100644 --- a/Source/UI/Window/UISecondCostumeWnd.cpp +++ b/Source/UI/Window/UISecondCostumeWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "UI/Window/UIWindowMgr.h" @@ -228,7 +229,7 @@ int UISecondCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, case UM_COMMAND: switch (a) { case ID_CLOSE: - g_windowMgr.CloseWindow(259); + g_windowMgr.CloseWindow(WID_SECONDCOSTUMEWND); break; case ID_RIGHT: diff --git a/Source/UI/Window/UISeekPartyListWnd.cpp b/Source/UI/Window/UISeekPartyListWnd.cpp index 9b9f9bf68..a20e3f71d 100644 --- a/Source/UI/Window/UISeekPartyListWnd.cpp +++ b/Source/UI/Window/UISeekPartyListWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UISeekPartyListWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -242,8 +243,8 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } this->Move(this->m_saved->x, this->m_saved->y); - this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->m_saved->width, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); return 0; case UM_COMMAND: switch (argument1) { @@ -257,11 +258,11 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_minimized = !this->m_minimized; this->Invalidate(); return 0; - case 284: + case ID_CHARGE: this->Invalidate(); return 0; case ID_HELP: - g_windowMgr.EnsureWindow(0xAD); + g_windowMgr.EnsureWindow(WID_PARTYBOOKINGHELPWND); return 0; case 365: case 380: { @@ -355,12 +356,12 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg const PartyBookingEntry entry = it->second; if (entry.isEnd) { - this->SendMsg(nullptr, 6, 0x17C, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 0x17C, 0, 0, 0); g_session.m_partyBooking.EraseEntry(it->first); } else { const std::string leaderName = it->second.leaderName; if (leaderName != g_session.DecodePlayerName()) { - g_windowMgr.SendNotice(14, reinterpret_cast(leaderName.c_str()), 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(leaderName.c_str()), 0, 0, 0, 0); } } return 0; @@ -369,25 +370,25 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } case ID_CLOSE: g_session.m_partyBooking.m_alarm = this->m_alarmCheck->geometry.unknown_0030 != 0; - g_windowMgr.CloseWindow(0xA9); + g_windowMgr.CloseWindow(WID_SEEKPARTYLISTWND); return 0; default: return 0; } case UM_TEXT_LBTN_UP: - if (argument1 != 378 || g_windowMgr.CloseWindow(0xA8)) { + if (argument1 != 378 || g_windowMgr.CloseWindow(WID_SEEKPARTYMBWND)) { return 0; } - g_windowMgr.EnsureWindow(0xA8); + g_windowMgr.EnsureWindow(WID_SEEKPARTYMBWND); return 0; case UM_SCROLLVERT: case UM_SCROLLVERTPAGEUP: case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; int next; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { next = previous - this->m_visibleRows + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { next = previous + this->m_visibleRows - 1; } else { next = static_cast(argument1) + previous; @@ -424,7 +425,7 @@ void UISeekPartyListWnd::NotifyNewAd() { if (this->m_alarmCheck->geometry.unknown_0030 != 0) { g_soundMgr->PlayWave("party_alarm.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); const char* message = LookupMessage(0x6D9); - g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 15, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(message), 0xFFFF00, 15, 0, 0); } } @@ -462,7 +463,7 @@ void UISeekPartyListWnd::OnWheel(int delta) { if (delta >= 0) { step = -step; } - this->SendMsg(this->m_scrollBar, 7, step, 0, 0, 0); + this->SendMsg(this->m_scrollBar, UM_SCROLLVERT, step, 0, 0, 0); } } @@ -509,7 +510,7 @@ void UISeekPartyListWnd::OnLBtnDblClk(int x, int y) { this->Invalidate(); } - this->SendMsg(nullptr, 6, 0x17d, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, 0x17d, 0, 0, 0); } // OFFSET: 0x00931090 diff --git a/Source/UI/Window/UISeekPartyMBWnd.cpp b/Source/UI/Window/UISeekPartyMBWnd.cpp index 4e7aee2df..f519b7b70 100644 --- a/Source/UI/Window/UISeekPartyMBWnd.cpp +++ b/Source/UI/Window/UISeekPartyMBWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UISeekPartyMBWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -81,7 +82,7 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st const int maximum = g_session.m_maxLevel; if (this->m_registration.detail.level >= 1 && this->m_registration.detail.level <= maximum) { this->m_registration.detail.mapId = static_cast((this->m_type + 1) * 256 | this->m_subType); - if (!g_windowMgr.CloseWindow(164)) { + if (!g_windowMgr.CloseWindow(WID_SEEKPARTYWND)) { PACKET_CZ_PARTY_BOOKING_REQ_REGISTER packet; packet.packetType = ID_CZ_PARTY_BOOKING_REQ_REGISTER; packet.detail = this->m_registration.detail; @@ -97,8 +98,8 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } case ID_CANCEL: case ID_CLOSE: - g_windowMgr.CloseWindow(168); - g_windowMgr.CloseWindow(170); + g_windowMgr.CloseWindow(WID_SEEKPARTYMBWND); + g_windowMgr.CloseWindow(WID_JOBLISTWND); break; case ID_MINI: if (this->m_minimized) { @@ -120,8 +121,8 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } this->Move(this->m_saved->x, this->m_saved->y); - this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); - this->SendMsg(nullptr, 23, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_RESIZE, 3, this->m_saved->width, this->m_saved->height, 0); + this->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); break; case UM_COMBOBOX_SELECTED: if (sender == this->m_typeCombo) { @@ -425,5 +426,5 @@ void UISeekPartyMBWnd::LoadRegionMaps() { } this->m_typeCombo->Select(0); - this->SendMsg(this->m_typeCombo, 0x27, 0, 0, 0, 0); + this->SendMsg(this->m_typeCombo, UM_COMBOBOX_SELECTED, 0, 0, 0, 0); } diff --git a/Source/UI/Window/UISelCharForUServerWnd.cpp b/Source/UI/Window/UISelCharForUServerWnd.cpp index 63334bc52..97c030fca 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.cpp +++ b/Source/UI/Window/UISelCharForUServerWnd.cpp @@ -1,3 +1,4 @@ +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UISelCharForUServerWnd.h" #include "UI/Window/UIEnums.h" #include "Client/Mode/CLoginMode.h" @@ -78,7 +79,7 @@ void UISelCharForUServerWnd::OnCreate(int, int) { } for (int index = 0; index < g_session.unknown_0E94; ++index) { - CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (!info) { continue; } @@ -134,7 +135,7 @@ void UISelCharForUServerWnd::OnCreate(int, int) { // OFFSET: 0x0093A7F0 // FUNCTION: fn_12758 int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message != 6) { + if (message != UM_COMMAND) { return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); } @@ -149,7 +150,7 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t for (int index = 0; index < g_session.unknown_0E94; ++index) { if (this->m_checkBoxes[index]->geometry.unknown_0030 != 0) { CMode* mode = g_modeMgr.gameMode; - const int* character = reinterpret_cast(mode->SendMsg(8, index, 0, 0, 0)); + const int* character = reinterpret_cast(mode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (character) { characterIds[count++] = *character; } @@ -205,7 +206,7 @@ void UISelCharForUServerWnd::UpdateCharInfoBalloon(int x, int y, std::uint32_t c this->unknown_19EC.clear(); if (x > 26 && x < this->geometry.width - 26 && static_cast(y - 95) < 270 && (y > 249 || y < 211)) { const int index = (y - 95) / 135 * this->m_columns + (x - 27) / 81; - CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, index, 0, 0, 0)); + CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(MM_QUERYCHARICTORINFO, index, 0, 0, 0)); if (info) { char name[25]; std::memcpy(name, info->name, sizeof(info->name)); diff --git a/Source/UI/Window/UISerachStoreInfoWnd.cpp b/Source/UI/Window/UISerachStoreInfoWnd.cpp index f9ac23fb4..d52cf0106 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.cpp +++ b/Source/UI/Window/UISerachStoreInfoWnd.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UISerachStoreInfoWnd.h" #include "UI/Window/UIEnums.h" @@ -95,7 +97,7 @@ void UISerachStoreInfoWnd::OnCreate(int width, int height) { } this->m_radios[0]->SetText(LookupMessage(0x6F2)); this->m_radios[1]->SetText(LookupMessage(0x6F3)); - this->m_radios[this->unknown_00E4]->SendMsg(this, 0xD, 1, 0, 0, 0); + this->m_radios[this->unknown_00E4]->SendMsg(this, UM_SETSTATE, 1, 0, 0, 0); this->m_edits[1] = new UIEditCtrl(); this->m_edits[1]->SetSize(0x4C, 0x10); @@ -183,7 +185,7 @@ void UISerachStoreInfoWnd::OnCreate(int width, int height) { this->AddBaseButton(); this->AddCloseButton("", 0); - this->SendMsg(this, 0x3C, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); g_windowMgr.SetFocus(this->m_edits[1]); this->m_message0 = 0x16D; } @@ -194,7 +196,7 @@ void UISerachStoreInfoWnd::OnRBtnDown(int x, int y) { ITEM_INFO item = this->ItemAt(x, y); if (item.itemId.size() != 0 && ((x > 160 && x < 330) || static_cast(x - 6) <= 43)) { g_modeMgr.GetGameMode(); - g_windowMgr.EnsureWindow(12)->SendMsg(nullptr, 0x18, reinterpret_cast(&item), 0, 0, 0); + g_windowMgr.EnsureWindow(WID_ITEMCOLLECTIONWND)->SendMsg(nullptr, UM_ITEMEXPLANATION, reinterpret_cast(&item), 0, 0, 0); } } @@ -212,7 +214,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_session.unknown_5BEC = -1; g_session.unknown_5BF0 = 0xFFFFFFFF; g_session.unknown_5BD4.clear(); - g_windowMgr.CloseWindow(181); + g_windowMgr.CloseWindow(WID_SEARCH_STORE_INFO); break; } case ID_CHECK: @@ -228,7 +230,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } else { checked = 0; } - this->m_radios[index]->SendMsg(this, 13, checked, 0, 0, 0); + this->m_radios[index]->SendMsg(this, UM_SETSTATE, checked, 0, 0, 0); } break; case 365: { @@ -259,7 +261,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a const int count = static_cast(itemIds.size() + cardIds.size()); if (this->unknown_00EC != 0) { if (count > 20) { - this->SendMsg(this, 60, 1, 1, 0, 0); + this->SendMsg(this, UM_REFRESH, 1, 1, 0, 0); return 0; } @@ -316,7 +318,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (this->unknown_00EC == 0) { this->m_findButton->SetDisabled(0); this->m_findButton->Invalidate(); - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); } break; } @@ -373,7 +375,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a if (this->unknown_00DC > 1) { this->unknown_00E0 = -1; --this->unknown_00DC; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; } } else if (argument1 == 317) { @@ -381,7 +383,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->unknown_00E0 = -1; if (static_cast(page * 10) < g_session.unknown_5BD4.size()) { this->unknown_00DC = page + 1; - this->SendMsg(this, 60, 0, 0, 0, 0); + this->SendMsg(this, UM_REFRESH, 0, 0, 0, 0); return 0; } if (reinterpret_cast(&g_session.unknown_5BE4)[1] != 0) { diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index 45f98ba09..0291182de 100644 --- a/Source/UI/Window/UIShowWarpWnd.cpp +++ b/Source/UI/Window/UIShowWarpWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIShowWarpWnd.h" +#include "UI/Window/WindowId.h" #include "UI/Window/UIEnums.h" #include "UI/Buttons/UIBitmapButton.h" #include "Client/Replay.h" @@ -55,11 +56,11 @@ void UIShowWarpWnd::Paint() { int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { case UM_DOWNPUSH: - this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return 0; case UM_UPPUSH: - this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); + this->m_list->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return 0; case UM_SETINFO: { @@ -76,8 +77,8 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument case UM_COMMAND: this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); - if (argument1 == 201) { - g_windowMgr.CloseWindow(0x134); + if (argument1 == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_SHOWWARPWND); } return 0; diff --git a/Source/UI/Window/UITab.cpp b/Source/UI/Window/UITab.cpp index b27b95848..af7245094 100644 --- a/Source/UI/Window/UITab.cpp +++ b/Source/UI/Window/UITab.cpp @@ -1,4 +1,5 @@ #include "Resource/Bitmap/BitmapResource.h" +#include "UI/Window/UIEnums.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" #include "UI/Window/UITab.h" @@ -45,14 +46,14 @@ void UITab::OnLBtnDown(int, int y) { if (this->geometry.unknown_0030 != static_cast(index)) { this->geometry.unknown_0030 = index; this->Invalidate(); - this->parent->SendMsg(this, 22, this->geometry.unknown_0030, 0, 0, 0); + this->parent->SendMsg(this, UM_TAB, this->geometry.unknown_0030, 0, 0, 0); } } // OFFSET: 0x00865200 // FUNCTION: fn_10921 int UITab::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { - if (message == 13) { + if (message == UM_SETSTATE) { this->geometry.unknown_0030 = argument1; this->Invalidate(); } diff --git a/Source/UI/Window/UITransMenuWnd.cpp b/Source/UI/Window/UITransMenuWnd.cpp index 68ceb78e8..70ed1a411 100644 --- a/Source/UI/Window/UITransMenuWnd.cpp +++ b/Source/UI/Window/UITransMenuWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UITransMenuWnd.h" +#include "UI/Window/UIEnums.h" #include "UI/Buttons/UIButton.h" #include @@ -33,7 +34,7 @@ void UITransMenuWnd::OnLBtnDown(int x, int y) { const TransMenuItem& item = this->m_items[this->m_selected]; if (item.enabled) { - this->SendMsg(nullptr, 48, item.command, 0, 0, 0); + this->SendMsg(nullptr, UM_MENU_SELECTED, item.command, 0, 0, 0); } } @@ -95,7 +96,7 @@ void UITransMenuWnd::Move(int x, int y) { // OFFSET: 0x00951440 // FUNCTION: fn_12950 int UITransMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { - if (message != 48) { + if (message != UM_MENU_SELECTED) { this->UIWindow::SendMsg(sender, message, a, b, c, d); } diff --git a/Source/UI/Window/UIVideoWnd.cpp b/Source/UI/Window/UIVideoWnd.cpp index 2859effa7..da0ab9fe2 100644 --- a/Source/UI/Window/UIVideoWnd.cpp +++ b/Source/UI/Window/UIVideoWnd.cpp @@ -1,5 +1,7 @@ #include "Render/Renderer.h" #include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIVideoWnd.h" #include "Contents/MessageTable.h" @@ -92,7 +94,7 @@ void UIVideoWnd::OnProcess() { } if (this->m_movie->State() == 2) { - g_windowMgr.CloseWindow(304); + g_windowMgr.CloseWindow(WID_VIDEOWND); } } @@ -103,21 +105,21 @@ int UIVideoWnd::SendMsg( ) { switch (message) { case UM_COMMAND: - if (argument1 == 521) { - g_windowMgr.CloseWindow(304); + if (argument1 == ID_CLOSE_VIDEO) { + g_windowMgr.CloseWindow(WID_VIDEOWND); } break; case UM_DEFPUSH: if (argument1 == 27) { - this->SendMsg(nullptr, 5, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_CLOSE, 0, 0, 0, 0); } break; case UM_CLOSE: if (g_windowMgr.Confirm(LookupMessage(3142), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_windowMgr.CloseWindow(304); + g_windowMgr.CloseWindow(WID_VIDEOWND); } break; - case 150: + case UM_OPEN_VIDEO: if (this->m_movie->Open(reinterpret_cast(argument1), 0, false) && this->m_movie) { if (this->m_texture) { g_texMgr.Remove(this->m_texture); @@ -128,14 +130,14 @@ int UIVideoWnd::SendMsg( this->m_texture = CreateTexture(handle->width, handle->height, 4, false, false); } break; - case 159: + case UM_SET_VIDEO_VOLUME: BinkSetVolume(this->m_movie->Handle(), 0, argument1 << 8); if (argument2 == 0) { this->m_savedVolume = CSoundMgr::Volume(g_soundMgr); CSoundMgr::SetVolume(g_soundMgr, 0); } break; - case 151: { + case UM_TOGGLE_VIDEO_PAUSE: { BinkHandle* handle = this->m_movie->Handle(); BinkPause(handle, handle->paused == 1 ? 0 : 1); break; diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index b181262dc..6361f8cf0 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -1,3 +1,5 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/WindowId.h" #include "Client/Input/Mouse.h" #include "UI/Window/UIEnums.h" #include "UI/Chat/UINewChatWnd.h" @@ -249,7 +251,7 @@ bool UIWindow::CanHitTest() { // OFFSET: 0x00A7BB00 // FUNCTION: fn_16933 void UIWindow::DragAndDrop(int, int, std::intptr_t) { - g_modeMgr.gameMode->SendMsg(18, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_CANCEL_DRAG, 0, 0, 0, 0); } // OFFSET: 0x005CA0F0 @@ -391,12 +393,12 @@ int UIWindow::SendMsg(UIWindow*, int message, std::intptr_t, std::intptr_t, std: switch (message) { case UM_DEFPUSH: if (this->parent) { - this->Parent()->SendMsg(this, 0, 0, 0, 0, 0); + this->Parent()->SendMsg(this, UM_DEFPUSH, 0, 0, 0, 0); } break; case UM_CANCELPUSH: if (this->parent) { - this->Parent()->SendMsg(this, 1, 0, 0, 0, 0); + this->Parent()->SendMsg(this, UM_CANCELPUSH, 0, 0, 0, 0); } break; } @@ -1890,7 +1892,7 @@ void UIListBox_NaviSearch::OnLBtnDblClk(int, int) { void UIListBox_NaviSearch::OnLBtnDown(int x, int y) { this->selected = this->LineAt(x, y); if (this->selected != -1) { - this->parent->SendMsg(this, 6, this->geometry.id, this->selected, 0, 0); + this->parent->SendMsg(this, UM_COMMAND, this->geometry.id, this->selected, 0, 0); } this->Invalidate(); @@ -1901,9 +1903,9 @@ void UIListBox_NaviSearch::OnLBtnDown(int x, int y) { void UIListBox_NaviSearch::OnWheel(int value) { if (this->verticalOverflow != 0) { if (value < 0) { - this->SendMsg(this->verticalBar, 7, 6, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, 6, 0, 0, 0); } else { - this->SendMsg(this->verticalBar, 7, -6, 0, 0, 0); + this->SendMsg(this->verticalBar, UM_SCROLLVERT, -6, 0, 0, 0); } } } @@ -2070,7 +2072,7 @@ void UINavigationroadiconWnd::OnLBtnUp(int x, int y) { if (slot != 0) { if (g_windowMgr.window_4F174) { - g_windowMgr.window_4F174->SendMsg(nullptr, 40, slot, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, UM_SETCURITEM, slot, 0, 0, 0); } const int column = slot <= 4 ? slot : slot - 4; @@ -2619,7 +2621,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu break; } if (argument1 == 499) { - if (!g_windowMgr.LookupWindow(6)) { + if (!g_windowMgr.LookupWindow(WID_WAITWND)) { UIPrivateAirplaneWnd* window = new UIPrivateAirplaneWnd(); window->SetSize(0xD0, 0x6E); window->Move(static_cast((g_renderer->viewport.width - 0xD0) * 0.5), static_cast((g_renderer->viewport.height - 0x6E) * 0.5)); @@ -2632,25 +2634,25 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu mapName = mapName.substr(0, mapName.find(".rsw")) + ".gat"; if (!g_privateAirplaneItems->IsStartableMap(mapName)) { window->SendMsg(nullptr, 0x9A, reinterpret_cast(LookupMessage(0xD03)), 0, 0, 0); - window->SendMsg(nullptr, 0x23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } std::string targetName = g_navigationManager.GetCurrentTargetName() + ".gat"; if (!g_privateAirplaneItems->IsEndableMap(targetName)) { window->SendMsg(nullptr, 0x9A, reinterpret_cast(LookupMessage(0xD04)), 0, 0, 0); - window->SendMsg(nullptr, 0x23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } if (mapName.compare(targetName) == 0) { window->SendMsg(nullptr, 0x9A, reinterpret_cast(LookupMessage(0xD19)), 0, 0, 0); - window->SendMsg(nullptr, 0x23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->scene && static_cast(g_modeMgr.GetGameMode())->scene->player && static_cast(g_modeMgr.GetGameMode())->scene->player->render.unknown_0070 == 3) { window->SendMsg(nullptr, 0x9A, reinterpret_cast(LookupMessage(0xD1A)), 0, 0, 0); - window->SendMsg(nullptr, 0x23, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } g_windowMgr.window_4F258 = window; @@ -2681,8 +2683,8 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } g_navigationManager.ShowRouteResult(result, 1); this->RefreshLayout(); - if (UIWindow* window = g_windowMgr.LookupWindow(0x13A)) { - window->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_NAVIGATIONRUIDEWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } break; } @@ -2717,21 +2719,21 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } this->RefreshLayout(); break; - case 0xC8: + case ID_BASE: g_navigationManager.unknown_1254 = false; this->geometry.targetAlpha = 0xFF; this->geometry.alphaStart = timeGetTime(); g_navigationManager.unknown_1248 = false; this->RefreshLayout(); break; - case 0xBD: - if (!g_windowMgr.CloseWindow(0x132)) { - g_windowMgr.EnsureWindow(0x132); + case ID_BUTTON1: + if (!g_windowMgr.CloseWindow(WID_NAVIGATIONROADICONWND)) { + g_windowMgr.EnsureWindow(WID_NAVIGATIONROADICONWND); } break; case 0xBF: { if (g_windowMgr.unknown_0214 != 0) { - g_windowMgr.CloseWindow(0x1A); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } this->ClearRouteTexts(); @@ -2739,14 +2741,14 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu EnumerateFileNames(this->unknown_0104, directory.c_str(), "*.txt"); const int count = static_cast(this->unknown_0104.size()); if (count != 0) { - UIWindow* history = g_windowMgr.EnsureWindow(0x1A); + UIWindow* history = g_windowMgr.EnsureWindow(WID_COMBOBOXWND); for (const std::string& name : this->unknown_0104) { - history->SendMsg(nullptr, 0x1F, reinterpret_cast(name.c_str()), 0, 0, 0); + history->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(name.c_str()), 0, 0, 0); } const int height = (std::min)(count * 0x10, 0xA0); - history->SendMsg(nullptr, 0x28, 0, 0, 0, 0); + history->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); history->Resize(0xA0, height); - history->SendMsg(nullptr, 0x53, 0xCB, 0, 0, 0); + history->SendMsg(nullptr, UM_SET_CALLER_WID, 0xCB, 0, 0, 0); int x = this->geometry.width - 0xA5; int y = 0x24; this->ToScreen(x, y); @@ -2755,13 +2757,13 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu break; } case ID_HELP: - if (!g_windowMgr.CloseWindow(0xE5)) { - g_windowMgr.EnsureWindow(0xE5); + if (!g_windowMgr.CloseWindow(WID_NAVIGATIONHELPWND)) { + g_windowMgr.EnsureWindow(WID_NAVIGATIONHELPWND); } break; case 0x1BA: - if (!g_windowMgr.CloseWindow(0x13A) && g_navigationManager.NodeCount() != 0) { - g_windowMgr.EnsureWindow(0x13A); + if (!g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND) && g_navigationManager.NodeCount() != 0) { + g_windowMgr.EnsureWindow(WID_NAVIGATIONRUIDEWND); } break; case ID_SELECT_ITEM: @@ -2795,7 +2797,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } this->Invalidate(); break; - case 0x11C: + case ID_CHARGE: if (!g_navigationManager.GetSavedTarget().object) { if (g_navigationManager.unknown_125C == 2) { if (g_navigationManager.unknown_1258 == 2) { @@ -2818,7 +2820,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu this->RefreshLayout(); } break; - case 0x162: + case ID_PREVIEW: if (g_navigationManager.GetCurrentTargetName().size() != 0) { const int type = g_navigationManager.GetCurrentTarget().type; if (type < 2) { @@ -2846,13 +2848,13 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu g_navigationManager.SetViewMode(1); g_navigationManager.unknown_125C = 0; g_navigationManager.ClearSavedTarget(); - g_windowMgr.CloseWindow(0x13A); + g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND); this->RefreshLayout(); g_worldViewMgr.ClearMarks(); } } else { if (g_windowMgr.modal) { - this->SendMsg(nullptr, 6, 0xCA, 0, 0, 0); + this->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } g_navigationManager.unknown_125C = 0; g_navigationManager.unknown_1254 = false; @@ -2860,8 +2862,8 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu g_worldViewMgr.ClearMarks(); g_worldViewMgr.ClearLevels(); g_worldViewMgr.ResetSelection(); - g_windowMgr.CloseWindow(0x13A); - g_windowMgr.CloseWindow(0xCB); + g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND); + g_windowMgr.CloseWindow(WID_NAVIGATIONV4WND); } break; } @@ -2874,7 +2876,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu this->FillRouteGroups(); this->Invalidate(); if (g_replayAnimationScaling != 0) { - this->unknown_00DC->SendMsg(nullptr, 0x39, argument1, 0, 0, 0); + this->unknown_00DC->SendMsg(nullptr, UM_CHANGEMSG, argument1, 0, 0, 0); } } else if (g_replayAnimationScaling == 0) { this->LoadRoute(static_cast(argument1)); @@ -2887,7 +2889,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu case UM_DEFPUSH: if (sender == this->unknown_00E0 && static_cast(this->unknown_00E0)->Length() > 0) { - this->SendMsg(this->unknown_00E0, 6, 0x141, 0, 0, 0); + this->SendMsg(this->unknown_00E0, UM_COMMAND, ID_SEARCH, 0, 0, 0); } break; } @@ -2897,8 +2899,8 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu // OFFSET: 0x005C8D70 // FUNCTION: fn_03627 int UINavigationroadiconWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { - if (message == 6 && a == 201) { - g_windowMgr.CloseWindow(306); + if (message == UM_COMMAND && a == ID_CLOSE) { + g_windowMgr.CloseWindow(WID_NAVIGATIONROADICONWND); } return 0; @@ -2951,17 +2953,17 @@ void UIListBox_NaviSearch::Refresh() { int UIListBox_NaviSearch::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { - if (message != 7 && message != 9 && message != 10) { + if (message != UM_SCROLLVERT && message != UM_SCROLLVERTPAGEUP && message != UM_SCROLLVERTPAGEDOWN) { return this->UIListBox::SendMsg(sender, message, argument1, argument2, argument3, argument4); } const int previous = this->topLine; int lineHeight; int top; - if (message == 9) { + if (message == UM_SCROLLVERTPAGEUP) { lineHeight = this->lineHeight; top = previous - this->geometry.height / lineHeight + 1; - } else if (message == 10) { + } else if (message == UM_SCROLLVERTPAGEDOWN) { lineHeight = this->lineHeight; top = previous - 1 + this->geometry.height / lineHeight; } else { @@ -2997,7 +2999,7 @@ int UINavigationRuideWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: switch (message) { case UM_COMMAND: if (a == 201) { - g_windowMgr.CloseWindow(314); + g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND); } [[fallthrough]]; case UM_REFRESH: @@ -3214,7 +3216,7 @@ bool UINavigationV4Wnd::LoadRoute(int index) { } this->FillRouteGroups(); - this->SendMsg(this, 6, 190, 0, 0, 0); + this->SendMsg(this, UM_COMMAND, ID_BUTTON2, 0, 0, 0); return true; } @@ -3575,7 +3577,7 @@ int UIPrivateAirplaneWnd::SendMsg( ) { switch (message) { case UM_COMMAND: - if (argument1 == 201) { + if (argument1 == ID_CLOSE) { if (!g_windowMgr.modalWindows.empty() && g_windowMgr.modalWindows.back()) { g_windowMgr.unknown_0474 = 0xBC; } diff --git a/Source/UI/Window/UIWindowFactory.cpp b/Source/UI/Window/UIWindowFactory.cpp index 536e70fdf..049ccab36 100644 --- a/Source/UI/Window/UIWindowFactory.cpp +++ b/Source/UI/Window/UIWindowFactory.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowFactory.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Render/Renderer.h" @@ -78,11 +79,11 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) { window->Move(x, y); this->rendered.push_back(window); if (id == 0x9F) { - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_0934), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_0934), 0, 0, 0); } else if (id == 0x9D) { - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_0944), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_0944), 0, 0, 0); } else if (id == 0xD4) { - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_09D4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_09D4), 0, 0, 0); } } diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 12b603c25..b743cc622 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1,3 +1,5 @@ +#include "Contents/Actors/ActorEnums.h" +#include "Client/Mode/ModeMessage.h" #include "UI/Window/UIEnums.h" #include "Contents/Hotkeys/InterfaceHotkey.h" #include "UI/Window/WindowId.h" @@ -844,7 +846,7 @@ void UIWindowMgr::ResetWindows() { this->unknown_0224 = 0; if (hadWindow0270) { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(292, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_CLOSE, 0, 0, 0, 0); } } const bool hadWindow276 = this->window_4F1E4 != nullptr; @@ -1143,7 +1145,7 @@ void UIWindowMgr::SelectWhisperName(const char* name) { UIWindow* field = *reinterpret_cast(reinterpret_cast(this->window_01C8) + 0xC0); *reinterpret_cast(reinterpret_cast(field) + 0x128) = index; - this->window_01C8->SendMsg(field, 0x27, index, 0, 0, 0); + this->window_01C8->SendMsg(field, UM_COMBOBOX_SELECTED, index, 0, 0, 0); } // GLOBAL: gl_25163 @@ -1161,12 +1163,12 @@ int UIWindowMgr::ShowWhisperFrom(const char* name, const char* text, int color, } else if (g_session.IsGuildMemberCharacter(accountId)) { label = "GuildMember"; } else if (g_session.IsFriendNameDifferent(name)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(917)), 0xFFFF, 0, 0, 0); } else if (g_session.IsGuildMemberNameDifferent(name)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(919)), 0xFFFF, 0, 0, 0); } - shown = this->SendNotice(14, reinterpret_cast(name), reinterpret_cast(label), reinterpret_cast(ShortcutFilename(accountId).c_str()), 0, 0); + shown = this->SendNotice(UIM_MAKE_WHISPER_WINDOW, reinterpret_cast(name), reinterpret_cast(label), reinterpret_cast(ShortcutFilename(accountId).c_str()), 0, 0); if (shown) { if (ResourceMgr::Instance().Exists(g_newWhisperWave)) { g_soundMgr->PlayWave(g_newWhisperWave, 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -1190,9 +1192,9 @@ int UIWindowMgr::ShowWhisperFrom(const char* name, const char* text, int color, } UIWindow* window = entry->second; - window->SendMsg(nullptr, 37, reinterpret_cast(text), color, 2, 0); - if ((this->modal == nullptr || this->window_4F174 == window) && !this->LookupWindow(278) && !this->LookupWindow(4) && !this->LookupWindow(199) && - !this->LookupWindow(200)) { + window->SendMsg(nullptr, UM_ADDCHAT, reinterpret_cast(text), color, 2, 0); + if ((this->modal == nullptr || this->window_4F174 == window) && !this->LookupWindow(WID_NEWMAKECHARWND) && !this->LookupWindow(WID_MAKECHARWND) && !this->LookupWindow(WID_SECONDPASSWORDINPUTWND) && + !this->LookupWindow(WID_SECONDPASSWORDEDITWND)) { int companion = -1; if (window->geometry.id == 12) { companion = 234; @@ -1267,7 +1269,7 @@ __declspec(noinline) void UIWindowMgr::RegisterNamedWindow(std::string name, UIW // FUNCTION: fn_17254 void UIWindowMgr::NotifyMode() { if (CMode* mode = g_modeMgr.GetGameMode()) { - mode->SendMsg(292, 0, 0, 0, 0); + mode->SendMsg(MM_NPC_MARKET_CLOSE, 0, 0, 0, 0); } } @@ -1373,7 +1375,7 @@ void UIWindowMgr::UnregisterNamedWindow(std::string name) { // FUNCTION: fn_17285 void UIWindowMgr::SendMsgToNamedWindow(const char* name) { if (this->namedWindows.find(name) != this->namedWindows.end()) { - this->namedWindows[name]->SendMsg(nullptr, 48, 0, 0, 0, 0); + this->namedWindows[name]->SendMsg(nullptr, UM_MENU_SELECTED, 0, 0, 0, 0); } } @@ -1557,7 +1559,7 @@ bool UIWindowMgr::ProcessKeyDown(int key, int keyData, int pressed) { return this->ProcessHotkeyAction(key, pressed); } - if (this->LookupWindow(0x9C) != nullptr) { + if (this->LookupWindow(WID_HOTKEYWND) != nullptr) { this->unknown_0025 = 0; } else if (!this->inputSuggestionsEnabled) { UIWindow* hover = this->hoverWindow; @@ -1677,7 +1679,7 @@ void UIWindowMgr::SendEmotionHotkey(int index) { if (offset != -1) { g_windowMgr.unknown_04DC = text + offset; } - g_modeMgr.gameMode->SendMsg(0x2A, talkType, reinterpret_cast(parts), 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, talkType, reinterpret_cast(parts), 0, 0); } return; } @@ -1686,20 +1688,20 @@ void UIWindowMgr::SendEmotionHotkey(int index) { const int& chatTarget = *reinterpret_cast(&g_session.unknown_5490[0x8]); if (chatTarget == 2) { if (g_guildInfo.m_guildId != 0) { - mode->SendMsg(0x81, 0, 0, 0, 0); + mode->SendMsg(MM_CHAT_GUILD, 0, 0, 0, 0); return; } } else { if (chatTarget == 1 && g_session.PartyCount() != 0) { - mode->SendMsg(0x42, 0, 0, 0, 0); + mode->SendMsg(MM_CHAT_PARTY, 0, 0, 0, 0); return; } if (chatTarget == 3 && g_clanInfo->m_hasClan) { - mode->SendMsg(0x121, 0, 0, 0, 0); + mode->SendMsg(MM_CHAT_CLAN, 0, 0, 0, 0); return; } } - mode->SendMsg(6, 0, 0, 0, 0); + mode->SendMsg(MM_CHATMSG, 0, 0, 0, 0); } // OFFSET: 0x00AA5B00 @@ -1717,7 +1719,7 @@ void UIWindowMgr::CycleWindowVisibility(int) { const int state = this->unknown_0508; if (state == 0) { if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 222, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 222, 0, 0, 0); } if (this->hiddenWindows.size() == 0) { for (std::list::iterator it = this->rendered.begin(); it != this->rendered.end(); ++it) { @@ -1743,7 +1745,7 @@ void UIWindowMgr::CycleWindowVisibility(int) { } if (closed) { if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 222, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 222, 0, 0, 0); } return; } @@ -1754,10 +1756,10 @@ void UIWindowMgr::CycleWindowVisibility(int) { window->Show(0); } } - this->CloseWindow(14); + this->CloseWindow(WID_MINIMAPZOOMWND); CPlayer* player = static_cast(g_modeMgr.GetGameMode())->scene->player; if (player) { - player->SendMsg(nullptr, 109, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player->SendMsg(nullptr, AM_DELETE_EFFECT, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); player->unknown_0544 = 0; } this->unknown_0508 = 2; @@ -1778,7 +1780,7 @@ void UIWindowMgr::CycleWindowVisibility(int) { if (closed) { this->ShowWindows189(0); if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 222, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 222, 0, 0, 0); } return; } @@ -1793,7 +1795,7 @@ void UIWindowMgr::CycleWindowVisibility(int) { } CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode && mode->unknown_0254 == 1) { - this->EnsureWindow(14); + this->EnsureWindow(WID_MINIMAPZOOMWND); } static_cast(g_modeMgr.GetGameMode())->scene->player->RefreshEffect164(); this->unknown_0508 = 1; @@ -1826,7 +1828,7 @@ int UIWindowMgr::LoadReplayWindows(const std::vector& data) { payload.resize(header.size); std::memcpy(payload.data(), data.data() + offset, header.size); offset += header.size; - window->SendMsg(nullptr, 123, reinterpret_cast(payload.data()), payload.size(), 0, 0); + window->SendMsg(nullptr, UM_REPLAY_FRAMED_DATA, reinterpret_cast(payload.data()), payload.size(), 0, 0); } } } @@ -1839,9 +1841,9 @@ int UIWindowMgr::LoadReplayWindows(const std::vector& data) { int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d, std::intptr_t e) { const char* text = reinterpret_cast(a); switch (selector) { - case 154: + case UIM_RESOLVE_PLAYER_TAGS: for (auto it = this->namedWindows.begin(); it != this->namedWindows.end(); ++it) { - it->second->SendMsg(nullptr, 154, a, 0, 0, 0); + it->second->SendMsg(nullptr, UM_RESOLVE_PLAYER_TAGS, a, 0, 0, 0); } break; case UIM_MAKE_WHISPER_WINDOW: { @@ -1850,7 +1852,7 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: UIWhisperWnd* window = new UIWhisperWnd(); window->SetSize(280, 120); this->rendered.push_back(window); - window->SendMsg(nullptr, 34, reinterpret_cast(&this->m_whisperPlacement), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&this->m_whisperPlacement), 0, 0, 0); window->Show(1); window->m_target = name; window->SetId(67); @@ -1893,7 +1895,7 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: break; case UIM_PUSH_INTO_CHATROOM: if (this->window_027C != nullptr) { - this->window_027C->SendMsg(nullptr, 37, a, b, 0, 0); + this->window_027C->SendMsg(nullptr, UM_ADDCHAT, a, b, 0, 0); } break; case UIM_PUSHINTOCHATHISTORY: @@ -1918,33 +1920,33 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: color = 0xFFFFFF; } if (std::strcmp(text, "No Msg") != 0 && std::strcmp(text, "NO MSG") != 0) { - this->window_01C8->SendMsg(nullptr, selector == 19 ? 115 : 37, a, color, c, d); + this->window_01C8->SendMsg(nullptr, selector == UIM_PUSHINTOCHATHISTORY2 ? UM_ADDCHAT2 : UM_ADDCHAT, a, color, c, d); } } break; } case UIM_LOADINGPERCENT: if (this->unknown_01BC != nullptr) { - this->unknown_01BC->SendMsg(nullptr, 17, a, 0, 0, 0); + this->unknown_01BC->SendMsg(nullptr, UM_LOADINGPERCENT, a, 0, 0, 0); } break; case UIM_OPENCHATWND: - this->ShowWindowById(1, 1); + this->ShowWindowById(WID_CHATWND, 1); if (this->window_01C8 != nullptr) { - this->window_01C8->SendMsg(nullptr, 16, 0, 0, 0, 0); + this->window_01C8->SendMsg(nullptr, UM_OPENCHATWND, 0, 0, 0, 0); } break; case UIM_CHANGECHATWNDSTATUS: if (this->window_01C8 != nullptr) { - this->window_01C8->SendMsg(nullptr, 15, a, 0, 0, 0); + this->window_01C8->SendMsg(nullptr, UM_CHANGESTATUS, a, 0, 0, 0); } break; case UIM_IME_OPENCANDIDATE: case UIM_IME_CHANGECANDIDATE: - this->EnsureWindow(51)->SendMsg(nullptr, 65, a, b, 0, 0); + this->EnsureWindow(WID_CANDIDATEWND)->SendMsg(nullptr, UM_IME_SET_CANDIDATE, a, b, 0, 0); break; case UIM_IME_CLOSECANDIDATE: - this->CloseWindow(51); + this->CloseWindow(WID_CANDIDATEWND); break; } return 0; @@ -1955,13 +1957,13 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: __declspec(noinline) void UIWindowMgr::BroadcastMessage21() { UIWindow* window = this->window_03DC; if (window || (window = this->unknown_03B0) != nullptr) { - window->SendMsg(nullptr, 21, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_RIGHTPUSH, 0, 0, 0, 0); return; } for (auto it = this->rendered.begin(); it != this->rendered.end(); ++it) { if ((*it)->IsFrameWnd()) { - (*it)->SendMsg(nullptr, 21, 0, 0, 0, 0); + (*it)->SendMsg(nullptr, UM_RIGHTPUSH, 0, 0, 0, 0); } } } @@ -2168,7 +2170,7 @@ bool UIWindowMgr::ProcessEnterKey() { bool handled = true; if (!this->modalWindows.empty() && this->modalWindows.back() != nullptr) { - this->Top()->SendMsg(nullptr, 0, 0, 0, 0, 0); + this->Top()->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); return true; } @@ -2179,7 +2181,7 @@ bool UIWindowMgr::ProcessEnterKey() { if (Replay::Instance().state == 2) { window->RecordEditTexts(); } - window->SendMsg(nullptr, 0, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); return true; } window = this->unknown_0318; @@ -2187,7 +2189,7 @@ bool UIWindowMgr::ProcessEnterKey() { if (Replay::Instance().state == 2) { window->RecordEditTexts(); } - window->SendMsg(nullptr, 0, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); return true; } window = this->unknown_01F8; @@ -2203,7 +2205,7 @@ bool UIWindowMgr::ProcessEnterKey() { if (window == nullptr) { window = this->unknown_021C; if (window != nullptr) { - window->SendMsg(nullptr, 0x13, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return true; } window = this->unknown_020C; @@ -2222,7 +2224,7 @@ bool UIWindowMgr::ProcessEnterKey() { if (static_cast(this->window_01C8)->SuggestionsVisible()) { UIWindow* child = static_cast(this->window_01C8)->m_suggestions; if (child != nullptr) { - child->SendMsg(nullptr, 0xB0, 0xD, 0, 0, 0); + child->SendMsg(nullptr, UM_CASH_EMOTION_KEY, 0xD, 0, 0, 0); return true; } } @@ -2236,7 +2238,7 @@ bool UIWindowMgr::ProcessEnterKey() { } else if (!handled) { return false; } - this->hoverWindow->SendMsg(nullptr, 0, 0, 0, 0, 0); + this->hoverWindow->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); return handled; } window = this->window_03D4; @@ -2253,7 +2255,7 @@ bool UIWindowMgr::ProcessEnterKey() { if (g_replayAnimationScaling == 0) { (*it)->Root()->RecordEditTexts(); } - (*it)->SendMsg(nullptr, 0, 0, 0, 0, 0); + (*it)->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); } return false; } @@ -2262,7 +2264,7 @@ bool UIWindowMgr::ProcessEnterKey() { } } - window->SendMsg(nullptr, 0, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); return handled; } @@ -2304,18 +2306,18 @@ UIWindow* UIWindowMgr::OpenSubChatWindow(int id, int x, int y, int width, int he // FUNCTION: fn_45514 void CloseWindow10005A() { - g_windowMgr.CloseWindow(10005); + g_windowMgr.CloseWindow(WID_MACROREPORT); } // FUNCTION: fn_45513 void CloseWindow10005B() { - g_windowMgr.CloseWindow(10005); + g_windowMgr.CloseWindow(WID_MACROREPORT); } // OFFSET: 0x00A05280 // FUNCTION: fn_45510 void CloseWindow10006() { - g_windowMgr.CloseWindow(10006); + g_windowMgr.CloseWindow(WID_ENCHANTUI); } // OFFSET: 0x00AA76F0 @@ -2469,8 +2471,8 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { switch (action) { case VK_MENU: if (this->modifierKey == 0) { - if (UIWindow* window = this->LookupWindow(140)) { - window->SendMsg(nullptr, 6, 219, 0, 0, 0); + if (UIWindow* window = this->LookupWindow(WID_ROMAPWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_MAP, 0, 0, 0); return false; } } @@ -2510,7 +2512,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; }; if (parent == static_cast(this->window_01C8)->m_tabControl || isRetained(parent)) { - parent->SendMsg(this->hoverWindow, 0, 1, 0, 0, 0); + parent->SendMsg(this->hoverWindow, UM_DEFPUSH, 1, 0, 0, 0); return false; } } @@ -2527,8 +2529,8 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; } - if (g_windowMgr.CloseWindow(78)) { - g_modeMgr.GetGameMode()->SendMsg(100, reinterpret_cast(""), -1, 1, 0); + if (g_windowMgr.CloseWindow(WID_ILLUSTWND)) { + g_modeMgr.GetGameMode()->SendMsg(MM_SHOW_IMAGE, reinterpret_cast(""), -1, 1, 0); } else if (UIWindow* window = g_windowMgr.LookupWindow(id)) { switch (id) { case WID_ITEMSHOPWND: @@ -2543,7 +2545,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { if (replaying != 0) { return false; } - window->SendMsg(nullptr, 6, 185, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CANCEL, 0, 0, 0); return false; case WID_BATTLEMSGOPTIONWND: case WID_SEARCH_STORE_INFO: @@ -2551,7 +2553,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { case WID_NAVIGATIONV4WND: case WID_STYLINGSHOPWND: case WID_REQUESTJOINPARTYWND: - window->SendMsg(nullptr, 6, 201, 0, 0, 0); + window->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); return false; case WID_BALLOONOPENBTN: case WID_WAITDBSAVEWND: @@ -2571,7 +2573,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { g_worldViewMgr.ClearMarks(); g_worldViewMgr.ClearLevels(); g_worldViewMgr.ResetSelection(); - g_windowMgr.CloseWindow(314); + g_windowMgr.CloseWindow(WID_NAVIGATIONRUIDEWND); } return false; } @@ -2580,7 +2582,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; } - if (this->LookupWindow(16) || this->LookupWindow(226)) { + if (this->LookupWindow(WID_SAYDIALOGWND) || this->LookupWindow(WID_SAYDIALOGWND_OVERLAY)) { return false; } @@ -2589,25 +2591,25 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; } - UIWindow* window = this->LookupWindow(10024); - if (this->CloseWindow(155) || window) { + UIWindow* window = this->LookupWindow(WID_WAITDBSAVEWND); + if (this->CloseWindow(WID_ESCOPTIONWND) || window) { return false; } - this->EnsureWindow(155); + this->EnsureWindow(WID_ESCOPTIONWND); return false; } - if (this->LookupWindow(277) && g_session.m_loginModeFlag == 1) { + if (this->LookupWindow(WID_NEWSELECTCHARWND) && g_session.m_loginModeFlag == 1) { if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 280, 120, 0) == 187) { - g_modeMgr.gameMode->SendMsg(10011, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(LMM_GOTO_LOGIN, 0, 0, 0, 0); } return false; } if (this->Confirm(LookupMessage(0x11), 2, true, false, 0, "Message", 280, 120, 0) == 187) { GetRagConnection().Close(); - g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0); } return false; } @@ -2618,13 +2620,13 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { } if (this->modifierKey == 0) { - if (UIWindow* window = this->LookupWindow(140)) { - window->SendMsg(nullptr, 6, 192, 0, 0, 0); + if (UIWindow* window = this->LookupWindow(WID_ROMAPWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_STATUS, 0, 0, 0); return false; } - if (UIWindow* window = this->LookupWindow(37)) { - window->SendMsg(nullptr, 6, 216, 0, 0, 0); + if (UIWindow* window = this->LookupWindow(WID_SKILLLISTWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_PLUS, 0, 0, 0); return false; } } @@ -2686,7 +2688,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { case VK_SNAPSHOT: case VK_SCROLL: if (pressed) { - g_modeMgr.gameMode->SendMsg(68, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SCREENSHOT, 0, 0, 0, 0); return false; } break; @@ -2707,7 +2709,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { case VK_END: if (this->window_4F1D4) { - this->window_4F1D4->SendMsg(nullptr, 114, 0, 0, 0, 0); + this->window_4F1D4->SendMsg(nullptr, UM_ENDPUSH, 0, 0, 0, 0); } break; } @@ -2758,7 +2760,7 @@ bool UIWindowMgr::CloseWindow(int id) { switch (id) { case WID_CHATWND: - this->CloseWindow(26); + this->CloseWindow(WID_COMBOBOXWND); if (this->window_01C8) { this->Schedule(this->window_01C8); this->window_01C8 = nullptr; @@ -2784,7 +2786,7 @@ bool UIWindowMgr::CloseWindow(int id) { break; case WID_RUNESYSTEMWND: if (UIWindow* found = this->LookupWindow(id)) { - this->CloseWindow(362); + this->CloseWindow(WID_RUNESYSTEM_DECOMRESULTWND); this->Schedule(found); closed = true; } @@ -2915,7 +2917,7 @@ bool UIWindowMgr::CloseWindow(int id) { break; case WID_CHOOSESELLBUYWND: if (this->unknown_0264) { - g_modeMgr.gameMode->SendMsg(291, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_NPC_TRADE_QUIT, 0, 0, 0, 0); this->Schedule(this->unknown_0264); this->unknown_0264 = nullptr; closed = true; @@ -2923,7 +2925,7 @@ bool UIWindowMgr::CloseWindow(int id) { break; case WID_ITEMSELLWND: if (this->unknown_025C) { - g_modeMgr.gameMode->SendMsg(291, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_NPC_TRADE_QUIT, 0, 0, 0, 0); this->Schedule(this->unknown_025C); this->unknown_025C = nullptr; closed = true; @@ -2945,7 +2947,7 @@ bool UIWindowMgr::CloseWindow(int id) { break; case WID_ITEMPURCHASEWND: if (this->unknown_0258) { - g_modeMgr.gameMode->SendMsg(291, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_NPC_TRADE_QUIT, 0, 0, 0, 0); this->Schedule(this->unknown_0258); this->unknown_0258 = nullptr; closed = true; @@ -3012,7 +3014,7 @@ bool UIWindowMgr::CloseWindow(int id) { case WID_BARTERITEMPURCHASEWND: if (this->window_4F264) { if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(309, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_NPC_BARTER_MARKET_CLOSE, 0, 0, 0, 0); } this->Schedule(this->window_4F264); this->window_4F264 = nullptr; @@ -3025,20 +3027,20 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; this->window_4F268 = nullptr; if (this->window_4F26C) { - this->CloseWindow(342); + this->CloseWindow(WID_EXPANDEDBARTERITEMPURCHASEWND); } } break; case WID_EXPANDEDBARTERITEMPURCHASEWND: if (this->window_4F26C) { if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(322, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_NPC_EXPANDED_BARTER_MARKET_CLOSE, 0, 0, 0, 0); } this->Schedule(this->window_4F26C); closed = true; this->window_4F26C = nullptr; if (this->window_4F268) { - this->CloseWindow(341); + this->CloseWindow(WID_EXPANDEDBARTERMARKETWND); } } break; @@ -3126,7 +3128,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; this->unknown_0218 = nullptr; if (this->unknown_0220) { - this->CloseWindow(234); + this->CloseWindow(WID_ITEMCOLLECTION_COMPARISONWND); } } break; @@ -3136,7 +3138,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; this->unknown_0220 = nullptr; if (this->unknown_0218) { - this->CloseWindow(12); + this->CloseWindow(WID_ITEMCOLLECTIONWND); } } break; @@ -3155,10 +3157,10 @@ bool UIWindowMgr::CloseWindow(int id) { } break; case WID_SKILLLISTWND: - if (g_windowMgr.LookupWindow(10030)) { - this->CloseWindow(10030); + if (g_windowMgr.LookupWindow(WID_SKILLDELAYINFO)) { + this->CloseWindow(WID_SKILLDELAYINFO); } - this->CloseWindow(46); + this->CloseWindow(WID_SKILLDESCRIBEWND); if (this->window_02C4) { this->Schedule(this->window_02C4); this->window_02C4 = nullptr; @@ -3177,7 +3179,7 @@ bool UIWindowMgr::CloseWindow(int id) { if (this->window_02C8) { this->window_02C8->StoreInfo(); } - closed = this->CloseWindow(34); + closed = this->CloseWindow(WID_MESSENGERGROUPWND); g_windowMgr.DismissTransient(); break; case WID_MESSENGERGROUPWND: @@ -3185,14 +3187,14 @@ bool UIWindowMgr::CloseWindow(int id) { this->Schedule(this->window_02C8); this->window_02C8 = nullptr; this->unknown_073C = 0; - g_windowMgr.CloseWindow(53); - g_windowMgr.CloseWindow(68); + g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); + g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND); g_windowMgr.DismissTransient(); closed = true; } break; case WID_MERCHANTSHOPMAKEWND: - this->CloseWindow(42); + this->CloseWindow(WID_MERCHANTMIRRORITEMWND); if (this->unknown_02FC) { this->Schedule(this->unknown_02FC); this->unknown_02FC = nullptr; @@ -3287,16 +3289,16 @@ bool UIWindowMgr::CloseWindow(int id) { break; case WID_GUILDWND: { - const bool closed60 = g_windowMgr.CloseWindow(60); - const bool closed61 = g_windowMgr.CloseWindow(61); - const bool closed62 = g_windowMgr.CloseWindow(62); - const bool closed63 = g_windowMgr.CloseWindow(63); - const bool closed64 = g_windowMgr.CloseWindow(64); - const bool closed65 = g_windowMgr.CloseWindow(65); - const bool closed66 = g_windowMgr.CloseWindow(66); + const bool closed60 = g_windowMgr.CloseWindow(WID_GUILDINFOMANAGEWND); + const bool closed61 = g_windowMgr.CloseWindow(WID_GUILDMEMBERMANAGEWND); + const bool closed62 = g_windowMgr.CloseWindow(WID_GUILDPOSITIONMANAGEWND); + const bool closed63 = g_windowMgr.CloseWindow(WID_GUILDSKILLWND); + const bool closed64 = g_windowMgr.CloseWindow(WID_GUILDBANISHEDMEMBERWND); + const bool closed65 = g_windowMgr.CloseWindow(WID_GUILDNOTICEWND); + const bool closed66 = g_windowMgr.CloseWindow(WID_GUILDTOTALINFOWND); closed = closed60 || closed61 || closed62 || closed63 || closed64 || closed65 || closed66; if (g_windowMgr.unknown_0214) { - g_windowMgr.CloseWindow(26); + g_windowMgr.CloseWindow(WID_COMBOBOXWND); } break; } @@ -3406,7 +3408,7 @@ bool UIWindowMgr::CloseWindow(int id) { } break; case WID_PARTYSETTINGWND_HEIGHT_220: - this->CloseWindow(53); + this->CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT); closed = true; break; case WID_TIPOFTHEDAYWND: @@ -3555,7 +3557,7 @@ bool UIWindowMgr::CloseWindow(int id) { this->Schedule(this->unknown_0390); this->unknown_0390 = nullptr; closed = true; - g_modeMgr.gameMode->SendMsg(146, -1, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PETEGG_SELECT_FROM_LIST, -1, 0, 0, 0); } break; case WID_PETTAMINGDECEIVEWND: @@ -3859,7 +3861,7 @@ bool UIWindowMgr::CloseWindow(int id) { } break; case WID_MERCHANTSHOPMAKEWND_MODE_1: - this->CloseWindow(175); + this->CloseWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); if (this->unknown_040C) { this->Schedule(this->unknown_040C); this->unknown_040C = nullptr; @@ -3945,7 +3947,7 @@ bool UIWindowMgr::CloseWindow(int id) { this->unknown_0454 = nullptr; closed = true; if (this->unknown_0450) { - this->CloseWindow(262); + this->CloseWindow(WID_OPENMAILBOXWND); } } break; @@ -4160,8 +4162,8 @@ void UIWindowMgr::ShowWaitDBSaveWindow() { this->rendered.push_back(this->window_4F2AC); UIWindow* window = this->window_4F2AC; - if (window && (this->modal == nullptr || this->window_4F174 == window) && !this->LookupWindow(278) && !this->LookupWindow(4) && - !this->LookupWindow(199) && !this->LookupWindow(200)) { + if (window && (this->modal == nullptr || this->window_4F174 == window) && !this->LookupWindow(WID_NEWMAKECHARWND) && !this->LookupWindow(WID_MAKECHARWND) && + !this->LookupWindow(WID_SECONDPASSWORDINPUTWND) && !this->LookupWindow(WID_SECONDPASSWORDEDITWND)) { int companion = -1; if (window->geometry.id == 12) { companion = 234; @@ -4241,13 +4243,13 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { if (static_cast(hotkey) < 45) { if (this->window_01E8) { - this->window_01E8->SendMsg(nullptr, 41, hotkey % 9, hotkey / 9, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, hotkey % 9, hotkey / 9, 0, 0); } return true; } if (this->unknown_0474 == 0) { - if (this->LookupWindow(0x2731) || this->LookupWindow(0x2728)) { + if (this->LookupWindow(WID_SELECTPACKAGEITEMBOX) || this->LookupWindow(WID_WAITDBSAVEWND)) { return false; } } @@ -4255,22 +4257,22 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { switch (hotkey) { case HK_BASICINFOWND_MINI + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xCA, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } break; case HK_EQUIPWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xC3, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_EQUIP, 0, 0, 0); } break; case HK_SKILLWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xC4, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_SKILL, 0, 0, 0); } break; case HK_QUESTWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0x169, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_QUEST, 0, 0, 0); } break; case HK_FRIENDWND_ONOFF + 100: @@ -4279,10 +4281,10 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { std::memcpy(&previous, this->unknown_0740, sizeof(previous)); int partyTab = 0; std::memcpy(this->unknown_0740, &partyTab, sizeof(partyTab)); - const bool closed = g_windowMgr.CloseWindow(0x45); + const bool closed = g_windowMgr.CloseWindow(WID_MESSENGERWND); std::memcpy(&partyTab, this->unknown_0740, sizeof(partyTab)); if (!closed || previous != partyTab) { - g_windowMgr.EnsureWindow(0x45); + g_windowMgr.EnsureWindow(WID_MESSENGERWND); } } break; @@ -4292,57 +4294,57 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { std::memcpy(&previous, this->unknown_0740, sizeof(previous)); int partyTab = 1; std::memcpy(this->unknown_0740, &partyTab, sizeof(partyTab)); - const bool closed = g_windowMgr.CloseWindow(0x45); + const bool closed = g_windowMgr.CloseWindow(WID_MESSENGERWND); std::memcpy(&partyTab, this->unknown_0740, sizeof(partyTab)); if (!closed || previous != partyTab) { - g_windowMgr.EnsureWindow(0x45); + g_windowMgr.EnsureWindow(WID_MESSENGERWND); } } break; case HK_CHATWND_MAKE + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xD6, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 0xD6, 0, 0, 0); } break; case HK_CARTWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xF7, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 0xF7, 0, 0, 0); } break; case HK_MAPWND_ONOFF + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x8C)) { - g_windowMgr.EnsureWindow(0x8C); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_ROMAPWND)) { + g_windowMgr.EnsureWindow(WID_ROMAPWND); } break; case HK_ITEMWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xC2, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_ITEMS, 0, 0, 0); } break; case HK_GUILDWND_ONOFF + 100: if (this->unknown_01DC) { if (g_guildInfo.m_guildId != 0) { - if (!g_windowMgr.CloseWindow(0x3B)) { - g_windowMgr.EnsureWindow(0x3B); + if (!g_windowMgr.CloseWindow(WID_GUILDWND)) { + g_windowMgr.EnsureWindow(WID_GUILDWND); } - } else if (!g_windowMgr.CloseWindow(0xD4)) { - g_windowMgr.EnsureWindow(0xD4); + } else if (!g_windowMgr.CloseWindow(WID_GUILDHELPERWND)) { + g_windowMgr.EnsureWindow(WID_GUILDHELPERWND); } } break; case HK_CLANWND_ONOFF + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0xED)) { - g_windowMgr.EnsureWindow(0xED); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_CLANINFOMANAGEWND)) { + g_windowMgr.EnsureWindow(WID_CLANINFOMANAGEWND); } break; case HK_EMOTIONWND_ONOFF + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x57)) { - g_windowMgr.EnsureWindow(0x57); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_CASHEMOTIONLISTWND)) { + g_windowMgr.EnsureWindow(WID_CASHEMOTIONLISTWND); } break; case HK_SITORSTAND + 100: if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(0x2A, 0x16, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_PROCESS_TALK_TYPE, 0x16, 0, 0, 0); } break; case HK_MINIMAP_ONOFF + 100: @@ -4351,15 +4353,15 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { this->unknown_005C = 0xAAFFFFFF; return true; } - if (!this->CloseWindow(14)) { - this->EnsureWindow(14); + if (!this->CloseWindow(WID_MINIMAPZOOMWND)) { + this->EnsureWindow(WID_MINIMAPZOOMWND); this->unknown_005C = 0xFFFFFFFF; } } break; case HK_MACROWND_ONOFF + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x56)) { - g_windowMgr.EnsureWindow(0x56); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_EMOTIONWND)) { + g_windowMgr.EnsureWindow(WID_EMOTIONWND); } break; case HK_EXEWND_ONOFF + 100: @@ -4371,56 +4373,56 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { this->CycleWindowVisibility(4); break; case HK_SKILLBAR_ONOFF + 100: - if (UIWindow* window = this->LookupWindow(0x24)) { - window->SendMsg(nullptr, 6, 0xD8, 0, 0, 0); + if (UIWindow* window = this->LookupWindow(WID_SHORTCUTWND)) { + window->SendMsg(nullptr, UM_COMMAND, ID_PLUS, 0, 0, 0); } break; case HK_CHATWND_ONOFF + 100: if (this->unknown_01DC) { - this->ShowWindowById(1, 1 - this->unknown_003C); + this->ShowWindowById(WID_CHATWND, 1 - this->unknown_003C); } break; case HK_CHATWND_ZOOM + 100: if (UIWindow* window = this->window_01C8) { if (window->geometry.visible != 0) { - window->SendMsg(nullptr, 2, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_TOGGLEPUSH, 0, 0, 0, 0); if (this->window_01C8->geometry.unknown_0030 == 0) { - this->ShowWindowById(1, 0); + this->ShowWindowById(WID_CHATWND, 0); } } else { - this->ShowWindowById(1, 1); + this->ShowWindowById(WID_CHATWND, 1); static_cast(this->window_01C8)->ApplyInputLayout(); } } break; case HK_GAGE_ONOFF + 100: if (g_modeMgr.gameMode) { - g_modeMgr.gameMode->SendMsg(0x29, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_TOGGLE_PLAYERGAGE, 0, 0, 0, 0); } break; case HK_SNAPSHOT + 100: - g_modeMgr.gameMode->SendMsg(0x44, 0, 0, 0, 0); + g_modeMgr.gameMode->SendMsg(MM_SCREENSHOT, 0, 0, 0, 0); break; case HK_MEMORIALWND_ONOFF + 100: if (UIWindow* window = this->unknown_03F8) { window->Show(window->geometry.visible == 0); } else { - g_windowMgr.EnsureWindow(0x89); + g_windowMgr.EnsureWindow(WID_MEMORIALDUNWND); } break; case HK_PETWND_ONOFF + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x58)) { - g_windowMgr.EnsureWindow(0x58); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_PETINFOWND)) { + g_windowMgr.EnsureWindow(WID_PETINFOWND); } break; case HK_HOMUNWND_ONOFF + 100: - if (this->unknown_01DC && g_session.unknown_5614 != 0 && !g_windowMgr.CloseWindow(0x71)) { - g_windowMgr.EnsureWindow(0x71); + if (this->unknown_01DC && g_session.unknown_5614 != 0 && !g_windowMgr.CloseWindow(WID_HOMUNINFOWND)) { + g_windowMgr.EnsureWindow(WID_HOMUNINFOWND); } break; case HK_MERWND_ONOFF + 100: - if (this->unknown_01DC && g_session.unknown_56B0 != 0 && !g_windowMgr.CloseWindow(0x7D)) { - g_windowMgr.EnsureWindow(0x7D); + if (this->unknown_01DC && g_session.unknown_56B0 != 0 && !g_windowMgr.CloseWindow(WID_MERINFOWND)) { + g_windowMgr.EnsureWindow(WID_MERINFOWND); } break; case HK_HOMUN_FOLLOW + 100: @@ -4456,13 +4458,13 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } break; case HK_FRIEND_OPTIONWND + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x44)) { - g_windowMgr.EnsureWindow(0x44); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_FRIENDOPTIONWND)) { + g_windowMgr.EnsureWindow(WID_FRIENDOPTIONWND); } break; case HK_PARTY_OPTIONWND + 100: - if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x35) && g_session.PartyCount()) { - g_windowMgr.EnsureWindow(0x35); + if (this->unknown_01DC && !g_windowMgr.CloseWindow(WID_PARTYSETTINGWND_PARTYCOUNT) && g_session.PartyCount()) { + g_windowMgr.EnsureWindow(WID_PARTYSETTINGWND_PARTYCOUNT); } break; case HK_GROUND_CURSOR_ONOFF + 100: { @@ -4476,59 +4478,59 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { if (this->unknown_01DC && this->chatModeChanged && this->window_01C8 && (this->IsHoverOnWindow01C8Button() || this->hoverWindow == nullptr)) { static_cast(this->window_01C8)->ToggleInput(); if (this->hoverWindow) { - this->hoverWindow->SendMsg(nullptr, 0, 0, 0, 0, 0); + this->hoverWindow->SendMsg(nullptr, UM_DEFPUSH, 0, 0, 0, 0); } } break; case HK_BASICINFOWND_BTN_ONOFF + 100: - if (UIWindow* window = this->LookupWindow(0x133)) { - window->SendMsg(nullptr, 60, 0, 0, 0, 0); + if (UIWindow* window = this->LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } break; case HK_CASHSHOPWND + 100: if (this->unknown_01DC) { - if (g_windowMgr.LookupWindow(0x13E) == nullptr) { - g_modeMgr.GetGameMode()->SendMsg(0x143, 0, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_CASHSHOP_WND) == nullptr) { + g_modeMgr.GetGameMode()->SendMsg(MM_REQUEST_CASH_SHOP, 0, 0, 0, 0); } else { - g_windowMgr.CloseWindow(0x13E); + g_windowMgr.CloseWindow(WID_CASHSHOP_WND); } } break; case HK_REPLAY_ONOFF + 100: - if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { - window->SendMsg(nullptr, 6, 0x18F, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, 0x18F, 0, 0, 0); } break; case HK_REPLAY_STARTSTOP + 100: if (g_replayAnimationScaling != 0 && this->window_4F168) { const int state = Replay::Instance().state; - this->window_4F168->SendMsg(nullptr, 6, state == 6 ? 0x191 : 0x192, 0, 0, 0); - this->window_4F168->SendMsg(nullptr, 35, 0, 0, 0, 0); + this->window_4F168->SendMsg(nullptr, UM_COMMAND, state == 6 ? 0x191 : 0x192, 0, 0, 0); + this->window_4F168->SendMsg(nullptr, UM_REFRESHBUTTON, 0, 0, 0, 0); } break; case HK_REPLAY_SPEEDP + 100: if (g_replayAnimationScaling != 0 && this->window_4F168) { - this->window_4F168->SendMsg(nullptr, 6, 0x195, 0, 0, 0); + this->window_4F168->SendMsg(nullptr, UM_COMMAND, ID_INCREASE_REPLAY_SPEED, 0, 0, 0); } break; case HK_REPLAY_SPEEDN + 100: if (g_replayAnimationScaling != 0 && this->window_4F168) { - this->window_4F168->SendMsg(nullptr, 6, 0x196, 0, 0, 0); + this->window_4F168->SendMsg(nullptr, UM_COMMAND, ID_DECREASE_REPLAY_SPEED, 0, 0, 0); } break; case HK_NAVIGATION_ONOFF + 100: if (g_windowMgr.window_4F174) { - g_windowMgr.window_4F174->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); } else if (g_windowMgr.modal) { - g_windowMgr.modal->SendMsg(nullptr, 6, 0xC8, 0, 0, 0); + g_windowMgr.modal->SendMsg(nullptr, UM_COMMAND, ID_BASE, 0, 0, 0); } else { - g_windowMgr.EnsureWindow(0xCB); + g_windowMgr.EnsureWindow(WID_NAVIGATIONV4WND); } break; case HK_BANK + 100: if (g_windowMgr.window_0448) { - g_windowMgr.CloseWindow(0x113); + g_windowMgr.CloseWindow(WID_BANK_NEWWND); } else { BankingCheckPacket packet; packet.id = 0x9AB; @@ -4540,12 +4542,12 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { break; case HK_STATUSWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0xC0, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, ID_STATUS, 0, 0, 0); } break; case HK_SHORTCUTWND_ROTATE + 100: { if (UIWindow* window = this->window_01E8) { - window->SendMsg(nullptr, 143, 1, g_session.GetOption(10), 0, 0); + window->SendMsg(nullptr, UM_ROTATE_SHORTCUT_ROWS, 1, g_session.GetOption(10), 0, 0); } ShortcutRotatePacket packet; packet.id = 0xB22; @@ -4561,58 +4563,58 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { break; } case HK_ACHIEVEMENT + 100: - if (!g_windowMgr.CloseWindow(0x10E)) { - g_windowMgr.EnsureWindow(0x10E); + if (!g_windowMgr.CloseWindow(WID_ACHIEVEMENTWND)) { + g_windowMgr.EnsureWindow(WID_ACHIEVEMENTWND); } break; case HK_SINGLEMAP_ONOFF + 100: if (static_cast(g_modeMgr.GetGameMode())->unknown_0254 != 0) { if (!g_session.IsNavigationAllowed()) { g_windowMgr.Confirm(LookupMessage(0xACF), 0, true, false, 0, "Message", 280, 120, 0); - } else if (!g_windowMgr.CloseWindow(0x111)) { - g_windowMgr.EnsureWindow(0x111); + } else if (!g_windowMgr.CloseWindow(WID_MINIMAPWND)) { + g_windowMgr.EnsureWindow(WID_MINIMAPWND); } } break; case HK_MAIL_ONOFF + 100: - if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { - window->SendMsg(nullptr, 6, 0x1DC, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + window->SendMsg(nullptr, UM_COMMAND, 0x1DC, 0, 0, 0); } break; case HK_SWAP_EQUIPMENT + 100: - g_modeMgr.GetGameMode()->SendMsg(0x130, 0, 0, 0, 0); + g_modeMgr.GetGameMode()->SendMsg(MM_SWAP_EQUIPMENT, 0, 0, 0, 0); break; case HK_TIPBOXWND_ONOFF + 100: - if (!g_windowMgr.CloseWindow(0x13B)) { - g_windowMgr.EnsureWindow(0x13B); + if (!g_windowMgr.CloseWindow(WID_TIPBOXWND)) { + g_windowMgr.EnsureWindow(WID_TIPBOXWND); } break; case HK_CHANGE_SKILLBAR + 100: - if (UIWindow* window = g_windowMgr.LookupWindow(0x24)) { - window->SendMsg(nullptr, 6, 0x225, 0, 0, 0); + if (UIWindow* window = g_windowMgr.LookupWindow(WID_SHORTCUTWND)) { + window->SendMsg(nullptr, UM_COMMAND, 0x225, 0, 0, 0); } break; case HK_COSEQUIPWND_ONOFF + 100: if (this->unknown_01DC) { - this->unknown_01DC->SendMsg(nullptr, 6, 0x242, 0, 0, 0); + this->unknown_01DC->SendMsg(nullptr, UM_COMMAND, 0x242, 0, 0, 0); } break; case HK_PARTYBOARDWND_ONOFF + 100: - if (!g_windowMgr.CloseWindow(0x144)) { - g_windowMgr.EnsureWindow(0x144); + if (!g_windowMgr.CloseWindow(WID_ADVENPARTYBOARDWND)) { + g_windowMgr.EnsureWindow(WID_ADVENPARTYBOARDWND); } break; case 0x9F: Singleton::GetInstance()->ToggleOption(0x109); break; case 0xA0: - if (!g_windowMgr.CloseWindow(0x15A)) { - g_windowMgr.EnsureWindow(0x15A); + if (!g_windowMgr.CloseWindow(WID_REPUTEWND)) { + g_windowMgr.EnsureWindow(WID_REPUTEWND); } break; case 0xA1: - if (!g_windowMgr.CloseWindow(0x2711)) { - g_windowMgr.EnsureWindow(0x2711); + if (!g_windowMgr.CloseWindow(WID_EQUIPMENTPROPERTIESWND)) { + g_windowMgr.EnsureWindow(WID_EQUIPMENTPROPERTIESWND); } break; case 0xA3: @@ -4702,9 +4704,9 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(220, g_session.IsTreeGroupThree(g_session.GetDisplayJob()) == true ? 71 : 55); window->Move(0, 0); this->AddRendered(window); - this->unknown_01DC->SendMsg(this->unknown_01DC, 0x22, reinterpret_cast(this->unknown_0514), 0, 0, 0); + this->unknown_01DC->SendMsg(this->unknown_01DC, UM_SETINFO, reinterpret_cast(this->unknown_0514), 0, 0, 0); g_snapMgr.SetRoot(window); - if (UIWindow* navigation = g_windowMgr.EnsureWindow(307)) { + if (UIWindow* navigation = g_windowMgr.EnsureWindow(WID_MENUICONWND)) { int x = 0; int y = 0; window->ToScreen(x, y); @@ -4722,43 +4724,43 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } } else { if (this->unknown_054C) { - this->EnsureWindow(8); + this->EnsureWindow(WID_ITEMWND); } if (this->unknown_05A4) { - this->EnsureWindow(10); + this->EnsureWindow(WID_EQUIPWND); } if (this->unknown_0588) { - this->EnsureWindow(11); + this->EnsureWindow(WID_STATUSWND); } if (this->unknown_05BC) { this->EnsureWindow(13); } if (this->unknown_077C) { - this->EnsureWindow(37); + this->EnsureWindow(WID_SKILLLISTWND); } if (this->unknown_0568) { - this->EnsureWindow(321); + this->EnsureWindow(WID_RENEWQUESTWND); } if (this->unknown_073C) { - this->EnsureWindow(69); + this->EnsureWindow(WID_MESSENGERWND); } if (g_session.unknown_5470 == 1 && g_session.unknown_5474 == 1 && g_effectDetailLevel == 2 && g_textureDetailLevel == 2) { - this->EnsureWindow(10014); + this->EnsureWindow(WID_GAMESETTINGSUI); } if (g_session.HasUnknown6178Records() == true) { - this->EnsureWindow(271); + this->EnsureWindow(WID_ACHTRACINGWND); } if (this->unknown_4F210 == true) { - this->EnsureWindow(286); + this->EnsureWindow(WID_MACROREPORTERWND); } this->RebuildMiniPartyWindows(); } if (static_cast(g_modeMgr.GetGameMode())->unknown_0254) { - this->EnsureWindow(14); + this->EnsureWindow(WID_MINIMAPZOOMWND); } - this->ShowWindowById(1, this->unknown_003C); - this->ShowWindowById(36, this->m_normalItemSlotWindow.show); - this->ShowWindowById(15, 0); + this->ShowWindowById(WID_CHATWND, this->unknown_003C); + this->ShowWindowById(WID_SHORTCUTWND, this->m_normalItemSlotWindow.show); + this->ShowWindowById(WID_ITEMDROPCNTWND, 0); break; case WID_CHATWND: window = this->window_01C8; @@ -4768,7 +4770,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(600, this->unknown_0038); this->AddRendered(window); } - this->window_01C8->SendMsg(nullptr, 0x22, 0, 0, 0, 0); + this->window_01C8->SendMsg(nullptr, UM_SETINFO, 0, 0, 0, 0); break; case WID_SELECTSERVERWND: window = new UISelectServerWnd(); @@ -4777,14 +4779,14 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->AddRendered(window); break; case WID_RPIMAGEWND2: - if (this->LookupWindow(325) == nullptr) { + if (this->LookupWindow(WID_RPIMAGEWND2) == nullptr) { window = new UIRPImageWnd2(); this->window_4F25C = window; window->SetSize(301, 132); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); } else { - window = this->LookupWindow(325); + window = this->LookupWindow(WID_RPIMAGEWND2); } break; case WID_LOGINWND: @@ -4857,13 +4859,13 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 120); this->AddRendered(window); - this->unknown_01D4->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x528), 0, 0, 0); + this->unknown_01D4->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x528), 0, 0, 0); g_snapMgr.Add(window); } window->Show(1); this->unknown_054C = 1; - if (UIWindow* basicInfo = g_windowMgr.LookupWindow(307)) { - basicInfo->SendMsg(nullptr, 6, 0x11E, 0xC2, 0, 0); + if (UIWindow* basicInfo = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + basicInfo->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC2, 0, 0); } break; case WID_QUESTDISPLAY: @@ -4875,7 +4877,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->window_0428->unknown_004C = 5; this->AddRendered(this->window_0428); this->rendered.sort(layerGreater); - this->window_0428->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x570), 0, 0, 0); + this->window_0428->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x570), 0, 0, 0); } break; case WID_WAITWND: @@ -4909,7 +4911,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(290, 34); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->window_01E8->SendMsg(nullptr, 0x22, reinterpret_cast(&this->m_normalItemSlotWindow), 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(&this->m_normalItemSlotWindow), 0, 0, 0); g_snapMgr.Add(window); } break; @@ -4922,7 +4924,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 167); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); - this->unknown_01E0->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x590), 0, 0, 0); + this->unknown_01E0->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x590), 0, 0, 0); g_snapMgr.Add(window); } window->Show(1); @@ -4936,7 +4938,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(640, 540); window->Move(CenterOnViewportX(0), ScaleByScreenHeight(30)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x9B4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x9B4), 0, 0, 0); g_snapMgr.Add(window); } window->Show(1); @@ -4949,14 +4951,14 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 141); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); - this->unknown_01C4->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x574), 0, 0, 0); + this->unknown_01C4->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x574), 0, 0, 0); g_snapMgr.Add(window); } window->Show(1); this->unknown_0588 = 1; - this->CloseWindow(21); - if (UIWindow* basicInfo = g_windowMgr.LookupWindow(307)) { - basicInfo->SendMsg(nullptr, 6, 0x11E, 0xC0, 0, 0); + this->CloseWindow(WID_NOTIFYLEVELUPWND); + if (UIWindow* basicInfo = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + basicInfo->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC0, 0, 0); } break; case WID_SKILLLISTWND: @@ -4967,13 +4969,13 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(560, 400); window->Move(CenterOnViewportX(50), ScaleByScreenHeight(50)); this->AddRendered(window); - this->window_02C4->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x76C), 0, 0, 0); + this->window_02C4->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x76C), 0, 0, 0); } window->Show(1); this->unknown_077C = 1; - this->CloseWindow(49); - if (UIWindow* basicInfo = g_windowMgr.LookupWindow(307)) { - basicInfo->SendMsg(nullptr, 6, 0x11E, 0xC4, 0, 0); + this->CloseWindow(WID_NOTIFYJOBLEVELUPWND); + if (UIWindow* basicInfo = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + basicInfo->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0xC4, 0, 0); } break; case WID_ITEMSTOREWND: @@ -4984,7 +4986,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 458); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->window_0288->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x614), 0, 0, 0); + this->window_0288->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x614), 0, 0, 0); } window->Show(1); break; @@ -5021,7 +5023,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(140, 145); static_cast(this->unknown_028C[tab])->SetTitle(LookupMessage(message)); this->AddRendered(window); - this->unknown_028C[tab]->SendMsg(nullptr, 0x22, reinterpret_cast(reinterpret_cast(base + 0x62C) + tab), 0, 0, 0); + this->unknown_028C[tab]->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(reinterpret_cast(base + 0x62C) + tab), 0, 0, 0); } window->Show(1); break; @@ -5037,7 +5039,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { static_cast(this->unknown_02A8)->SetTitle(LookupMessage(id == WID_ITEMSTORESUBWND_TAB_7 ? 0x5BF : 0)); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02A8->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x69C), 0, 0, 0); + this->unknown_02A8->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x69C), 0, 0, 0); } window->Show(1); break; @@ -5050,7 +5052,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { static_cast(this->unknown_02AC)->SetTitle(LookupMessage(0x447)); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02AC->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6AC), 0, 0, 0); + this->unknown_02AC->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6AC), 0, 0, 0); } window->Show(1); break; @@ -5070,7 +5072,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(152, 199); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02B8->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6EC), 0, 0, 0); + this->unknown_02B8->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6EC), 0, 0, 0); } break; case WID_SEEKPARTYWND: @@ -5081,7 +5083,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(152, 199); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02B0->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6DC), 0, 0, 0); + this->unknown_02B0->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6DC), 0, 0, 0); } window->Show(1); g_session.m_partyBooking.unknown_0000 = 1; @@ -5094,9 +5096,9 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(360, 350); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02B4->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6CC), 0, 0, 0); + this->unknown_02B4->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6CC), 0, 0, 0); } else { - g_windowMgr.CloseWindow(168); + g_windowMgr.CloseWindow(WID_SEEKPARTYMBWND); } } break; @@ -5107,23 +5109,23 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(550, 350); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_02BC->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6BC), 0, 0, 0); + this->unknown_02BC->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6BC), 0, 0, 0); } else { - g_windowMgr.CloseWindow(169); + g_windowMgr.CloseWindow(WID_SEEKPARTYLISTWND); } break; case WID_MESSENGERWND: if (*reinterpret_cast(this->unknown_0740)) { - this->EnsureWindow(34)->SendMsg(nullptr, 6, 0xD7, 2, 0, 0); + this->EnsureWindow(WID_MESSENGERGROUPWND)->SendMsg(nullptr, UM_COMMAND, ID_RADIOBTN, 2, 0, 0); } else { - this->EnsureWindow(34)->SendMsg(nullptr, 6, 0xD7, 1, 0, 0); + this->EnsureWindow(WID_MESSENGERGROUPWND)->SendMsg(nullptr, UM_COMMAND, ID_RADIOBTN, 1, 0, 0); } break; case WID_MESSENGERGROUPWND: if (g_replayAnimationScaling && !Replay::Instance().header.options.Get(ReplayRecordOption::Party)) { break; } - this->CloseWindow(69); + this->CloseWindow(WID_MESSENGERWND); window = this->window_02C8; if (window == nullptr) { window = new UIMessengerGroupWnd(); @@ -5131,7 +5133,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(273, 326); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->window_02C8->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x72C), 0, 0, 0); + this->window_02C8->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x72C), 0, 0, 0); } window->Show(1); this->unknown_073C = 1; @@ -5144,10 +5146,10 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(400, 260); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(200)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7A4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7A4), 0, 0, 0); } window->Show(1); - this->EnsureWindow(42); + this->EnsureWindow(WID_MERCHANTMIRRORITEMWND); break; case WID_MERCHANTMIRRORITEMWND: window = reinterpret_cast(this->unknown_02F8); @@ -5157,14 +5159,14 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(0), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_0794), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_0794), 0, 0, 0); } window->Show(1); break; case WID_MERCHANTITEMWND: if (!g_mapPropertyMgr->GetValue(g_session.unknown_0000, 40)) { - g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x94C)), 255, 0, 0, 0); + g_windowMgr.SendNotice(UIM_OPENCHATWND, 0, 0, 0, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0x94C)), 255, 0, 0, 0); break; } window = this->unknown_02F4; @@ -5174,7 +5176,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_0780), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_0780), 0, 0, 0); } window->Show(1); this->unknown_0790 = 1; @@ -5231,7 +5233,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(200, 100); window->Move(CenterOnViewportX(220), CenterOnViewportY(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x9D4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x9D4), 0, 0, 0); } window->Show(1); break; @@ -5274,25 +5276,25 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } switch (guildInfo->unknown_0010) { case 0: - window = g_windowMgr.EnsureWindow(60); + window = g_windowMgr.EnsureWindow(WID_GUILDINFOMANAGEWND); break; case 1: - window = g_windowMgr.EnsureWindow(61); + window = g_windowMgr.EnsureWindow(WID_GUILDMEMBERMANAGEWND); break; case 2: - window = g_windowMgr.EnsureWindow(62); + window = g_windowMgr.EnsureWindow(WID_GUILDPOSITIONMANAGEWND); break; case 3: - window = g_windowMgr.EnsureWindow(63); + window = g_windowMgr.EnsureWindow(WID_GUILDSKILLWND); break; case 4: - window = g_windowMgr.EnsureWindow(64); + window = g_windowMgr.EnsureWindow(WID_GUILDBANISHEDMEMBERWND); break; case 5: - window = g_windowMgr.EnsureWindow(65); + window = g_windowMgr.EnsureWindow(WID_GUILDNOTICEWND); break; case 6: - window = g_windowMgr.EnsureWindow(66); + window = g_windowMgr.EnsureWindow(WID_GUILDTOTALINFOWND); break; } break; @@ -5305,7 +5307,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5317,7 +5319,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5329,7 +5331,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5341,7 +5343,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5353,7 +5355,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5365,7 +5367,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5377,7 +5379,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(g_defaultPlacementWidth, g_defaultPlacementHeight); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x834), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x834), 0, 0, 0); } window->Show(1); break; @@ -5403,7 +5405,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->unknown_0348->unknown_004C = 2; this->rendered.sort(layerGreater); } else { - this->unknown_0348->SendMsg(nullptr, 0x22, -1, 0, 0, 0); + this->unknown_0348->SendMsg(nullptr, UM_SETINFO, -1, 0, 0, 0); } window->Show(1); break; @@ -5446,7 +5448,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(213, 90); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x86C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x86C), 0, 0, 0); } window->Show(1); break; @@ -5458,7 +5460,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(130, g_session.PartyCount() ? 245 : 180); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x814), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x814), 0, 0, 0); } window->Show(1); break; @@ -5470,7 +5472,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(130, 220); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x814), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x814), 0, 0, 0); } window->Show(1); break; @@ -5627,7 +5629,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_0284->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x75C), 0, 0, 0); + this->unknown_0284->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x75C), 0, 0, 0); } window->Show(1); break; @@ -5660,7 +5662,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 180); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(100)); this->AddRendered(window); - this->unknown_01F0->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x5E4), 0, 0, 0); + this->unknown_01F0->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x5E4), 0, 0, 0); } window->Show(1); this->unknown_01F0->unknown_004C = 1; @@ -5673,7 +5675,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->unknown_01F4 = window; window->SetSize(g_renderer->viewport.width, 100); window->Move(0, g_renderer->viewport.height - 100); - this->AddOverlay(250, window); + this->AddOverlay(WID_COMBINEDCARDITEMCOLLECTION_COMPARISONWND, window); } window->Show(1); break; @@ -5685,7 +5687,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(300)); this->AddRendered(window); - this->window_027C->SendMsg(nullptr, 0x35, reinterpret_cast(base + 0x604), 0, 0, 0); + this->window_027C->SendMsg(nullptr, UM_SETINFO2, reinterpret_cast(base + 0x604), 0, 0, 0); } window->Show(1); break; @@ -5708,7 +5710,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(300)); this->AddRendered(window); - this->unknown_01F8->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x5F4), 0, 0, 0); + this->unknown_01F8->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x5F4), 0, 0, 0); } window->Show(1); break; @@ -5720,7 +5722,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(200, 200); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_0208->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x87C), 0, 0, 0); + this->unknown_0208->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x87C), 0, 0, 0); } window->Show(1); break; @@ -5732,7 +5734,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(200, 200); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->unknown_01FC->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x88C), 0, 0, 0); + this->unknown_01FC->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x88C), 0, 0, 0); } window->Show(1); break; @@ -5821,7 +5823,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x70C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x70C), 0, 0, 0); } window->Show(1); break; @@ -5833,7 +5835,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x70C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x70C), 0, 0, 0); } window->Show(1); break; @@ -5845,7 +5847,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7D4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7D4), 0, 0, 0); } window->Show(1); break; @@ -5857,10 +5859,10 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x71C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x71C), 0, 0, 0); } window->Show(1); - this->EnsureWindow(50); + this->EnsureWindow(WID_ITEMPARAMCHANGEDISPLAYWND); break; case WID_MERCHANTITEMMYSHOPWND: window = this->unknown_0304; @@ -5870,7 +5872,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7C4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7C4), 0, 0, 0); } window->Show(1); break; @@ -5882,7 +5884,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7B4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7B4), 0, 0, 0); } window->Show(1); break; @@ -5894,7 +5896,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6FC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6FC), 0, 0, 0); } window->Show(1); break; @@ -5906,7 +5908,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6FC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6FC), 0, 0, 0); } window->Show(1); break; @@ -5918,7 +5920,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6FC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6FC), 0, 0, 0); } window->Show(1); break; @@ -5930,7 +5932,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x71C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x71C), 0, 0, 0); } window->Show(1); break; @@ -5942,7 +5944,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 0, 0, 0, 0); } window->Show(1); break; @@ -6053,7 +6055,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 34); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300) - 34); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x804), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x804), 0, 0, 0); } window->Show(1); break; @@ -6065,7 +6067,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7F4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7F4), 0, 0, 0); } window->Show(1); break; @@ -6077,7 +6079,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7E4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7E4), 0, 0, 0); } window->Show(1); break; @@ -6089,7 +6091,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); this->AddRendered(window); } - window->SendMsg(nullptr, 0x22, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 0, 0, 0, 0); window->Show(1); break; case WID_COMBINEDCARDITEMCOLLECTION_COMPARISONWND: @@ -6100,7 +6102,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x7F4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x7F4), 0, 0, 0); } window->Show(1); break; @@ -6201,7 +6203,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->unknown_0380 = window; window->SetSize(375, 260); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(300) - 60); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x89C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x89C), 0, 0, 0); this->AddRendered(window); } window->Show(1); @@ -6216,7 +6218,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } window->SetSize(298, 380); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(400) - 60); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x8AC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x8AC), 0, 0, 0); this->AddRendered(window); } window->Show(1); @@ -6231,7 +6233,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->window_038C = window; window->SetSize(280, 180); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(400) - 60); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x8BC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x8BC), 0, 0, 0); this->AddRendered(window); } window->Show(1); @@ -6341,7 +6343,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->window_03C0 = window; window->SetSize(280, 208); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(400) - 60); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x8CC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x8CC), 0, 0, 0); this->AddRendered(window); } window->Show(1); @@ -6355,7 +6357,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->window_03C4->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x8DC), 0, 0, 0); + this->window_03C4->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x8DC), 0, 0, 0); } static_cast(this->window_03C4)->skillTab = 0; this->window_03C4->Show(1); @@ -6371,7 +6373,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->window_03C8 = window; window->SetSize(280, 180); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(400) - 60); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x8F0), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x8F0), 0, 0, 0); this->AddRendered(window); } window->Show(1); @@ -6404,7 +6406,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(194, 34); window->Move(CenterOnViewportX(259), CenterOnViewportY(230)); this->AddRendered(window); - this->window_4F164->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_4F154), 0, 0, 0); + this->window_4F164->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_4F154), 0, 0, 0); } break; case WID_NAVIGATIONV4WND: @@ -6414,12 +6416,12 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window = new UINavigationV4Wnd(); this->window_4F174 = window; window->SetSize(272, 338); - this->window_4F174->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x4F178), 0, 0, 0); + this->window_4F174->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x4F178), 0, 0, 0); this->AddRendered(window); } break; case WID_NAVIGATIONHELPWND: - if (this->LookupWindow(229) == nullptr) { + if (this->LookupWindow(WID_NAVIGATIONHELPWND) == nullptr) { window = new UINavigationHelpWnd(); window->SetSize(310, 200); window->Move(100, 100); @@ -6427,7 +6429,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_NAVIGATIONROADICONWND: - if (this->LookupWindow(306) == nullptr) { + if (this->LookupWindow(WID_NAVIGATIONROADICONWND) == nullptr) { int x = 200; int y = 200; if (this->window_4F174) { @@ -6441,7 +6443,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_NAVIGATIONRUIDEWND: - if (this->LookupWindow(314) == nullptr) { + if (this->LookupWindow(WID_NAVIGATIONRUIDEWND) == nullptr) { int x = 200; int y = 200; if (this->window_4F174) { @@ -6463,7 +6465,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(200)); this->AddRendered(window); - this->window_03CC->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x900), 0, 0, 0); + this->window_03CC->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x900), 0, 0, 0); } static_cast(this->window_03CC)->skillTab = 1; this->window_03CC->Show(1); @@ -6519,7 +6521,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(300, 95); this->AddRendered(window); reinterpret_cast(this->unknown_03E4)->SetId(130); - reinterpret_cast(this->unknown_03E4)->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x914), 0, 0, 0); + reinterpret_cast(this->unknown_03E4)->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x914), 0, 0, 0); } window->Show(0); break; @@ -6531,7 +6533,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(300, 95); this->AddRendered(window); reinterpret_cast(this->unknown_03E8)->SetId(131); - reinterpret_cast(this->unknown_03E8)->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x924), 0, 0, 0); + reinterpret_cast(this->unknown_03E8)->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x924), 0, 0, 0); } window->Show(0); break; @@ -6631,17 +6633,17 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_JOINTO_BATTLEFIELDWND: - window = this->LookupWindow(157); + window = this->LookupWindow(WID_JOINTO_BATTLEFIELDWND); if (window == nullptr) { window = new UIEntryQueueWnd(); window->SetSize(350, 350); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_0944), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_0944), 0, 0, 0); } window->Show(1); break; case WID_ENTRYQUEUESTANDBYWND: - window = this->LookupWindow(209); + window = this->LookupWindow(WID_ENTRYQUEUESTANDBYWND); if (window == nullptr) { UIEntryQueueStandByWnd* standBy = new UIEntryQueueStandByWnd(); window = standBy; @@ -6651,7 +6653,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_ENTRYQUEUEREQUESTWND: - window = this->LookupWindow(210); + window = this->LookupWindow(WID_ENTRYQUEUEREQUESTWND); if (window == nullptr) { UIEntryQueueRequestWnd* request = new UIEntryQueueRequestWnd(); window = request; @@ -6661,7 +6663,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_ENTRYQUEUEHELPWND: - window = this->LookupWindow(211); + window = this->LookupWindow(WID_ENTRYQUEUEHELPWND); if (window == nullptr) { window = new UIEntryQueueHelpWnd(); window->SetSize(100, 100); @@ -6677,10 +6679,10 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(360, 289); window->Move(CenterOnViewportX(185), ScaleByScreenHeight(200)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x954), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x954), 0, 0, 0); } window->Show(1); - this->EnsureWindow(175); + this->EnsureWindow(WID_MERCHANTMIRRORITEMWND_MODE_1); break; case WID_MERCHANTMIRRORITEMWND_MODE_1: window = reinterpret_cast(this->unknown_0410); @@ -6690,7 +6692,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(CenterOnViewportX(0), ScaleByScreenHeight(120)); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x964), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x964), 0, 0, 0); } window->Show(1); break; @@ -6702,7 +6704,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x974), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x974), 0, 0, 0); } window->Show(1); break; @@ -6714,7 +6716,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(350, 120); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x984), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x984), 0, 0, 0); } window->Show(1); break; @@ -6726,7 +6728,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x994), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x994), 0, 0, 0); } window->Show(1); break; @@ -6738,7 +6740,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(280, 120); window->Move(300, 0); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x9A4), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x9A4), 0, 0, 0); } window->Show(1); break; @@ -6812,7 +6814,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { break; } case WID_MERGEITEMWND: - window = this->LookupWindow(227); + window = this->LookupWindow(WID_MERGEITEMWND); if (window == nullptr) { window = new CMergeItemWnd(); window->SetSize(1, 1); @@ -6822,8 +6824,8 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_MERCHANTITEMPURCHASEMSGWND: - if (this->LookupWindow(230) == nullptr) { - this->CloseWindow(230); + if (this->LookupWindow(WID_MERCHANTITEMPURCHASEMSGWND) == nullptr) { + this->CloseWindow(WID_MERCHANTITEMPURCHASEMSGWND); } window = new (std::nothrow) UIMerchantItemPurchaseMSGWnd(); if (window == nullptr) { @@ -6842,29 +6844,29 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(400, 317); window->Move(ScaleToViewportWidth(0), 147); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x9F0), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x9F0), 0, 0, 0); } window->Show(1); break; case WID_BANK_NEWWND: - if (this->LookupWindow(295)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xBC6)), 255, 0, 0, 0); + if (this->LookupWindow(WID_REFININGWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBC6)), 255, 0, 0, 0); break; } - if (this->LookupWindow(343)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xE85)), 255, 0, 0, 0); + if (this->LookupWindow(WID_GRADEENCHANTWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE85)), 255, 0, 0, 0); break; } - if (this->LookupWindow(10006)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF05)), 255, 0, 0, 0); + if (this->LookupWindow(WID_ENCHANTUI)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF05)), 255, 0, 0, 0); break; } - if (this->LookupWindow(341)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF7F)), 255, 0, 0, 0); + if (this->LookupWindow(WID_EXPANDEDBARTERMARKETWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF7F)), 255, 0, 0, 0); break; } - if (g_windowMgr.LookupWindow(361)) { - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xFD7)), 255, 0, 0, 0); + if (g_windowMgr.LookupWindow(WID_RUNESYSTEMWND)) { + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFD7)), 255, 0, 0, 0); break; } window = this->window_0448; @@ -6948,7 +6950,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_PETEVOLUTIONWND: - window = this->LookupWindow(261); + window = this->LookupWindow(WID_PETEVOLUTIONWND); if (window == nullptr) { window = new UIPetEvolutionWnd(); window->SetSize(290, 400); @@ -6958,7 +6960,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_SECONDCOSTUMEWND: - window = dynamic_cast(this->LookupWindow(259)); + window = dynamic_cast(this->LookupWindow(WID_SECONDCOSTUMEWND)); if (window == nullptr) { window = new UISecondCostumeWnd(); this->window_4F170 = window; @@ -6969,7 +6971,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_MILEAGEWND: - window = this->LookupWindow(267); + window = this->LookupWindow(WID_MILEAGEWND); if (window == nullptr) { window = new UIMileageWnd(); CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\mileage_bg1.bmp"))); @@ -7012,7 +7014,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_ACHIEVEMENTWND: - window = dynamic_cast(this->LookupWindow(270)); + window = dynamic_cast(this->LookupWindow(WID_ACHIEVEMENTWND)); if (window == nullptr) { window = new UIAchievementWnd(); window->SetSize(750, 468); @@ -7020,12 +7022,12 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); this->AddRendered(window); } - if (UIWindow* basicInfo = g_windowMgr.LookupWindow(307)) { - basicInfo->SendMsg(nullptr, 6, 0x11E, 0x1D9, 0, 0); + if (UIWindow* basicInfo = g_windowMgr.LookupWindow(WID_MENUICONWND)) { + basicInfo->SendMsg(nullptr, UM_COMMAND, ID_NOTICE, 0x1D9, 0, 0); } break; case WID_ACHTRACINGWND: - window = dynamic_cast(this->LookupWindow(271)); + window = dynamic_cast(this->LookupWindow(WID_ACHTRACINGWND)); if (window == nullptr) { window = new UIAchTracingWnd(); window->SetSize(300, 150); @@ -7034,7 +7036,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->unknown_004C = 5; this->AddRendered(window); this->rendered.sort(layerGreater); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x4F1D8), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x4F1D8), 0, 0, 0); } break; case WID_MINIMAPWND: @@ -7043,7 +7045,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->window_4F1CC = window; MiniMapWndInfo* miniMapInfo = reinterpret_cast(base + 0x4F1A8); window->SetSize(miniMapInfo->unknown_0010, miniMapInfo->unknown_0014); - window->SendMsg(nullptr, 0x22, reinterpret_cast(miniMapInfo), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(miniMapInfo), 0, 0, 0); window->Show(1); this->AddRendered(window); } @@ -7059,7 +7061,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_ROUNDBOXTOOLTIPWND: - if (this->LookupWindow(276) == nullptr) { + if (this->LookupWindow(WID_ROUNDBOXTOOLTIPWND) == nullptr) { window = new UIRoundBoxTooltipWnd(); this->window_4F1E4 = window; window->SetSize(100, 200); @@ -7072,7 +7074,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_STYLINGSHOPWND: - window = this->LookupWindow(281); + window = this->LookupWindow(WID_STYLINGSHOPWND); if (window == nullptr) { window = new UIStylingShopWnd(); window->SetSize(480, 330); @@ -7114,7 +7116,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->AddRendered(window); } window->Show(1); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x4F200), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x4F200), 0, 0, 0); this->unknown_4F210 = true; break; case WID_MACROUSERINFOWND: @@ -7140,7 +7142,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_VIEWCAMERAINFOWND: - window = this->LookupWindow(289); + window = this->LookupWindow(WID_VIEWCAMERAINFOWND); if (window == nullptr) { int y = 200; int x = g_renderer->viewport.width - 200; @@ -7158,7 +7160,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(g_session.unknown_61B1); break; case WID_LAPINEBOXWND: - if (this->LookupWindow(290) == nullptr) { + if (this->LookupWindow(WID_LAPINEBOXWND) == nullptr) { window = new UILapineBoxWnd(); window->SetSize(400, 250); window->Move((g_renderer->viewport.width - 400) / 2, (g_renderer->viewport.height - 250) / 2); @@ -7166,7 +7168,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_TRANSMENUWND: - window = this->LookupWindow(291); + window = this->LookupWindow(WID_TRANSMENUWND); if (window == nullptr) { window = new UITransMenuWnd(); window->SetSize(30, 40); @@ -7177,65 +7179,65 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_PREVIEWEQUIPWND: - if (this->LookupWindow(294) == nullptr) { + if (this->LookupWindow(WID_PREVIEWEQUIPWND) == nullptr) { window = new UIPreviewEquipWnd(); window->SetSize(280, 260); window->Move(static_cast((g_renderer->viewport.width - 280) * g_depthAverageHalf), static_cast((g_renderer->viewport.height - 260) * g_depthAverageHalf)); - window->SendMsg(nullptr, 0x22, reinterpret_cast(this->unknown_4F220), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(this->unknown_4F220), 0, 0, 0); this->AddRendered(window); } else { - window = this->LookupWindow(294); + window = this->LookupWindow(WID_PREVIEWEQUIPWND); } break; case WID_REFININGWND: { const int x = static_cast((g_renderer->viewport.width - 264) * g_depthAverageHalf); const int y = static_cast((g_renderer->viewport.height - 346) * g_depthAverageHalf); - this->EnsureWindow(8); + this->EnsureWindow(WID_ITEMWND); if (this->unknown_01D4) { this->unknown_01D4->Move(x + 264, y - this->unknown_01D4->geometry.height + 346); } if (this->unknown_0454) { - this->CloseWindow(264); - this->CloseWindow(265); - this->unknown_0454->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xBAF)), 255, 0, 0, 0); + this->CloseWindow(WID_RODEXCOMPOSEWND); + this->CloseWindow(WID_RODEXCONTENTSWND); + this->unknown_0454->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBAF)), 255, 0, 0, 0); } if (this->window_0448) { - g_windowMgr.CloseWindow(275); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xBC5)), 255, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BANK_NEWWND); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xBC5)), 255, 0, 0, 0); } - if (this->LookupWindow(295) == nullptr) { + if (this->LookupWindow(WID_REFININGWND) == nullptr) { window = new UIRefiningWnd(); window->SetSize(264, 346); window->Move(x, y); this->AddRendered(window); } else { - window = this->LookupWindow(295); + window = this->LookupWindow(WID_REFININGWND); } break; } case WID_LAPINEUPGRADEBOXWND: - if (this->LookupWindow(302) == nullptr) { + if (this->LookupWindow(WID_LAPINEUPGRADEBOXWND) == nullptr) { window = new UILapineUpgradeBoxWnd(); window->SetSize(400, 250); window->Move((g_renderer->viewport.width - 400) / 2, (g_renderer->viewport.height - 250) / 2); this->AddRendered(window); } else { - window = this->LookupWindow(302); + window = this->LookupWindow(WID_LAPINEUPGRADEBOXWND); } break; case WID_HOTKEYGUIDEWND: - if (this->LookupWindow(303) == nullptr) { + if (this->LookupWindow(WID_HOTKEYGUIDEWND) == nullptr) { window = new UIHotkeyGuideWnd(); window->SetSize(934, 498); window->Move((g_renderer->viewport.width - 934) / 2, (g_renderer->viewport.height - 498) / 2); this->AddRendered(window); } else { - window = this->LookupWindow(303); + window = this->LookupWindow(WID_HOTKEYGUIDEWND); } break; case WID_VIDEOWND: - window = this->LookupWindow(304); + window = this->LookupWindow(WID_VIDEOWND); if (window == nullptr) { window = new UIVideoWnd(); window->SetSize(g_renderer->viewport.width, g_renderer->viewport.height); @@ -7244,29 +7246,29 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_MENUICONWND: - if (this->LookupWindow(307) == nullptr) { + if (this->LookupWindow(WID_MENUICONWND) == nullptr) { window = new UIMenuIconWnd(); window->SetSize(220, 197); window->Move(0, 225); this->AddRendered(window); } else { - window = this->LookupWindow(307); + window = this->LookupWindow(WID_MENUICONWND); } break; case WID_SHOWWARPWND: - if (this->LookupWindow(308) == nullptr) { + if (this->LookupWindow(WID_SHOWWARPWND) == nullptr) { window = new UIShowWarpWnd(); window->SetSize(280, 120); window->Move(CenterOnViewportX(200), ScaleByScreenHeight(300)); this->AddRendered(window); window->Show(1); } else { - window = this->LookupWindow(308); + window = this->LookupWindow(WID_SHOWWARPWND); window->Show(1); } break; case WID_TIPBOXWND: - if (this->LookupWindow(315) == nullptr) { + if (this->LookupWindow(WID_TIPBOXWND) == nullptr) { window = new UITipboxWnd(); this->window_0468 = window; window->SetSize(480, 365); @@ -7274,20 +7276,20 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->AddRendered(window); window->Show(1); } else { - window = this->LookupWindow(315); + window = this->LookupWindow(WID_TIPBOXWND); window->Show(1); } break; case WID_CASHSHOP_WND: - if (this->LookupWindow(318) == nullptr) { + if (this->LookupWindow(WID_CASHSHOP_WND) == nullptr) { window = new UICashShopWnd(); this->window_4F254 = window; window->SetSize(723, 540); window->Move(static_cast((g_renderer->viewport.width - 723) * 0.5), static_cast((g_renderer->viewport.height - 540) * 0.5)); - window->SendMsg(nullptr, 0x22, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 0, 0, 0, 0); this->AddRendered(window); } else { - window = this->LookupWindow(318); + window = this->LookupWindow(WID_CASHSHOP_WND); } break; case WID_RENEWQUESTWND: @@ -7298,11 +7300,11 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(381, 466); window->Move((g_renderer->viewport.width - 381) / 2, (g_renderer->viewport.height - 466) / 2); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x550), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x550), 0, 0, 0); g_snapMgr.Add(window); } window->Show(1); - this->CloseWindow(143); + this->CloseWindow(WID_NOTIFYQUESTWND); this->unknown_0568 = 1; break; case WID_RENEWDETAILQUESTINFOWND: @@ -7311,7 +7313,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { if (window == nullptr) { window = new UIRenewDetailQuestInfoWnd(); window->SetSize(342, 412); - if (UIWindow* quest = this->LookupWindow(321)) { + if (UIWindow* quest = this->LookupWindow(WID_RENEWQUESTWND)) { window->Move(quest->geometry.x + quest->geometry.width, quest->geometry.y); } else { window->Move((g_renderer->viewport.width - 342) / 2, (g_renderer->viewport.height - 412) / 2); @@ -7322,70 +7324,70 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_CHECKATTENDANCEWND: - if (this->LookupWindow(328) == nullptr) { + if (this->LookupWindow(WID_CHECKATTENDANCEWND) == nullptr) { window = new UICheckAttendanceWnd(); window->SetSize(488, 413); window->Move(static_cast((g_renderer->viewport.width - 488) * 0.5), static_cast((g_renderer->viewport.height - 413) * 0.5)); this->AddRendered(window); } else { - window = this->LookupWindow(328); + window = this->LookupWindow(WID_CHECKATTENDANCEWND); } break; case WID_BARTERMARKETWND: - if (this->LookupWindow(334) == nullptr) { + if (this->LookupWindow(WID_BARTERMARKETWND) == nullptr) { window = new UIBartermarketWnd(); this->window_4F260 = window; window->SetSize(280, 400); window->Move(0, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x6FC), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x6FC), 0, 0, 0); } else { - window = this->LookupWindow(334); + window = this->LookupWindow(WID_BARTERMARKETWND); } break; case WID_BARTERITEMPURCHASEWND: - if (this->LookupWindow(335) == nullptr) { + if (this->LookupWindow(WID_BARTERITEMPURCHASEWND) == nullptr) { window = new UIBarterItemPurchaseWnd(); this->window_4F264 = window; window->SetSize(280, 120); window->Move(300, 200); this->AddRendered(window); - window->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0x71C), 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0x71C), 0, 0, 0); } else { - window = this->LookupWindow(335); + window = this->LookupWindow(WID_BARTERITEMPURCHASEWND); } break; case WID_EXPANDEDBARTERMARKETWND: - if (this->LookupWindow(275)) { - g_windowMgr.CloseWindow(275); - g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0xF7E)), 255, 0, 0, 0); + if (this->LookupWindow(WID_BANK_NEWWND)) { + g_windowMgr.CloseWindow(WID_BANK_NEWWND); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xF7E)), 255, 0, 0, 0); } - if (this->LookupWindow(341) == nullptr) { + if (this->LookupWindow(WID_EXPANDEDBARTERMARKETWND) == nullptr) { window = new UIExpandedBartermarketWnd(); this->window_4F268 = window; window->SetSize(366, 366); window->Move(200, 200); this->AddRendered(window); } else { - window = this->LookupWindow(341); + window = this->LookupWindow(WID_EXPANDEDBARTERMARKETWND); } break; case WID_EXPANDEDBARTERITEMPURCHASEWND: - if (this->LookupWindow(275)) { + if (this->LookupWindow(WID_BANK_NEWWND)) { break; } - if (this->LookupWindow(342) == nullptr) { + if (this->LookupWindow(WID_EXPANDEDBARTERITEMPURCHASEWND) == nullptr) { window = new UIExpandedBarterItemPurchaseWnd(); this->window_4F26C = window; window->SetSize(366, 366); window->Move(586, 200); this->AddRendered(window); } else { - window = this->LookupWindow(341); + window = this->LookupWindow(WID_EXPANDEDBARTERMARKETWND); } break; case WID_NOTEWND: - if (this->LookupWindow(333) == nullptr) { + if (this->LookupWindow(WID_NOTEWND) == nullptr) { window = new UINoteWnd(); window->SetSize(358, 275); if (UIWindow* shop = this->unknown_02FC) { @@ -7393,14 +7395,14 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } else { window->Move(static_cast((g_renderer->viewport.width - 358) * 0.5), static_cast((g_renderer->viewport.height - 275) * 0.5)); } - window->SendMsg(nullptr, 0x22, 0xC95, 0, 0, 0); + window->SendMsg(nullptr, UM_SETINFO, 0xC95, 0, 0, 0); this->AddRendered(window); } else { - window = this->LookupWindow(333); + window = this->LookupWindow(WID_NOTEWND); } break; case WID_ACCOUNTLIMITEDTOOLWND: - window = this->LookupWindow(340); + window = this->LookupWindow(WID_ACCOUNTLIMITEDTOOLWND); if (window == nullptr) { window = new UIAccountLimitedToolWnd(); window->SetSize(390, 350); @@ -7412,37 +7414,37 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { case WID_GRADEENCHANTWND: { const int x = static_cast((g_renderer->viewport.width - 400) * g_depthAverageHalf - 100.0f); const int y = static_cast((g_renderer->viewport.height - 330) * g_depthAverageHalf); - this->EnsureWindow(8); + this->EnsureWindow(WID_ITEMWND); if (this->unknown_01D4) { this->unknown_01D4->Move(x + 400, y - this->unknown_01D4->geometry.height + 330); } if (this->unknown_0454) { - this->CloseWindow(264); - this->CloseWindow(265); - this->unknown_0454->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xE82)), 255, 0, 0, 0); + this->CloseWindow(WID_RODEXCOMPOSEWND); + this->CloseWindow(WID_RODEXCONTENTSWND); + this->unknown_0454->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE82)), 255, 0, 0, 0); } if (this->window_0448) { - g_windowMgr.CloseWindow(275); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xE84)), 255, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BANK_NEWWND); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xE84)), 255, 0, 0, 0); } - if (this->LookupWindow(343) == nullptr) { + if (this->LookupWindow(WID_GRADEENCHANTWND) == nullptr) { window = new UIGradeEnchantWnd(); window->SetSize(400, 330); window->Move(x, y); this->AddRendered(window); } else { - window = this->LookupWindow(343); + window = this->LookupWindow(WID_GRADEENCHANTWND); } break; } case WID_CHANGEMATERIALWND: - window = this->LookupWindow(344); + window = this->LookupWindow(WID_CHANGEMATERIALWND); if (window == nullptr) { window = new UIChangeMaterialWnd(); window->SetSize(500, 314); window->Move(static_cast((g_renderer->viewport.width - 500) * 0.5), static_cast((g_renderer->viewport.height - 314) * 0.5)); - window->SendMsg(nullptr, 0x17, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, 0, 0, 0, 0); this->AddRendered(window); this->SetFocus(nullptr); } @@ -7455,7 +7457,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(480, 340); window->Move(g_renderer->viewport.centerX - window->geometry.width / 2, g_renderer->viewport.centerY - window->geometry.height / 2); this->AddRendered(window); - this->window_4F274->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0xA20), 0, 0, 0); + this->window_4F274->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0xA20), 0, 0, 0); } break; case WID_REGISTERPARTYWND: @@ -7466,7 +7468,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(220, 215); window->Move(g_renderer->viewport.centerX + 240, g_renderer->viewport.centerY + 170); this->AddRendered(window); - this->window_4F270->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0xA00), 0, 0, 0); + this->window_4F270->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0xA00), 0, 0, 0); } break; case WID_REQUESTJOINPARTYWND: @@ -7487,11 +7489,11 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->SetSize(220, 190); window->Move(g_renderer->viewport.centerX + 240, g_renderer->viewport.centerY - 170); this->AddRendered(window); - this->window_4F27C->SendMsg(nullptr, 0x22, reinterpret_cast(base + 0xA10), 0, 0, 0); + this->window_4F27C->SendMsg(nullptr, UM_SETINFO, reinterpret_cast(base + 0xA10), 0, 0, 0); } break; case WID_REPUTEWND: - window = this->LookupWindow(346); + window = this->LookupWindow(WID_REPUTEWND); if (window == nullptr) { window = new UIReputeWnd(); window->SetSize(640, 450); @@ -7500,7 +7502,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_ITEMREFORMWND: - window = this->LookupWindow(348); + window = this->LookupWindow(WID_ITEMREFORMWND); if (window == nullptr) { window = new UIItemReformWnd(); window->SetSize(440, 260); @@ -7509,7 +7511,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } break; case WID_BALLOONOPENBTN: - window = this->LookupWindow(358); + window = this->LookupWindow(WID_BALLOONOPENBTN); if (window == nullptr) { window = new UIBalloonOpenBtn(); window->SetSize(18, 18); @@ -7529,18 +7531,18 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_RUNESYSTEMWND: - window = this->LookupWindow(361); + window = this->LookupWindow(WID_RUNESYSTEMWND); if (window == nullptr) { g_runeSystemMgr->SendRequest(0xBCB, nullptr, -1); if (this->unknown_0454) { - this->CloseWindow(264); - this->CloseWindow(265); - this->unknown_0454->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFD8)), 255, 0, 0, 0); + this->CloseWindow(WID_RODEXCOMPOSEWND); + this->CloseWindow(WID_RODEXCONTENTSWND); + this->unknown_0454->SendMsg(nullptr, UM_COMMAND, ID_CLOSE, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFD8)), 255, 0, 0, 0); } if (this->window_0448) { - g_windowMgr.CloseWindow(275); - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFD9)), 255, 0, 0, 0); + g_windowMgr.CloseWindow(WID_BANK_NEWWND); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFD9)), 255, 0, 0, 0); } window = new UIRuneSystemWnd(); window->SetSize(910, 539); @@ -7550,11 +7552,11 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); break; case WID_RUNESYSTEM_DECOMRESULTWND: - window = this->LookupWindow(362); + window = this->LookupWindow(WID_RUNESYSTEM_DECOMRESULTWND); if (window == nullptr) { window = new UIRuneSystem_DecomResultWnd(); window->SetSize(240, 180); - if (UIWindow* runeSystem = this->LookupWindow(361)) { + if (UIWindow* runeSystem = this->LookupWindow(WID_RUNESYSTEMWND)) { window->Move(runeSystem->geometry.x + 478, runeSystem->geometry.y + 129); } this->AddRendered(window); @@ -7563,7 +7565,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->Promote(window); break; case WID_DEBUFFREMOVEWND: - if (this->LookupWindow(10032) == nullptr) { + if (this->LookupWindow(WID_DEBUFFREMOVEWND) == nullptr) { window = new UIDebuffRemoveWnd(); window->SetSize(180, 47); window->Move(static_cast((g_renderer->viewport.width - 180) * 0.5), static_cast((g_renderer->viewport.height - 47) * 0.5)); @@ -7615,19 +7617,19 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { if (notify) { switch (id) { case WID_JOINGUILDACCEPTWND: - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFDA)), 0xFFFF00, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFDA)), 0xFFFF00, 0, 0, 0); break; case WID_ALLYGUILDACCEPTWND: - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFDB)), 0xFFFF00, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFDB)), 0xFFFF00, 0, 0, 0); break; case WID_JOINFRIENDACCEPTWND: - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFDC)), 0xFFFF00, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFDC)), 0xFFFF00, 0, 0, 0); break; case WID_JOINPARTYACCEPTWND: - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFDD)), 0xFFFF00, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFDD)), 0xFFFF00, 0, 0, 0); break; case WID_EXCHANGEACCEPTWND: - this->SendNotice(1, reinterpret_cast(LookupMessage(0xFDE)), 0xFFFF00, 0, 0, 0); + this->SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(LookupMessage(0xFDE)), 0xFFFF00, 0, 0, 0); break; } } diff --git a/Source/UI/Window/WindowAncestry.cpp b/Source/UI/Window/WindowAncestry.cpp index 403e470b9..3b9a558e0 100644 --- a/Source/UI/Window/WindowAncestry.cpp +++ b/Source/UI/Window/WindowAncestry.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Replay.h" #include "Client/ReplayRecordOption.h" #include "UI/Window/UIWindow.h" @@ -105,10 +106,10 @@ void UIWindow::PropagateMsg(UIWindow* sender, int message, std::intptr_t argumen // OFFSET: 0x00A81D70 // FUNCTION: fn_16989 void UIWindow::BroadcastMsg4() { - this->SendMsg(nullptr, 4, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_PAGEDOWNPUSH, 0, 0, 0, 0); for (std::list::iterator it = this->m_children.begin(); it != this->m_children.end(); ++it) { if (*it) { - (*it)->SendMsg(nullptr, 4, 0, 0, 0, 0); + (*it)->SendMsg(nullptr, UM_PAGEDOWNPUSH, 0, 0, 0, 0); } } } @@ -116,10 +117,10 @@ void UIWindow::BroadcastMsg4() { // OFFSET: 0x00A81DC0 // FUNCTION: fn_16990 void UIWindow::BroadcastMsg3() { - this->SendMsg(nullptr, 3, 0, 0, 0, 0); + this->SendMsg(nullptr, UM_PAGEUPPUSH, 0, 0, 0, 0); for (std::list::iterator it = this->m_children.begin(); it != this->m_children.end(); ++it) { if (*it) { - (*it)->SendMsg(nullptr, 3, 0, 0, 0, 0); + (*it)->SendMsg(nullptr, UM_PAGEUPPUSH, 0, 0, 0, 0); } } } diff --git a/Source/UI/Window/WindowDialogs.cpp b/Source/UI/Window/WindowDialogs.cpp index dd86fdcb1..b92d939c1 100644 --- a/Source/UI/Window/WindowDialogs.cpp +++ b/Source/UI/Window/WindowDialogs.cpp @@ -1,4 +1,5 @@ #include "Client/Application/ApplicationWindow.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CLoginMode.h" #include "Client/Mode/ModeMgr.h" @@ -22,85 +23,85 @@ bool UIWindowMgr::ProcessDialogKey(int, int key) { switch (key) { case 0x100001: - this->window_01E8->SendMsg(nullptr, 41, 0, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 0, 1, 0, 0); return false; case 0x110001: - this->window_01E8->SendMsg(nullptr, 41, 1, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 1, 1, 0, 0); return false; case 0x120001: - this->window_01E8->SendMsg(nullptr, 41, 2, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 2, 1, 0, 0); return false; case 0x130001: - this->window_01E8->SendMsg(nullptr, 41, 3, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 3, 1, 0, 0); return false; case 0x140001: - this->window_01E8->SendMsg(nullptr, 41, 4, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 4, 1, 0, 0); return false; case 0x150001: - this->window_01E8->SendMsg(nullptr, 41, 5, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 5, 1, 0, 0); return false; case 0x160001: - this->window_01E8->SendMsg(nullptr, 41, 6, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 6, 1, 0, 0); return false; case 0x170001: - this->window_01E8->SendMsg(nullptr, 41, 7, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 7, 1, 0, 0); return false; case 0x180001: - this->window_01E8->SendMsg(nullptr, 41, 8, 1, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 8, 1, 0, 0); return false; case 0x1E0001: - this->window_01E8->SendMsg(nullptr, 41, 0, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 0, 2, 0, 0); return false; case 0x1F0001: - this->window_01E8->SendMsg(nullptr, 41, 1, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 1, 2, 0, 0); return false; case 0x200001: - this->window_01E8->SendMsg(nullptr, 41, 2, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 2, 2, 0, 0); return false; case 0x210001: - this->window_01E8->SendMsg(nullptr, 41, 3, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 3, 2, 0, 0); return false; case 0x220001: - this->window_01E8->SendMsg(nullptr, 41, 4, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 4, 2, 0, 0); return false; case 0x230001: - this->window_01E8->SendMsg(nullptr, 41, 5, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 5, 2, 0, 0); return false; case 0x240001: - this->window_01E8->SendMsg(nullptr, 41, 6, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 6, 2, 0, 0); return false; case 0x250001: - this->window_01E8->SendMsg(nullptr, 41, 7, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 7, 2, 0, 0); return false; case 0x260001: - this->window_01E8->SendMsg(nullptr, 41, 8, 2, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 8, 2, 0, 0); return false; case 0x2C0001: - this->window_01E8->SendMsg(nullptr, 41, 0, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 0, 0, 0, 0); return false; case 0x2D0001: - this->window_01E8->SendMsg(nullptr, 41, 1, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 1, 0, 0, 0); return false; case 0x2E0001: - this->window_01E8->SendMsg(nullptr, 41, 2, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 2, 0, 0, 0); return false; case 0x2F0001: - this->window_01E8->SendMsg(nullptr, 41, 3, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 3, 0, 0, 0); return false; case 0x300001: - this->window_01E8->SendMsg(nullptr, 41, 4, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 4, 0, 0, 0); return false; case 0x310001: - this->window_01E8->SendMsg(nullptr, 41, 5, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 5, 0, 0, 0); return false; case 0x320001: - this->window_01E8->SendMsg(nullptr, 41, 6, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 6, 0, 0, 0); return false; case 0x330001: - this->window_01E8->SendMsg(nullptr, 41, 7, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 7, 0, 0, 0); return false; case 0x340001: - this->window_01E8->SendMsg(nullptr, 41, 8, 0, 0, 0); + this->window_01E8->SendMsg(nullptr, UM_USE_SHORTEN_ITEM, 8, 0, 0, 0); return false; default: return false; @@ -154,8 +155,8 @@ int UIWindowMgr::Confirm( } if (UIWindow* active = this->Top()) { - if (active->SendMsg(nullptr, 158, 0, 0, 0, 0) == 0 && replace) { - active->SendMsg(nullptr, 57, reinterpret_cast(text), 0, 0, 0); + if (active->SendMsg(nullptr, UM_IS_MESSAGE_PROTECTED, 0, 0, 0, 0) == 0 && replace) { + active->SendMsg(nullptr, UM_CHANGEMSG, reinterpret_cast(text), 0, 0, 0); } return 185; @@ -166,7 +167,7 @@ int UIWindowMgr::Confirm( box->Configure(text, type, defaultAccept, timeout, caption, width, height, 1, nullptr); if (protect == 1) { - box->SendMsg(nullptr, 157, 1, 0, 0, 0); + box->SendMsg(nullptr, UM_SET_MESSAGE_PROTECTED, 1, 0, 0, 0); } this->rendered.insert(this->rendered.end(), box); diff --git a/Source/UI/Window/WindowId.h b/Source/UI/Window/WindowId.h index f8b0e10f4..abfdbcfde 100644 --- a/Source/UI/Window/WindowId.h +++ b/Source/UI/Window/WindowId.h @@ -260,6 +260,19 @@ enum WindowId : int { WID_DEBUFFREMOVEWND = 10032, WID_GUILDWND = 59, WID_MESSENGERWND = 69, + WID_WHISPERWND = 67, + WID_EQUIPMENTPROPERTIESWND = 10001, + WID_ADVENTUREGUIDE = 10002, + WID_MACROREPORT = 10005, + WID_ENCHANTUI = 10006, + WID_RENEWQUESTUI = 10008, + WID_ONGOINGQUESTINFO = 10009, + WID_RECOMMENDEDQUESTINFO = 10010, + WID_EXCHANGEUI = 10011, + WID_PROBABILITYTABLE = 10012, + WID_GAMESETTINGSUI = 10014, + WID_SKILLDELAYINFO = 10030, + WID_SELECTPACKAGEITEMBOX = 10033, }; #endif diff --git a/Source/UI/Window/WindowMgrState.cpp b/Source/UI/Window/WindowMgrState.cpp index 959bde7b1..5251c33cf 100644 --- a/Source/UI/Window/WindowMgrState.cpp +++ b/Source/UI/Window/WindowMgrState.cpp @@ -1,3 +1,6 @@ +#include "Client/Mode/ModeMessage.h" +#include "UI/Window/UIEnums.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CLoginMode.h" #include "Client/Mode/ModeDragState.h" @@ -135,7 +138,7 @@ void UIWindowMgr::RestoreMiniPartyWindows() { window->SetSize(174, 52); window->m_cell = record.unknown_0008; this->AddMiniPartyWindow(window); - window->SendMsg(nullptr, 0x17, reinterpret_cast(&member), 0, 0, 0); + window->SendMsg(nullptr, UM_REFRESHITEM, reinterpret_cast(&member), 0, 0, 0); } } @@ -570,13 +573,13 @@ void UIWindowMgr::ConfirmActiveDialog() { if (window || (window = this->unknown_01F0) != nullptr || (window = this->unknown_01F4) != nullptr || (window = this->unknown_0214) != nullptr || (window = this->unknown_021C) != nullptr || (window = this->unknown_020C) != nullptr || (window = this->unknown_0374) != nullptr || (window = this->hoverWindow) != nullptr) { - window->SendMsg(nullptr, 18, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); return; } for (auto entry = this->rendered.begin(); entry != this->rendered.end(); ++entry) { if ((*entry)->IsFrameWnd()) { - (*entry)->SendMsg(nullptr, 18, 0, 0, 0, 0); + (*entry)->SendMsg(nullptr, UM_UPPUSH, 0, 0, 0, 0); } } } @@ -658,7 +661,7 @@ void UIWindowMgr::SaveVisibleWindowIds() { // FUNCTION: fn_17282 void UIWindowMgr::UpdateNavigationList() { if (this->window_4F174 && !g_navigationManager.unknown_1254 && static_cast(this->window_4F174)->IsListShown()) { - this->window_4F174->SendMsg(nullptr, 6, 202, 0, 0, 0); + this->window_4F174->SendMsg(nullptr, UM_COMMAND, ID_MINI, 0, 0, 0); } } @@ -1046,31 +1049,31 @@ void UIWindowMgr::SendFlagEffect(int message) { switch (message) { case 210: - mode->SendMsg(329, reinterpret_cast("ET_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_FLAG"), 0, 0, 0); break; case 211: - mode->SendMsg(329, reinterpret_cast("ET_INDONESIA_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_INDONESIA_FLAG"), 0, 0, 0); break; case 212: - mode->SendMsg(329, reinterpret_cast("ET_PH_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_PH_FLAG"), 0, 0, 0); break; case 213: - mode->SendMsg(329, reinterpret_cast("ET_MY_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_MY_FLAG"), 0, 0, 0); break; case 214: - mode->SendMsg(329, reinterpret_cast("ET_SI_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_SI_FLAG"), 0, 0, 0); break; case 215: - mode->SendMsg(329, reinterpret_cast("ET_BR_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_BR_FLAG"), 0, 0, 0); break; case 216: - mode->SendMsg(329, reinterpret_cast("ET_INDIA_FLAG"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_INDIA_FLAG"), 0, 0, 0); break; case 217: - mode->SendMsg(329, reinterpret_cast("ET_FLAG8"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_FLAG8"), 0, 0, 0); break; case 218: - mode->SendMsg(329, reinterpret_cast("ET_FLAG9"), 0, 0, 0); + mode->SendMsg(MM_CASH_EMOTION, reinterpret_cast("ET_FLAG9"), 0, 0, 0); break; } } @@ -1139,7 +1142,7 @@ void UIWindowMgr::RestoreHiddenWindows() { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode && mode->unknown_0254 == 1) { - this->EnsureWindow(14); + this->EnsureWindow(WID_MINIMAPZOOMWND); } static_cast(g_modeMgr.GetGameMode())->scene->player->RefreshEffect164(); diff --git a/Source/UI/Window/WindowMouseHit.cpp b/Source/UI/Window/WindowMouseHit.cpp index 8eca26dbe..fdeec52cd 100644 --- a/Source/UI/Window/WindowMouseHit.cpp +++ b/Source/UI/Window/WindowMouseHit.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/WindowId.h" #include "Client/Session.h" #include "Client/Mode/ModeMgr.h" #include "Client/Browser/WebBrowser.h" @@ -27,7 +28,7 @@ static __forceinline void PromoteWindow(UIWindowMgr* manager, UIWindow* window) return; } - if (manager->LookupWindow(278) || manager->LookupWindow(4) || manager->LookupWindow(199) || manager->LookupWindow(200)) { + if (manager->LookupWindow(WID_NEWMAKECHARWND) || manager->LookupWindow(WID_MAKECHARWND) || manager->LookupWindow(WID_SECONDPASSWORDINPUTWND) || manager->LookupWindow(WID_SECONDPASSWORDEDITWND)) { return; } @@ -326,15 +327,15 @@ int UIWindowMgr::ProcessMouse() { if (g_mouse.buttons[0] == 1) { if (this->unknown_0214 && (!window || (window != this->unknown_0214 && !window->IsDescendantOf(this->unknown_0214)))) { - this->CloseWindow(26); + this->CloseWindow(WID_COMBOBOXWND); } if (this->unknown_021C) { if (!window) { - this->CloseWindow(260); + this->CloseWindow(WID_COMBOBOXIDWND); this->CloseDropDown(); } else if (window != this->unknown_021C && !window->IsDescendantOf(this->unknown_021C)) { - this->CloseWindow(260); + this->CloseWindow(WID_COMBOBOXIDWND); } } else if (!window) { this->CloseDropDown(); diff --git a/Source/UI/Window/WindowOrdering.cpp b/Source/UI/Window/WindowOrdering.cpp index ead6db505..e2a72dbea 100644 --- a/Source/UI/Window/WindowOrdering.cpp +++ b/Source/UI/Window/WindowOrdering.cpp @@ -1,4 +1,6 @@ #include "UI/Window/UIRoulletteWnd.h" +#include "UI/Window/WindowId.h" +#include "UI/Window/UIEnums.h" #include "Contents/Configuration/ServiceOptions.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UIWindow.h" @@ -18,7 +20,7 @@ void UIWindowMgr::InvalidateAll() { // FUNCTION: fn_17185 void UIWindowMgr::RefreshClanWnd() { if (this->window_0444) { - this->window_0444->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->window_0444->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -26,25 +28,25 @@ void UIWindowMgr::RefreshClanWnd() { // FUNCTION: fn_17186 void UIWindowMgr::RefreshGuildWindows() { if (this->window_0320) { - this->window_0320->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->window_0320->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->window_0324) { - this->window_0324->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->window_0324->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->unknown_0328) { - this->unknown_0328->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0328->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->window_032C) { - this->window_032C->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->window_032C->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->unknown_0330) { - this->unknown_0330->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0330->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->unknown_0334) { - this->unknown_0334->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0334->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } if (this->unknown_0338) { - this->unknown_0338->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0338->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -52,7 +54,7 @@ void UIWindowMgr::RefreshGuildWindows() { // FUNCTION: fn_17187 void UIWindowMgr::RefreshRouletteWnd() { if (this->unknown_0464) { - this->unknown_0464->SendMsg(nullptr, 60, 0, 0, 0, 0); + this->unknown_0464->SendMsg(nullptr, UM_REFRESH, 0, 0, 0, 0); } } @@ -105,7 +107,7 @@ void UIWindowMgr::Promote(UIWindow* window) { return; } - if (this->LookupWindow(278) || this->LookupWindow(4) || this->LookupWindow(199) || this->LookupWindow(200)) { + if (this->LookupWindow(WID_NEWMAKECHARWND) || this->LookupWindow(WID_MAKECHARWND) || this->LookupWindow(WID_SECONDPASSWORDINPUTWND) || this->LookupWindow(WID_SECONDPASSWORDEDITWND)) { return; } diff --git a/Source/UI/Window/WindowRetirement.cpp b/Source/UI/Window/WindowRetirement.cpp index 43cdfa092..1f8abbd07 100644 --- a/Source/UI/Window/WindowRetirement.cpp +++ b/Source/UI/Window/WindowRetirement.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Contents/Configuration/ServiceOptions.h" #include "UI/Layout/SnapMgr.h" #include "UI/Window/UIWindow.h" @@ -95,13 +96,13 @@ void UIWindowMgr::SubmitActiveDialog() { if (window || (window = this->unknown_01F0) != nullptr || (window = this->unknown_01F4) != nullptr || (window = this->unknown_0214) != nullptr || (window = this->unknown_021C) != nullptr || (window = this->unknown_020C) != nullptr || (window = this->unknown_0374) != nullptr || (window = this->hoverWindow) != nullptr) { - window->SendMsg(nullptr, 19, 0, 0, 0, 0); + window->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); return; } for (auto entry = this->rendered.begin(); entry != this->rendered.end(); ++entry) { if ((*entry)->IsFrameWnd()) { - (*entry)->SendMsg(nullptr, 19, 0, 0, 0, 0); + (*entry)->SendMsg(nullptr, UM_DOWNPUSH, 0, 0, 0, 0); } } }