From 858265cc6926777fa765c8e34d2ff5cc01c0e457 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 8 Nov 2026 12:37:46 +0000 Subject: [PATCH] Maintenance: Second pass: name remaining numeric switch case labels (identifier-only; no code change). ~3,500 more labels across 150 Batch #14936 by ragnarok-clanker: no function's compiled code changes; checked with 158 compiled unit(s), including every includer of Source/Client/Mode/GameModeEnums.h, Source/Client/Mode/ModeMessage.h, Source/Contents/Actors/ActorEnums.h, Source/Contents/Actors/PetEnums.h, Source/Contents/Combat/CombatTypes.h, Source/Contents/Configuration/ServiceEnums.h, Source/Contents/Effects/EffectPrimId.h, Source/Contents/Hotkeys/InterfaceHotkey.h, Source/Contents/Items/ItemId.h, Source/Contents/Items/ItemType.h, Source/Network/Packets/ModeResultEnums.h, Source/Network/Packets/NoticeEnums.h, Source/Network/Packets/PacketId.h, Source/UI/Window/UIEnums.h, Source/UI/Window/WindowId.h. --- Source/Client/Input/Language.cpp | 8 +- Source/Client/Mode/GameMode.cpp | 824 ++++++++--------- Source/Client/Mode/GameModeEnums.h | 81 ++ Source/Client/Mode/GameModeHandlers.cpp | 69 +- Source/Client/Mode/GameModeNotices.cpp | 24 +- Source/Client/Mode/GameModePackets.cpp | 857 +++++++++--------- Source/Client/Mode/GameModeSounds.cpp | 7 +- Source/Client/Mode/LoginMode.cpp | 154 ++-- Source/Client/Mode/LoginModeNotices.cpp | 49 +- Source/Client/Mode/ModeMessage.h | 200 ++++ Source/Client/Mode/ModeMgr.cpp | 5 +- Source/Client/Replay.cpp | 2 +- Source/Client/Session.cpp | 20 +- Source/Client/SessionPredicates.cpp | 25 +- Source/Contents/Actors/ActorEnums.h | 177 ++++ Source/Contents/Actors/GameActor.cpp | 83 +- Source/Contents/Actors/GameObject.cpp | 86 +- Source/Contents/Actors/GroundScope.cpp | 9 +- Source/Contents/Actors/MercenaryAI.cpp | 69 +- Source/Contents/Actors/PetEnums.h | 25 + Source/Contents/Actors/Player.cpp | 210 ++--- Source/Contents/Actors/RenderObject.cpp | 183 ++-- Source/Contents/Actors/Skill.cpp | 13 +- Source/Contents/CashEmotionMgr.cpp | 27 +- Source/Contents/ClientItemLists.cpp | 17 +- Source/Contents/Combat/CombatTypes.h | 4 +- .../Configuration/ServiceConfiguration.cpp | 41 +- Source/Contents/Configuration/ServiceEnums.h | 15 + Source/Contents/Effects/EffectPrimId.h | 94 ++ .../Effects/EffectPrimitiveMotion.cpp | 135 +-- .../Effects/EffectPrimitiveRendering.cpp | 173 ++-- Source/Contents/Effects/MsgEffect.cpp | 210 ++--- Source/Contents/Effects/Particle.cpp | 3 +- Source/Contents/Effects/RagEffect.cpp | 13 +- Source/Contents/Effects/SpriteParticle.cpp | 7 +- .../Contents/Effects/ViolentQuakeEffect.cpp | 5 +- Source/Contents/EntryQueueMgr.cpp | 21 +- Source/Contents/Hotkeys/InterfaceHotkey.h | 95 ++ Source/Contents/Hotkeys/UserHotkeyMgr.cpp | 17 +- Source/Contents/Items/ItemId.h | 209 +++++ Source/Contents/Items/ItemInfo.cpp | 9 +- Source/Contents/Items/ItemNaming.cpp | 19 +- Source/Contents/Items/ItemType.h | 24 + Source/Contents/Messenger/ClientMessenger.cpp | 55 +- Source/Contents/Messenger/MessengerMember.cpp | 59 +- Source/Contents/PetTalk.cpp | 31 +- .../Skills/SkillActionShinkiroShiranui.cpp | 9 +- Source/Contents/Sound/SoundMaker.cpp | 47 +- Source/Contents/World/WorldObjects.cpp | 69 +- Source/Network/Packets/ModeResultEnums.h | 29 +- Source/Network/Packets/NoticeEnums.h | 290 +++++- Source/Network/Packets/PacketId.h | 183 ++++ Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 650 ++++++------- Source/UI/Acceptance/UIExchangeAcceptWnd.cpp | 11 +- Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp | 9 +- Source/UI/Buttons/UITextButton.cpp | 9 +- Source/UI/CashShop/UICashShopWnd.cpp | 43 +- Source/UI/Chat/UINewChatWnd.cpp | 41 +- Source/UI/Clan/UIClanWnd.cpp | 9 +- Source/UI/Dialogs/UIEditctrlWnd.cpp | 15 +- Source/UI/Edit/UIEditBoxEx.cpp | 13 +- Source/UI/Edit/UIEditCtrl.cpp | 420 ++++----- Source/UI/Edit/UIEditVariants.cpp | 25 +- Source/UI/Emotion/UIEmotionWnd.cpp | 7 +- Source/UI/EntryQueue/UIEntryQueueWnd.cpp | 5 +- Source/UI/Exchange/UIExchangeUI.cpp | 11 +- Source/UI/Guild/UIAgitWnd.cpp | 5 +- Source/UI/Guild/UIGuildHelperWnd.cpp | 21 +- Source/UI/Guild/UIGuildWnd.cpp | 171 ++-- Source/UI/Guild/UIGuild_Storage_Log.cpp | 13 +- Source/UI/Item/UIMerchantItemLogWnd.cpp | 7 +- Source/UI/Item/UIParaItemShopWnd.cpp | 76 +- Source/UI/Items/MergeItemWnd.cpp | 19 +- Source/UI/Items/UIIllustWnd.cpp | 13 +- Source/UI/Items/UIItemRepairWnd.cpp | 17 +- Source/UI/Items/UIMakeTargetListWnd.cpp | 13 +- Source/UI/Items/UIMakeTargetProcessWnd.cpp | 11 +- Source/UI/Items/UISwapEquipmentWnd.cpp | 9 +- Source/UI/Items/UIWeaponRefineWnd.cpp | 13 +- Source/UI/Lists/UIComboBox.cpp | 25 +- Source/UI/Lists/UIComboBoxDefWnd.cpp | 11 +- Source/UI/Lists/UIComboBoxEx.cpp | 13 +- Source/UI/Lists/UIListBox.cpp | 21 +- Source/UI/Lists/UIListBoxEx.cpp | 19 +- Source/UI/Lists/UIListBoxID.cpp | 19 +- Source/UI/Lists/UIScrollBar.cpp | 61 +- Source/UI/Lists/UITagListBox.cpp | 21 +- Source/UI/Menu/UIMenuIconWnd.cpp | 33 +- Source/UI/Party/UIAdvenPartyBoardWnd.cpp | 17 +- Source/UI/Party/UIApplyForPartyWnd.cpp | 7 +- Source/UI/Party/UIMiniPartyWnd.cpp | 45 +- Source/UI/Party/UIRegisterPartyWnd.cpp | 9 +- Source/UI/Party/UIRequestJoinPartyWnd.cpp | 7 +- Source/UI/Quest/UIQuestDisplay.cpp | 7 +- Source/UI/Quest/UIRenewQuestUI.cpp | 5 +- Source/UI/Quest/UIRenewQuestWnd.cpp | 25 +- Source/UI/Rodex/UIRodexComposeWnd.cpp | 11 +- Source/UI/Rodex/UIRodexInboxWnd.cpp | 19 +- Source/UI/RuneSystem/UIRuneSystemWnd.cpp | 51 +- Source/UI/Shortcuts/ShortcutCooldowns.cpp | 9 +- Source/UI/Shortcuts/ShortcutDrop.cpp | 69 +- Source/UI/Shortcuts/ShortcutVisibility.cpp | 13 +- Source/UI/Shortcuts/UIQuickSlotWnd.cpp | 7 +- Source/UI/Shortcuts/UIShortCutWnd.cpp | 70 +- Source/UI/StylingShop/UIStylingShopWnd.cpp | 31 +- Source/UI/Text/UIAchWnd.cpp | 27 +- Source/UI/Text/UITagTextViewer.cpp | 23 +- Source/UI/Text/UITextViewer.cpp | 13 +- Source/UI/Text/UITextViewerMessages.cpp | 21 +- Source/UI/UIBartermarketWnd.cpp | 45 +- Source/UI/UICaptchaRegisterWnd.cpp | 7 +- Source/UI/UIChangeMaterialWnd.cpp | 35 +- Source/UI/UICheckAttendanceWnd.cpp | 9 +- Source/UI/UIGradeEnchantWnd.cpp | 15 +- Source/UI/UIHotkeyGuideWnd.cpp | 3 +- Source/UI/UIItemReformWnd.cpp | 17 +- Source/UI/UILapineBoxWnd.cpp | 15 +- Source/UI/UILapineUpgradeBoxWnd.cpp | 23 +- Source/UI/UIMacroBlackListCheckWnd.cpp | 25 +- Source/UI/UIMacroUserInfoWnd.cpp | 25 +- Source/UI/UIPreviewEquipWnd.cpp | 5 +- Source/UI/UIRefiningWnd.cpp | 11 +- Source/UI/UIReputeWnd.cpp | 15 +- Source/UI/UIScrollWnd.cpp | 13 +- Source/UI/UISlotBitmap.cpp | 5 +- Source/UI/Window/FrameFocus.cpp | 10 +- Source/UI/Window/UIAccountLimitedToolWnd.cpp | 11 +- Source/UI/Window/UIBasicInfoWnd.cpp | 7 +- Source/UI/Window/UIBattleMsgOptionWnd.cpp | 15 +- Source/UI/Window/UIBitmapTab.cpp | 9 +- Source/UI/Window/UIChangeNameWnd.cpp | 11 +- Source/UI/Window/UIEmblemWnd.cpp | 5 +- Source/UI/Window/UIEnums.h | 298 ++++++ Source/UI/Window/UIEscOptionWnd.cpp | 5 +- Source/UI/Window/UIFrameWnd.cpp | 55 +- Source/UI/Window/UIHotKeyWnd.cpp | 42 +- Source/UI/Window/UIJobListWnd.cpp | 5 +- Source/UI/Window/UIMessageBox.cpp | 163 ++-- Source/UI/Window/UINavigationWnd.cpp | 29 +- Source/UI/Window/UINewMakeCharWnd.cpp | 23 +- Source/UI/Window/UINewSelectCharWnd.cpp | 37 +- Source/UI/Window/UINewSkillListWnd.cpp | 43 +- Source/UI/Window/UINormalMB.cpp | 5 +- Source/UI/Window/UIPetEvolutionWnd.cpp | 5 +- Source/UI/Window/UIRebirthWnd.cpp | 11 +- Source/UI/Window/UIRoMapWnd.cpp | 13 +- Source/UI/Window/UIRodexContentsWnd.cpp | 7 +- Source/UI/Window/UIRoulletteWnd.cpp | 3 +- Source/UI/Window/UISecondCostumeWnd.cpp | 13 +- Source/UI/Window/UISeekPartyListWnd.cpp | 21 +- Source/UI/Window/UISeekPartyMBWnd.cpp | 15 +- Source/UI/Window/UISelCharForUServerWnd.cpp | 5 +- Source/UI/Window/UISerachStoreInfoWnd.cpp | 13 +- Source/UI/Window/UIShowWarpWnd.cpp | 9 +- Source/UI/Window/UIVideoWnd.cpp | 7 +- Source/UI/Window/UIWindow.cpp | 35 +- Source/UI/Window/UIWindowFactory.cpp | 2 +- Source/UI/Window/UIWindowMgr.cpp | 292 +++--- Source/UI/Window/WindowId.h | 22 +- 159 files changed, 5409 insertions(+), 3560 deletions(-) create mode 100644 Source/Client/Mode/GameModeEnums.h create mode 100644 Source/Client/Mode/ModeMessage.h create mode 100644 Source/Contents/Actors/ActorEnums.h create mode 100644 Source/Contents/Actors/PetEnums.h create mode 100644 Source/Contents/Configuration/ServiceEnums.h create mode 100644 Source/Contents/Effects/EffectPrimId.h create mode 100644 Source/Contents/Hotkeys/InterfaceHotkey.h create mode 100644 Source/Contents/Items/ItemType.h create mode 100644 Source/UI/Window/UIEnums.h diff --git a/Source/Client/Input/Language.cpp b/Source/Client/Input/Language.cpp index c600e8f83..6a808ce11 100644 --- a/Source/Client/Input/Language.cpp +++ b/Source/Client/Input/Language.cpp @@ -444,19 +444,19 @@ CLanguageBase::CLanguageBase() this->codePage = g_inlineCharset ? LanguageCodePage(this->language) : g_textCodePage; switch (static_cast(GetUserDefaultLangID() & 0x3FF)) { - case 7: + case LANG_GERMAN: this->alternateLanguage = 7; this->servicePrefix = "german\\"; break; - case 16: + case LANG_ITALIAN: this->alternateLanguage = 16; this->servicePrefix = "italian\\"; break; - case 22: + case LANG_PORTUGUESE: this->alternateLanguage = 22; this->servicePrefix = "portuguese\\"; break; - case 31: + case LANG_TURKISH: this->alternateLanguage = 31; this->servicePrefix = "turkish\\"; break; diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 6dd3b1582..edbc09e10 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -1,4 +1,8 @@ #include "Client/Mode/CGameMode.h" +#include "UI/Window/UIEnums.h" +#include "Client/Mode/ModeMessage.h" +#include "Client/Mode/GameModeEnums.h" +#include "Contents/Items/ItemId.h" #include "Contents/Jobs/JobId.h" #include "Contents/Skills/SkillId.h" #include "Contents/Skills/SkillUnitId.h" @@ -826,13 +830,13 @@ int ConfirmGameModeAction96(); // FUNCTION: fn_45487 int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, int argument4) { switch (event) { - case 4: + case MM_SHOWMOUSEPOINTER: this->SendMousePointerPosition(static_cast(argument1), static_cast(argument2), argument3); return 0; - case 5: + case MM_HIDEMOUSEPOINTER: this->SendMousePointerState(argument1); return 0; - case 0x10: + case MM_ITEMTHROW: if (!this->IsMenuWindowOpen() && *reinterpret_cast(&this->unknown_0100[4]) + 2000U <= timeGetTime() && this->unknown_02CC == 0 && *reinterpret_cast(this->unknown_02D0) == 0 && argument1 != 0 && @@ -845,48 +849,48 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } this->SendMsg(0x12, 0, 0, 0, 0); return 0; - case 0xE: { + case MM_DISCONNECT_CHARACTER: { const GameModePacketDword packet{0xCC, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xF: { + case MM_DISCONNECT_ALL_CHARACTER: { const std::uint16_t packet = 0xCE; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x16: { + case MM_REQ_NEXT_SCRIPT: { const GameModePacketDword packet{0xB9, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x17: { + case MM_CHOOSE_MENU: { const GameModePacketDwordByte packet{ 0xB8, static_cast(argument2), static_cast(argument1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x19: { + case MM_RESTART: { const GameModePacketByte packet{0xB2, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x20: { + case MM_REQ_NUM_USER: { const std::uint16_t packet = 0xC1; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x30: + case MM_REQ_EXIT_ROOM: if (g_windowMgr.window_027C != nullptr) { const std::uint16_t packet = 0xE3; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); } return 0; - case 0x2A: + case MM_PROCESS_TALK_TYPE: this->ExecuteTalkType(argument1, reinterpret_cast(argument2)); return 0; - case 0x2E: { + case MM_REQ_ROLE_CHANGE: { char text[24]; std::strcpy(text, reinterpret_cast(argument1)); GameModePacketDwordPayload24 packet; @@ -896,7 +900,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x2F: { + case MM_REQ_EXPEL_MEMBER: { char text[24]; std::strcpy(text, reinterpret_cast(argument1)); GameModePacketPayload24 packet; @@ -905,22 +909,22 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x34: { + case MM_CONCLUDE_EXCHANGE_ITEM: { const std::uint16_t packet = 0xEB; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x35: { + case MM_CANCEL_EXCHANGE_ITEM: { const std::uint16_t packet = 0xED; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x36: { + case MM_EXEC_EXCHANGE_ITEM: { const std::uint16_t packet = 0xEF; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x37: { + case MM_ADD_ITEM_TO_STORE: { g_session.FlagInventoryItem(static_cast(argument1)); const GameModePacketWordDword packet{ g_unknown_01738268 != 0 ? 0x9E1 : 0x364, @@ -929,7 +933,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x38: { + case MM_MOVE_ITEM_FROM_STORE_TO_BODY: { g_session.FlagItem1738(static_cast(argument1)); const GameModePacketWordDword packet{ g_unknown_01738268 != 0 ? 0x9E2 : 0x365, @@ -943,23 +947,23 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x49: { + case MM_CANCEL_LOCKON: { const std::uint16_t packet = 0x118; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x4A: { + case MM_SELECT_WARPPOINT: { GameModePacketWordText16 packet{0x11B, static_cast(argument2), {}}; std::strncpy(packet.text, reinterpret_cast(argument1), sizeof(packet.text)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x4B: { + case MM_REMEMBER_WARPPOINT: { const std::uint16_t packet = 0x11D; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x4C: + case MM_MOVE_ITEM_FROM_BODY_TO_CART: if (!this->IsMenuWindowOpen()) { g_session.FlagInventoryItem(static_cast(argument1)); const GameModePacketWordDword packet{ @@ -968,7 +972,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x4D: + case MM_MOVE_ITEM_FROM_CART_TO_BODY: if (!this->IsMenuWindowOpen()) { g_session.FlagItem1740(static_cast(argument1)); const GameModePacketWordDword packet{ @@ -977,7 +981,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x4E: + case MM_MOVE_ITEM_FROM_STORE_TO_CART: if (!this->IsMenuWindowOpen()) { g_session.FlagItem1738(static_cast(argument1)); const GameModePacketWordDword packet{ @@ -987,7 +991,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x4F: + case MM_MOVE_ITEM_FROM_CART_TO_STORE: if (!this->IsMenuWindowOpen()) { g_session.FlagItem1740(static_cast(argument1)); const GameModePacketWordDword packet{ @@ -1002,18 +1006,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x51: { + case MM_REQ_CLOSESTORE: { const std::uint16_t packet = 0x12E; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x43: { + case MM_UPGRADE_SKILLLEVEL: { *reinterpret_cast(&this->unknown_0100[0x0C]) = 1; const GameModePacketWord packet{0x112, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x5C: { + case MM_MOVETO_MAP: { GameModePacketText16Words packet{ 0x140, {}, static_cast(argument2), static_cast(argument3) }; @@ -1033,7 +1037,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x59: { + case MM_CLOSE_DIALOG: { this->unknown_024C = 0; g_windowMgr.CloseWindow(0x10); g_windowMgr.CloseWindow(0x11); @@ -1041,7 +1045,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x5A: + case MM_REFRESH_MUSIC: if (g_serviceOptions.Get(7) != 0) { if (g_soundMgr->secondaryEnabled == 0) { g_soundMgr->PlayStream(nullptr, 0, false); @@ -1051,7 +1055,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_soundMgr->StopStreams(); } return 0; - case 0x5B: + case MM_ITEM_CREATE: if (argument1 != 0) { GameModePacketText100 packet; packet.packetId = 0x9CE; @@ -1061,29 +1065,29 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(0x66, &packet); } return 0; - case 0x60: { + case MM_CHANGE_GROUPEXPOPTION: { const GameModePacketDword packet{0x102, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x6B: { + case MM_REQ_GUILD_MENU: { const GameModePacketDword packet{0x14F, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x6D: { + case MM_REQ_OPEN_MEMBER_INFO: { const GameModePacketDword packet{0x157, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x72: { + case MM_JOIN_GUILD: { const GameModePacketDwordDword packet{ 0x16B, static_cast(argument1), static_cast(argument2) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x69: { + case MM_REQ_GUILD_MENUINTERFACE: { const std::uint16_t packet = 0x14D; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; @@ -1093,7 +1097,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(4, &packet); return 0; } - case 0x75: + case MM_REQ_GIVE_MANNER_POINT: if (g_serviceMode != 3) { int duration = argument3; if (duration < 0) { @@ -1108,7 +1112,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x76: { + case MM_GUILD_NOTICE: { GameModePacketDwordText60Text120 packet; packet.packetId = 0x16E; packet.argument = static_cast(argument1); @@ -1126,49 +1130,49 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x79: { + case MM_REQ_ITEMIDENTIFY: { const GameModePacketWord packet{0x178, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x80: { + case MM_REQ_DISCONNECT: { const std::uint16_t packet[2] = {0x18A, 0}; GetRagConnection().Send(g_packetLengths.FixedLength(packet[0]), packet); return 0; } - case 0x7C: { + case MM_REQ_ITEMCOMPOSITION: { const GameModePacketWordWord packet{ 0x17C, static_cast(argument1), static_cast(argument2) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x7D: { + case MM_REQ_HOSTILE_GUILD: { const GameModePacketDword packet{0x180, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x7B: { + case MM_REQ_ITEMCOMPOSITION_LIST: { *reinterpret_cast(this->unknown_045C) = argument1; const GameModePacketWord packet{0x17A, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x78: { + case MM_ALLY_GUILD: { const GameModePacketDwordDword packet{ 0x172, static_cast(argument1), static_cast(argument2) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x7F: { + case MM_REQ_DELETE_RELATED_GUILD: { const GameModePacketDwordDword packet{ 0x183, static_cast(argument1), static_cast(argument2) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x82: { + case MM_REQ_MAKING_ITEM: { GameModePacketDwordDwordDword packet{0x18E, 0, 0, 0}; if (argument1 != 0) { const ITEM_INFO* materials = reinterpret_cast(argument2); @@ -1179,7 +1183,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x86: { + case MM_BEGIN_DRAG_FROM_METALPROCESSWND: { const char* itemId = reinterpret_cast(argument1); this->drag.Clear(); this->drag.source = 0xE; @@ -1187,12 +1191,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->drag.resource = g_session.ItemDragResource(itemId, 1); return 0; } - case 0x88: { + case MM_ITEMPICKUP: { const GameModePacketDword packet{0x362, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x89: + 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); } else { @@ -1202,7 +1206,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x8A: + case MM_REQUEST_MOVE: if (!this->IsMenuWindowOpen()) { const GameModePacketByte3 packet{ 0x35F, @@ -1214,14 +1218,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x8B: { + case MM_CHANGE_DIRECTION: { const GameModePacketByteWord packet{ 0x361, static_cast(argument2), static_cast(argument1) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x8E: { + case MM_RESET_PARAMETER: { if (argument1 == 1) { g_session.m_skillBundle.ResetFirstLevelChange(); } @@ -1229,7 +1233,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x8F: { + case MM_REQ_CHANGE_MAPTYPE: { const GameModePacketWordWordWord packet{ 0x198, static_cast(argument1), static_cast(argument2), static_cast(argument3 != 0) @@ -1237,12 +1241,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x90: { + case MM_CHANGE_EFFECTSTATE: { const GameModePacketDword packet{0x19D, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x91: { + case MM_PET_RENAME: { GameModePacketPayload24 packet; packet.packetId = 0x1A5; const char* text = reinterpret_cast(argument1); @@ -1256,17 +1260,17 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x92: { + case MM_PETEGG_SELECT_FROM_LIST: { const GameModePacketWord packet{0x1A7, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x93: { + case MM_REQ_PETEGG_INFO: { const GameModePacketWord packet{0x1A8, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x95: { + case MM_PETDECEIVE_SHOOT: { const GameModePacketDword packet{0x19F, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1279,12 +1283,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->SendMsg(0x75, this->unknown_02E0, 1, argument1, 0); g_session.AddProhibitionLog(this->unknown_02E0, argument1); return 0; - case 0x99: { + case MM_ARROW_FROM_LIST: { const GameModePacketDword packet{0x1AE, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x9A: + case MM_SELECT_CART: if (argument2 != 0) { const GameModePacketDwordByte packet{ 0x980, static_cast(argument2), static_cast(argument1) @@ -1295,27 +1299,27 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x9B: { + case MM_REMOVE_TO_AID: { const GameModePacketDword packet{ 0x843, static_cast(std::atoi(reinterpret_cast(argument1))) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x9C: { + case MM_SHIFT_TO_GID: { GameModePacketPayload24 packet{0x1BB, {}}; std::strcpy(reinterpret_cast(packet.payload), reinterpret_cast(argument1)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x9D: { + case MM_RECALL_AID: { const GameModePacketDword packet{ 0x842, static_cast(std::atoi(reinterpret_cast(argument1))) }; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x9E: { + case MM_RECALL_GID: { GameModePacketPayload24 packet{0x1BD, {}}; std::strcpy(reinterpret_cast(packet.payload), reinterpret_cast(argument1)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -1333,17 +1337,17 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xA1: { + case MM_BILLING_INFO: { const std::uint16_t packet = 0x1C0; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0xA3: { + case MM_SELECT_SPELL: { const GameModePacketDword packet{0x1CE, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xA7: { + case MM_JOIN_COUPLE: { const GameModePacketDwordDwordDword packet{ 0x1E3, *reinterpret_cast(&this->unknown_028C[0]), @@ -1353,7 +1357,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xAD: { + case MM_JOIN_BABY: { const GameModePacketDwordDwordDword packet{ 0x1F7, *reinterpret_cast(&this->unknown_028C[0]), @@ -1363,7 +1367,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xAE: { + case MM_REPAIRITEM_SELECT_FROM_LIST: { GameModePacketPayload24 packet; packet.packetId = 0xB66; if (argument1 == -1) { @@ -1375,12 +1379,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xA9: { + case MM_DORIDORI: { const std::uint16_t packet = 0x1E7; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0xA4: + case MM_SEND_TEXT_TO_NPC: this->SendNpcInputText( argument1, reinterpret_cast(argument2), reinterpret_cast(argument3), argument4 ); @@ -1416,7 +1420,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x104: { + case MM_GROUP_CHANGE_MASTER: { g_adventurerAgencyMgr->RequestStop(); const GameModePacketDword packet{0x7DA, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); @@ -1505,12 +1509,12 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB3: { + case MM_REQ_JOIN_BABY: { const GameModePacketDword packet{0x1F9, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB0: { + case MM_DELETE_FRIEND: { const GameModePacketDwordDword packet{ 0x203, static_cast(argument1), static_cast(argument2) }; @@ -1529,7 +1533,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB6: { + case MM_REFINEITEM_SELECT_FROM_LIST: { const GameModePacketDword packet{0x222, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1539,7 +1543,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xB9: { + case MM_MER_RENAME: { GameModePacketPayload24 packet; packet.packetId = 0x231; const char* text = reinterpret_cast(argument1); @@ -1553,33 +1557,33 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xBA: { + case MM_COMMAND_MER: { const GameModePacketByte packet{0x29F, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xBE: { + case MM_STARPLACE_ACCEPT: { const GameModePacketByte packet{0x254, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xBF: { + case MM_GET_MAIL_LIST: { const std::uint16_t packet = 0x23F; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0xC1: { + case MM_RESET_MAIL_ITEM: { const GameModePacketWord packet{0x246, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC5: { + case MM_RETURN_MAIL: { GameModePacketDwordPayload24 packet{0x273, static_cast(argument1), {}}; std::memcpy(packet.payload, reinterpret_cast(argument2), sizeof(packet.payload)); GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xC6: { + case MM_GET_MAIL_ITEM: { const GameModePacketDword packet{0x244, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; @@ -1642,7 +1646,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0xFA: { + case MM_REBIRTH: { const std::uint16_t packet = 0x292; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; @@ -1656,7 +1660,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.CloseWindow(0xB2); g_windowMgr.CloseWindow(0xB3); return 0; - case 0xF6: { + case MM_REQ_HUNTING: { const std::uint16_t packet = 0x279; GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; @@ -1668,7 +1672,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i *reinterpret_cast(&this->unknown_00EC[4]) = 0; } return 0; - case 0x1D: + case MM_REQ_STATUS: if (this->unknown_02D4 == 0) { this->unknown_02D4 = 1; if (this->unknown_0250 == 0) { @@ -1677,7 +1681,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } } return 0; - case 0x1E: + case MM_STATUS_CHANGE: if (this->unknown_02D4 == 0) { this->unknown_02D4 = 1; if (this->unknown_0250 == 0) { @@ -1688,7 +1692,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } } return 0; - case 0x12: + case MM_CANCEL_DRAG: if (g_replayAnimationScaling == 0 || this->unknown_05EC[0] == 0) { this->drag.source = 0; this->drag.id = 0; @@ -1696,40 +1700,40 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.ShowWindowById(15, 0); } return 0; - case 9: + case MM_QUERYRSWNAME: return reinterpret_cast(this->mapName); case 0x21: this->unknown_026E[0x16] = 0; return 0; - case 0x25: + case MM_ACK_SELL: if (this->unknown_0250 == 0) { const GameModePacketC5 packet{0xC5, static_cast(argument1), 1}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x26: + case MM_ACK_BUY: if (this->unknown_0250 == 0) { const GameModePacketC5 packet{0xC5, static_cast(argument1), 0}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x41: + case MM_DELETEPARTYPOSALL: this->unknown_01B4.clear(); return 0; - case 0x47: + case MM_CANCEL_USE_SKILL: this->unknown_0408 = nullptr; this->unknown_040C = 0; this->unknown_0414 = 0; g_pickInvert = 0; return 0; - case 0xAC: + case MM_DELETEGUILDPOSALL: this->unknown_01BC.clear(); return 0; - case 0x5F: + case MM_GET_SKILL_USE_TYPE: return reinterpret_cast(this->unknown_0408); - case 0x61: + case MM_GET_SKILL_USE_LEVEL: return this->unknown_0414; - case 0x63: + case MM_SEND_NUMBER_TO_NPC: if (this->scene->GetGameActorByAID(argument1) != nullptr) { const GameModePacketDwordDword packet{ 0x143, static_cast(argument1), static_cast(argument2) @@ -1743,7 +1747,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->actorMenuIds.push_back(0xB); this->actorMenuIds.push_back(0x15); return 0; - case 0x8D: + case MM_QUIT_TO_IDENTRY: g_charServerAccountIdPending = 0; g_loginStartMode = 3; g_modeMgr.Switch(0, "login.rsw"); @@ -1804,7 +1808,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); } return 0; - case 0x15: + case MM_ITEMTHROW_THROUGH_DROPCNTWND: this->SendMsg(0x10, static_cast(this->drag.id), argument1, 0, 0); return 0; case 0x58: @@ -1818,7 +1822,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i case 0xA6: case 0x127: return 0; - case 0x6: { + case MM_CHATMSG: { if (g_windowMgr.unknown_04DC.empty() || g_session.IsBerserkActive() == 1) { return 0; } @@ -1972,7 +1976,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(size + 4), packet); return 0; } - case 0x23: { + case MM_REQ_SELL: { const int count = g_session.GetList4Size(); const std::uint32_t size = 4U + static_cast(count) * 4U; if (size > 0x800) { @@ -1997,7 +2001,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.CloseWindow(0x18); return 0; } - case 0x3F: { + case MM_ADDPARTYPOS: { const std::uint32_t accountId = static_cast(argument1); this->unknown_01B4[accountId].x = argument2; this->unknown_01B4[accountId].y = argument3; @@ -2050,7 +2054,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } } - case 0x73: { + case MM_REQ_JOIN_GUILD: { CGameActor* actor = static_cast(this->scene->GetGameActorByAID(argument1)); if (actor == nullptr || actor->unknown_0305 != 0) { return 0; @@ -2102,18 +2106,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0xC: + case MM_ADDREGISTERPOS: this->unknown_019C[static_cast(argument1)].first = argument2; this->unknown_019C[static_cast(argument1)].second = argument3; return 0; - case 0x32: { + case MM_ACK_EXCHANGE_ITEM: { this->SendMsg(0x28, 0, 0, 0, 0); g_session.ClearTradeItems(); const GameModePacketByte packet{0xE6, static_cast(argument1)}; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x3B: { + case MM_REQ_JOIN_GROUP: { const char* name = reinterpret_cast(argument1); if (std::strlen(name) >= 24) { g_windowMgr.Confirm(LookupMessage(0x213), 0, true, false, 0, "Message", 280, 120, 0); @@ -2129,7 +2133,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x68: { + case MM_REQ_CHANGE_GUILD_POSITIONINFO: { if (g_guildInfo.unknown_00B4 == 0) { return 0; } @@ -2168,7 +2172,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFFF00, 4, 0, 0); return 0; } - case 0xA8: { + case MM_CONFORM_MAKEGROUP: { if (g_forbiddenWords.Contains(g_session.unknown_54AC.c_str())) { g_windowMgr.Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); return 0; @@ -2337,7 +2341,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i Replay::Instance().RestartClock(); return 0; } - case 0x11: { + case MM_DROP: { if (this->drag.source == 0) { return 0; } @@ -2433,7 +2437,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.RetireTransientWindow(); return 0; } - case 0x2D: { + case MM_REQ_ENTER_ROOM: { UIWindow* window = g_windowMgr.window_027C; std::uint32_t& lastTick = *reinterpret_cast(&this->unknown_026E[0xE]); if (timeGetTime() > lastTick + 1000U) { @@ -2458,7 +2462,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x3C: { + case MM_JOIN_GROUP: { if (argument2 == 0) { g_session.unknown_54C4.clear(); } else { @@ -2468,7 +2472,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x5D: { + case MM_USESKILL_LEVEL_PLUS: { if (CSkillInfo::UsesLevel(*g_session.m_hotkeyScript, this->unknown_040C)) { CSkillInfo skill = g_session.m_skillBundle.Lookup(this->unknown_040C); if (skill.available) { @@ -2483,7 +2487,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x6A: { + case MM_REQ_DISORGANIZE_GUILD: { if (g_guildInfo.unknown_00B4 == 0) { return 0; } @@ -2499,7 +2503,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x96: { + case MM_COMMAND_PET: { if (argument3 == 1) { const int foodId = g_session.GetPetFood(g_session.unknown_103C); int quantity; @@ -2562,10 +2566,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(length), packet); return 0; } - case 0xD: + case MM_DELETEREGISTERPOS: this->unknown_019C.erase(static_cast(argument1)); return 0; - case 0x3D: { + 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); } @@ -2605,7 +2609,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet), &packet); return 0; } - case 0x45: { + case MM_USE_SKILL: { if (g_windowMgr.LookupWindow(0xC4) != nullptr) { g_session.m_automaticSkills.Complete(argument1); return 0; @@ -2710,7 +2714,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packetId), packet); return 0; } - case 0x64: { + case MM_SHOW_IMAGE: { const std::string text(reinterpret_cast(argument1)); this->miniMapTooltipId = argument2; this->miniMapTooltipText = text; @@ -2725,7 +2729,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->UpdateMiniMapTooltip(); return 0; } - case 0xAA: + case MM_ADDGUILDPOS: this->unknown_01BC[static_cast(argument1)].x = argument2; this->unknown_01BC[static_cast(argument1)].y = argument3; this->unknown_01BC[static_cast(argument1)].color = 0xFFFFA6D2; @@ -2788,7 +2792,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packetId), packet); return 0; } - case 0x14: { + case MM_TAKE_OFF_EQUIP: { if (g_windowMgr.LookupWindow(0x271B) != nullptr) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); return 0; @@ -2808,7 +2812,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 1; } - case 0x29: { + case MM_TOGGLE_PLAYERGAGE: { if (this->itemWindow != nullptr) { g_windowMgr.Schedule(this->itemWindow); this->itemWindow = nullptr; @@ -2841,7 +2845,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.AddRenderedFront(gauge); return 0; } - case 0x48: { + case MM_HANG_USE_SKILL: { if (g_windowMgr.LookupWindow(0xC4) != nullptr || g_windowMgr.unknown_0304 != nullptr) { return 0; } @@ -2861,7 +2865,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_pickInvert = IsSupportSkill(this->unknown_040C); return 0; } - case 0x56: { + case MM_MAKE_SKILL_USED_MSG: { bool allowed = argument3 >= 0 && argument1 >= 0; switch (argument1) { case MC_IDENTIFY: @@ -2924,7 +2928,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i actor->SendMsg(nullptr, 7, 0, address, address >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; } - case 0x67: { + case MM_REQ_CHANGE_MEMBERPOS: { if (g_guildInfo.unknown_00B4 == 0) { return 0; } @@ -2944,7 +2948,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(length, packet); return 0; } - case 0x77: { + case MM_REQ_ALLY_GUILD: { const GameModePacketDwordDwordDword packet{ 0x170, static_cast(argument1), g_session.m_aid, g_session.m_gid }; @@ -2975,7 +2979,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x13: { + case MM_WEAR_EQUIP: { if (g_windowMgr.LookupWindow(0x271B) != nullptr) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 255, 0, 0, 0); return 0; @@ -3011,7 +3015,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x31: { + case MM_REQ_EXCHANGE_ITEM: { if (this->IsMenuWindowOpen()) { return 0; } @@ -3030,15 +3034,15 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x7A: + case MM_QUAKE: if (g_serviceOptions.Get(0xDD)) { this->camera->Start(1, argument1 == 1 || argument1 >= 650 ? argument1 : 0, 1.0f, 0.24f, 0.2f); } return 0; - case 0x87: + case MM_SETQUAKEINFO: this->camera->SetAmplitudes(*reinterpret_cast(argument1), *reinterpret_cast(argument2), *reinterpret_cast(argument3)); return 0; - case 0x94: { + case MM_PET_ACT: { if (argument1 == -1 || (argument1 % 10 < 2 && g_session.m_petFriendly / 10 < 90 && !g_session.IsAdminSubMode(3))) { return 0; } @@ -3160,7 +3164,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(header[1], packet); return 0; } - case 0xB: { + case MM_WHISPERMSG: { if (std::strlen(g_windowMgr.unknown_04DC.c_str()) == 0 || g_session.IsBerserkActive() == 1) { return 0; } @@ -3245,7 +3249,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.CloseWindow(0x156); this->SendMsg(0x64, reinterpret_cast(""), -1, 0, 0); return 0; - case 0x2B: { + case MM_CREATE_CHATROOM: { const ChatRoomSetting& setting = *reinterpret_cast(argument1); this->unknown_03C8 = setting.title; this->unknown_03F8 = setting.isPublic; @@ -3268,14 +3272,14 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(packetLength), packet); return 0; } - case 0x40: { + case MM_DELETEPARTYPOS: { const auto found = this->unknown_01B4.find(static_cast(argument1)); if (found != this->unknown_01B4.end()) { this->unknown_01B4.erase(found); } return 0; } - case 0x6F: { + case MM_REQ_BAN_GUILD: { if (g_guildInfo.unknown_00B4 == 0 && g_guildInfo.unknown_00B0 == 0) { return 0; } @@ -3294,7 +3298,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packetId), packet); return 0; } - case 0xAF: { + case MM_JOIN_FRIEND: { if (argument3 != 0) { g_windowMgr.EnsureWindow(0x22)->SendMsg(nullptr, 6, 0xD7, 1, 0, 0); } @@ -3314,7 +3318,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0xF9: { + case MM_REQ_BUY_CASH_POINT: { if (g_session.GetList2Size() == 0 || this->unknown_0250 != 0) { g_session.ClearTradeItems(); return 0; @@ -3369,7 +3373,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x1B: { + case MM_USEITEM: { if (g_windowMgr.LookupWindow(0x271B)) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x6A3)), 0xFF, 0, 0, 0); return 0; @@ -3453,7 +3457,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_session.unknown_54AC = name; return 0; } - case 0x3E: { + case MM_REQ_EXPEL_GROUP_MEMBER: { if (g_session.unknown_5464 == 0) { return 0; } @@ -3465,7 +3469,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x83: { + case MM_USE_SKILL_TOGROUND_WITH_TALKBOX: { const int* request = reinterpret_cast(argument1); std::uint16_t packet[16]; packet[0] = 0x367; @@ -3493,7 +3497,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet[0]), packet); return 0; } - case 0xFE: { + case MM_CHAT_BATTLEFIELD: { if (std::strlen(g_windowMgr.unknown_04DC.c_str()) == 0 || g_session.IsBerserkActive() == 1) { return 0; } @@ -3548,7 +3552,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x139: { + case MM_SHORTCUT_KEY_CHANGE: { std::uint16_t packet[7]; packet[0] = 0xB21; packet[1] = 0; @@ -3575,7 +3579,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i action.ExecuteNamed(reinterpret_cast(argument1)); return 0; } - case 0x18: { + case MM_MENUSELECTED: { if (g_windowMgr.unknown_0210) { g_windowMgr.CloseWindow(0x12); } @@ -3584,32 +3588,32 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } const int action = this->actorMenuIds[argument1]; switch (action) { - case 4: + 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); } else if (static_cast(g_modeMgr.GetGameMode())->scene->player->GetStateFlags() != 2) { this->SendMsg(0x31, this->unknown_02E0, 0, 0, 0); } return 0; - case 5: + case MENUID_INVITE_IN_PARTY: case 58: { const std::string name = this->ActorName(this->unknown_02E0); this->SendMsg(action == 5 ? 0x3B : 0x10C, reinterpret_cast(name.c_str()), 0, 0, 0); return 0; } - case 10: + case MENUID_ADD_TO_FRIEND_CHAR_LIST: g_windowMgr.RequestAddFriend(this->ActorName(this->unknown_02E0).c_str()); return 0; - case 11: + case MENUID_WRITE_CHAT_TO_FILE: g_windowMgr.SendMsgToNamedWindow(this->unknown_01FC.c_str()); return 0; - case 12: - case 13: { + case MENUID_REQ_EX_LIST: + case MENUID_REQ_IN: { std::string name = this->ActorName(this->unknown_02E0); this->ExecuteTalkType(action == 12 ? 0x12 : 0x13, &name); return 0; } - case 20: { + case MENUID_MAKE_WHISPER_WINDOW: { const std::string name = this->ActorName(this->unknown_02E0); const char* category = g_windowMgr.IsFriend(name.c_str()) ? LookupMessage(0x66) : (g_session.IsGuildMemberAccount(this->unknown_02E0) ? "GuildMember" : nullptr); @@ -3621,10 +3625,10 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i reinterpret_cast(code.c_str()), 0, 0); return 0; } - case 21: + case MENUID_ADD_TO_FRIEND_CHAR_LIST_FROM_WINDOW: g_windowMgr.RequestAddFriend(this->unknown_01FC.c_str()); return 0; - case 22: + case MENUID_INVITE_IN_GUILD: this->SendMsg(0x73, this->unknown_02E0, 0, 0, 0); return 0; case 23: @@ -3642,17 +3646,17 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i window->SendMsg(nullptr, 0x51, 1, 0, 0, 0); return 0; } - case 25: + case MENUID_ALLY_GUILD: this->SendMsg(0x77, this->unknown_02E0, 0, 0, 0); return 0; - case 26: + case MENUID_HOSTILE_GUILD: this->SendMsg(0x7D, this->unknown_02E0, 0, 0, 0); return 0; - case 28: + case MENUID_DISCONNECT_CHARACTER: this->SendMsg(0xE, this->unknown_02E0, 0, 0, 0); return 0; - case 29: - case 38: { + 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); return 0; @@ -3663,18 +3667,18 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i window->SetAction(0xBB, reinterpret_cast(action == 29 ? ConfirmGameModeAction96 : ConfirmGameModeActionB8)); return 0; } - case 30: - case 31: - case 32: + case MENUID_PET_PERFORMANCE: + case MENUID_PET_RETURN_EGG: + case MENUID_PET_ACC_OFF: this->SendMsg(0x96, action - 28, 0, 0, 0); return 0; - case 33: + case MENUID_PET_SHOWINFO: this->SendMsg(0x96, 0, 0, 0, 0); if (!g_windowMgr.CloseWindow(0x58)) { g_windowMgr.EnsureWindow(0x58); } return 0; - case 34: { + case MENUID_COPY_GID: { char text[512]; std::sprintf(text, "%s : %d (GID)", g_session.m_serverName.c_str(), this->unknown_02E0); CLanguageBase* language = g_serverLanguage; @@ -3682,19 +3686,19 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i language->Insert(text); return 0; } - case 35: + case MENUID_SHOW_CHAT_PROHIBIT_LOG: g_windowMgr.EnsureWindow(0x67)->SendMsg(nullptr, 0x22, this->unknown_02E0, 0, 0, 0); return 0; - case 36: + case MENUID_INVITE_IN_BABY: this->SendMsg(0xB3, this->unknown_02E0, 0, 0, 0); return 0; - case 37: + case MENUID_HOMUN_SHOWINFO: this->SendMsg(0xB8, 0, 0, 0, 0); if (!g_windowMgr.CloseWindow(0x71)) { g_windowMgr.EnsureWindow(0x71); } return 0; - case 39: { + case MENUID_HOMUN_FOLLOW: { auto* actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(&g_session.unknown_5570[8]))); if (actor && actor->HasUnknown030CEntry()) { float value[6] = {}; @@ -3704,13 +3708,13 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 40: + case MENUID_MER_SHOWINFO: this->SendMsg(0xBA, 1, 0, 0, 0); if (!g_windowMgr.CloseWindow(0x7D)) { g_windowMgr.EnsureWindow(0x7D); } return 0; - case 41: { + case MENUID_MER_FOLLOW: { auto* actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(&g_session.unknown_5620[8]))); if (actor && actor->unknown_0310 && *reinterpret_cast(actor->unknown_0310 + 4)) { float value[6] = {}; @@ -3720,7 +3724,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 42: + case MENUID_VIEW_OTHERUSER_EQUIPWND: case 44: case 65: { if (action == 44 && !IsAdminAccount(g_session.m_aid)) { @@ -3757,7 +3761,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i return 0; } } - case 0x1F: { + case MM_REQ_EMOTION: { auto& tick = *reinterpret_cast(&this->unknown_026E[0xA]); if (this->unknown_026E[0x16] || timeGetTime() <= tick + 2500U) { return 0; @@ -3781,7 +3785,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x52: { + case MM_REQ_OPENSTORE: { const int count = g_session.GetList11Size(); unsigned char packet[0x47BC]; *reinterpret_cast(packet) = 0x1B2; @@ -3815,7 +3819,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_session.ClearItems1768(); return 0; } - case 0x6E: { + case MM_REQ_LEAVE_GUILD: { unsigned char packet[54]; *reinterpret_cast(packet) = 0x159; *reinterpret_cast(packet + 2) = g_guildInfo.m_guildId; @@ -3832,7 +3836,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(0x159), packet); return 0; } - case 0x70: { + case MM_REQ_MAKE_GUILD: { const char* name = reinterpret_cast(argument1); const std::size_t length = std::strlen(name); char text[256]; @@ -3872,7 +3876,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0xAB: { + case MM_DELETEGUILDPOS: { const auto entry = this->unknown_01BC.find(static_cast(argument1)); if (entry != this->unknown_01BC.end()) { this->unknown_01BC.erase(entry); @@ -3955,7 +3959,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.CloseWindow(0x2731); return 0; } - case 0x33: { + 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); @@ -3980,7 +3984,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x53: { + case MM_PC_PURCHASE_ITEMLIST_FROMMC: { g_session.CopyItems1760To1770(); const int count = g_session.GetList10Size(); const std::uint32_t length = 12U + static_cast(count) * 4U; @@ -4004,7 +4008,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i } return 0; } - case 0x54: { + case MM_REQ_BUY_FROMMC: { if (this->scene != nullptr && this->scene->player != nullptr && this->scene->player->render.unknown_0070 == 3) { return 0; } @@ -4166,7 +4170,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x22: { + case MM_REQ_PURCHASE: { const int count = g_session.GetList2Size(); const std::uint32_t length = 4U + static_cast(count) * 6U; if (length > 0x800) { @@ -4191,7 +4195,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.CloseWindow(0x17); return 0; } - case 0x2C: { + case MM_CHANGE_CHATROOM: { if (g_windowMgr.window_027C == nullptr) { return 0; } @@ -4215,7 +4219,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(header[1]), packet); return 0; } - case 0x42: { + case MM_CHAT_PARTY: { if (g_windowMgr.unknown_04DC.empty() || g_session.IsBerserkActive() == 1) { return 0; } @@ -4252,7 +4256,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(header[1], packet); return 0; } - case 0x5E: { + case MM_USESKILL_LEVEL_MINUS: { if (CSkillInfo::UsesLevel(*g_session.m_hotkeyScript, this->unknown_040C)) { const CSkillInfo skill = g_session.m_skillBundle.Lookup(this->unknown_040C); if (skill.available != 0) { @@ -4347,7 +4351,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_session.ClearTradeItems(); return 0; } - case 0x11D: + case MM_WHISPER_FILTER: if (g_session.unknown_5460 != 0) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x56B)), 0x6E96FF, 0, 0, 0); } else if (g_session.PartyCount() == 0) { @@ -4384,7 +4388,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i static_cast(static_cast(player->render.screenY) + static_cast(offset) * player->render.unknown_005C)); return 0; } - case 0x1: + case MM_SOCKETERROR: this->unknown_0244 = 1; this->unknown_0248 = timeGetTime(); GetRagConnection().Close(); @@ -4392,7 +4396,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i this->SendMsg(0x8D, 0, 0, 0, 0); } return 0; - case 0x7: { + case MM_BROADCASTMSG: { std::string text; if (argument1 == 0 || argument1 == 1) { text = std::string(g_session.DecodePlayerName()) + ": " + g_windowMgr.unknown_04DC.c_str(); @@ -4422,7 +4426,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i g_windowMgr.ClearUnknown04DC(); return 0; } - case 0xA: { + 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); } @@ -4438,7 +4442,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetId), &packet); return 0; } - case 0x46: { + 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); return 0; @@ -4468,7 +4472,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(g_packetLengths.FixedLength(words[0]), packet); return 0; } - case 0x66: { + case MM_SEND_GUILD_EMBLEM: { if (g_guildInfo.unknown_00B4 == 0 || static_cast(static_cast(argument2) + 4) > 0x800) { return 0; } @@ -4479,7 +4483,7 @@ int CGameMode::SendMsg(int event, int argument1, int argument2, int argument3, i GetRagConnection().Send(static_cast(header[1]), packet); return 0; } - case 0x81: { + case MM_CHAT_GUILD: { if (std::strlen(g_windowMgr.unknown_04DC.c_str()) == 0 || g_guildInfo.m_guildId == 0 || g_session.IsBerserkActive() == 1) { return 0; } @@ -4662,15 +4666,15 @@ void CGameMode::PlaceWindowAtActor(UIWindow* window, CGameActor* actor) { int offsetX = 0; int offsetY = 0; switch (actor->render.unknown_00A8 != 0 ? raised : 0) { - case 0: + case NAME_BALLOON_BOTTOM: offsetX = -(width / 2); offsetY = static_cast(static_cast(g_renderer->viewport.height * 20 / 480) * actor->render.unknown_005C); break; - case 1: + case NAME_BALLOON_TOP: offsetX = -(width / 2); offsetY = static_cast(static_cast(g_renderer->viewport.height * -100 / 480) * actor->render.unknown_005C); break; - case 2: + case NAME_BALLOON_LEFT: offsetX = static_cast( static_cast(g_renderer->viewport.width * -30 / 640) * actor->render.unknown_005C - static_cast(width / 2) ); @@ -4678,7 +4682,7 @@ void CGameMode::PlaceWindowAtActor(UIWindow* window, CGameActor* actor) { static_cast(g_renderer->viewport.height * -25 / 480) * actor->render.unknown_005C - static_cast(height / 2) ); break; - case 3: + case NAME_BALLOON_RIGHT: offsetX = static_cast( static_cast(g_renderer->viewport.width * 30 / 640) * actor->render.unknown_005C - static_cast(width / 2) ); @@ -4744,11 +4748,11 @@ void CGameMode::RequestPlayerAction(int target, int argument) { } switch (reinterpret_cast(this->unknown_0408)) { - case 0: + case SUT_NOSKILL: this->scene->player->SendMsg(nullptr, 10, 0, target, 0, argument, argument >> 31, 0, 0, 0, 0, 0, 0, 0, 0); break; - case 2: - case 4: + 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); break; @@ -4835,10 +4839,10 @@ void CGameMode::WriteChatLog(const char* text) { bool CGameMode::IsEffectId990Group(int id) { bool result = false; switch (id) { - case 990: - case 991: - case 992: - case 993: + case ITEMID_BLOODY_RED: + case ITEMID_CRYSTAL_BLUE: + case ITEMID_WIND_OF_VERDURE: + case ITEMID_YELLOW_LIVE: result = true; break; } @@ -4850,10 +4854,10 @@ bool CGameMode::IsEffectId990Group(int id) { bool CGameMode::IsEffectId994Group(int id) { bool result = false; switch (id) { - case 994: - case 995: - case 996: - case 997: + case ITEMID_FLAME_HEART: + case ITEMID_MISTIC_FROZEN: + case ITEMID_ROUGH_WIND: + case ITEMID_GREAT_NATURE: result = true; break; } @@ -6412,16 +6416,16 @@ void CGameMode::EnsureNameBalloon(UINameBalloonText*& balloon) { } switch (g_serviceOptions.Get(0x5C) != 0) { - case 0: + case NAME_BALLOON_BOTTOM: balloon = new UINameBalloonText(); break; - case 1: + case NAME_BALLOON_TOP: balloon = new UINameBalloonText(); break; - case 2: + case NAME_BALLOON_LEFT: balloon = new UIVerticalNameBalloonText(); break; - case 3: + case NAME_BALLOON_RIGHT: balloon = new UIVerticalNameBalloonText(); break; } @@ -6788,355 +6792,355 @@ void CGameMode::PlayItemUseEffect(int itemId, std::uint32_t aid) { int secondEffectId = -1; int effectId = -1; switch (itemId) { - case 0x1F5: - case 0x1FB: - case 0x221: - case 0x239: - case 0x242: - case 0x256: - case 0x2D2F: - case 0x2D30: - case 0x2D32: - case 0x3909: + case ITEMID_RED_POTION: + case Red_Herb: + case ITEMID_RED_SLIM_POTION: + case Novice_Potion: + case Strawberry: + case Light_Red_Pot: + case Novice_Potion_B: + case Red_Slim_Potion_B: + case Red_Potion_B: + case Tyr: effectId = 0xCC; break; - case 0x1F6: - case 0x243: - case 0x257: - case 0x2D31: - case 0x311E: + case Orange_Potion: + case Delicious_Fish: + case Light_Orange_Pot: + case Orange_Potion_B: + case Mora_Berry: effectId = 0xCD; break; - case 0x1F7: - case 0x1FC: - case 0x222: - case 0x2CEC: - case 0x2D2E: - case 0x2D36: + case ITEMID_YELLOW_POTION: + case Yellow_Herb: + case ITEMID_YELLOW_SLIM_POTION: + case Light_Yellow_Pot: + case Yellow_Potion_B: + case Yellow_Slim_Potion_B: effectId = 0xCE; break; - case 0x1F8: - case 0x1FD: - case 0x223: - case 0x22B: - case 0x22C: - case 0x22D: - case 0x2CED: - case 0x2CEF: - case 0x2D1C: - case 0x2D25: - case 0x2D26: - case 0x2D2D: - case 0x2D35: + case ITEMID_WHITE_POTION: + case White_Herb: + case ITEMID_WHITE_SLIM_POTION: + case Rice_Cake: + case Long_Rice_Cake: + case Hash_Rice_Cake: + case Light_White_Pot: + case Siege_White_Potion: + case Woe_White_Potion: + case TE_White_Potion: + case TE_White_Slim_Potion: + case White_Potion_B: + case White_Slim_Potion_B: effectId = 0xCF; break; - case 0x1F9: - case 0x1FE: - case 0x2CEE: - case 0x2CF0: - case 0x2D1D: - case 0x2D34: + case ITEMID_BLUE_POTION: + case Blue_Herb: + case Light_Blue_Pot: + case Siege_Blue_Potion: + case Woe_Blue_Potion: + case Blue_Potion_B: effectId = 0xD0; break; - case 0x1FA: - case 0x1FF: - case 0x2D33: + case Green_Potion: + case Green_Herb: + case Green_Potion_B: effectId = 0xD1; break; - case 0x200: - case 0x201: - case 0x203: - case 0x204: - case 0x213: - case 0x214: - case 0x216: - case 0x217: - case 0x224: - case 0x225: - case 0x226: - case 0x246: - case 0x2AA: + case ITEMID_APPLE: + case Banana: + case Carrot: + case Sweet_Potato: + case Apple_Juice: + case Banana_Juice: + case Carrot_Juice: + case ITEMID_PUMPKIN: + case Cheese: + case Nice_Sweet_Potato: + case Popped_Rice: + case Orange: + case Realgar_Wine: effectId = 0xD2; break; - case 0x202: - case 0x215: - case 0x238: - case 0x25F: - case 0x2A8: - case 0x2AB: - case 0x302D: - case 0x3037: - case 0x3039: - case 0x3041: + case Grape: + case Grape_Juice: + case Lemon: + case Yggdrasilberry: + case Magical_Carnation: + case Exorcize_Herb: + case ITEMID_ANCILLA: + case Manuks_Courage: + case Luciola: + case Tiny_Waterbottle: effectId = 0xD3; break; - case 0x205: - case 0x206: - case 0x207: - case 0x208: - case 0x209: - case 0x20E: - case 0x210: - case 0x211: - case 0x212: - case 0x218: - case 0x219: - case 0x21A: - case 0x21B: - case 0x21C: - case 0x21D: - case 0x21E: - case 0x21F: - case 0x220: - case 0x227: - case 0x228: - case 0x229: - case 0x232: - case 0x233: - case 0x234: - case 0x235: - case 0x236: - case 0x237: - case 0x23A: - case 0x23B: - case 0x23C: - case 0x23F: - case 0x240: - case 0x241: - case 0x244: - case 0x245: - case 0x247: - case 0x248: - case 0x249: - case 0x24A: - case 0x297: - case 0x2D1B: + case Meat: + case Honey: + case Milk: + case Leaflet_Of_Hinal: + case Leaflet_Of_Aloe: + case Royal_Jelly: + case Monster: + case Candy: + case Candy_Striper: + case Ice_Cream: + case ITEMID_PET_FOOD: + case Well_Baked_Cookie: + case Piece_Of_Cake: + case Falcon: + case Pecopeco: + case Festive_Cookie: + case Festive_Rainbow_Cake: + case Fish_Slice: + case Shusi: + case KETUPAT: + case Bun: + case Pizza: + case Pizza_01: + case Rice_Ball: + case Vita500_Bottle: + case Tomyumkung: + case Prawn: + case Lucky_Candy: + case Lucky_Candy_Cane: + case Lucky_Cookie: + case Piece_Of_Cake_: + case Prickly_Fruit: + case Grain: + case Bread: + case Mushroom: + case KETUPAT_: + case Fish_Ball_Soup: + case Wurst: + case Mother: + case Korea_Rice_Cake: + case Woe_Violet_Potion: case 0x2D37: case 0x2D38: - case 0x2D39: - case 0x2D3A: + case Rice_Ball_B: + case Candy_Striper_B: case 0x2D3B: - case 0x2D3C: - case 0x2D3D: - case 0x2D3E: + case Candy_B: + case Piece_Of_Cake_B: + case Well_Baked_Cookie_B: effectId = 7; break; - case 0x22E: - case 0x231: - case 0x2D40: - case 0x2D43: - case 0x2FCD: + case Chocolate: + case White_Chocolate: + case White_Chocolate_B: + case Chocolate_B: + case Choco_Lump: effectId = 0x16C; break; - case 0x22F: - case 0x230: - case 0x2D41: - case 0x2D42: - case 0x2DB5: + case HandMade_Chocolate: + case HandMade_Chocolate_: + case HandMade_Chocolate_B: + case HandMade_Chocolate_B_: + case Girl_Bunch_Of_Flower: effectId = 0x16B; break; - case 0x285: - case 0x38AD: - case 0x580E: + case Center_Potion: + case Light_Center_Pot: + case Center_Potion_B: effectId = 0xDA; break; - case 0x290: - case 0x38AE: - case 0x5810: + case Awakening_Potion: + case Light_Awakening_Pot: + case Awakening_Potion_B: effectId = 0xDB; break; - case 0x291: - case 0x38AF: - case 0x580F: + case Berserk_Potion: + case Light_Berserk_Pot: + case Berserk_Potion_B: effectId = 0xDC; break; - case 0x22A: - case 0x2F5A: - case 0x2F5B: - case 0x2F5C: - case 0x2FA3: - case 0x2FA4: - case 0x2FA5: - case 0x2FA6: - case 0x2FCE: - case 0x2FCF: - case 0x5817: - case 0x5818: - case 0x5819: + case Mojji: + case Sesame_Pastry: + case Honey_Pastry: + case Rainbow_Cake: + case Plain_Rice_Cake: + case Hearty_Rice_Cake: + case Salty_Rice_Cake: + case Lucky_Rice_Cake: + case New_Year_Rice_Cake_1: + case New_Year_Rice_Cake_2: + case Sesame_Pastry_B: + case Honey_Pastry_B: + case Rainbow_Cake_B: g_soundMgr->PlayWave("_heal_effect.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x1EB; break; - case 0x296: - case 0x2FE6: + case Inspector_Certificate: + case Inspector_Certificate_: g_soundMgr->PlayWave("effect\\mapae.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x1FB; break; - case 0x2AC: + case Durian: static_cast(actor)->LaunchEffect(0x105, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); effectId = 0xDC; break; - case 0x2AD: + case RAMADAN: effectId = 0x1EC; break; - case 0x20A: + case Fruit_Of_Mastela: g_soundMgr->PlayWave("_heal_effect.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; - case 0x20B: + case ITEMID_HOLY_WATER: g_soundMgr->PlayWave("effect\\EF_Blessing.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; - case 0x2EF0: - case 0x5811: + case Speed_Up_Potion: + case Speed_Up_Potion_B: g_soundMgr->PlayWave("effect\\fast.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x207; break; - case 0x2EF1: - case 0x5812: + case Slow_Down_Potion: + case Slow_Down_Potion_B: effectId = 0x26; break; - case 0x2EF2: + case Fire_Cracker: g_soundMgr->PlayWave("effect\\itempokjuk.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x1FC; break; - case 0x23D: - case 0x254: - case 0x255: - case 0x2D3F: - case 0x2FCA: + case Chocolate_Drink: + case Cute_Strawberry_Choco: + case Lovely_Choco_Tart: + case Chocolate_Drink_B: + case Cacao99: effectId = 0x1FD; break; - case 0x2EF7: + case Giftbox_China: g_soundMgr->PlayWave("effect\\ro2effect.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x221; break; - case 0x2EFB: - case 0x588D: + case Giggling_Box: + case HALLOWEEN_G_BOX: g_soundMgr->PlayWave("wraith_die.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; - case 0x2EFC: + case Box_Of_Thunder: effectId = 0x240; break; - case 0x2EFD: + case Gloomy_Box: effectId = 0x241; break; - case 0x2EFE: + case Box_Of_Grudge: effectId = 0x242; break; - case 0x2EFF: + case Sleepy_Box: effectId = 0x243; break; - case 0x2F00: + case Box_Of_Storm: effectId = 0x244; break; - case 0x2F02: + case Painting_Box: g_soundMgr->PlayWave("ork_warrior_breath.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; - case 0x2F01: + case Box_Of_Sunlight: effectId = 0x245; break; - case 0x2F56: + case Resist_Fire: g_soundMgr->PlayWave("evil_cloud_hermit_attack.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x25B; break; - case 0x2F57: + case Resist_Water: g_soundMgr->PlayWave("evil_cloud_hermit_attack.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x33; break; - case 0x2F58: + case Resist_Earth: g_soundMgr->PlayWave("evil_cloud_hermit_attack.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x93; break; - case 0x2F59: + case Resist_Wind: g_soundMgr->PlayWave("evil_cloud_hermit_attack.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x34; break; - case 0x2F63: + case Lucky_Potion: effectId = 0x264; break; - case 0x2FDA: + case Str_Dish10_M: effectId = 0x251; break; - case 0x2FDB: + case Agi_Dish10_M: effectId = 0x254; break; - case 0x2FDC: + case Int_Dish10_M: effectId = 0x252; break; - case 0x2FDD: + case Dex_Dish10_M: effectId = 0x255; break; - case 0x2FDE: + case Luk_Dish10_M: effectId = 0x256; break; - case 0x2FDF: + case Vit_Dish10_M: effectId = 0x253; break; - case 0x2FBA: + case Assumptio_5_Scroll: static_cast(actor)->LaunchEffect(0x177, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); static_cast(actor)->LaunchEffect(0x1B8, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x3016: - case 0x3017: + case Spray_Of_Flowers: + case Large_Spray_Of_Flowers: effectId = 0x2BB; break; - case 0x301B: + case Goddess_Bless: effectId = 0x152; break; - case 0x301C: + case Angel_Bless: effectId = 0x2C1; break; - case 0x301D: + case Powder_Snow: g_soundMgr->PlayWave("effect\\storm.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x2C2; break; - case 0x301E: + case Little_Heart: effectId = 0x2C3; break; - case 0x3026: + case J_Firecracker: g_soundMgr->PlayWave("effect\\pokjuk_jap.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x2C5; break; - case 0x23E: - case 0x3036: - case 0x3038: + case Egg: + case Manuk: + case Pinguicula: effectId = 0xD2; break; - case 0x3280: + case J_Aspersio_5_Scroll: effectId = 0x56; break; - case 0x3198: + case RWC_Cele_Fire: g_soundMgr->PlayWave("effect\\itempokjuk.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x3DB; break; - case 0x3199: + case RWC_Cele_Fire2: g_soundMgr->PlayWave("effect\\itempokjuk.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x3DC; break; - case 0x31F4: + case No100_Firecracker: g_soundMgr->PlayWave("effect\\itempokjuk.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); effectId = 0x3EE; break; - case 0x38D2: + case Fire_Cracker_Love: effectId = 0x2AA; break; - case 0x38D3: + case Fire_Cracker_Wday: effectId = 0x2AB; break; - case 0x38D4: + case Fire_Cracker_Vday: effectId = 0x2AC; break; - case 0x38D5: + case Fire_Cracker_Bday: effectId = 0x2AD; break; - case 0x38D6: + case Fire_Cracker_Xmas: effectId = 0x2AE; break; - case 0x18733: - case 0x18734: - case 0x18735: + case Bath_Foam_A: + case Bath_Foam_B: + case Bath_Foam_C: effectId = 0x63D; secondEffectId = 0x63E; break; - case 0x18736: + case Aroma_Oil: effectId = 0x63B; secondEffectId = 0x63C; break; diff --git a/Source/Client/Mode/GameModeEnums.h b/Source/Client/Mode/GameModeEnums.h new file mode 100644 index 000000000..ce50fffda --- /dev/null +++ b/Source/Client/Mode/GameModeEnums.h @@ -0,0 +1,81 @@ +#ifndef RAGNAROK_SOURCE_CLIENT_MODE_GAMEMODEENUMS_H +#define RAGNAROK_SOURCE_CLIENT_MODE_GAMEMODEENUMS_H + +enum NAME_BALLOON_TYPE : int { + NAME_BALLOON_BOTTOM = 0, + NAME_BALLOON_TOP = 1, + NAME_BALLOON_LEFT = 2, + NAME_BALLOON_RIGHT = 3, +}; + +enum ENUM_SKILL_USE_TYPE : int { + SUT_NOSKILL = 0, + SUT_TO_CHARACTER = 2, + SUT_TO_ALL = 4, +}; + +enum MSGEFFECTTYPE : int { + MET_JUST_ANIMATE = 0, + MET_EMOTION = 1, + MET_MVP = 2, + MET_CART = 3, + MET_PKEFFECT = 4, + MET_ICEEFFECT = 5, + MET_ICEBREAKEFFECT = 6, + MET_CURSE_EFFECT = 7, + MET_SLEEP_EFFECT = 8, + MET_STUN_EFFECT = 9, + MET_SILENCE_EFFECT = 10, + MET_ANGELUS_EFFECT = 11, + MET_CRUSIS_EFFECT = 12, + MET_MISS = 13, + MET_NUMBER = 14, + MET_CRITICAL_EFFECT = 15, + MET_NUMBER_CRITICAL = 16, + MET_LUCKY_EFFECT = 17, + MET_BIRD = 18, + MET_NUMBER_HALF = 21, + MET_NUMBER_TOTAL = 22, + MET_GUARD = 24, + MET_BLUE_EFFECT = 25, + MET_CURSOR_EFFECT = 26, +}; + +enum MAKE_MSG_EFFECT_TYPE : int { + MAKETYPE_MVP_EFFECT = 0, + MAKETYPE_CART_EFFECT = 1, + MAKETYPE_PK_EFFECT = 2, + MAKETYPE_ICE_EFFECT = 3, + MAKETYPE_ICEBREAK_EFFECT = 4, + MAKETYPE_SMOKE_EFFECT = 5, + MAKETYPE_CURSE_EFFECT = 6, + MAKETYPE_SLEEP_EFFECT = 7, + MAKETYPE_STUN_EFFECT = 8, + MAKETYPE_SILENCE_EFFECT = 9, + MAKETYPE_ANGELUS_EFFECT = 10, + MAKETYPE_CRUSIS_EFFECT = 11, + MAKETYPE_CRITICAL_EFFECT = 12, + MAKETYPE_LUCKY_EFFECT = 13, + MAKETYPE_BIRD_EFFECT = 14, + MAKETYPE_CART_EFFECT2 = 16, + MAKETYPE_CART_EFFECT3 = 17, + MAKETYPE_CART_EFFECT4 = 18, + MAKETYPE_CART_EFFECT5 = 19, + MAKETYPE_GUARD_EFFECT = 20, + MAKETYPE_CART_EFFECT6 = 21, + MAKETYPE_BLUE_EFFECT = 22, + MAKETYPE_BIRD_EFFECT2 = 23, + MAKETYPE_BIRD_EFFECT3 = 24, + MAKETYPE_CART_EFFECT11 = 25, + MAKETYPE_CART_EFFECT12 = 26, + MAKETYPE_CART_EFFECT13 = 27, + MAKETYPE_CART_EFFECT14 = 28, + MAKETYPE_CART_EFFECT15 = 29, + MAKETYPE_CART_EFFECT16 = 30, + MAKETYPE_CURSOR_EFFECT = 31, + MAKETYPE_BIRD_EFFECT4 = 32, + MAKETYPE_BIRD_EFFECT5 = 33, + MAKETYPE_BIRD_EFFECT6 = 34, +}; + +#endif diff --git a/Source/Client/Mode/GameModeHandlers.cpp b/Source/Client/Mode/GameModeHandlers.cpp index f5850c062..392354849 100644 --- a/Source/Client/Mode/GameModeHandlers.cpp +++ b/Source/Client/Mode/GameModeHandlers.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Network/Packets/NoticeEnums.h" #include "Contents/Skills/SkillUnitId.h" #include "Network/Packets/ModeResultEnums.h" #include "Client/Mode/CLoginMode.h" @@ -610,7 +611,7 @@ void CGameMode::ReceivePendingResult(const unsigned char* packet) { std::string text; std::uint32_t color = 0xFF; switch (*reinterpret_cast(packet + 10)) { - case 0: + case ERROR_TYPE_NONE: case 8: g_pendingAid = *reinterpret_cast(packet + 2); g_pendingGid = *reinterpret_cast(packet + 6); @@ -624,25 +625,25 @@ void CGameMode::ReceivePendingResult(const unsigned char* packet) { text = LookupMessage(54); } break; - case 1: + case ERROR_TYPE_NPC: text = LookupMessage(1227); break; - case 2: + case ERROR_TYPE_SYSTEM: text = LookupMessage(1228); break; - case 3: + case ERROR_TYPE_INVENTORY_WEIGHT: text = LookupMessage(56); break; - case 4: + case ERROR_TYPE_EXCHANGE: text = LookupMessage(1229); break; - case 5: + case ERROR_TYPE_ITEM_ID: text = LookupMessage(1230); break; - case 6: + case ERROR_TYPE_MONEY: text = LookupMessage(1254); break; - case 7: + case ERROR_TYPE_AMOUNT: text = LookupMessage(1813); break; case 9: @@ -695,23 +696,23 @@ void CGameMode::ReceiveItem1718BasicList(const unsigned char* packet) { // FUNCTION: fn_21793 void CGameMode::ReceiveItem1718Result(const unsigned char* packet) { switch (packet[2]) { - case 0: + case PURCHASE_SUCCEED: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; - case 1: + 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); break; - case 3: + 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); break; - case 2: + 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); break; - case 9: + 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); break; @@ -1092,31 +1093,31 @@ void CGameMode::ReceiveResultNotice00FC(const unsigned char* packet) { this->unknown_00FC = 0; switch (packet[2]) { - case 0: + case ENTERROOM_FULL: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x43)), 0xFF, 0, 0, 0); break; - case 1: + 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); break; - case 2: + case ENTERROOM_KICKED: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x44)), 0xFF, 0, 0, 0); break; - case 4: + case REFUSETYPE_ZENY: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x37)), 0xFF, 0, 0, 0); break; - case 5: + case REFUSETYPE_LOWLEVEL: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B0)), 0xFF, 0, 0, 0); break; - case 6: + case REFUSETYPE_HIGHLEVEL: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B1)), 0xFF, 0, 0, 0); break; - case 7: + case REFUSETYPE_JOB: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(0x1B2)), 0xFF, 0, 0, 0); break; @@ -1256,13 +1257,13 @@ void CGameMode::ReceiveServerRateNotice(const unsigned char* packet) { std::memset(text, 0, sizeof(text)); g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (g_session.unknown_54A0) { - case 0: + case EXP_NOTSHARED: std::sprintf(text, "%s - %s : %s", LookupMessage(291), LookupMessage(292), LookupMessage(287)); break; - case 1: + case EXP_SHARED: std::sprintf(text, "%s - %s : %s", LookupMessage(291), LookupMessage(292), LookupMessage(288)); break; - case 2: + case EXP_CHANGE_IMPOSSIBLE: std::sprintf(text, "%s - %s : %s(%s)", LookupMessage(291), LookupMessage(292), LookupMessage(287), LookupMessage(1535)); break; } @@ -1458,25 +1459,25 @@ void CGameMode::ReceiveNamedResultNotice(const unsigned char* packet) { void CGameMode::ReceiveResultNotice0118(const unsigned char* packet) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (packet[2]) { - case 0: + case WT_EXCLUDE_WHISPER: switch (packet[3]) { - case 1: + case WHIPSER_SETTING_FAILED: g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(194)).c_str()), 0xFFFF, 0, 0, 0); break; - case 2: + case WHISPER_SETTING_FAILED_OVERCOUNT: g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(195)).c_str()), 0xFFFF, 0, 0, 0); break; } break; - case 1: + case WT_INCLUDE_WHISPER: switch (packet[3]) { - case 0: + case WHISPER_SETTING_SUCCEED: g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(196)).c_str()), 0xFFFF, 0, 0, 0); break; - case 1: + case WHIPSER_SETTING_FAILED: g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(197)).c_str()), 0xFFFF, 0, 0, 0); break; - case 2: + case WHISPER_SETTING_FAILED_OVERCOUNT: g_windowMgr.SendNotice(1, reinterpret_cast((this->unknown_0118 + LookupMessage(198)).c_str()), 0xFFFF, 0, 0, 0); break; } @@ -2096,20 +2097,20 @@ void CGameMode::ReceiveServiceRequest(unsigned char type, int value) { case 4: this->OpenServiceWindow(type); break; - case 5: + case OUT_UI_TIP: if (UITipboxWnd* window = static_cast(g_windowMgr.EnsureWindow(315))) { window->ShowTip(value); } break; - case 6: + case OUT_UI_QUEST: g_renewQuestMgr->ShowQuestInfo(value); break; - case 7: + case OUT_UI_ATTENDANCE: if (UIWindow* window = g_windowMgr.EnsureWindow(328)) { window->SendMsg(nullptr, 0x22, value, 0, 0, 0); } break; - case 8: + case OUT_UI_ENCHANTGRADE: g_windowMgr.EnsureWindow(343); break; } diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index 5ac2937af..75e05578d 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -1457,7 +1457,7 @@ void CGameMode::ReceiveShortcutPagePacket(const unsigned char* data) { void CGameMode::ReceiveCardCompositionResult(const unsigned char* data) { const auto* packet = reinterpret_cast(data); switch (packet->result) { - case 0: { + case ITEMCOMPOSITON_SUCCESS: { g_windowMgr.SendNotice(1, 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); @@ -1475,7 +1475,7 @@ void CGameMode::ReceiveCardCompositionResult(const unsigned char* data) { } break; } - case 1: + case ITEMCOMPOSITION_FAILURE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(494)), 0xFF, 0, 0, 0); break; } @@ -2550,34 +2550,34 @@ void CGameMode::ReceivePartyMemberEffect(const unsigned char* data) { } switch (packet->type) { - case 0: + case LEVELUP_EFFECT: actor->LaunchEffect(371, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 1: + case JOBLEVELUP_EFFECT: actor->LaunchEffect(158, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 7: + case LEVELUP_EFFECT2: actor->LaunchEffect(338, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 9: + case LEVELUP_EFFECT3: actor->LaunchEffect(582, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 8: + case JOBLEVELUP_EFFECT2: actor->LaunchEffect(337, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 2: + case REFINING_FAIL_EFFECT: actor->LaunchEffect(155, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 3: + case REFINING_SUCCESS_EFFECT: actor->LaunchEffect(154, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 5: + case MAKEITEM_AM_SUCCESS_EFFECT: actor->LaunchEffect(305, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 6: + case MAKEITEM_AM_FAIL_EFFECT: actor->LaunchEffect(306, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 4: + case GAME_OVER_EFFECT: g_partyEffectNoticePending = 1; break; } diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index 9c52bf7b9..3fabe46b9 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -1,5 +1,6 @@ #include "Contents/Combat/CombatTypes.h" #include "Contents/Effects/EffectTypes.h" +#include "Contents/Items/ItemType.h" #include "Contents/Skills/SkillId.h" #include "Contents/Skills/SkillUnitId.h" #include "Network/Packets/NoticeEnums.h" @@ -537,13 +538,13 @@ void CGameMode::ReceiveUnknown05C4Result(const unsigned char* data) { this->unknown_05C8 = -1; switch (packet->result) { - case 0: + 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); return; - case 1: - case 2: + case BOSS_INFO_ALIVE: + case BOSS_INFO_ALIVE_WITHMSG: this->unknown_05C4 = packet->first; this->unknown_05C8 = packet->second; if (packet->result != 2) { @@ -551,7 +552,7 @@ void CGameMode::ReceiveUnknown05C4Result(const unsigned char* data) { } std::sprintf(message, LookupMessage(1225), name); break; - case 3: + case BOSS_INFO_DEAD: if (packet->current == 0 && packet->total == 1) { std::sprintf(message, LookupMessage(1261), name); } else { @@ -1027,20 +1028,20 @@ __declspec(noinline) void CGameMode::ReceiveHuntingList(const unsigned char* pac bool CGameMode::NotifyItemResult(int result) { int message; switch (result) { - case 5: + case PICKUP_OVERCOUNT_ONEITEM: message = 279; break; - case 4: + case PICKUP_OVERCOUNT: message = 220; break; - case 2: + case PICKUP_OVERWEIGHT: message = 52; break; - case 1: - case 6: + case PICKUP_FAILED: + case PICKUP_REFUSED_TIME: message = 53; break; - case 7: + case ADDITEM_STACKLIMIT: message = 1418; break; case 9: @@ -6553,7 +6554,7 @@ __declspec(noinline) void CGameMode::ReceiveActorColorChat(const unsigned char* __declspec(noinline) void CGameMode::ReceiveWearEquipAck(unsigned char result, std::uint16_t index, std::uint16_t look, int location) { *reinterpret_cast(&this->unknown_0100[0x04]) = timeGetTime() - 2000; switch (result) { - case 0: { + case ITEM_EQUIP_ACK_OK: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, index); if (item.unknown_0000[1] > 0) { item.unknown_0070 = look; @@ -6562,12 +6563,12 @@ __declspec(noinline) void CGameMode::ReceiveWearEquipAck(unsigned char result, s } break; } - case 1: { + case ITEM_EQUIP_ACK_FAILLEVEL: { const char* text = LookupMessage(1953); g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 7, 0, 0); break; } - case 2: { + case ITEM_EQUIP_ACK_FAIL: { const char* text = LookupMessage(372); g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 7, 0, 0); break; @@ -6839,14 +6840,14 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { char text[256]; CGameActor* actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(packet + 4))); switch (static_cast(packet[3])) { - case 0: + case HO_PRE_INIT: *reinterpret_cast(&g_session.unknown_5570[0x08]) = *reinterpret_cast(packet + 4); if (actor) { g_session.unknown_5614 = 1; g_session.m_homunJob = actor->GetEffectiveJob(-1); } break; - case 1: + case HO_RELATIONSHIP_CHANGED: g_session.unknown_55D4 = *reinterpret_cast(packet + 8); if (actor) { g_session.m_homunJob = actor->GetEffectiveJob(-1); @@ -6859,7 +6860,7 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xF5F5F5, 0, 0, 0); } break; - case 2: + case HO_FULLNESS_CHANGED: g_session.unknown_55F0 = *reinterpret_cast(packet + 8); g_session.RefreshHomunculusInfo(); if (actor) { @@ -6873,7 +6874,7 @@ void CGameMode::ReceiveHomunculusChange(const unsigned char* packet) { g_windowMgr.SendNotice(1, reinterpret_cast(text), 0x1EF5F5, 0, 0, 0); } break; - case 3: + case HO_ACCESSARY_CHANGED: if (actor) { if (*reinterpret_cast(packet + 8)) { g_session.unknown_55D8 = *reinterpret_cast(packet + 8); @@ -7094,22 +7095,22 @@ void CGameMode::ReceiveItemObtainNotice(const unsigned char* packet) { item.unknown_0060 = 0; item.identified = 1; switch (*reinterpret_cast(packet + 2)) { - case 0: + case MSG_WEAPONREFINE_SUCCESS: g_windowMgr.SendNotice( 1, reinterpret_cast(FormatOwnedString(LookupMessage(911), item.DisplayName(0).c_str()).c_str()), 0xFFFF00, 0, 0, 0 ); break; - case 1: + case MSG_WEAPONREFINE_FAIL: g_windowMgr.SendNotice( 1, reinterpret_cast(FormatOwnedString(LookupMessage(912), item.DisplayName(0).c_str()).c_str()), 0xCDCD00, 0, 0, 0 ); break; - case 2: + 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 ); break; - case 3: + 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 ); @@ -7751,31 +7752,31 @@ void CGameMode::ReceiveNotifyBan(const unsigned char* packet) { GetRagConnection().Close(); std::string text; switch (code) { - case 0: + case BAN_UNFAIR: text = text + LookupMessage(3) + "(" + IntToString(0, 0) + ")"; break; - case 1: + case BAN_SERVER_SHUTDOWN: text = text + LookupMessage(4) + "(" + IntToString(1, 0) + ")"; break; - case 2: + case BAN_ANOTHER_LOGIN: text = text + LookupMessage(5) + "(" + IntToString(2, 0) + ")"; break; - case 3: + case BAN_DETECTED_SPEEDHACK: text = text + LookupMessage(241) + "(" + IntToString(3, 0) + ")"; break; - case 4: + case BAN_PC_OVERFLOW: text = text + LookupMessage(264) + "(" + IntToString(4, 0) + ")"; break; - case 5: + case BAN_UNDER_AGE: text = text + LookupMessage(305) + "(" + IntToString(5, 0) + ")"; break; - case 9: + case BAN_IP_OVERFLOW: text = text + LookupMessage(529) + "(" + IntToString(9, 0) + ")"; break; - case 10: + case BAN_PAY_OUT: text = text + LookupMessage(530) + "(" + IntToString(10, 0) + ")"; break; - case 15: + case BAN_OP_FORCE: if (g_serviceType == 4) { text = text + LookupMessage(579) + "(" + IntToString(15, 0) + ")"; } @@ -8268,7 +8269,7 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (packet->result) { - case 0: { + case PICKUP_SUCCEED: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8299,7 +8300,7 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); break; } - case 3: { + case RECEIVE_ITEM: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8319,15 +8320,15 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -8365,7 +8366,7 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (packet->result) { - case 0: { + case PICKUP_SUCCEED: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8401,7 +8402,7 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { } break; } - case 3: { + case RECEIVE_ITEM: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8422,15 +8423,15 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -8471,7 +8472,7 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (packet->result) { - case 0: { + case PICKUP_SUCCEED: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8501,7 +8502,7 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { window->SendMsg(nullptr, 0x22, reinterpret_cast(&item), 0, 0, 0); break; } - case 3: { + case RECEIVE_ITEM: { ITEM_INFO item; item.unknown_0000[0] = packet->type; item.unknown_0000[2] = packet->location; @@ -8520,15 +8521,15 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -8573,7 +8574,7 @@ void CGameMode::ReceiveItemPickupAck5( this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (result) { - case 0: { + case PICKUP_SUCCEED: { { StoreItemOption options[5] = {}; ITEM_INFO item; @@ -8617,7 +8618,7 @@ void CGameMode::ReceiveItemPickupAck5( } break; } - case 3: { + case RECEIVE_ITEM: { StoreItemOption options[5] = {}; ITEM_INFO item; item.unknown_0000[0] = type; @@ -8644,15 +8645,15 @@ void CGameMode::ReceiveItemPickupAck5( item.unknown_0000[3] = 0x8000; } switch (type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -8693,7 +8694,7 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (packet->result) { - case 0: { + case PICKUP_SUCCEED: { StoreItemOption options[5]; std::memcpy(options, packet->options, sizeof(options)); ITEM_INFO item; @@ -8735,7 +8736,7 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { } break; } - case 3: { + case RECEIVE_ITEM: { StoreItemOption options[5]; std::memcpy(options, packet->options, sizeof(options)); ITEM_INFO item; @@ -8763,15 +8764,15 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -9260,34 +9261,34 @@ void CGameMode::ReceiveSkillFailure(const unsigned char* data) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); if (packet->skillId == NV_BASIC) { switch (packet->value) { - case 0: + case ZCSK_ITEMEXCHANGE: notice = LookupMessage(0x9F); break; - case 1: + case ZCSK_EMOTION: this->unknown_026E[0x16] = 0; notice = LookupMessage(0xA0); break; - case 2: + case ZCSK_SIT: notice = LookupMessage(0xA1); break; - case 3: + case ZCSK_CHAT: notice = LookupMessage(0xA2); break; - case 4: + case ZCSK_PARTY: notice = LookupMessage(0xA3); break; - case 5: + case ZCSK_SHOUT: notice = LookupMessage(0xA4); break; - case 6: + case ZCSK_PK: notice = LookupMessage(0xA5); break; - case 7: { + case ZCSK_MANNERPOINT: { const char* text = LookupMessage(0x17F); g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFF, 0xB, 0, 0); } [[fallthrough]]; - case 8: + case ZCSK_JOINPARTY: notice = LookupMessage(0x518); break; default: @@ -9767,7 +9768,7 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { this->unknown_01A4.erase(this->unknown_01A4.begin(), this->unknown_01A4.end()); switch (packet->result) { - case 0: { + case PICKUP_SUCCEED: { StoreItemOption options[5]; std::memcpy(options, packet->options, sizeof(options)); ITEM_INFO item; @@ -9812,7 +9813,7 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { } break; } - case 3: { + case RECEIVE_ITEM: { StoreItemOption options[5]; std::memcpy(options, packet->options, sizeof(options)); ITEM_INFO item; @@ -9841,15 +9842,15 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -9974,15 +9975,15 @@ void CGameMode::ReceiveItemPickupAck9(const unsigned char* data) { item.unknown_0000[3] = 0x8000; } switch (packet->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: break; default: item.unknown_0000[2] = 0; @@ -11561,23 +11562,23 @@ void CGameMode::ReceiveParaResultList(const unsigned char* packet) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3043)), 0xFF, 0, 0, 0); break; - case 0: + case PURCHASE_SUCCEED: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; - case 1: + 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); break; - case 2: + 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); break; - case 3: + 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); break; - case 9: + 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); break; @@ -12148,8 +12149,8 @@ void CGameMode::ReceivePartyMemberLeft(const unsigned char* data) { name[24] = '\0'; std::memcpy(name, packet->name, sizeof(packet->name)); switch (packet->type) { - case 0: - case 1: + case GROUPMEMBER_DELETE_LEAVE: + case GROUPMEMBER_DELETE_EXPEL: this->SendMsg(0x40, g_session.GetPartyMemberAid(name), 0, 0, 0); g_session.RemovePartyMemberByName(name); break; @@ -12963,11 +12964,11 @@ void CGameMode::ReceiveActorMoveEntryLegacy(const unsigned char* data) { } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( @@ -12976,8 +12977,8 @@ void CGameMode::ReceiveActorMoveEntryLegacy(const unsigned char* data) { ); break; } - case 13: - case 14: + 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); break; } @@ -13097,11 +13098,11 @@ void CGameMode::SpawnMovingActor( } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( @@ -13110,8 +13111,8 @@ void CGameMode::SpawnMovingActor( ); break; } - case 13: - case 14: + 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); break; } @@ -13966,11 +13967,11 @@ void CGameMode::ReceiveActorStandEntryLegacy(const unsigned char* data) { } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( @@ -13979,8 +13980,8 @@ void CGameMode::ReceiveActorStandEntryLegacy(const unsigned char* data) { ); break; } - case 13: - case 14: + 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); break; } @@ -15044,11 +15045,11 @@ void CGameMode::SpawnStandingActor( } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( @@ -15057,8 +15058,8 @@ void CGameMode::SpawnStandingActor( ); break; } - case 13: - case 14: + 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); break; } @@ -15325,11 +15326,11 @@ void CGameMode::SpawnStateActor( } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t currentHp = hp; const std::int64_t currentMaxHp = maxHp; actor->SendMsg( @@ -15338,8 +15339,8 @@ void CGameMode::SpawnStateActor( ); break; } - case 13: - case 14: + 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); break; } @@ -15787,11 +15788,11 @@ void CGameMode::ReceiveActorStateEntryLegacy(const unsigned char* data) { } switch (actor->unknown_0314) { - case 0: - case 5: - case 8: - case 9: - case 10: { + case PC_TYPE: + case NPC_MOB_TYPE: + case NPC_HO_TYPE: + case NPC_MERSOL_TYPE: + case NPC_ELEMENTAL_TYPE: { const std::int64_t hp = packet->hp; const std::int64_t maxHp = packet->maxHp; actor->SendMsg( @@ -15800,8 +15801,8 @@ void CGameMode::ReceiveActorStateEntryLegacy(const unsigned char* data) { ); break; } - case 13: - case 14: + 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); break; } @@ -20357,12 +20358,12 @@ void CGameMode::ProcessIncomingPackets() { case 0x7A: case 0x83: case 0x84: - case 0x98: + case ID_ZC_ACK_WHISPER_0098: case 0x164: case ID_PING: case 0x1CC: - case 0x1E0: - case 0x1E9: + case ID_ZC_ACK_ACCOUNTNAME: + case ID_ZC_ADD_MEMBER_TO_GROUP2: case 0x227: case 0x283: case 0x851: @@ -20372,7 +20373,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_OPEN_BANKING: case ID_ZC_ACK_CLOSE_BANKING: case 0x9CC: - case 0x9EB: + case ID_ZC_ACK_READ_MAIL: case 0xA7B: case 0xAB1: case 0xAD2: @@ -20392,7 +20393,7 @@ void CGameMode::ProcessIncomingPackets() { case 0x79: this->ReceiveActorStandEntryOld0(g_gameModePacketBuffer); break; - case 0x7B: + case 0x7b: this->ReceiveActorMoveEntryOld0(g_gameModePacketBuffer); break; case spawn_unit2Type: @@ -20413,13 +20414,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_NPCACK_MAPMOVE: this->ReceiveMapMove(g_gameModePacketBuffer); break; - case 0x92: + case ID_ZC_NPCACK_SERVERMOVE_0092: this->ReceiveZoneServerChange(g_gameModePacketBuffer); break; case ID_ZC_WHISPER: this->ReceiveWhisper(g_gameModePacketBuffer); break; - case 0xA0: + case ID_ZC_ITEM_PICKUP_ACK_00a0: this->ReceiveItemPickupAck(g_gameModePacketBuffer); break; case ID_ZC_PAR_CHANGE: @@ -20443,7 +20444,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_STATUS_CHANGE: this->ReceiveStatusChange(g_gameModePacketBuffer); break; - case 0xC3: + case ID_ZC_SPRITE_CHANGE: this->ReceiveSpriteChange(g_gameModePacketBuffer); break; case ID_ZC_PC_SELL_ITEMLIST: @@ -20467,20 +20468,20 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_CHANGE_CHATROOM: this->ReceiveActorMessage34(g_gameModePacketBuffer); break; - case 0xE7: + case ID_ZC_ACK_EXCHANGE_ITEM_00e7: this->ReceiveExchangeRequestAck(g_gameModePacketBuffer); break; case ID_ZC_ACK_ADD_EXCHANGE_ITEM: this->ReceiveExchangeItemAddAck(g_gameModePacketBuffer); break; - case 0xFB: + case ID_ZC_GROUP_LIST: this->ReceivePartyMemberList(g_gameModePacketBuffer); break; - case 0xFD: + case ID_ZC_ACK_REQ_JOIN_GROUP: case ID_ZC_PARTY_JOIN_REQ_ACK: this->ReceiveNamedActionResult(g_gameModePacketBuffer); break; - case 0x104: + case ID_ZC_ADD_MEMBER_TO_GROUP: this->ReceivePartyMemberInfo(g_gameModePacketBuffer); break; case ID_ZC_DELETE_MEMBER_FROM_GROUP: @@ -20494,7 +20495,7 @@ void CGameMode::ProcessIncomingPackets() { case 0x29E: this->ApplySkillUpdatePacket(g_gameModePacketBuffer); break; - case 0x114: + case ID_ZC_NOTIFY_SKILL_0114: this->ReceiveActorSkillAction(g_gameModePacketBuffer); break; case ID_ZC_NOTIFY_SKILL_POSITION: @@ -20503,11 +20504,11 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_NOTIFY_GROUNDSKILL: this->ReceiveNotifyGroundSkill(g_gameModePacketBuffer); break; - case 0x11F: + case ID_ZC_SKILL_ENTRY: this->Zc_Skill_Entry(g_gameModePacketBuffer); break; - case 0x133: - case 0x800: + case ID_ZC_PC_PURCHASE_ITEMLIST_FROMMC_0133: + case ID_ZC_PC_PURCHASE_ITEMLIST_FROMMC_0800: this->ReceiveItem1748List(g_gameModePacketBuffer); break; case ID_ZC_PC_PURCHASE_RESULT_FROMMC: @@ -20525,19 +20526,19 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_MYGUILD_BASIC_INFO: this->ReceiveGuildRelationList(g_gameModePacketBuffer); break; - case 0x150: + case ID_ZC_GUILD_INFO_0150: this->ReceiveGuildInfo2(g_gameModePacketBuffer); break; - case 0x154: + case ID_ZC_MEMBERMGR_INFO_0154: this->ReceiveGuildMemberMemoList(g_gameModePacketBuffer); break; - case 0x15A: + case ID_ZC_ACK_LEAVE_GUILD: this->ReceiveGuildMemberLeft(g_gameModePacketBuffer); break; case ID_ZC_POSITION_INFO: this->ReceiveGuildPositionInfo(g_gameModePacketBuffer); break; - case 0x163: + case ID_ZC_BAN_LIST_0163: this->ReceiveGuildBanList(g_gameModePacketBuffer); break; case ID_ZC_POSITION_ID_NAME_INFO: @@ -20558,7 +20559,7 @@ void CGameMode::ProcessIncomingPackets() { case 0x182: this->ReceiveGuildMemberAdd(g_gameModePacketBuffer); break; - case 0x185: + case ID_ZC_ADD_RELATED_GUILD: this->ReceiveAddRelatedGuild(g_gameModePacketBuffer); break; case ID_ZC_ACK_ITEMREFINING: @@ -20567,13 +20568,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_REQMAKINGITEM: this->ReceiveItemEffectResult(g_gameModePacketBuffer); break; - case 0x195: + case ID_ZC_ACK_REQNAMEALL_0195: this->ReceiveActorNameAll(reinterpret_cast(g_gameModePacketBuffer)); break; case sc_notickType: this->ReceiveStatusChangeNotice(g_gameModePacketBuffer); break; - case 0x19A: + case ID_ZC_NOTIFY_RANKING: this->ReceiveEffectNumber(g_gameModePacketBuffer); break; case ID_ZC_NOTIFY_EFFECT: @@ -20595,7 +20596,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_PET_ACT: this->ReceivePetAct(g_gameModePacketBuffer); break; - case 0x1B6: + case ID_ZC_GUILD_INFO2: this->ReceiveGuildInfo(g_gameModePacketBuffer); break; case ID_ZC_DISPEL: @@ -20604,16 +20605,16 @@ void CGameMode::ProcessIncomingPackets() { case 0x1C1: this->ReceiveBillingInfo(g_gameModePacketBuffer); break; - case 0x1C4: + case ID_ZC_ADD_ITEM_TO_STORE2: this->ReceiveItem1738Add(g_gameModePacketBuffer); break; - case 0x1C5: + case ID_ZC_ADD_ITEM_TO_CART2: this->ReceiveItem1740Add(g_gameModePacketBuffer); break; case graffiti_entryType: this->Zc_Skill_Entry2(g_gameModePacketBuffer); break; - case 0x1CF: + case ID_ZC_DEVOTIONLIST: this->ReceiveDevotionList(g_gameModePacketBuffer); break; case ID_ZC_BLADESTOP: @@ -20626,16 +20627,16 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_SOUND: this->ReceiveSound(g_gameModePacketBuffer); break; - case 0x1D7: + case ID_ZC_SPRITE_CHANGE2: this->ReceiveSpriteChange2Mirrored(g_gameModePacketBuffer); break; - case 0x1D8: + case 0x1d8: this->ReceiveActorStateEntryOld(g_gameModePacketBuffer); break; - case 0x1D9: + case 0x1d9: this->ReceiveActorStandEntryOld(g_gameModePacketBuffer); break; - case 0x1DA: + case 0x1da: this->ReceiveActorMoveEntryOld(g_gameModePacketBuffer); break; case ID_ZC_NOTIFY_SKILL: @@ -20665,10 +20666,10 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_FRIENDS_LIST: this->ReceiveFriendList(g_gameModePacketBuffer); break; - case 0x20E: + case ID_ZC_STARSKILL: this->ReceiveSpecialBroadcast(g_gameModePacketBuffer); break; - case 0x214: + case ID_ZC_ACK_STATUS_GM: this->ReceiveStatDump(g_gameModePacketBuffer); break; case ID_ZC_SKILLMSG: @@ -20677,16 +20678,16 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_WEAPONREFINE: this->ReceiveItemObtainNotice(g_gameModePacketBuffer); break; - case 0x22A: + case 0x22a: this->ReceiveActorStandEntry(g_gameModePacketBuffer); break; - case 0x22B: + case 0x22b: this->ReceiveActorStandEntryOld2(g_gameModePacketBuffer); break; - case 0x22C: + case 0x22c: this->ReceiveActorMoveEntryOld2(g_gameModePacketBuffer); break; - case 0x22E: + case ID_ZC_PROPERTY_HOMUN_022e: this->ReceiveHomunculusInfo(g_gameModePacketBuffer); break; case ID_ZC_CHANGESTATE_MER: @@ -20698,13 +20699,13 @@ void CGameMode::ProcessIncomingPackets() { case 0x27B: this->ReceiveBroadcastBalloonNotice(g_gameModePacketBuffer); break; - case 0x284: + case ID_ZC_NOTIFY_EFFECT3_0284: this->ReceiveActorStatusValuePacket(g_gameModePacketBuffer); break; case ID_ZC_PC_CASH_POINT_ITEMLIST: this->ReceivePendingItem1718List(g_gameModePacketBuffer); break; - case 0x289: + case ID_ZC_PC_CASH_POINT_UPDATE: this->ReceivePendingResult(g_gameModePacketBuffer); break; case ID_ZC_NPC_SHOWEFST_UPDATE: @@ -20716,7 +20717,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_BOSS_INFO: this->ReceiveUnknown05C4Result(g_gameModePacketBuffer); break; - case 0x294: + case ID_ZC_READ_BOOK: this->ReceiveBookOpen(g_gameModePacketBuffer); break; case 0x295: @@ -20734,22 +20735,22 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_CASH_ITEM_DELETE: this->ReceiveUnknownD25850(g_gameModePacketBuffer); break; - case 0x29A: + case ID_ZC_ITEM_PICKUP_ACK2: this->ReceiveItemPickupAck2(g_gameModePacketBuffer); break; - case 0x29B: + case ID_ZC_MER_INIT: this->Zc_Mer_Init(g_gameModePacketBuffer); break; - case 0x2A2: + case ID_ZC_MER_PAR_CHANGE: this->Zc_Mer_Par_Change(g_gameModePacketBuffer); break; - case 0x2B8: + case ID_ZC_ITEM_PICKUP_PARTY_02b8: this->ReceivePartyItemPickupNotice(g_gameModePacketBuffer); break; case ID_ZC_EQUIPITEM_DAMAGED: this->ReceiveEquipItemDamaged(g_gameModePacketBuffer); break; - case 0x2C1: + case ID_ZC_NPC_CHAT: this->ReceiveActorColorChat(g_gameModePacketBuffer); break; case 0x2C2: @@ -20770,26 +20771,26 @@ void CGameMode::ProcessIncomingPackets() { case 0x2CE: this->ReceiveMemorialDungeonNotify(g_gameModePacketBuffer); break; - case 0x2D0: + case 0x2d0: this->ReceiveEquipItemList38(g_gameModePacketBuffer); break; - case 0x2D1: + case 0x2d1: this->ReceiveStorageEquipList2(g_gameModePacketBuffer); break; - case 0x2D2: + case 0x2d2: this->ReceiveItem1740BasicListBind(g_gameModePacketBuffer); break; - case 0x2D4: + case ID_ZC_ITEM_PICKUP_ACK3: this->ReceiveItemPickupAck3(g_gameModePacketBuffer); break; case 0x2D5: this->ReceiveUnknownD2D990(g_gameModePacketBuffer); break; - case 0x2D7: - case 0x859: + case ID_ZC_EQUIPWIN_MICROSCOPE_02d7: + case ID_ZC_EQUIPWIN_MICROSCOPE_0859: this->ReceiveEquipWindowMicroscope2(g_gameModePacketBuffer); break; - case 0x2D9: + case ID_ZC_CONFIG: this->ReceiveFeedOption(g_gameModePacketBuffer); break; case ID_ZC_CONFIG_NOTIFY: @@ -20801,15 +20802,15 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACCEPT_ENTER: this->ReceiveAcceptEnter(g_gameModePacketBuffer); break; - case 0x2EC: - case 0x7F7: + case 0x2ec: + case 0x7f7: case 0x856: this->ReceiveActorMoveEntryNamed(g_gameModePacketBuffer); break; - case 0x2ED: + case 0x2ed: this->ReceiveActorStandEntryOld3(g_gameModePacketBuffer); break; - case 0x2EE: + case 0x2ee: this->ReceiveActorStandEntryFont(g_gameModePacketBuffer); break; case ID_ZC_SKILL_POSTDELAY: @@ -20824,13 +20825,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_MILLENNIUMSHIELD: this->ReceiveActorEffect228(g_gameModePacketBuffer); break; - case 0x446: + case ID_ZC_QUEST_NOTIFY_EFFECT: this->ReceiveMinimapMarker(g_gameModePacketBuffer); break; - case 0x7D8: + case ID_ZC_REQ_GROUPINFO_CHANGE_V2: this->ReceiveServerRateNotice(g_gameModePacketBuffer); break; - case 0x7DB: + case ID_ZC_HO_PAR_CHANGE_07db: this->ReceiveHomunculusProperty(g_gameModePacketBuffer); break; case ID_ZC_MSG_VALUE: @@ -20842,11 +20843,11 @@ void CGameMode::ProcessIncomingPackets() { case 0x7F6: this->Zc_Notify_Exp(g_gameModePacketBuffer); break; - case 0x7F8: + case 0x7f8: case 0x858: this->ReceiveActorStandEntryNamedOld(g_gameModePacketBuffer); break; - case 0x7F9: + case 0x7f9: case 0x857: this->ReceiveActorStateEntryNamedOld(g_gameModePacketBuffer); break; @@ -20856,31 +20857,31 @@ void CGameMode::ProcessIncomingPackets() { case partyleaderchangedType: this->ReceivePartyLeaderChange(g_gameModePacketBuffer); break; - case 0x7FE: + case ID_ZC_PLAY_NPC_BGM_07fe: this->ReceiveNpcBgm(g_gameModePacketBuffer); break; - case 0x803: + case ID_ZC_PARTY_BOOKING_ACK_REGISTER: this->ReceivePartyBookingUpdateResult(g_gameModePacketBuffer); break; - case 0x805: + case ID_ZC_PARTY_BOOKING_ACK_SEARCH: this->ReceivePartyBookingSearchResult(g_gameModePacketBuffer); break; - case 0x807: + case ID_ZC_PARTY_BOOKING_ACK_DELETE: this->ReceivePartyBookingRegisterResult(g_gameModePacketBuffer); break; - case 0x809: + case ID_ZC_PARTY_BOOKING_NOTIFY_INSERT: this->ReceivePartyBookingInsert(g_gameModePacketBuffer); break; - case 0x80A: + case ID_ZC_PARTY_BOOKING_NOTIFY_UPDATE: this->ReceivePartyBookingUpdate(g_gameModePacketBuffer); break; - case 0x80B: + case ID_ZC_PARTY_BOOKING_NOTIFY_DELETE: this->ReceivePartyBookingDelete(g_gameModePacketBuffer); break; - case 0x810: + case ID_ZC_OPEN_BUYING_STORE: this->ReceiveOpenStore(g_gameModePacketBuffer); break; - case 0x812: + case ID_ZC_FAILED_OPEN_BUYING_STORE_TO_BUYER: this->ReceiveBuyingStoreOpenResult(g_gameModePacketBuffer); break; case ID_ZC_MYITEMLIST_BUYING_STORE: @@ -20895,13 +20896,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_ITEMLIST_BUYING_STORE: this->ReceiveBuyingStoreItemList(g_gameModePacketBuffer); break; - case 0x81A: + case ID_ZC_FAILED_TRADE_BUYING_STORE_TO_BUYER: this->ReceiveUnknownD2A1F0(g_gameModePacketBuffer); break; - case 0x81B: + case ID_ZC_UPDATE_ITEM_FROM_BUYING_STORE: this->ReceiveVendingItemSoldNow(g_gameModePacketBuffer); break; - case 0x81C: + case ID_ZC_ITEM_DELETE_BUYING_STORE: this->ReceiveItemSellResult(g_gameModePacketBuffer); break; case 0x81D: @@ -20916,13 +20917,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER: this->ReceiveBuyingStoreSellResult(g_gameModePacketBuffer); break; - case 0x836: + case ID_ZC_SEARCH_STORE_INFO_ACK_0836: this->ReceiveSearchStoreItemsOld(g_gameModePacketBuffer); break; case ID_ZC_SEARCH_STORE_INFO_FAILED: this->ReceiveWindow181Message(g_gameModePacketBuffer); break; - case 0x839: + case ID_ZC_ACK_BAN_GUILD_SSO: this->ReceiveGuildMemberExpelled(g_gameModePacketBuffer); break; case ID_ZC_OPEN_SEARCH_STORE_INFO: @@ -20946,13 +20947,13 @@ void CGameMode::ProcessIncomingPackets() { case 0x8B6: this->Zc_Trycollection(g_gameModePacketBuffer); break; - case 0x8C7: + case ID_ZC_SKILL_ENTRY3: this->ReceiveGroundSkill8(g_gameModePacketBuffer); break; case ID_ZC_ACK_SCHEDULER_CASHITEM: this->ReceiveTypedItemList(g_gameModePacketBuffer); break; - case 0x8CB: + case ID_ZC_PERSONAL_INFOMATION_08cb: case ID_ZC_PERSONAL_INFOMATION: this->ReceiveRateInfo(g_gameModePacketBuffer); break; @@ -20962,31 +20963,31 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_SPIRITS_ATTRIBUTE: this->ReceiveActorCharm(g_gameModePacketBuffer); break; - case 0x8D2: + case ID_ZC_FASTMOVE: this->ReceiveActorMessage144(g_gameModePacketBuffer); break; case ID_ZC_CLEAR_DIALOG: this->RefreshWindow16(g_gameModePacketBuffer); break; - case 0x8FF: + case ID_ZC_EFST_SET_ENTER_08ff: this->ReceiveStatusChangeEffect(g_gameModePacketBuffer); break; case 0x901: this->ReceiveEquipItemListFlags(g_gameModePacketBuffer); break; - case 0x906: + case ID_ZC_EQUIPWIN_MICROSCOPE_0906: this->ReceiveEquipWindowMicroscope(g_gameModePacketBuffer); break; case ID_ZC_INVENTORY_TAB: this->ReceiveInventoryItemUpdate(g_gameModePacketBuffer); break; - case 0x90F: + case ID_ZC_NOTIFY_NEWENTRY7: this->ReceiveActorStandEntryLegacy(g_gameModePacketBuffer); break; - case 0x914: + case ID_ZC_NOTIFY_MOVEENTRY8: this->ReceiveActorMoveEntryLegacy(g_gameModePacketBuffer); break; - case 0x915: + case ID_ZC_NOTIFY_STANDENTRY9: this->ReceiveActorStateEntryLegacy(g_gameModePacketBuffer); break; case 0x96B: @@ -21013,10 +21014,10 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_UPDATE_RANKING_POINT: this->ReceiveTypedNotice(g_gameModePacketBuffer); break; - case 0x97F: + case ID_ZC_SELECTCART: this->ReceiveWindow95Data(g_gameModePacketBuffer); break; - case 0x983: + case ID_ZC_MSG_STATE_CHANGE3: this->ReceiveStatusChangeEffect2(g_gameModePacketBuffer); break; case ID_ZC_EFST_SET_ENTER: @@ -21055,13 +21056,13 @@ void CGameMode::ProcessIncomingPackets() { case 0x996: this->ReceiveStorageEquipList4(g_gameModePacketBuffer); break; - case 0x997: + case ID_ZC_EQUIPWIN_MICROSCOPE_0997: this->ReceiveEquipWindowMicroscope3(g_gameModePacketBuffer); break; case ID_ZC_MAPPROPERTY_R2: this->ReceiveMapProperty(g_gameModePacketBuffer); break; - case 0x99F: + case ID_ZC_SKILL_ENTRY4: this->ReceiveGroundSkill32(g_gameModePacketBuffer); break; case ID_ZC_BANKING_CHECK: @@ -21076,7 +21077,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_C_MARKERINFO: this->AddMiniMapEffectMarker(g_gameModePacketBuffer); break; - case 0x9CA: + case ID_ZC_SKILL_ENTRY5: this->ReceiveGroundSkillExtended(g_gameModePacketBuffer); break; case ID_ZC_MSG_COLOR: @@ -21091,13 +21092,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_GUILDSTORAGE_LOG: this->ReceiveGuildStorageLog(g_gameModePacketBuffer); break; - case 0x9DB: + case ID_ZC_NOTIFY_MOVEENTRY10: this->ReceiveActorMoveEntry(g_gameModePacketBuffer); break; - case 0x9DC: + case ID_ZC_NOTIFY_NEWENTRY10: this->ReceiveActorStandEntryNamed(g_gameModePacketBuffer); break; - case 0x9DD: + case ID_ZC_NOTIFY_STANDENTRY10: this->ReceiveActorStateEntryNamed(g_gameModePacketBuffer); break; case ID_ZC_WHISPER2: @@ -21121,49 +21122,49 @@ void CGameMode::ProcessIncomingPackets() { case rodexdelete: this->ReceiveRodexMailDeleted(g_gameModePacketBuffer); break; - case 0x9F8: + case ID_ZC_ALL_QUEST_LIST3: this->ReceiveOngoingQuestList(g_gameModePacketBuffer); break; - case 0x9F9: + case ID_ZC_ADD_QUEST_EX: this->ReceiveAddQuest(g_gameModePacketBuffer); break; - case 0x9FA: + case ID_ZC_UPDATE_MISSION_HUNT_EX: this->ReceiveQuestHuntUpdate2(g_gameModePacketBuffer); break; - case 0x9FD: + case ID_ZC_NOTIFY_MOVEENTRY11: this->ReceiveActorMoveEntryBody(g_gameModePacketBuffer); break; - case 0x9FE: + case ID_ZC_NOTIFY_NEWENTRY11: this->ReceiveActorStandEntryNamedBody(g_gameModePacketBuffer); break; - case 0x9FF: + case ID_ZC_NOTIFY_STANDENTRY11: this->ReceiveActorStateEntryNamedBody(g_gameModePacketBuffer); break; case ID_ZC_DRESSROOM_OPEN: this->EnsureWindow259(g_gameModePacketBuffer); break; - case 0xA05: + case ID_ZC_ACK_ADD_ITEM_TO_MAIL: this->ReceiveItemReward(g_gameModePacketBuffer); break; case rodexremoveitem: this->ReceiveStackedItemReturn(g_gameModePacketBuffer); break; - case 0xA0A: + case ID_ZC_ADD_ITEM_TO_STORE3: this->ReceiveItem1738AddOptions(g_gameModePacketBuffer); break; - case 0xA0B: + case ID_ZC_ADD_ITEM_TO_CART3: this->ReceiveItem1740AddOptions(g_gameModePacketBuffer); break; - case 0xA0C: + case ID_ZC_ITEM_PICKUP_ACK_V6: this->ReceiveItemPickupAck7(g_gameModePacketBuffer); break; - case 0xA0D: + case 0xa0d: this->ReceiveInventoryEquipList2(g_gameModePacketBuffer); break; - case 0xA0F: + case 0xa0f: this->ReceiveItem1740EquipListOptions(g_gameModePacketBuffer); break; - case 0xA10: + case 0xa10: this->ReceiveStorageEquipList5(g_gameModePacketBuffer); break; case 0xA11: @@ -21178,7 +21179,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_DYNAMICNPC_CREATE_RESULT: this->ReceiveDynamicNpcNotice(g_gameModePacketBuffer); break; - case 0xA1A: + case ID_ZC_ACK_OPEN_ROULETTE: this->ReceiveRouletteOpen(g_gameModePacketBuffer); break; case rouletteinfoackType: @@ -21193,7 +21194,7 @@ void CGameMode::ProcessIncomingPackets() { case roulettercvitemackType: this->ReceiveRouletteSetResult(g_gameModePacketBuffer); break; - case 0xA2D: + case ID_ZC_EQUIPWIN_MICROSCOPE_0a2d: this->ReceiveEquipWindowMicroscope4(g_gameModePacketBuffer); break; case ID_ZC_ACK_REQNAMEALL: @@ -21208,7 +21209,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xA36: this->ReceiveActorInt8(g_gameModePacketBuffer); break; - case 0xA37: + case ID_ZC_ITEM_PICKUP_ACK_V7: this->ReceiveItemPickupAck8(g_gameModePacketBuffer); break; case ID_ZC_EQUIPMENT_EFFECT: @@ -21217,25 +21218,25 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_UPDATE_CARDSLOT: this->ReceiveEquipCardChange(g_gameModePacketBuffer); break; - case 0xA43: + case ID_ZC_ADD_MEMBER_TO_GROUP3: this->ReceiveUnknownD89C60(g_gameModePacketBuffer); break; - case 0xA44: + case 0xa44: this->ReceivePartyInfo2(g_gameModePacketBuffer); break; case ID_ZC_STYLE_CHANGE_RES: this->ReceiveCharacterRenameResult(g_gameModePacketBuffer); break; - case 0xA7D: + case ID_ZC_ACK_MAIL_LIST2: this->ReceiveRodexMailListRefresh(g_gameModePacketBuffer); break; - case 0xA82: + case ID_ZC_ACK_BAN_GUILD_DELNAME: this->ReceiveGuildExpulsion2(g_gameModePacketBuffer); break; - case 0xA83: + case ID_ZC_ACK_LEAVE_GUILD_DELNAME: this->ReceiveGuildLeave2(g_gameModePacketBuffer); break; - case 0xA84: + case ID_ZC_GUILD_INFO3: this->ReceiveGuildInfo3(g_gameModePacketBuffer); break; case 0xA85: @@ -21244,10 +21245,10 @@ void CGameMode::ProcessIncomingPackets() { case 0xA86: this->ReceiveGuildMemberList3(g_gameModePacketBuffer); break; - case 0xA87: + case ID_ZC_BAN_LIST2: this->ReceiveGuildBanList2(g_gameModePacketBuffer); break; - case 0xA96: + case ID_ZC_ADD_EXCHANGE_ITEM_0a96: this->ReceiveItemSlotAddOptions(g_gameModePacketBuffer); break; case 0xA98: @@ -21262,7 +21263,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xA9D: this->ReceiveCharViewResult(g_gameModePacketBuffer); break; - case 0xAA5: + case ID_ZC_MEMBERMGR_INFO2: this->ReceiveGuildMemberList(g_gameModePacketBuffer); break; case 0xAA6: @@ -21286,7 +21287,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xABF: this->ReceiveWindow308TextEntries(g_gameModePacketBuffer); break; - case 0xAC2: + case ID_ZC_ACK_MAIL_LIST3: this->ReceiveRodexMailList(g_gameModePacketBuffer); break; case ID_ZC_NPCACK_SERVERMOVE: @@ -21301,7 +21302,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xACC: this->ReceiveExpGainNotice(g_gameModePacketBuffer); break; - case 0xADD: + case ID_ZC_ITEM_FALL_ENTRY5: this->ReceiveItemDropEntry(g_gameModePacketBuffer); break; case 0xADE: @@ -21313,10 +21314,10 @@ void CGameMode::ProcessIncomingPackets() { case 0xAE1: this->ReceiveNamedResultNotice(g_gameModePacketBuffer); break; - case 0xAE4: + case 0xae4: this->ReceiveUnknownD65870(g_gameModePacketBuffer); break; - case 0xAE5: + case 0xae5: this->ReceivePartyRoster(g_gameModePacketBuffer); break; case ID_ZC_ACK_RANKING2: @@ -21328,19 +21329,19 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_GUILD_POSITION: this->ReceiveActorClanName(g_gameModePacketBuffer); break; - case 0xAFE: + case 0xafe: this->ReceiveQuestHuntUpdate(g_gameModePacketBuffer); break; - case 0xAFF: + case ID_ZC_ALL_QUEST_LIST4: this->ReceiveOngoingQuestList2(g_gameModePacketBuffer); break; - case 0xB03: + case ID_ZC_EQUIPWIN_MICROSCOPE_0b03: this->ReceiveEquipWindowMicroscope5(g_gameModePacketBuffer); break; case ID_ZC_INVENTORY_START: this->ReceiveInventoryStart(g_gameModePacketBuffer); break; - case 0xB0C: + case 0xb0c: this->ReceiveAddQuest64(g_gameModePacketBuffer); break; case ID_ZC_REMOVE_EFFECT: @@ -21367,13 +21368,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_GUILD_AGIT_INFO: this->ReceiveGuildUnknown0114List(g_gameModePacketBuffer); break; - case 0xB2F: + case ID_ZC_PROPERTY_HOMUN_0b2f: this->ReceiveHomunculusInfo2(g_gameModePacketBuffer); break; case ID_ZC_EQUIPWIN_MICROSCOPE: this->ReceiveEquipWindowMicroscope6(g_gameModePacketBuffer); break; - case 0xB39: + case 0xb39: this->ReceiveEquipItemList(g_gameModePacketBuffer); break; case 0xB3C: @@ -21412,7 +21413,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_NPC_MARKET_PURCHASE_RESULT: this->ReceiveParaResultList(g_gameModePacketBuffer); break; - case 0xB56: + case ID_ZC_NPC_EXPANDED_BARTER_MARKET_ITEMINFO_0b56: this->ReceiveExpandedBarterMarketItemList(g_gameModePacketBuffer); break; case ID_ZC_GRADE_ENCHANT_MATERIAL_LIST: @@ -21529,7 +21530,7 @@ void CGameMode::ProcessIncomingPackets() { case 0xC44: this->ReceiveSimulationResult(g_gameModePacketBuffer); break; - case 0x73: { + case ID_ZC_ACCEPT_ENTER_V1: { g_session.SetServerTime(*reinterpret_cast(g_gameModePacketBuffer + 2)); const unsigned char *posDir = g_gameModePacketBuffer + 6; g_session.SetPlayerPosition((posDir[0] << 2) | (posDir[1] >> 6), ((posDir[1] & 0x3F) << 4) | (posDir[2] >> 4), posDir[2] & 0xF); @@ -21605,7 +21606,7 @@ void CGameMode::ProcessIncomingPackets() { this->StopActorMove(packet->aid, packet->x, packet->y, 0); break; } - case 0x8A: { + case ID_ZC_NOTIFY_ACT_008a: { const ActorActionPacket *packet = reinterpret_cast(g_gameModePacketBuffer); this->ReceiveActorAction(packet->sourceAid, packet->targetAid, packet->tick, packet->attackMT, packet->attackedMT, packet->damage, packet->count, packet->type, packet->damage2, 0); @@ -21674,7 +21675,7 @@ void CGameMode::ProcessIncomingPackets() { break; } case ID_ZC_ITEM_ENTRY: - case 0x9E: { + case ID_ZC_ITEM_FALL_ENTRY: { const unsigned char *packet = g_gameModePacketBuffer; const bool falling = static_cast(type) == 0x9E; ItemFallEntry entry = {}; @@ -21706,7 +21707,7 @@ void CGameMode::ProcessIncomingPackets() { this->RemoveUnknown01A4(aid); break; } - case 0xA3: { + case 0xa3: { g_session.KeepEquipment(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(NormalItemRecord); const NormalItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -21727,7 +21728,7 @@ void CGameMode::ProcessIncomingPackets() { RefreshItemWindows(&g_windowMgr); break; } - case 0xA4: { + case 0xa4: { g_session.RemoveEquipment(); g_session.ResetEquipment(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(EquipItemRecord); @@ -21759,7 +21760,7 @@ void CGameMode::ProcessIncomingPackets() { RefreshItemWindows(&g_windowMgr); break; } - case 0xA5: { + case 0xa5: { g_windowMgr.EnsureWindow(33); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(NormalItemRecord); const NormalItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -21780,7 +21781,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1738Window(); break; } - case 0xA6: { + case 0xa6: { g_windowMgr.EnsureWindow(33); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(EquipItemRecord); const EquipItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -21801,7 +21802,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1738Window(); break; } - case 0xA8: { + case ID_ZC_USE_ITEM_ACK: { const ItemUseAckPacket *packet = reinterpret_cast(g_gameModePacketBuffer); if (packet->result) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, packet->index); @@ -21815,15 +21816,15 @@ void CGameMode::ProcessIncomingPackets() { this->unknown_02CC = 0; break; } - case 0xAA: { + case ID_ZC_REQ_WEAR_EQUIP_ACK_00aa: { const unsigned char *packet = g_gameModePacketBuffer; *reinterpret_cast(&this->unknown_0100[0x04]) = timeGetTime() - 2000; switch (packet[8]) { - case 0: - case 2: + case ACK_REQ_EQUIP_FAILURE: + case ACK_REQ_EQUIP_FAILURE_LEVEL: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(372)), 0xFF, 7, 0, 0); break; - case 1: { + case ACK_REQ_EQUIP_SUCCESS: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *reinterpret_cast(packet + 2)); if (item.unknown_0000[1]) { item.unknown_0070 = *reinterpret_cast(packet + 6); @@ -21835,7 +21836,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0xAC: { + case ID_ZC_REQ_TAKEOFF_EQUIP_ACK_00ac: { const unsigned char *packet = g_gameModePacketBuffer; *reinterpret_cast(&this->unknown_0100[0x08]) = timeGetTime() - 2000; const std::uint16_t location = *reinterpret_cast(packet + 4); @@ -21936,7 +21937,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.CloseWindow(23); g_windowMgr.CloseWindow(24); break; - case 0xC6: { + case ID_ZC_PC_PURCHASE_ITEMLIST_00c6: { g_session.ClearTradeItems(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(ShopItemRecord); const ShopItemRecord *records = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -21960,13 +21961,13 @@ void CGameMode::ProcessIncomingPackets() { sellWindow->SendMsg(nullptr, 23, 0, 0, 0, 0); break; } - case 0xCB: + case ID_ZC_PC_SELL_RESULT: switch (g_gameModePacketBuffer[2]) { - case 0: + case SELL_SUCCEED: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(54)), 0xFFFF00, 0, 0, 0); break; - case 1: + case SELL_FAIL: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(57)), 0xFF, 0, 0, 0); break; @@ -21975,7 +21976,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.CloseWindow(22); g_windowMgr.CloseWindow(24); break; - case 0xCD: { + 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); @@ -21985,22 +21986,22 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_SETTING_WHISPER_STATE: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { - case 0: + case WT_EXCLUDE_WHISPER: switch (g_gameModePacketBuffer[3]) { - case 0: + case WHISPER_SETTING_SUCCEED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3427)), 0xFFFF, 0, 0, 0); break; - case 1: + case WHIPSER_SETTING_FAILED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3428)), 0xFFFF, 0, 0, 0); break; } break; - case 1: + case WT_INCLUDE_WHISPER: switch (g_gameModePacketBuffer[3]) { - case 0: + case WHISPER_SETTING_SUCCEED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3429)), 0xFFFF, 0, 0, 0); break; - case 1: + case WHIPSER_SETTING_FAILED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3430)), 0xFFFF, 0, 0, 0); break; } @@ -22091,11 +22092,11 @@ void CGameMode::ProcessIncomingPackets() { window->SendMsg(nullptr, 45, reinterpret_cast(name), 0, 0, 0); char text[128]; switch (g_gameModePacketBuffer[0x1C]) { - case 0: + case ROOMEXITTYPE_EXIT: sprintf(text, LookupMessage(180), name); g_windowMgr.SendNotice(5, reinterpret_cast(text), 0x80, 0, 0, 0); break; - case 1: + case ROOMEXITTYPE_EXPEL: sprintf(text, LookupMessage(181), name); g_windowMgr.SendNotice(5, reinterpret_cast(text), 0x80, 0, 0, 0); break; @@ -22110,7 +22111,7 @@ void CGameMode::ProcessIncomingPackets() { window->SendMsg(nullptr, 46, reinterpret_cast(name), *reinterpret_cast(g_gameModePacketBuffer + 2), 0, 0); break; } - case 0xE5: { + case ID_ZC_REQ_EXCHANGE_ITEM_00e5: { if (g_serviceOptions.Get(136)) { g_modeMgr.gameMode->SendMsg(50, 4, 0, 0, 0); break; @@ -22126,10 +22127,10 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_CONCLUDE_EXCHANGE_ITEM: if (UIWindow *window = g_windowMgr.LookupWindow(10011)) { switch (g_gameModePacketBuffer[2]) { - case 0: + case EXI_CONCLUDE_ME: window->SendMsg(nullptr, 51, 0, 0, 0, 0); break; - case 1: + case EXI_CONCLUDE_OTHER: window->SendMsg(nullptr, 52, 0, 0, 0, 0); break; } @@ -22150,10 +22151,10 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.CloseWindow(10011); g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { - case 0: + case EXITEM_EXCHANGE_SUCCEED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(75)), 0xFFFF00, 0, 0, 0); break; - case 1: + 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); @@ -22183,14 +22184,14 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_MAKE_GROUP: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { - case 0: + case GROUP_MAKE_SUCCEED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(77)), 0xFFFF00, 0, 0, 0); g_windowMgr.EnsureWindow(34); break; - case 1: + case GROUP_MAKE_FAILED_SAMENAME: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(78)), 0xFF, 0, 0, 0); break; - case 2: + case GROUP_MAKE_FAILED_ALEADY_GROUP_MEMBER: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(79)), 0xFF, 0, 0, 0); break; case 3: @@ -22198,7 +22199,7 @@ void CGameMode::ProcessIncomingPackets() { break; } break; - case 0xFE: + case ID_ZC_REQ_JOIN_GROUP: case ID_ZC_PARTY_JOIN_REQ: { char name[25]; strncpy(name, reinterpret_cast(g_gameModePacketBuffer + 6), 24); @@ -22211,7 +22212,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.EnsureWindow(35)->SendMsg(nullptr, 56, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); break; } - case 0x101: { + case ID_ZC_GROUPINFO_CHANGE: { char text[128]; g_session.unknown_54A0 = *reinterpret_cast(g_gameModePacketBuffer + 2); if (g_windowMgr.unknown_030C) { @@ -22228,7 +22229,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.SendNotice(1, reinterpret_cast(text), 0xFFFF, 12, 0, 0); break; } - case 0x106: { + case ID_ZC_NOTIFY_HP_TO_GROUPM_0106: { const std::uint32_t aid = *reinterpret_cast(g_gameModePacketBuffer + 2); if (g_session.IsMercenaryAid(aid)) { break; @@ -22287,7 +22288,7 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_SKILLINFO_LIST: case ID_ZC_HOSKILLINFO_LIST: - case 0x29D: { + case ID_ZC_MER_SKILLINFO_LIST: { std::vector skills; const int count = static_cast((*reinterpret_cast(g_gameModePacketBuffer + 2) - 4u) / sizeof(SkillListRecord)); const SkillListRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -22315,7 +22316,7 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(packet + 0x0C), *reinterpret_cast(packet + 8)); break; } - case 0x119: { + case ID_ZC_STATE_CHANGE_0119: { const unsigned char *packet = g_gameModePacketBuffer; int state[4]; state[0] = *reinterpret_cast(packet + 6); @@ -22345,13 +22346,13 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x11A: { + case ID_ZC_USE_SKILL_011a: { const unsigned char *packet = g_gameModePacketBuffer; this->ReceiveSkillUse(*reinterpret_cast(packet + 2), *reinterpret_cast(packet + 4), *reinterpret_cast(packet + 0x0A), *reinterpret_cast(packet + 6), packet[0x0E]); break; } - case 0x11C: { + 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); @@ -22449,7 +22450,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1740Window(); break; } - case 0x124: { + case ID_ZC_ADD_ITEM_TO_CART_0124: { const unsigned char *packet = g_gameModePacketBuffer; ITEM_INFO item; item.unknown_0000[1] = *reinterpret_cast(packet + 2); @@ -22523,7 +22524,7 @@ void CGameMode::ProcessIncomingPackets() { actor->SendMsg(nullptr, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; - case 0x137: + case ID_ZC_DELETEITEM_FROM_MCSTORE_0137: ProcessVendingSale(_time32(nullptr), *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 4), 0, 0); break; @@ -22558,10 +22559,10 @@ void CGameMode::ProcessIncomingPackets() { g_session.SetUnknown16EC(*reinterpret_cast(g_gameModePacketBuffer + 2)); *reinterpret_cast(&this->unknown_0100[0x04]) = timeGetTime() - 2000; break; - case 0x13D: + case ID_ZC_RECOVERY_013d: this->ReceiveHpSpRecovery(g_gameModePacketBuffer, 0); break; - case 0x13E: + case ID_ZC_USESKILL_ACK_013e: this->ProcessSkillUsePacket(g_gameModePacketBuffer, 0); break; case ID_ZC_OPEN_EDITDLG: { @@ -22586,7 +22587,7 @@ void CGameMode::ProcessIncomingPackets() { this->unknown_01C4[id].tick = timeGetTime(); break; } - case 0x145: { + case ID_ZC_SHOW_IMAGE_0145: { char name[17]; strncpy(name, reinterpret_cast(g_gameModePacketBuffer + 2), 16); int index = g_gameModePacketBuffer[0x12]; @@ -22629,15 +22630,15 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x14A: + case ID_ZC_ACK_GIVE_MANNER_POINT: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { - case 0: + case MP_SUCCESS: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(854)), 0xFFFF00, 0, 0, 0); break; - case 3: + case MP_SUCCESS_BY_ADMIN: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(830)), 0xFFFF, 0, 0, 0); break; - case 4: + case MP_BYSELF: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(833)), 0xFFFF, 0, 0, 0); break; } @@ -22656,7 +22657,7 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_GUILD_MENUINTERFACE: g_guildInfo.unknown_00A4 = *reinterpret_cast(g_gameModePacketBuffer + 2); break; - case 0x152: { + case ID_ZC_GUILD_EMBLEM_IMG_0152: { const unsigned char *packet = g_gameModePacketBuffer; const std::uint32_t guildId = *reinterpret_cast(packet + 4); const int version = *reinterpret_cast(packet + 8); @@ -22686,16 +22687,16 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_ACK_DISORGANIZE_GUILD_RESULT: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { - case 0: + 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); break; - case 1: + case DISRESULT_INVALIDKEY: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(401)), 0xFFFF, 0, 0, 0); break; - case 2: + case DISRESULT_MEMBEREXIST: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(402)), 0xFFFF, 4, 0, 0); break; } @@ -22714,19 +22715,19 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_RESULT_MAKE_GUILD: switch (g_gameModePacketBuffer[2]) { - case 0: + 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); break; - case 1: + case GM_ALREADY_MEMBER: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(375)), 0xFFFF, 4, 0, 0); break; - case 2: + case GM_GUILD_EXIST: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(376)), 0xFFFF, 4, 0, 0); break; - case 3: + case GM_NONE_ITEM: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(405)), 0xFFFF, 4, 0, 0); break; case 4: @@ -22737,16 +22738,16 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_REQ_JOIN_GUILD: g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); switch (g_gameModePacketBuffer[2]) { - case 0: + case REQJOINGUILD_ALREADY_OTHERGUILDM: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(378)), 0xFF, 4, 0, 0); break; - case 1: + case REQJOINGUILD_REJECT: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(379)), 0xFF, 4, 0, 0); break; - case 2: + case REQJOINGUILD_ACCEPT: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(380)), 0xFFFF00, 4, 0, 0); break; - case 3: + case REQJOINGUILD_OVERSIZE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(381)), 0xFF, 4, 0, 0); break; case 4: @@ -22765,7 +22766,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.EnsureWindow(70)->SendMsg(nullptr, 73, *reinterpret_cast(g_gameModePacketBuffer + 2), reinterpret_cast(name), 0, 0); break; } - case 0x16C: { + case ID_ZC_UPDATE_GDID_016c: { const unsigned char *packet = g_gameModePacketBuffer; const int flags = *reinterpret_cast(packet + 0x0A); const std::uint32_t guildId = *reinterpret_cast(packet + 2); @@ -22784,7 +22785,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x16D: { + case ID_ZC_UPDATE_CHARSTAT_016d: { const unsigned char *packet = g_gameModePacketBuffer; const int online = *reinterpret_cast(packet + 0x0A); g_guildInfo.SetMemberOnline(*reinterpret_cast(packet + 2), online); @@ -22810,19 +22811,19 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_ACK_REQ_ALLY_GUILD: switch (g_gameModePacketBuffer[2]) { - case 0: + case REQALLYGUILD_ALREADY_ALLIED: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(394)), 0xFFFF, 4, 0, 0); break; - case 1: + case REQALLYGUILD_REJECT: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(395)), 0xFFFF, 4, 0, 0); break; - case 2: + case REQALLYGUILD_ACCEPT: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(396)), 0xFFFF00, 4, 0, 0); break; - case 3: + case REQALLYGUILD_OVERSIZE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(397)), 0xFFFF, 4, 0, 0); break; - case 4: + case REQMYGUILD_OVERSIZE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(398)), 0xFFFF, 4, 0, 0); break; case 5: @@ -22830,7 +22831,7 @@ void CGameMode::ProcessIncomingPackets() { break; } break; - case 0x177: { + 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); @@ -22846,19 +22847,19 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_ACK_ITEMIDENTIFY: switch (g_gameModePacketBuffer[4]) { - case 0: { + case ITEMIDENTIFY_SUCCESS: { g_windowMgr.SendNotice(1, 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 1: + case ITEMIDENTIFY_FAIL: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(492)), 0xFF, 0, 0, 0); break; } break; - case 0x17B: { + 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); @@ -22875,13 +22876,13 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_ACK_REQ_HOSTILE_GUILD: switch (g_gameModePacketBuffer[2]) { - case 0: + case RESULT_HOSTILE_SUCCESS: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(495)), 0xFFFF00, 4, 0, 0); break; - case 1: + case RESULT_HOSTILE_OVERSIZE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(496)), 0xFF, 4, 0, 0); break; - case 2: + case RESULT_HOSTILE_ALREADY_HOSTILE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(497)), 0xFF, 4, 0, 0); break; case 3: @@ -22896,7 +22897,7 @@ void CGameMode::ProcessIncomingPackets() { break; case ID_ZC_NOTIFY_MAPINFO: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { - case 0: + 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); break; @@ -22904,24 +22905,24 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); g_windowMgr.SendNotice(19, reinterpret_cast(LookupMessage(501)), 0xFFFF00, 0, 0, 0); break; - case 2: + 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); break; - case 3: + 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); break; } break; - case 0x18B: + case ID_ZC_ACK_REQ_DISCONNECT: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { - case 0: + case DISCONNECTABLE_STATE: GetRagConnection().Close(); this->SendMsg(2, 0, 0, 0, 0); break; - case 1: + case NOTDISCONNECTABLE_STATE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(502)), 0xFF, 0, 0, 0); break; } @@ -22960,12 +22961,12 @@ void CGameMode::ProcessIncomingPackets() { const_cast(mode->scene->terrain->CellAt(column, row))->type = *reinterpret_cast(g_gameModePacketBuffer + 6); break; } - case 0x194: + case ID_ZC_ACK_REQNAME_BYGID_0194: SetPlayerName( *reinterpret_cast(g_gameModePacketBuffer + 2), std::string(reinterpret_cast(g_gameModePacketBuffer + 6), reinterpret_cast(g_gameModePacketBuffer + 0x1E)).c_str()); break; - case 0x199: + case ID_ZC_NOTIFY_MAPPROPERTY: g_serviceOptions.Set(229, *reinterpret_cast(g_session.unknown_5454) != 0); switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case MAPPROPERTY_FREEPVPZONE: @@ -23022,7 +23023,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.unknown_1040 = value; break; } - case 0x1A6: { + 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); @@ -23114,7 +23115,7 @@ void CGameMode::ProcessIncomingPackets() { this->SendMsg(100, reinterpret_cast(name), position, 0, 0); break; } - case 0x1B4: + case ID_ZC_CHANGE_GUILD_01b4: if (CGameActor *actor = static_cast(this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2)))) { actor->SetGuildInfo(*reinterpret_cast(g_gameModePacketBuffer + 6), *reinterpret_cast(g_gameModePacketBuffer + 0xA)); } @@ -23150,7 +23151,7 @@ void CGameMode::ProcessIncomingPackets() { case 0x1C7: ShowErrorDialog(GetRenderSystemHolder()->system, "No Packet Encryption !!!", 0); break; - case 0x1C8: { + case ID_ZC_USE_ITEM_ACK2: { if (*reinterpret_cast(g_gameModePacketBuffer + 8) == g_session.m_aid) { this->unknown_02CC = 0; if (g_gameModePacketBuffer[0xE]) { @@ -23175,7 +23176,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x1CD: { + case ID_ZC_AUTOSPELLLIST_01cd: { char count = 0; for (const int *skill = reinterpret_cast(g_gameModePacketBuffer + 2); skill < reinterpret_cast(g_gameModePacketBuffer + 0x1E); ++skill) { @@ -23248,7 +23249,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x1E2: { + case ID_ZC_REQ_COUPLE: { char name[25]; strncpy(name, reinterpret_cast(g_gameModePacketBuffer + 0xA), 24); name[24] = 0; @@ -23276,7 +23277,7 @@ void CGameMode::ProcessIncomingPackets() { actor->SetUnknown02E4(1); } break; - case 0x1EE: { + case 0x1ee: { g_session.KeepEquipment(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(CardItemRecord); const CardItemRecord *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -23299,7 +23300,7 @@ void CGameMode::ProcessIncomingPackets() { RefreshItemWindows(&g_windowMgr); break; } - case 0x1EF: { + case 0x1ef: { 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) { @@ -23372,7 +23373,7 @@ void CGameMode::ProcessIncomingPackets() { this->exchangeName.assign(name, strlen(name)); break; } - case 0x1F6: { + case ID_ZC_REQ_BABY: { char name[25]; strncpy(name, reinterpret_cast(g_gameModePacketBuffer + 0xA), 24); name[24] = 0; @@ -23382,7 +23383,7 @@ void CGameMode::ProcessIncomingPackets() { 0); break; } - case 0x1FC: { + case ID_ZC_REPAIRITEMLIST_01fc: { const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / 23; if (count == 0) { g_windowMgr.Confirm(LookupMessage(424), 0, true, false, 0, "Message", 280, 120, 0); @@ -23398,10 +23399,10 @@ void CGameMode::ProcessIncomingPackets() { } case ID_ZC_ACK_ITEMREPAIR: switch (g_gameModePacketBuffer[4]) { - case 0: + case ITEMREPAIR_SUCCESS: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(813)), 0xFFFF00, 0, 0, 0); break; - case 1: + case ITEMREPAIR_FAIL: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(814)), 0xFF, 0, 0, 0); break; } @@ -23439,7 +23440,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshWindow02C8(); } break; - case 0x207: { + case ID_ZC_REQ_ADD_FRIENDS: { char name[25]; strncpy(name, reinterpret_cast(g_gameModePacketBuffer + 0xA), 24); name[24] = 0; @@ -23453,7 +23454,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x209: + case ID_ZC_ADD_FRIENDS_LIST: ReceiveFriendAddResult(g_gameModePacketBuffer); break; case 0x20A: @@ -23461,7 +23462,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshWindow02C8(); } break; - case 0x216: + case ID_ZC_BABYMSG: switch (*reinterpret_cast(g_gameModePacketBuffer + 2)) { case 0: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(899)), 0x9B9BFF, 0, 0, 0); @@ -23519,7 +23520,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x253: + case ID_ZC_STARPLACE: g_windowMgr.EnsureWindow(119)->SendMsg(nullptr, 91, static_cast(g_gameModePacketBuffer[2]), 0, 0, 0); break; case ID_ZC_MAKINGITEM_LIST: { @@ -23536,7 +23537,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x2B4: { + case ID_ZC_DEL_QUEST: { std::string title = g_renewQuestMgr->GetOngoingQuest(*reinterpret_cast(g_gameModePacketBuffer + 2)).m_title; CRenewQuestMgr *manager = g_renewQuestMgr; unsigned int id = *reinterpret_cast(g_gameModePacketBuffer + 2); @@ -23546,7 +23547,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.SendNotice(1, reinterpret_cast(message.c_str()), 0xFFFF, 19, 0, 0); break; } - case 0x2B7: + case ID_ZC_ACTIVE_QUEST: g_renewQuestMgr->SetOngoingQuestState(*reinterpret_cast(g_gameModePacketBuffer + 2), g_gameModePacketBuffer[6]); g_renewQuestMgr->UpdateQuestWindows(); break; @@ -23559,7 +23560,7 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x2DD: + case ID_ZC_BATTLEFIELD_NOTIFY_CAMPINFO: if (*reinterpret_cast(g_gameModePacketBuffer + 2) == g_session.m_aid) { g_session.unknown_0F24[0] = g_gameModePacketBuffer[0x1E]; break; @@ -23575,17 +23576,17 @@ void CGameMode::ProcessIncomingPackets() { } } break; - case 0x2DE: + case ID_ZC_BATTLEFIELD_NOTIFY_POINT: g_session.m_score1 = *reinterpret_cast(g_gameModePacketBuffer + 2); g_session.m_score2 = *reinterpret_cast(g_gameModePacketBuffer + 4); break; - case 0x2DF: + 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), *reinterpret_cast(g_gameModePacketBuffer + 0x22), 0); } break; - case 0x2E0: + case ID_ZC_BATTLEFIELD_NOTIFY_HP_02e0: if (g_session.IsCompanionAid(*reinterpret_cast(g_gameModePacketBuffer + 2))) { break; } @@ -23595,7 +23596,7 @@ void CGameMode::ProcessIncomingPackets() { actor->SendMsg(nullptr, 34, 0, x, x >> 31, y, y >> 31, 0, 0, 0, 0, 0, 0, 0, 0); } break; - case 0x2E1: + case ID_ZC_NOTIFY_ACT2: this->ReceiveActorAction( *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 6), *reinterpret_cast(g_gameModePacketBuffer + 0xA), *reinterpret_cast(g_gameModePacketBuffer + 0xE), @@ -23603,7 +23604,7 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_gameModePacketBuffer + 0x1A), g_gameModePacketBuffer[0x1C], *reinterpret_cast(g_gameModePacketBuffer + 0x1D), 0); break; - case 0x2E8: { + case 0x2e8: { g_session.KeepEquipment(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(CardItemExpiryRecord); const CardItemExpiryRecord *entry = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -23628,7 +23629,7 @@ void CGameMode::ProcessIncomingPackets() { RefreshItemWindows(&g_windowMgr); break; } - case 0x2E9: { + case 0x2e9: { 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) { @@ -23652,7 +23653,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1740Window(); break; } - case 0x2EA: { + case 0x2ea: { g_windowMgr.EnsureWindow(33); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(CardItemExpiryRecord); const CardItemExpiryRecord *entry = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -23677,14 +23678,14 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1738Window(); break; } - case 0x2EF: + case ID_ZC_NOTIFY_FONT: if (*reinterpret_cast(g_gameModePacketBuffer + 2) == g_session.m_aid) { g_session.unknown_0F30[0] = g_gameModePacketBuffer[6]; } else if (CRenderObject *actor = this->scene->GetGameActorByAID(*reinterpret_cast(g_gameModePacketBuffer + 2))) { *reinterpret_cast(actor->render.unknown_00ECBytes) = *reinterpret_cast(g_gameModePacketBuffer + 6); } break; - case 0x2F0: + 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); g_session.unknown_555C[0x0A] = true; @@ -23765,7 +23766,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.SendNotice(1, reinterpret_cast(message), 0xFFCDCD, 11, 0, 0); break; } - case 0x7FB: + case ID_ZC_USESKILL_ACK2: this->ProcessSkillUsePacket(g_gameModePacketBuffer, 1); break; case 0x85A: { @@ -24170,15 +24171,15 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 0x80F: + case ID_ZC_ADD_EXCHANGE_ITEM2: ReceiveItemSlot(g_gameModePacketBuffer); break; case ID_ZC_SSILIST_ITEM_CLICK_ACK: g_session.unknown_5BE8 = *reinterpret_cast(g_gameModePacketBuffer + 2); g_session.unknown_5BEC = *reinterpret_cast(g_gameModePacketBuffer + 4); break; - case 0x845: - case 0xA2B: + 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), @@ -24189,7 +24190,7 @@ void CGameMode::ProcessIncomingPackets() { } } break; - case 0x84B: { + case ID_ZC_ITEM_FALL_ENTRY4: { const unsigned char *packet = g_gameModePacketBuffer; ItemFallEntry entry = {}; entry.count = *reinterpret_cast(packet + 0x13); @@ -24228,11 +24229,11 @@ void CGameMode::ProcessIncomingPackets() { this->StopActorMove(packet->aid, packet->x, packet->y, 1); break; } - case 0x8D0: { + case ID_ZC_REQ_WEAR_EQUIP_ACK2: { const unsigned char *packet = g_gameModePacketBuffer; *reinterpret_cast(&this->unknown_0100[0x04]) = timeGetTime() - 2000; switch (packet[8]) { - case 0: { + case ITEM_EQUIP_ACK_OK: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, *reinterpret_cast(packet + 2)); if (item.unknown_0000[1]) { item.unknown_0070 = *reinterpret_cast(packet + 6); @@ -24241,13 +24242,13 @@ void CGameMode::ProcessIncomingPackets() { } break; } - case 1: + case ITEM_EQUIP_ACK_FAILLEVEL: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(1953)), 0xFF, 7, 0, 0); break; } break; } - case 0x8D1: { + case ID_ZC_REQ_TAKEOFF_EQUIP_ACK2: { const unsigned char *packet = g_gameModePacketBuffer; *reinterpret_cast(&this->unknown_0100[0x08]) = timeGetTime() - 2000; switch (packet[6]) { @@ -24318,13 +24319,13 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_ACK_WHISPER: this->ReceiveWhisperResult(g_gameModePacketBuffer[0x2], *reinterpret_cast(g_gameModePacketBuffer + 0x3)); break; - case 0x9E6: + case ID_ZC_UPDATE_ITEM_FROM_BUYING_STORE2: ReceiveBuyingStorePurchase(g_gameModePacketBuffer); break; - case 0x9FC: + case ID_ZC_PET_EVOLUTION_RESULT: this->NotifyResult2571(*reinterpret_cast(g_gameModePacketBuffer + 0x2)); break; - case 0xA09: + case ID_ZC_ADD_EXCHANGE_ITEM3: ReceiveItemSlotOptions(g_gameModePacketBuffer); break; case achievementRewardAckType: @@ -24336,10 +24337,10 @@ void CGameMode::ProcessIncomingPackets() { case 0xA29: this->ReceivePacket0A29(*reinterpret_cast(g_gameModePacketBuffer + 0x2)); break; - case 0xA2F: + case ID_ZC_ACK_CHANGE_TITLE: this->ReceiveJobTitle(g_gameModePacketBuffer[0x2], *reinterpret_cast(g_gameModePacketBuffer + 0x3)); break; - case 0xA38: + case ID_ZC_UI_OPEN_0a38: this->OpenServiceWindow(g_gameModePacketBuffer[0x2]); break; case 0xA3A: @@ -24522,12 +24523,12 @@ void CGameMode::ProcessIncomingPackets() { case ID_ZC_DIALOG_WINDOW_POS: this->MoveWindow16(*reinterpret_cast(g_gameModePacketBuffer + 0x2), *reinterpret_cast(g_gameModePacketBuffer + 0x6)); break; - case 0xBAA: + case ID_ZC_BATTLEFIELD_NOTIFY_HP_0baa: this->RejectRequest(*reinterpret_cast(g_gameModePacketBuffer + 0x2), *reinterpret_cast(g_gameModePacketBuffer + 0x6), *reinterpret_cast(g_gameModePacketBuffer + 0xA), *reinterpret_cast(g_gameModePacketBuffer + 0xE), *reinterpret_cast(g_gameModePacketBuffer + 0x12)); break; - case 0xBAB: + case ID_ZC_NOTIFY_HP_TO_GROUPM_0bab: this->IgnoreRemovedPacket12(reinterpret_cast(*reinterpret_cast(g_gameModePacketBuffer + 0x2)), *reinterpret_cast(g_gameModePacketBuffer + 0x6), *reinterpret_cast(g_gameModePacketBuffer + 0xA), *reinterpret_cast(g_gameModePacketBuffer + 0xE), *reinterpret_cast(g_gameModePacketBuffer + 0x12)); @@ -24636,12 +24637,12 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_gameModePacketBuffer + 8), *reinterpret_cast(g_gameModePacketBuffer + 4)); break; - case 0xB09: + case 0xb09: this->ReceiveItemListPart(g_gameModePacketBuffer[4], static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 5) / 34, g_gameModePacketBuffer + 5); break; - case 0xB0A: + case 0xb0a: this->ReceiveEquipListPart(g_gameModePacketBuffer[4], static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 5) / 67, g_gameModePacketBuffer + 5); @@ -24769,14 +24770,14 @@ void CGameMode::ProcessIncomingPackets() { reinterpret_cast(g_gameModePacketBuffer + 0x15), *reinterpret_cast(g_gameModePacketBuffer + 0x3D), g_gameModePacketBuffer[0x41]); break; - case 0xB33: + case ID_ZC_SKILLINFO_UPDATE3: this->ReceiveSkillUpdate( *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 8), *reinterpret_cast(g_gameModePacketBuffer + 0xA), g_gameModePacketBuffer[0xE], *reinterpret_cast(g_gameModePacketBuffer + 0xC), *reinterpret_cast(g_gameModePacketBuffer + 4), *reinterpret_cast(g_gameModePacketBuffer + 0xF)); break; - case 0xB31: + case ID_ZC_ADD_SKILL2: this->ReceiveLearnedSkill( *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 8), *reinterpret_cast(g_gameModePacketBuffer + 4), g_gameModePacketBuffer[0xE], @@ -24811,12 +24812,12 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_gameModePacketBuffer + 0x22), *reinterpret_cast(g_gameModePacketBuffer + 0x24)); break; } - case 0xAB9: + case ID_ZC_CHANGE_ITEM_OPTION_0ab9: this->ReceiveItemUpgrade( *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 4), *reinterpret_cast(g_gameModePacketBuffer + 6), *reinterpret_cast(g_gameModePacketBuffer + 0x16)); break; - case 0xB13: + case ID_ZC_CHANGE_ITEM_OPTION_0b13: this->RefreshInventoryOrEquipItem(*reinterpret_cast(g_gameModePacketBuffer + 2), g_gameModePacketBuffer[4], *reinterpret_cast(g_gameModePacketBuffer + 5), *reinterpret_cast(g_gameModePacketBuffer + 7), @@ -24837,7 +24838,7 @@ void CGameMode::ProcessIncomingPackets() { } } break; - case 0x990: + case ID_ZC_ITEM_PICKUP_ACK_V5: this->ReceiveItemPickupAck5( *reinterpret_cast(g_gameModePacketBuffer + 2), *reinterpret_cast(g_gameModePacketBuffer + 4), *reinterpret_cast(g_gameModePacketBuffer + 6), g_gameModePacketBuffer[0xA], g_gameModePacketBuffer[0xB], g_gameModePacketBuffer[0xC], @@ -24943,7 +24944,7 @@ void CGameMode::ProcessIncomingPackets() { *reinterpret_cast(g_gameModePacketBuffer + 0x21), *reinterpret_cast(g_gameModePacketBuffer + 0x23), reinterpret_cast(g_gameModePacketBuffer + 0x25), *reinterpret_cast(g_gameModePacketBuffer + 0x3D)); break; - case 0xB32: { + case ID_ZC_SKILLINFO_LIST3: { std::vector skills; const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / sizeof(SkillListEntry); const SkillListEntry *record = reinterpret_cast(g_gameModePacketBuffer + 4); @@ -25186,7 +25187,7 @@ void CGameMode::ProcessIncomingPackets() { g_session.RefreshItem1738Window(); break; } - case 0xB76: + case ID_ZC_PROPERTY_HOMUN_0b76: StringFormat(reinterpret_cast(g_session.unknown_5570 + 0xC), 32, static_cast(-1), "%s", reinterpret_cast(g_gameModePacketBuffer + 2)); g_session.unknown_55F8 = g_gameModePacketBuffer[0x1A]; @@ -25231,7 +25232,7 @@ void CGameMode::ProcessIncomingPackets() { } reinterpret_cast(g_session.unknown_5620)[1] = *reinterpret_cast(g_gameModePacketBuffer + 0x4B); break; - case 0xB0E: { + case ID_ZC_NPC_BARTER_MARKET_ITEMINFO_0b0e: { g_barterMarketItemMgr->Clear(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / 25; const unsigned char *record = g_gameModePacketBuffer + 4; @@ -25254,7 +25255,7 @@ void CGameMode::ProcessIncomingPackets() { g_windowMgr.EnsureWindow(335)->SendMsg(nullptr, 23, 0, 0, 0, 0); break; } - case 0x9D5: { + case ID_ZC_NPC_MARKET_OPEN_09d5: { g_session.ClearTradeItems(); const int count = static_cast(*reinterpret_cast(g_gameModePacketBuffer + 2) - 4) / 15; const unsigned char *record = g_gameModePacketBuffer + 4; diff --git a/Source/Client/Mode/GameModeSounds.cpp b/Source/Client/Mode/GameModeSounds.cpp index 99d3b18e0..c96590659 100644 --- a/Source/Client/Mode/GameModeSounds.cpp +++ b/Source/Client/Mode/GameModeSounds.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Network/Packets/NoticeEnums.h" #include "Contents/Actors/Pc.h" #include "Contents/Actors/RenderObject.h" #include "Contents/Sound/SoundMgr.h" @@ -28,7 +29,7 @@ void CGameMode::ReceiveSound(const unsigned char* data) { const SoundPacket* packet = reinterpret_cast(data); switch (packet->act) { - case 0: { + case SOUND_ACT_PLAY: { CRenderObject* actor = this->scene->GetGameActorByAID(packet->npcId); if (actor != nullptr) { CPlayer* player = this->scene->player; @@ -40,7 +41,7 @@ void CGameMode::ReceiveSound(const unsigned char* data) { } break; } - case 1: { + case SOUND_ACT_REPEAT: { GameModeLoopSound sound; sound.name = packet->name; sound.term = packet->term; @@ -50,7 +51,7 @@ void CGameMode::ReceiveSound(const unsigned char* data) { g_soundMgr->PlayWave(packet->name, 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); break; } - case 2: + case SOUNT_ACT_STOP: for (std::vector::iterator it = this->loopSounds.begin(); it != this->loopSounds.end(); ++it) { GameModeLoopSound sound = *it; if (std::strcmp(sound.name.c_str(), packet->name) == 0) { diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index a04052db5..500fae273 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -1,4 +1,6 @@ #include "Client/Mode/CLoginMode.h" +#include "Client/Mode/ModeMessage.h" +#include "Contents/Configuration/ServiceEnums.h" #include "Network/Packets/PacketId.h" #include "Network/Packets/ModeResultEnums.h" #include "Utility/EncryptedName.h" @@ -483,13 +485,13 @@ int GetClientType() { switch (g_serviceType) { case 1: return 14; - case 2: + case ServiceJapan: return 9; - case 3: + case ServiceChina: return 4; - case 4: + case ServiceTaiwan: return 5; - case 5: + case ServiceThai: return 7; case 6: return 13; @@ -507,11 +509,11 @@ int GetClientType() { return 22; case 13: return 23; - case 15: + case ServiceVietnam: return 33; case 19: return 35; - case 14: + case ServiceRussia: return 25; case 20: return 36; @@ -523,11 +525,11 @@ int GetClientType() { switch (g_serviceType) { case 7: return 27; - case 2: + case ServiceJapan: return 28; - case 5: + case ServiceThai: return 29; - case 15: + case ServiceVietnam: return 32; case 6: return 34; @@ -539,13 +541,13 @@ int GetClientType() { switch (g_serviceType) { case 1: return 1; - case 2: + case ServiceJapan: return 3; - case 3: + case ServiceChina: return 4; - case 4: + case ServiceTaiwan: return 5; - case 5: + case ServiceThai: return 7; case 6: return 12; @@ -563,11 +565,11 @@ int GetClientType() { return 22; case 13: return 23; - case 14: + case ServiceRussia: return 25; - case 15: + case ServiceVietnam: return 26; - case 17: + case ServiceChile: return 30; case 18: return 31; @@ -1199,7 +1201,7 @@ void CLoginMode::SubD97F00(int) { // FUNCTION: fn_22308 void CLoginMode::OpenAccountRegistration() { switch (g_serviceType) { - case 0: + case ServiceKorea: if (*reinterpret_cast(&g_session.unknown_59DC[0x198]) == 1) { const char* url = LookupMessage(1308); const char source[] = {'\x30', '\x45', '\xCA', '\xFB', '\x9D'}; @@ -1220,9 +1222,9 @@ void CLoginMode::OpenAccountRegistration() { ShellExecuteA(hWnd, DecryptName<0x17A9E5BF39AD4737ULL>(source), file, nullptr, nullptr, SW_SHOWNORMAL); break; } - case 2: + case ServiceJapan: break; - case 3: { + case ServiceChina: { const char urlSource[] = {'\x2B', '\x5D', '\x27', '\x57', '\xEF', '\x90', '\x66', '\xED', '\x6D', '\x42', '\x26', '\x49', '\xB9', '\xCA', '\x27', '\xB7', '\x20', '\x46', '\x3E', '\x08', '\xEA', '\xDE', '\x2A', '\xED', '\x7E', '\x5F', '\x3C', '\x52', '\xB6', '\xD7', '\x2C', '\xEB', '\x6D', '\x44', '\x32', '\x4E', '\xBB', '\x99', '\x2A', '\xF0', '\x27', '\x14', '\x62', '\x17', '\xE5', '\x8F', '\x6F', '\xE9', @@ -2010,10 +2012,10 @@ void CLoginMode::ShowLoginError(int code, int argument) { case 33: message = LookupMessage(0xA7A); break; - case 0: + case REFUSE_INVALID_ID: message = LookupMessage(6); break; - case 1: + case REFUSE_INVALID_PASSWD: if (g_serviceType == 0 && ++g_loginFailCount >= 3) { message = std::string(PasswordRetryExceededMessage{}().Text()); if (g_windowMgr.Confirm(message.c_str(), 0, true, true, 0, "Message", 280, 120, 0) == 0xB8) { @@ -2037,66 +2039,66 @@ void CLoginMode::ShowLoginError(int code, int argument) { message = LookupMessage(0x10B); } break; - case 2: + case REFUSE_ID_EXPIRED: message = LookupMessage(8); break; - case 4: + case REFUSE_NOT_CONFIRMED: case 0x13C6: message = LookupMessage(0x10A); break; - case 5: + case REFUSE_INVALID_VERSION: message = LookupMessage(0x136); break; - case 99: + case REFUSE_DELETED_ACCOUNT: message = LookupMessage(0x170); break; - case 6: { + case REFUSE_BLOCK_TEMPORARY: { const std::string text = FormatOwnedString(LookupMessage(0x1C1), argument); message = text; break; } - case 101: { + case REFUSE_TEMP_BAN_HACKING_INVESTIGATION: { const std::string text = FormatOwnedString(LookupMessage(0x32A), argument); message = text; break; } - case 102: + case REFUSE_TEMP_BAN_BUG_INVESTIGATION: message = LookupMessage(0x32B); break; - case 103: + case REFUSE_TEMP_BAN_DELETING_CHAR: message = LookupMessage(0x35B); break; - case 104: + case REFUSE_TEMP_BAN_DELETING_SPOUSE_CHAR: message = LookupMessage(0x35C); break; case 7: message = LookupMessage(0x1B7); break; - case 8: + case REFUSE_NONSAKRAY_ID_BLOCKED: message = LookupMessage(0x2A9); break; - case 9: + case REFUSE_BAN_BY_DBA: message = LookupMessage(0x2BF); break; - case 10: + case REFUSE_EMAIL_NOT_CONFIRMED: message = LookupMessage(0x2C0); break; - case 11: + case REFUSE_BAN_BY_GM: message = LookupMessage(0x2C1); break; - case 12: + case REFUSE_TEMP_BAN_FOR_DBWORK: message = LookupMessage(0x2C2); break; - case 13: + case REFUSE_SELF_LOCK: message = LookupMessage(0x2C3); break; - case 14: + case REFUSE_NOT_PERMITTED_GROUP: message = LookupMessage(0x2C4); break; - case 15: + case REFUSE_WAIT_FOR_SAKRAY_ACTIVE: message = LookupMessage(0x2C5); break; - case 100: { + case REFUSE_ALREADY_CONNECT: { const std::string text = FormatOwnedString(LookupMessage(0x329), argument); message = text; break; @@ -2121,10 +2123,10 @@ void CLoginMode::ShowLoginError(int code, int argument) { message.clear(); } break; - case 106: + case ACCEPT_LOGIN_USER_PHONE_BLOCK: message = LookupMessage(0x50D); break; - case 105: + case REFUSE_USER_PHONE_BLOCK: message = LookupMessage(0x55C); break; case 17: { @@ -2416,13 +2418,13 @@ void CLoginMode::PollNetworkStatus() { while (GetRagConnection().ReadPacket(g_gameModePacketBuffer, nullptr, g_packetLengths)) { switch (GetRagConnection().GetPacketType(reinterpret_cast(g_gameModePacketBuffer))) { - case 0x69: - case 0x6D: + case ID_AC_ACCEPT_LOGIN_V1: + case ID_HC_ACCEPT_MAKECHAR_V1: case ID_PING: case 0x283: case 0x8E3: case 0x8E4: - case 0x99D: + case ID_HC_ACK_CHARINFO_PER_PAGE_V1: case 0x9C2: case 0xA4D: case 0xA73: @@ -2431,7 +2433,7 @@ void CLoginMode::PollNetworkStatus() { case 0xAE0: case 0xC20: break; - case 0x6A: { + case ID_AC_REFUSE_LOGIN_V1: { RefuseLoginPacket* packet = reinterpret_cast(g_gameModePacketBuffer); packet->blockDate[19] = '\0'; this->ShowLoginError(packet->result, reinterpret_cast(packet->blockDate)); @@ -2533,10 +2535,10 @@ void CLoginMode::PollNetworkStatus() { this->pendingCursorType = 7; break; } - case 0x71: + case ID_HC_NOTIFY_ZONESVR_V1: this->ReceiveNotifyZoneServer(reinterpret_cast(g_gameModePacketBuffer)); break; - case 0x73: + case ID_ZC_ACCEPT_ENTER_V1: this->Zc_Accept_Enter2(reinterpret_cast(g_gameModePacketBuffer)); return; case ID_ZC_REFUSE_ENTER: @@ -2625,7 +2627,7 @@ void CLoginMode::PollNetworkStatus() { } break; } - case 0x290: + case ID_HC_ACK_CHANGE_CHARNAME_V1: this->ReceiveCharacterResult(reinterpret_cast(g_gameModePacketBuffer)); break; case 0x2CA: @@ -2789,7 +2791,7 @@ void CLoginMode::PollNetworkStatus() { break; } break; - case 0x8D5: + case ID_HC_ACK_CHANGE_CHARACTER_SLOT_V1: case ID_HC_ACK_CHANGE_CHARACTER_SLOT: if (reinterpret_cast(g_gameModePacketBuffer)->result == 1) { g_windowMgr.Confirm(LookupMessage(0x7E1), 0, true, false, 0, "Message", 280, 120, 0); @@ -2969,38 +2971,38 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, (void)argument4; switch (event) { - case 0: + case MM_COMMAND: switch (argument1) { - case 10001: + case LMM_MAKECHARACTER: this->pendingCursorType = 8; return 0; - case 10002: + case LMM_TRANSFERCHARACTER: this->pendingCursorType = 9; return 0; - case 10004: + case LMM_SELECTCHARACTER: this->pendingCursorType = 7; return 0; - case 10006: + case LMM_CANCEL: if (this->cursorType == 7) { g_windowMgr.Shutdown(); GetRagConnection().Close(); this->pendingCursorType = 6; } return 0; - case 10010: + case LMM_DELETE_CHARACTER: this->pendingCursorType = 11; return 0; default: return 0; } - case 1: + case MM_SOCKETERROR: GetRagConnection().Close(); if (g_windowMgr.Confirm(LookupMessage(2), 0, true, true, 0, "Message", 280, 120, 0) != 0x10D) { g_charServerAccountIdPending = 0; this->pendingCursorType = 3; } return 0; - case 8: + case MM_QUERYCHARICTORINFO: for (int i = 0; i < this->characterCount; ++i) { if (this->characters[i].slot == argument1) { return reinterpret_cast(&this->characters[i]); @@ -3069,10 +3071,10 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, return 0; } return reinterpret_cast(&this->characters[this->characterCount - 1]); - case 10000: + case LMM_CONNECT_TO_ACSVR: this->pendingCursorType = 4; return 0; - case 10003: { + case LMM_SELECTSVR: { *reinterpret_cast(this->unknown_01C8) = argument1; if (argument1 == -1) { return 0; @@ -3104,10 +3106,10 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, this->pendingCursorType = 5; return 0; } - case 10005: + case LMM_SENDCHARINFO: this->pendingCursorType = 10; return 0; - case 10006: + case LMM_CANCEL: if (this->cursorType == 6 || this->cursorType == 27) { GetRagConnection().Close(); g_charServerAccountIdPending = 0; @@ -3118,14 +3120,14 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, this->pendingCursorType = 7; } return 0; - case 10007: + case LMM_PASSWORD: strcpy(reinterpret_cast(this->unknown_0138), reinterpret_cast(argument1)); return 0; - case 10008: + case LMM_ID: strcpy(reinterpret_cast(&this->unknown_0138[0x40]), reinterpret_cast(argument1)); strcpy(reinterpret_cast(g_session.unknown_07F4), reinterpret_cast(argument1)); return 0; - case 10009: { + case LMM_SELECT_CHARACTER: { g_session.unknown_0F50 = static_cast(g_selectedSlotIndex); g_windowMgr.LoadShortcutItems(); for (int i = 0; i < this->characterCount; ++i) { @@ -3206,25 +3208,25 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } return 0; } - case 10011: + case LMM_GOTO_LOGIN: GetRagConnection().Close(); g_charServerAccountIdPending = 0; this->pendingCursorType = 3; return 0; - case 10012: + case LMM_SET_EMAIL_ADDRESS: g_windowMgr.InvalidateAll(); strcpy(reinterpret_cast(this->billingInfo), reinterpret_cast(argument1)); return 0; - case 10013: + case LMM_GET_EMAIL_ADDRESS: return reinterpret_cast(this->billingInfo); - case 10014: + case LMM_GET_MAKING_CHAR_NAME: return reinterpret_cast(&this->unknown_0078); - case 10015: + case LMM_SET_MAKING_CHAR_NAME: strcpy(reinterpret_cast(&this->unknown_0078), reinterpret_cast(argument1)); return 0; - case 10016: + case LMM_GET_CHAR_PARAM: return reinterpret_cast(this->charParams); - case 10017: { + case LMM_SET_CHAR_PARAM: { const int* values = reinterpret_cast(argument1); this->charParams[0] = values[0]; this->charParams[1] = values[1]; @@ -3236,14 +3238,14 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, this->unknown_0074 = values[7]; return 0; } - case 10018: + case LMM_GOTOSELECTACCOUNT: if (argument2 == 201) { g_modeMgr.gameMode->SendMsg(2, 0, 0, 0, 0); return 0; } this->pendingCursorType = 2; return 0; - case 10019: + case LMM_SELECTACCOUNT: this->unknown_6F48 = argument1; *reinterpret_cast(&g_session.unknown_5478[4]) = argument1; TraceSelection(argument1); @@ -3273,7 +3275,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, } this->pendingCursorType = (g_serviceType == 5 || g_serviceType == 7) ? 13 : 3; return 0; - case 10020: { + case LMM_GET_BILLING_INFO: { char* output = reinterpret_cast(argument1); switch (this->slotExtension.unknown_0001) { case 100: @@ -3312,7 +3314,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, return 0; } } - case 10021: + case LMM_DISCONNECT_ACSVR: GetRagConnection().Close(); if (g_windowMgr.Confirm(LookupMessage(1), 0, true, false, 0, "Message", 280, 120, 0) != 0x10D) { this->otpStarted = timeGetTime(); @@ -3320,7 +3322,7 @@ int CLoginMode::SendMsg(int event, int argument1, int argument2, int argument3, this->pendingCursorType = 3; } return 0; - case 10022: + case LMM_SELECTACCOUNT2: this->unknown_6F4C = argument1; this->unknown_6F38.clear(); TraceSelectionRange(this->unknown_6F48, this->unknown_6F4C); diff --git a/Source/Client/Mode/LoginModeNotices.cpp b/Source/Client/Mode/LoginModeNotices.cpp index ca516451e..2e71a0934 100644 --- a/Source/Client/Mode/LoginModeNotices.cpp +++ b/Source/Client/Mode/LoginModeNotices.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CLoginMode.h" +#include "Network/Packets/NoticeEnums.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -151,25 +152,25 @@ void CLoginMode::ReceiveNotifyBan(const unsigned char* data) { GetRagConnection().Close(); switch (errorCode) { - case 0: + case BAN_UNFAIR: strcpy(text, LookupMessage(3)); break; - case 1: + case BAN_SERVER_SHUTDOWN: strcpy(text, LookupMessage(4)); break; - case 2: + case BAN_ANOTHER_LOGIN: strcpy(text, LookupMessage(5)); break; - case 3: + case BAN_DETECTED_SPEEDHACK: strcpy(text, LookupMessage(241)); break; - case 4: + case BAN_PC_OVERFLOW: strcpy(text, LookupMessage(264)); break; - case 5: + case BAN_UNDER_AGE: strcpy(text, LookupMessage(305)); break; - case 6: + case BAN_NOT_SETTLED: strcpy(text, LookupMessage(438)); if (g_windowMgr.Confirm(text, 2, true, true, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.Quit(); @@ -177,55 +178,55 @@ void CLoginMode::ReceiveNotifyBan(const unsigned char* data) { } text[0] = '\0'; break; - case 7: + case BAN_ACCOUNT_BUSY: strcpy(text, LookupMessage(439)); break; - case 8: + case BAN_INFORMATION_REMAINED: strcpy(text, LookupMessage(440)); break; - case 9: + case BAN_IP_OVERFLOW: strcpy(text, LookupMessage(529)); break; - case 10: + case BAN_PAY_OUT: strcpy(text, LookupMessage(530)); break; - case 11: + case BAN_PAY_SUSPEND: strcpy(text, LookupMessage(575)); break; - case 12: + case BAN_PAY_CHANGE: strcpy(text, LookupMessage(576)); break; - case 13: + case BAN_PAY_WRONGIP: strcpy(text, LookupMessage(577)); break; - case 14: + case BAN_PAY_PNGAMEROOM: strcpy(text, LookupMessage(578)); break; - case 16: + case BAN_JAPAN_REFUSE1: strcpy(text, LookupMessage(606)); break; - case 17: + case BAN_JAPAN_REFUSE2: strcpy(text, LookupMessage(607)); break; - case 18: + case BAN_INFORMATION_REMAINED_ANOTHER_ACCOUNT: strcpy(text, LookupMessage(678)); break; - case 100: + case BAN_PC_IP_UNFAIR: strcpy(text, LookupMessage(1123)); break; - case 101: + case BAN_PC_IP_COUNT_ALL: strcpy(text, LookupMessage(1178)); break; - case 102: + case BAN_PC_IP_COUNT: strcpy(text, LookupMessage(1179)); break; - case 103: + case BAN_GRAVITY_MEM_AGREE: strcpy(text, LookupMessage(1309)); break; - case 104: + case BAN_GAME_MEM_AGREE: strcpy(text, LookupMessage(1310)); break; - case 105: + case BAN_HAN_VALID: strcpy(text, LookupMessage(1311)); break; case 107: diff --git a/Source/Client/Mode/ModeMessage.h b/Source/Client/Mode/ModeMessage.h new file mode 100644 index 000000000..a11e07711 --- /dev/null +++ b/Source/Client/Mode/ModeMessage.h @@ -0,0 +1,200 @@ +#ifndef RAGNAROK_SOURCE_CLIENT_MODE_MODEMESSAGE_H +#define RAGNAROK_SOURCE_CLIENT_MODE_MODEMESSAGE_H + +enum MODETYPE : int { + MT_LOGIN = 0, + MT_GAME = 1, +}; + +enum MODEMESSAGE : int { + MM_COMMAND = 0, + MM_SOCKETERROR = 1, + MM_SHOWMOUSEPOINTER = 4, + MM_HIDEMOUSEPOINTER = 5, + MM_CHATMSG = 6, + MM_BROADCASTMSG = 7, + MM_QUERYCHARICTORINFO = 8, + MM_QUERYRSWNAME = 9, + MM_CONTACTNPC = 10, + MM_WHISPERMSG = 11, + MM_ADDREGISTERPOS = 12, + MM_DELETEREGISTERPOS = 13, + MM_DISCONNECT_CHARACTER = 14, + MM_DISCONNECT_ALL_CHARACTER = 15, + MM_ITEMTHROW = 16, + MM_DROP = 17, + MM_CANCEL_DRAG = 18, + MM_WEAR_EQUIP = 19, + MM_TAKE_OFF_EQUIP = 20, + MM_ITEMTHROW_THROUGH_DROPCNTWND = 21, + MM_REQ_NEXT_SCRIPT = 22, + MM_CHOOSE_MENU = 23, + MM_MENUSELECTED = 24, + MM_RESTART = 25, + MM_USEITEM = 27, + MM_REQ_STATUS = 29, + MM_STATUS_CHANGE = 30, + MM_REQ_EMOTION = 31, + MM_REQ_NUM_USER = 32, + MM_REQ_PURCHASE = 34, + MM_REQ_SELL = 35, + MM_ACK_SELL = 37, + MM_ACK_BUY = 38, + MM_TOGGLE_PLAYERGAGE = 41, + MM_PROCESS_TALK_TYPE = 42, + MM_CREATE_CHATROOM = 43, + MM_CHANGE_CHATROOM = 44, + MM_REQ_ENTER_ROOM = 45, + MM_REQ_ROLE_CHANGE = 46, + MM_REQ_EXPEL_MEMBER = 47, + MM_REQ_EXIT_ROOM = 48, + MM_REQ_EXCHANGE_ITEM = 49, + MM_ACK_EXCHANGE_ITEM = 50, + MM_ADD_EXCHANGE_ITEM = 51, + MM_CONCLUDE_EXCHANGE_ITEM = 52, + MM_CANCEL_EXCHANGE_ITEM = 53, + MM_EXEC_EXCHANGE_ITEM = 54, + MM_ADD_ITEM_TO_STORE = 55, + MM_MOVE_ITEM_FROM_STORE_TO_BODY = 56, + MM_REQ_JOIN_GROUP = 59, + MM_JOIN_GROUP = 60, + MM_REQ_LEAVE_GROUP = 61, + MM_REQ_EXPEL_GROUP_MEMBER = 62, + MM_ADDPARTYPOS = 63, + MM_DELETEPARTYPOS = 64, + MM_DELETEPARTYPOSALL = 65, + MM_CHAT_PARTY = 66, + MM_UPGRADE_SKILLLEVEL = 67, + MM_USE_SKILL = 69, + MM_USE_SKILL_TOGROUND = 70, + MM_CANCEL_USE_SKILL = 71, + MM_HANG_USE_SKILL = 72, + MM_CANCEL_LOCKON = 73, + MM_SELECT_WARPPOINT = 74, + MM_REMEMBER_WARPPOINT = 75, + MM_MOVE_ITEM_FROM_BODY_TO_CART = 76, + MM_MOVE_ITEM_FROM_CART_TO_BODY = 77, + MM_MOVE_ITEM_FROM_STORE_TO_CART = 78, + MM_MOVE_ITEM_FROM_CART_TO_STORE = 79, + MM_REQ_CLOSESTORE = 81, + MM_REQ_OPENSTORE = 82, + MM_PC_PURCHASE_ITEMLIST_FROMMC = 83, + MM_REQ_BUY_FROMMC = 84, + MM_MAKE_SKILL_USED_MSG = 86, + MM_CLOSE_DIALOG = 89, + MM_REFRESH_MUSIC = 90, + MM_ITEM_CREATE = 91, + MM_MOVETO_MAP = 92, + MM_USESKILL_LEVEL_PLUS = 93, + MM_USESKILL_LEVEL_MINUS = 94, + MM_GET_SKILL_USE_TYPE = 95, + MM_CHANGE_GROUPEXPOPTION = 96, + MM_GET_SKILL_USE_LEVEL = 97, + MM_SEND_NUMBER_TO_NPC = 99, + MM_SHOW_IMAGE = 100, + MM_SEND_GUILD_EMBLEM = 102, + MM_REQ_CHANGE_MEMBERPOS = 103, + MM_REQ_CHANGE_GUILD_POSITIONINFO = 104, + MM_REQ_GUILD_MENUINTERFACE = 105, + MM_REQ_DISORGANIZE_GUILD = 106, + MM_REQ_GUILD_MENU = 107, + MM_REQ_OPEN_MEMBER_INFO = 109, + MM_REQ_LEAVE_GUILD = 110, + MM_REQ_BAN_GUILD = 111, + MM_REQ_MAKE_GUILD = 112, + MM_JOIN_GUILD = 114, + MM_REQ_JOIN_GUILD = 115, + MM_REQ_GIVE_MANNER_POINT = 117, + MM_GUILD_NOTICE = 118, + MM_REQ_ALLY_GUILD = 119, + MM_ALLY_GUILD = 120, + MM_REQ_ITEMIDENTIFY = 121, + MM_QUAKE = 122, + MM_REQ_ITEMCOMPOSITION_LIST = 123, + MM_REQ_ITEMCOMPOSITION = 124, + MM_REQ_HOSTILE_GUILD = 125, + MM_REQ_DELETE_RELATED_GUILD = 127, + MM_REQ_DISCONNECT = 128, + MM_CHAT_GUILD = 129, + MM_REQ_MAKING_ITEM = 130, + MM_USE_SKILL_TOGROUND_WITH_TALKBOX = 131, + MM_BEGIN_DRAG_FROM_METALPROCESSWND = 134, + MM_SETQUAKEINFO = 135, + MM_ITEMPICKUP = 136, + MM_REQUEST_ACT = 137, + MM_REQUEST_MOVE = 138, + MM_CHANGE_DIRECTION = 139, + MM_QUIT_TO_IDENTRY = 141, + MM_RESET_PARAMETER = 142, + MM_REQ_CHANGE_MAPTYPE = 143, + MM_CHANGE_EFFECTSTATE = 144, + MM_PET_RENAME = 145, + MM_PETEGG_SELECT_FROM_LIST = 146, + MM_REQ_PETEGG_INFO = 147, + MM_PET_ACT = 148, + MM_PETDECEIVE_SHOOT = 149, + MM_COMMAND_PET = 150, + MM_ARROW_FROM_LIST = 153, + MM_SELECT_CART = 154, + MM_REMOVE_TO_AID = 155, + MM_SHIFT_TO_GID = 156, + MM_RECALL_AID = 157, + MM_RECALL_GID = 158, + MM_BILLING_INFO = 161, + MM_SELECT_SPELL = 163, + MM_SEND_TEXT_TO_NPC = 164, + MM_JOIN_COUPLE = 167, + MM_CONFORM_MAKEGROUP = 168, + MM_DORIDORI = 169, + MM_ADDGUILDPOS = 170, + MM_DELETEGUILDPOS = 171, + MM_DELETEGUILDPOSALL = 172, + MM_JOIN_BABY = 173, + MM_REPAIRITEM_SELECT_FROM_LIST = 174, + MM_JOIN_FRIEND = 175, + MM_DELETE_FRIEND = 176, + MM_REQ_JOIN_BABY = 179, + MM_REFINEITEM_SELECT_FROM_LIST = 182, + MM_MER_RENAME = 185, + MM_COMMAND_MER = 186, + MM_STARPLACE_ACCEPT = 190, + MM_GET_MAIL_LIST = 191, + MM_RESET_MAIL_ITEM = 193, + MM_RETURN_MAIL = 197, + MM_GET_MAIL_ITEM = 198, + MM_REQ_HUNTING = 246, + MM_REQ_BUY_CASH_POINT = 249, + MM_REBIRTH = 250, + MM_CHAT_BATTLEFIELD = 254, + MM_GROUP_CHANGE_MASTER = 260, + MM_WHISPER_FILTER = 285, + MM_SHORTCUT_KEY_CHANGE = 313, +}; + +enum LOGINMODEMESSAGE : int { + LMM_CONNECT_TO_ACSVR = 10000, + LMM_MAKECHARACTER = 10001, + LMM_TRANSFERCHARACTER = 10002, + LMM_SELECTSVR = 10003, + LMM_SELECTCHARACTER = 10004, + LMM_SENDCHARINFO = 10005, + LMM_CANCEL = 10006, + LMM_PASSWORD = 10007, + LMM_ID = 10008, + LMM_SELECT_CHARACTER = 10009, + LMM_DELETE_CHARACTER = 10010, + LMM_GOTO_LOGIN = 10011, + LMM_SET_EMAIL_ADDRESS = 10012, + LMM_GET_EMAIL_ADDRESS = 10013, + LMM_GET_MAKING_CHAR_NAME = 10014, + LMM_SET_MAKING_CHAR_NAME = 10015, + LMM_GET_CHAR_PARAM = 10016, + LMM_SET_CHAR_PARAM = 10017, + LMM_GOTOSELECTACCOUNT = 10018, + LMM_SELECTACCOUNT = 10019, + LMM_GET_BILLING_INFO = 10020, + LMM_DISCONNECT_ACSVR = 10021, + LMM_SELECTACCOUNT2 = 10022, +}; + +#endif diff --git a/Source/Client/Mode/ModeMgr.cpp b/Source/Client/Mode/ModeMgr.cpp index 89671d1c4..e8bd8f259 100644 --- a/Source/Client/Mode/ModeMgr.cpp +++ b/Source/Client/Mode/ModeMgr.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/ModeMgr.h" +#include "Client/Mode/ModeMessage.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CLoginMode.h" @@ -32,10 +33,10 @@ void CModeMgr::Run(int mode, const char* name) { this->state = this->nextState; std::strcpy(this->modeName, this->nextModeName); switch (this->state) { - case 0: + case MT_LOGIN: this->gameMode = new CLoginMode(); break; - case 1: + case MT_GAME: this->gameMode = new CGameMode(); break; } diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index a88700391..73b206f9e 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -1008,7 +1008,7 @@ std::vector CSession::BuildSkillListReplayPacket(short id) { return BuildSkillInfoListPacket(0x10F, this->m_skillBundle.skills); case ID_ZC_HOSKILLINFO_LIST: return BuildSkillInfoListPacket(0x235, this->m_homunSkills); - case 0x29D: + case ID_ZC_MER_SKILLINFO_LIST: return BuildSkillInfoListPacket(0x29D, this->m_mercSkills); default: return {}; diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index a38094771..3f4884309 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -778,13 +778,13 @@ ITEM_INFO* CSession::GetEquippedItem(const ITEM_INFO* item) { equipped = &this->unknown_17F0[0]; break; case EQP_HAND_R: - case 0x22: + case EQP_HAND_R | EQP_HAND_L: equipped = &this->unknown_17F0[1]; break; case EQP_GARMENT: equipped = &this->unknown_17F0[2]; break; - case 0x88: + case EQP_ACC_RL: equipped = &this->unknown_17F0[3]; break; case EQP_ARMOR: @@ -797,13 +797,13 @@ ITEM_INFO* CSession::GetEquippedItem(const ITEM_INFO* item) { equipped = &this->unknown_17F0[6]; break; case EQP_HEAD_TOP: - case 0x101: - case 0x300: - case 0x301: + case EQP_HEAD_TOP | EQP_HEAD_LOW: + case EQP_HEAD_TOP | EQP_HEAD_MID: + case EQP_HEAD_TOP | EQP_HEAD_MID | EQP_HEAD_LOW: equipped = &this->unknown_17F0[8]; break; case EQP_HEAD_MID: - case 0x201: + case EQP_HEAD_MID | EQP_HEAD_LOW: equipped = &this->unknown_17F0[9]; break; case EQP_COSTUME_HEAD_LOW: @@ -831,13 +831,13 @@ ITEM_INFO* CSession::GetEquippedItem(const ITEM_INFO* item) { equipped = &this->unknown_2B50[7]; break; case EQP_COSTUME_HEAD_TOP: - case 0xC00: - case 0x1400: - case 0x1C00: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_LOW: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW: equipped = &this->unknown_2B50[8]; break; case EQP_COSTUME_HEAD_MID: - case 0x1800: + case EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW: equipped = &this->unknown_2B50[9]; break; } diff --git a/Source/Client/SessionPredicates.cpp b/Source/Client/SessionPredicates.cpp index 827277230..4f48334f3 100644 --- a/Source/Client/SessionPredicates.cpp +++ b/Source/Client/SessionPredicates.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Contents/Skills/SkillId.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" #include "Contents/Actors/GameActor.h" @@ -11,18 +12,18 @@ // FUNCTION: fn_23850 int CSession::IsState291To303(int state) const { switch (state) { - case 291: - case 292: - case 293: - case 294: - case 295: - case 297: - case 298: - case 299: - case 300: - case 301: - case 302: - case 303: + case SA_MONOCELL: + case SA_CLASSCHANGE: + case SA_SUMMONMONSTER: + case SA_REVERSEORCISH: + case SA_DEATH: + case SA_TAMINGMONSTER: + case SA_QUESTION: + case SA_GRAVITY: + case SA_LEVELUP: + case SA_INSTANTDEATH: + case SA_FULLRECOVERY: + case SA_COMA: return 1; default: return 0; diff --git a/Source/Contents/Actors/ActorEnums.h b/Source/Contents/Actors/ActorEnums.h new file mode 100644 index 000000000..ba97f15df --- /dev/null +++ b/Source/Contents/Actors/ActorEnums.h @@ -0,0 +1,177 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ACTORS_ACTORENUMS_H +#define RAGNAROK_SOURCE_CONTENTS_ACTORS_ACTORENUMS_H + +enum ACTORSTATEID : int { + ST_STAND = 0, + ST_MOVE = 1, + ST_ATTACK = 2, + ST_DEAD = 3, + ST_DAMAGE = 4, + ST_PICKUP = 5, + ST_SIT = 6, + ST_SKILL = 7, + ST_BEGIN_SKILL = 8, + ST_ATTACK2 = 9, + ST_SLEEP = 10, + ST_ATTACKWAIT = 11, + ST_THROW = 12, + ST_AUTOCOUNTER = 13, + ST_DANCE = 16, + ST_SING = 17, + ST_READYSHOT = 18, + ST_READYJUMP = 19, + ST_LANDJUMP = 20, + ST_R_STORM = 21, + ST_R_DOWN = 22, + ST_R_TURN = 23, + ST_R_COUNTER = 24, + ST_R_DODGE = 25, + ST_A_COUNTER = 26, + ST_A_JUMPKICK = 27, + ST_THROW2 = 28, + ST_A_STORM = 30, + ST_A_DOWN = 31, + ST_A_TURN = 32, + ST_SG_DOWN = 33, + ST_SG_TURN = 34, + ST_NINJASKILL1 = 35, + ST_NINJASKILL2 = 36, + ST_NINJAREADY = 37, + ST_GUNSKILL1 = 38, + ST_GUNSKILL2 = 39, + ST_GUNSKILL3 = 40, + ST_GUNREADY = 41, + ST_GUNREADY2 = 42, + ST_MADOSKILL = 43, + ST_MADOSKILL2 = 44, + ST_AB_SPECIAL = 45, +}; + +enum AIPROPERTY : int { + V_OWNER = 0, + V_POSITION = 1, + V_MOTION = 3, + V_ATTACKRANGE = 4, + V_TARGET = 5, + V_SKILLATTACKRANGE = 6, + V_HOMUNTYPE = 7, + V_HP = 8, + V_SP = 9, + V_MAXHP = 10, + V_MAXSP = 11, + V_MERTYPE = 12, +}; + +enum AICOMMAND : int { + MOVE_CMD = 1, + ATTACK_OBJECT_CMD = 3, + ATTACK_AREA_CMD = 4, + PATROL_CMD = 5, + SKILL_OBJECT_CMD = 7, + SKILL_AREA_CMD = 8, +}; + +enum ACTORMESSAGE : int { + AM_MOVE = 0, + AM_STANDENTRY = 3, + AM_INITSTANDENTRY = 4, + AM_MOVEENTRY = 5, + AM_INITMOVEENTRY = 6, + AM_CHAT = 7, + AM_FREEZE = 8, + AM_PREMOVE = 9, + AM_PROCEEDATTACK = 10, + AM_ACTION = 11, + AM_DEAD = 12, + AM_CANCELATTACK = 13, + AM_SETPOS = 14, + AM_ATTACKCLICKUP = 15, + AM_REQ_CHANGE_DIR = 16, + AM_REQ_MOVE = 17, + AM_PROCEEDPICKUPITEM = 18, + AM_SETMASTERGID = 22, + AM_EFFECT_DEAD = 23, + AM_MASTER_DEAD = 24, + AM_CHILD_DEAD = 25, + AM_ATTACKED = 26, + AM_WILL_BE_ATTACKED = 27, + AM_REQ_ATTACK = 29, + AM_REQ_SIT = 31, + AM_MAKE_CHAT_TITLE = 32, + AM_DELETE_CHAT_TITLE = 33, + AM_UPDATEGAGE = 34, + AM_REMOVEGAGE = 35, + AM_SKILL = 37, + AM_GROUNDSKILL = 38, + AM_ATTACKEDNOMOTION = 39, + AM_REQ_ATTACK_REPEAT = 40, + AM_PROCEEDSKILL = 41, + AM_REQ_SKILL = 42, + AM_ATTR_STATE_CHANGE = 43, + AM_SETCOUNT = 44, + AM_SKILLSTANDENTRY = 45, + AM_SETPARAM = 46, + AM_SETJOB = 47, + AM_MSGMASTER_DEAD = 49, + AM_SET_MASTER_POINTER = 50, + AM_DISAPPEAR = 53, + AM_DELETE_SHOP_TITLE = 54, + AM_MAKE_SHOP_TITLE = 55, + AM_CORRECT_POS = 61, + AM_SETPOS2 = 64, + AM_PROCEEDGROUNDSKILL = 65, + AM_REQ_GROUND_SKILL = 66, + AM_SET_DURATION = 80, + AM_SET_TARGET_AID = 81, + AM_MAKE_SKILL_RECHARGEGAGE = 82, + AM_DELETE_SKILL_RECHARGEGAGE = 83, + AM_MAKE_NUMBER = 88, + AM_MAKE_MISS = 89, + AM_SET_SKILL_USE_LEVEL = 90, + AM_REQ_MOVE_PRIMITIVE = 91, + AM_ATTACKED_CRITICAL = 93, + AM_ATTACKED_LUCKY = 94, + AM_MAKE_LUCKY = 95, + AM_ATTACKED_SKILL = 96, + AM_ATTACKEDNOMOTION_SKILL = 97, + AM_RESURRECTION = 98, + AM_OUTOFSIGHT = 99, + AM_SET_HEAD_DIR = 100, + AM_MAKE_BIRD = 101, + AM_DELETE_BIRD = 102, + AM_PROCEEDTOUCHSKILL = 103, + AM_DELETE_EFFECT = 109, + AM_STATUS_CHANGE = 110, + AM_SETTIME = 115, + AM_SET_SKILL = 117, + AM_SKILL_UPDATE = 119, + AM_IS_HAVE_EFFECT = 120, + AM_INITSTANDENTRY2 = 121, + AM_INITMOVEENTRY2 = 122, + AM_MOVEENTRY2 = 123, + AM_STANDENTRY2 = 124, +}; + +enum PROCEEDTYPE : int { + PT_ATTACK = 1, + PT_PICKUPITEM = 2, + PT_SKILL = 3, + PT_GROUNDSKILL = 4, + PT_ATTACK_2 = 5, + PT_TOUCH_SKILL = 6, +}; + +enum MOTIONTYPE : int { + MT_LOOP = 0, + MT_ONETIME = 1, + MT_STATIC = 2, +}; + +enum BLURACTORMESSAGE : int { + BM_RGB = 0, + BM_ALPHA = 1, + BM_MOTIONY = 2, + BM_MOTION_FREEZE = 3, +}; + +#endif diff --git a/Source/Contents/Actors/GameActor.cpp b/Source/Contents/Actors/GameActor.cpp index 78c8ca694..0e1e8a351 100644 --- a/Source/Contents/Actors/GameActor.cpp +++ b/Source/Contents/Actors/GameActor.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/GameActor.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Jobs/JobId.h" #include "Contents/Skills/SkillId.h" @@ -144,7 +145,7 @@ bool CGameActor::ProcessState() { int moved = 0; switch (this->render.unknown_0070) { - case 0xD: + case ST_AUTOCOUNTER: if (this->unknown_0178 == 0) { this->unknown_0178 = 1; if (g_session.IsPlayerJobId(this->GetEffectiveJob(-1)) != 0) { @@ -169,7 +170,7 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 0: + case ST_STAND: if (this->render.unknown_006C == 1 && this->render.isMotionFinished) { this->SetState(0, 1); } else if (this->unknown_0314 == 7 && this->render.accountId == g_session.unknown_1010 && static_cast(this->unknown_027C) > 0 && @@ -189,7 +190,7 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 1: + case ST_MOVE: if (this->route.Empty()) { break; } else { @@ -269,9 +270,9 @@ bool CGameActor::ProcessState() { goto applyHeight; } - case 2: - case 9: - case 0xC: + case ST_ATTACK: + case ST_ATTACK2: + case ST_THROW: case 0x34: case 0x35: case 0x36: @@ -287,7 +288,7 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 8: + case ST_BEGIN_SKILL: this->unknown_0178 = 0; this->ProcessMotion(); { @@ -305,9 +306,9 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 5: - case 7: - case 0x2D: + case ST_PICKUP: + case ST_SKILL: + case ST_AB_SPECIAL: this->unknown_0178 = 0; this->ProcessMotion(); if (this->render.isMotionFinished) { @@ -317,7 +318,7 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 4: + case ST_DAMAGE: this->unknown_0178 = 0; this->ProcessMotion(); { @@ -342,7 +343,7 @@ bool CGameActor::ProcessState() { } break; - case 3: + case ST_DEAD: this->render.unknown_00C8 = 0; this->render.unknown_00D8 = 0; this->render.unknown_00DC = 0; @@ -362,35 +363,35 @@ bool CGameActor::ProcessState() { this->unknown_0258 = serverTime; return true; - case 10: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - case 0x1C: - case 0x1E: - case 0x1F: - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - case 0x28: - case 0x29: - case 0x2A: - case 0x2B: - case 0x2C: + case ST_SLEEP: + case ST_DANCE: + case ST_SING: + case ST_READYSHOT: + case ST_READYJUMP: + case ST_LANDJUMP: + case ST_R_STORM: + case ST_R_DOWN: + case ST_R_TURN: + case ST_R_COUNTER: + case ST_R_DODGE: + case ST_A_COUNTER: + case ST_A_JUMPKICK: + case ST_THROW2: + case ST_A_STORM: + case ST_A_DOWN: + case ST_A_TURN: + case ST_SG_DOWN: + case ST_SG_TURN: + case ST_NINJASKILL1: + case ST_NINJASKILL2: + case ST_NINJAREADY: + case ST_GUNSKILL1: + case ST_GUNSKILL2: + case ST_GUNSKILL3: + case ST_GUNREADY: + case ST_GUNREADY2: + case ST_MADOSKILL: + case ST_MADOSKILL2: case 0x2F: case 0x30: case 0x31: diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index c8645e0d4..57f383e25 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -1,4 +1,6 @@ #include "Contents/Actors/GameObject.h" +#include "Contents/Actors/ActorEnums.h" +#include "Network/Packets/NoticeEnums.h" #include "Contents/Jobs/JobId.h" #include "Contents/Effects/EffectTypes.h" #include "Contents/Actors/GameActor.h" @@ -941,7 +943,7 @@ void CGameActor::ApplyPendingUnknown0408() { // FUNCTION: fn_21111 void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, int d, int e, int, int, int, int, int, int, int, int) { switch (static_cast(a) << 32 | static_cast(message)) { - case 24: + 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); } @@ -1007,7 +1009,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 23: + case AM_EFFECT_DEAD: if (sender) { CRagEffect* const effect = static_cast(sender); for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { @@ -1026,7 +1028,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 109: + case AM_DELETE_EFFECT: if (g_effectMgr->HasAllocator(b) && sender) { g_effectMgr->Retire(static_cast(sender)->render.accountId, b); return; @@ -1074,7 +1076,7 @@ void EffectActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 120: + case AM_IS_HAVE_EFFECT: if (g_effectMgr->HasAllocator(b) == true && sender) { if (g_effectMgr->Has(static_cast(sender)->render.accountId, b) == true) { *reinterpret_cast(b) = -1; @@ -1221,10 +1223,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } } break; - case 81: + case AM_SET_TARGET_AID: this->hitTargetAid = b; break; - case 88: { + case AM_MAKE_NUMBER: { if ((g_session.GetSceneUnknown004C() != 0 || g_session.WorldUnknown0050() != 0) && g_session.IsAdminSubMode(7) == 0) { break; } @@ -1245,7 +1247,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 89: { + case AM_MAKE_MISS: { if (!g_serviceOptions.Get(0x35)) { break; } @@ -1258,7 +1260,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, case 126: this->LaunchEffect(0x150, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 95: { + 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); @@ -1319,7 +1321,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_037C[1] = 0; } break; - case 101: { + case AM_MAKE_BIRD: { if (this->unknown_037C[0] != 0) { break; } @@ -1360,7 +1362,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_037C[0] = reinterpret_cast(effect); break; } - case 102: + 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])->m_visible = false; @@ -1620,14 +1622,14 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_037C[12] = 0; } break; - case 12: + case AM_DEAD: if (this->render.unknown_0070 == 3) { break; } this->SetState(3, 1); break; - case 96: - case 97: { + case AM_ATTACKED_SKILL: + case AM_ATTACKEDNOMOTION_SKILL: { this->render.overrideColor = 0xFFFF0000; const int effectId = reinterpret_cast(b)->effectId; if (effectId == 0xC6) { @@ -1636,10 +1638,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->render.overrideColor = effectId == 0xB8 ? 0xFF505050 : this->render.overrideColor; } } - case 26: - case 39: - case 93: - case 94: + case AM_ATTACKED: + case AM_ATTACKEDNOMOTION: + case AM_ATTACKED_CRITICAL: + case AM_ATTACKED_LUCKY: case 111: case 129: case 132: @@ -1899,7 +1901,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->SendMsg(nullptr, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } break; - case 27: { + case AM_WILL_BE_ATTACKED: { ActorDamageMessage* damage = reinterpret_cast(b); if ((static_cast(e) << 32 | static_cast(d)) != 0) { if (damage->action != 0x94) { @@ -1928,22 +1930,22 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_02A8.push_back(*damage); break; } - case 37: + case AM_SKILL: this->ProcessSkillMessage(sender, reinterpret_cast(b), d, f); break; - case 38: + case AM_GROUNDSKILL: this->PlayGroundSkillEffect(reinterpret_cast(sender), reinterpret_cast(b), d, f); break; - case 11: + case AM_ACTION: this->ProcessHitMessage(sender, reinterpret_cast(b), d, f); break; - case 43: { + case AM_ATTR_STATE_CHANGE: { const int* states = reinterpret_cast(b); this->SetStatusStates(states[0], states[1], states[2], true); this->unknown_02C8 = states[3]; break; } - case 3: { + case AM_STANDENTRY: { PcStandEntry* entry = reinterpret_cast(b); switch (this->unknown_0314) { case 8: @@ -1968,7 +1970,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->SetGuildInfo(entry->guildId, entry->guildVersion); break; } - case 4: { + case AM_INITSTANDENTRY: { PcStandEntry* entry = reinterpret_cast(b); switch (this->unknown_0314) { case 8: @@ -2001,10 +2003,10 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->SetStatusStates(entry->bodyState, entry->stateFlags, entry->effectState, false); if (Replay::Instance().state == 6) { switch (entry->state) { - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -2026,8 +2028,8 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 6: - case 122: { + case AM_INITMOVEENTRY: + case AM_INITMOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); switch (this->unknown_0314) { case 8: @@ -2064,8 +2066,8 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 5: - case 123: { + case AM_MOVEENTRY: + case AM_MOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); switch (this->unknown_0314) { case 8: @@ -2093,7 +2095,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 0: { + case AM_MOVE: { const int* route = reinterpret_cast(b); this->routeStartTick = route[0]; if (this->FindRoute(route[1], route[2], route[3], route[4], route[5], route[6], *reinterpret_cast(&this->unknown_0170[4]))) { @@ -2106,19 +2108,19 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 54: + case AM_DELETE_SHOP_TITLE: if (this->unknown_0264[2] != 0) { g_windowMgr.Schedule(reinterpret_cast(this->unknown_0264[2])); this->unknown_0264[2] = 0; } break; - case 33: + case AM_DELETE_CHAT_TITLE: if (this->unknown_0264[1] != 0) { g_windowMgr.Schedule(reinterpret_cast(this->unknown_0264[1])); this->unknown_0264[1] = 0; } break; - case 55: + case AM_MAKE_SHOP_TITLE: if (this->unknown_0264[2] == 0) { UIMerchantShopTitle* title = new UIMerchantShopTitle(0); this->unknown_0264[2] = reinterpret_cast(title); @@ -2132,7 +2134,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, reinterpret_cast(this->unknown_0264[2])->Show(0); } break; - case 32: + case AM_MAKE_CHAT_TITLE: if (this->unknown_0264[1] == 0) { UIChatRoomTitle* title = new UIChatRoomTitle(); this->unknown_0264[1] = reinterpret_cast(title); @@ -2142,7 +2144,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, reinterpret_cast(this->unknown_0264[1])->SendMsg(nullptr, 0x22, 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 82: + case AM_MAKE_SKILL_RECHARGEGAGE: if (this->unknown_0264[3] == 0) { // GLOBAL: gl_25466 static float s_gaugeOffsetY = static_cast(g_renderer->viewport.height * 81 / 480); @@ -2158,7 +2160,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->unknown_0280 = timeGetTime() + b; this->unknown_0284 = timeGetTime(); break; - case 83: + case AM_DELETE_SKILL_RECHARGEGAGE: if (this->unknown_0264[3] != 0) { g_windowMgr.Schedule(reinterpret_cast(this->unknown_0264[3])); this->unknown_0264[3] = 0; @@ -2171,7 +2173,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } } break; - case 7: { + case AM_CHAT: { std::string text(reinterpret_cast(b)); if (g_windowMgr.window_01C8 != nullptr) { text = static_cast(g_windowMgr.window_01C8)->ConvertChat(std::string(reinterpret_cast(b))); @@ -2263,19 +2265,19 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 61: + case AM_CORRECT_POS: this->unknown_0158[5] = b; *reinterpret_cast(this->unknown_0170) = d; mode->CellCenter(b, d, this->render.position.x, this->render.position.z); break; - case 98: + case AM_RESURRECTION: this->render.unknown_0070 = 0; this->render.isLieOnGround = false; this->render.unknown_00A4Bytes[1] = 1; static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; this->SetState(0, 1); break; - case 99: + case AM_OUTOFSIGHT: this->render.accountId = 0xFFFFFFFF; this->unknown_02B8 = 0; this->render.unknown_00A4Bytes[0] = 0; @@ -2454,7 +2456,7 @@ void CGameActor::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; } - case 110: { + case AM_STATUS_CHANGE: { const bool on = (static_cast(e) << 32 | static_cast(d)) != 0; switch (static_cast(c) << 32 | static_cast(b)) { case EFST_PROVOKE: diff --git a/Source/Contents/Actors/GroundScope.cpp b/Source/Contents/Actors/GroundScope.cpp index eecdc15bb..d13fac4fe 100644 --- a/Source/Contents/Actors/GroundScope.cpp +++ b/Source/Contents/Actors/GroundScope.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/GroundScope.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Skills/SkillId.h" #include "Client/Mode/CGameMode.h" @@ -185,20 +186,20 @@ void CGroundScope::Render(int argument) { // FUNCTION: fn_24299 void CGroundScope::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) { switch (static_cast(a) << 32 | static_cast(message)) { - case 14: + case AM_SETPOS: this->m_cellX = b; this->m_cellY = d; return; - case 22: + case AM_SETMASTERGID: this->unknown_0158 = b; return; - case 115: + case AM_SETTIME: this->m_lastingTime = b; return; - case 117: + case AM_SET_SKILL: this->m_size = this->SkillScopeType(b) + 2; this->m_skillId = b; this->m_angleSpeed = this->m_size != 0 ? 0.5f / static_cast(this->m_size) : 0.0f; diff --git a/Source/Contents/Actors/MercenaryAI.cpp b/Source/Contents/Actors/MercenaryAI.cpp index 54067090e..c8c88a7a4 100644 --- a/Source/Contents/Actors/MercenaryAI.cpp +++ b/Source/Contents/Actors/MercenaryAI.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/MercenaryAI.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -380,11 +381,11 @@ int AiHomunGetV(lua_State* state) { double result = 0.0; switch (property) { - case 0: + case V_OWNER: result = static_cast(g_session.m_aid); break; - case 1: + case V_POSITION: case 13: if (actor) { if (aid != g_session.m_aid) { @@ -447,7 +448,7 @@ int AiHomunGetV(lua_State* state) { case 2: return 1; - case 3: + case V_MOTION: if (!actor) { result = -1.0; } else { @@ -455,7 +456,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 4: { + case V_ATTACKRANGE: { int range = *reinterpret_cast(&g_session.unknown_5620[4]); if (!actor || range == 0) { result = -1.0; @@ -465,7 +466,7 @@ int AiHomunGetV(lua_State* state) { break; } - case 5: + case V_TARGET: if (!actor) { result = -1.0; } else { @@ -473,7 +474,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 6: + case V_SKILLATTACKRANGE: case 14: { std::uint32_t skillId = static_cast(lua_tonumber(state, 3)); CSkillInfo skill = g_session.LookupHomunSkill(skillId); @@ -492,7 +493,7 @@ int AiHomunGetV(lua_State* state) { return 1; } - case 7: + case V_HOMUNTYPE: if (!actor) { result = -1.0; } else { @@ -500,7 +501,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 8: + case V_HP: if (aid == g_session.m_aid) { result = static_cast(g_session.unknown_5568); } else if (!g_session.IsHomunAid(aid)) { @@ -510,7 +511,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 9: + case V_SP: if (aid == g_session.m_aid) { result = static_cast(*reinterpret_cast(&g_session.unknown_5570[0])); } else if (!g_session.IsHomunAid(aid)) { @@ -520,7 +521,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 10: + case V_MAXHP: if (aid == g_session.m_aid) { result = static_cast(g_session.unknown_556C); } else if (!g_session.IsHomunAid(aid)) { @@ -530,7 +531,7 @@ int AiHomunGetV(lua_State* state) { } break; - case 11: + case V_MAXSP: if (aid == g_session.m_aid) { result = static_cast(*reinterpret_cast(&g_session.unknown_5570[4])); } else if (!g_session.IsHomunAid(aid)) { @@ -564,11 +565,11 @@ int AiMercenaryGetV(lua_State* state) { double result = 0.0; switch (property) { - case 0: + case V_OWNER: result = static_cast(g_session.m_aid); break; - case 1: + case V_POSITION: case 13: if (actor) { if (aid != g_session.m_aid) { @@ -632,7 +633,7 @@ int AiMercenaryGetV(lua_State* state) { case 2: return 1; - case 3: + case V_MOTION: if (!actor) { result = -1.0; } else { @@ -640,7 +641,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 4: { + case V_ATTACKRANGE: { int range = *reinterpret_cast(&g_session.unknown_5690[0]); if (!actor || range == 0) { result = -1.0; @@ -650,7 +651,7 @@ int AiMercenaryGetV(lua_State* state) { break; } - case 5: + case V_TARGET: if (!actor || actor->render.unknown_0070 == 3) { result = -1.0; } else { @@ -658,7 +659,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 6: + case V_SKILLATTACKRANGE: case 14: { std::uint32_t skillId = static_cast(lua_tonumber(state, 3)); CSkillInfo skill = g_session.LookupMercSkill(skillId); @@ -677,7 +678,7 @@ int AiMercenaryGetV(lua_State* state) { return 1; } - case 8: + case V_HP: if (aid == g_session.m_aid) { result = static_cast(g_session.unknown_5568); } else if (!g_session.IsMercenaryAid(aid)) { @@ -687,7 +688,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 9: + case V_SP: if (aid == g_session.m_aid) { result = static_cast(*reinterpret_cast(&g_session.unknown_5570[0])); } else if (!g_session.IsMercenaryAid(aid)) { @@ -697,7 +698,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 10: + case V_MAXHP: if (aid == g_session.m_aid) { result = static_cast(g_session.unknown_556C); } else if (!g_session.IsMercenaryAid(aid)) { @@ -707,7 +708,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 11: + case V_MAXSP: if (aid == g_session.m_aid) { result = static_cast(*reinterpret_cast(&g_session.unknown_5570[4])); } else if (!g_session.IsMercenaryAid(aid)) { @@ -717,7 +718,7 @@ int AiMercenaryGetV(lua_State* state) { } break; - case 12: + case V_MERTYPE: if (!actor) { result = -1.0; } else { @@ -874,21 +875,21 @@ int AiGetMsg(lua_State* state) { lua_pushnumber(state, message.type); lua_settable(state, -3); switch (message.type) { - case 1: - case 4: - case 5: + case MOVE_CMD: + case ATTACK_AREA_CMD: + case PATROL_CMD: AiSetTableNumber(state, 2, message.x); AiSetTableNumber(state, 3, message.y); break; - case 3: + case ATTACK_OBJECT_CMD: AiSetTableNumber(state, 2, message.target); break; - case 7: + case SKILL_OBJECT_CMD: AiSetTableNumber(state, 2, message.level); AiSetTableNumber(state, 3, message.skill); AiSetTableNumber(state, 4, message.target); break; - case 8: + case SKILL_AREA_CMD: AiSetTableNumber(state, 2, message.level); AiSetTableNumber(state, 3, message.skill); AiSetTableNumber(state, 4, message.x); @@ -925,21 +926,21 @@ int AiGetResMsg(lua_State* state) { lua_pushnumber(state, message.type); lua_settable(state, -3); switch (message.type) { - case 1: - case 4: - case 5: + case MOVE_CMD: + case ATTACK_AREA_CMD: + case PATROL_CMD: AiSetTableNumber(state, 2, message.x); AiSetTableNumber(state, 3, message.y); break; - case 3: + case ATTACK_OBJECT_CMD: AiSetTableNumber(state, 2, message.target); break; - case 7: + case SKILL_OBJECT_CMD: AiSetTableNumber(state, 2, message.level); AiSetTableNumber(state, 3, message.skill); AiSetTableNumber(state, 4, message.target); break; - case 8: + case SKILL_AREA_CMD: AiSetTableNumber(state, 2, message.level); AiSetTableNumber(state, 3, message.skill); AiSetTableNumber(state, 4, message.x); diff --git a/Source/Contents/Actors/PetEnums.h b/Source/Contents/Actors/PetEnums.h new file mode 100644 index 000000000..ac931e2e3 --- /dev/null +++ b/Source/Contents/Actors/PetEnums.h @@ -0,0 +1,25 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ACTORS_PETENUMS_H +#define RAGNAROK_SOURCE_CONTENTS_ACTORS_PETENUMS_H + +enum PETTALKACTION : int { + PM_FEEDING = 0, + PM_HUNTING = 1, + PM_DANGER = 2, + PM_DEAD = 3, + PM_NORMAL = 4, + PM_PERFORMANCE_S = 5, + PM_LEVELUP = 6, + PM_PERFORMANCE1 = 7, + PM_PERFORMANCE2 = 8, + PM_PERFORMANCE3 = 9, + PM_CONNENCT = 10, +}; + +enum PETHUNGER : int { + PET_HUNGRY = 1, + PET_SATISFIED = 2, + PET_ENOUGH = 3, + PET_FULL = 4, +}; + +#endif diff --git a/Source/Contents/Actors/Player.cpp b/Source/Contents/Actors/Player.cpp index 2cdd179a1..0cecde1ae 100644 --- a/Source/Contents/Actors/Player.cpp +++ b/Source/Contents/Actors/Player.cpp @@ -1,4 +1,6 @@ #include "Contents/Actors/Pc.h" +#include "Contents/Actors/ActorEnums.h" +#include "Network/Packets/NoticeEnums.h" #include "Contents/Effects/EffectTypes.h" #include "Contents/Skills/SkillUnitId.h" @@ -391,18 +393,18 @@ void CGrannyPc::SetState(int state, int resetPosition) { const SpawnArrow spawnArrow = reinterpret_cast(&CGameMode::SpawnArrowEffect); switch (state) { - case 8: + case ST_BEGIN_SKILL: this->RegisterPos(); this->SetAction(0x60, 6, 1); this->render.isMotionFinished = true; break; - case 6: + case ST_SIT: this->RegisterPos(); this->SetAction(0x10, 4, 1); this->render.isMotionFinished = true; this->render.curMotion = this->unknown_0430; break; - case 1: + case ST_MOVE: this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -410,7 +412,7 @@ void CGrannyPc::SetState(int state, int resetPosition) { this->unknown_0430 = 0; CGameActor::SetState(1, resetPosition); break; - case 0: + case ST_STAND: CGameActor::SetState(0, resetPosition); this->render.curMotion = this->unknown_0430; if (current == 4 || current == 2 || this->unknown_02C8 != 0 || current == 8) { @@ -418,7 +420,7 @@ void CGrannyPc::SetState(int state, int resetPosition) { } static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; break; - case 7: + case ST_SKILL: if (current == 6) { return; } @@ -441,7 +443,7 @@ void CGrannyPc::SetState(int state, int resetPosition) { } this->unknown_0378 = 6.0f; break; - case 2: { + case ST_ATTACK: { this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -461,7 +463,7 @@ void CGrannyPc::SetState(int state, int resetPosition) { } break; } - case 9: { + case ST_ATTACK2: { this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -507,9 +509,9 @@ int CPlayer::AngleToDirection(float angle) { // FUNCTION: fn_22663 bool CPlayer::IsSpecialState(int state) const { switch (state) { - case 2: - case 5: - case 6: + case ST_ATTACK: + case ST_PICKUP: + case ST_SIT: case 62: case 63: case 64: @@ -1662,7 +1664,7 @@ int CPc::GetMonsterTransformJob() { __declspec(noinline) int CPc::JobActionBase(int state) { int base = 0; switch (state) { - case 8: + case ST_BEGIN_SKILL: base = 96; switch (this->GetEffectiveJob(-1)) { case JT_DO_SUMMONER: @@ -1672,13 +1674,13 @@ __declspec(noinline) int CPc::JobActionBase(int state) { break; } break; - case 6: + case ST_SIT: base = 16; break; - case 0: + case ST_STAND: base = 32; break; - case 7: + case ST_SKILL: switch (this->GetEffectiveJob(-1)) { case JT_CRUSADER: case JT_BARD: @@ -2895,8 +2897,8 @@ bool CPlayer::OnProcess() { void CPlayer::UpdatePendingAction() { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (this->unknown_0508) { - case 1: - case 5: { + case PT_ATTACK: + case PT_ATTACK_2: { CGameActor* target = static_cast(mode->scene->GetGameActorByAID(this->unknown_051C)); if (target == nullptr) { break; @@ -2972,7 +2974,7 @@ void CPlayer::UpdatePendingAction() { } return; } - case 3: { + case PT_SKILL: { CGameActor* target; if (this->unknown_051C == g_session.m_aid) { target = this; @@ -3018,7 +3020,7 @@ void CPlayer::UpdatePendingAction() { this->SendMsg(nullptr, 91, 0, cellX, cellX >> 31, cellY, cellY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } - case 4: { + case PT_GROUNDSKILL: { int groundX = this->unknown_0534; int groundY = this->unknown_0538; int column; @@ -3052,7 +3054,7 @@ void CPlayer::UpdatePendingAction() { this->SendMsg(nullptr, 91, 0, groundX, groundX >> 31, groundY, groundY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } - case 2: { + case PT_PICKUPITEM: { CItem* item = mode->scene->GetItemByAID(this->unknown_051C); if (item == nullptr) { break; @@ -3089,7 +3091,7 @@ void CPlayer::UpdatePendingAction() { this->SendMsg(nullptr, 91, 0, itemX, itemX >> 31, itemY, itemY >> 31, 0, 0, 0, 0, 0, 0, 0, 0); return; } - case 6: { + case PT_TOUCH_SKILL: { CGameActor* skill = static_cast(mode->scene->GetSkillByAID(this->unknown_051C)); if (skill == nullptr) { break; @@ -3845,7 +3847,7 @@ void CPlayer::SendMsg( ) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (static_cast(a) << 32 | static_cast(message)) { - case 0x42: { + case AM_REQ_GROUND_SKILL: { PlayerSkillRequest request; request.skill = this->unknown_052C; request.x = this->unknown_0534; @@ -3873,20 +3875,20 @@ void CPlayer::SendMsg( } break; } - case 0x2A: + case AM_REQ_SKILL: mode->SendMsg(0x45, this->unknown_052C, this->unknown_051C, this->unknown_0530, 0); break; - case 0x28: { + 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); } break; } - case 0x1D: + case AM_REQ_ATTACK: mode->SendMsg(0x89, 0, this->unknown_051C, 0, 0); break; - case 0x1F: + case AM_REQ_SIT: if (!StateFlag01(this->stateFlags)) { if (this->render.unknown_0070 == 0) { mode->SendMsg(0x89, 2, this->unknown_051C, 0, 0); @@ -3895,7 +3897,7 @@ void CPlayer::SendMsg( } } break; - case 0x11: + case AM_REQ_MOVE: this->SendMsg(nullptr, 0xD, 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)) { @@ -3910,14 +3912,14 @@ void CPlayer::SendMsg( } } break; - case 0x5B: + case AM_REQ_MOVE_PRIMITIVE: g_unknown173AD3F = false; if (timeGetTime() > this->unknown_0528 + 350) { this->unknown_0528 = timeGetTime(); mode->SendMsg(0x8A, b, d, 0, 0); } break; - case 0x10: { + case AM_REQ_CHANGE_DIR: { const std::uint32_t state = this->render.unknown_0070; if (state != 0 && state != 4 && state != 6) { break; @@ -3978,13 +3980,13 @@ void CPlayer::SendMsg( mode->SendMsg(0x8B, CPlayer::AngleToDirection(this->render.angle), motion, 0, 0); break; } - case 0x09: + case AM_PREMOVE: this->unknown_050C = 1; this->unknown_0504 = timeGetTime(); reinterpret_cast(this->unknown_04F8) = b; this->unknown_04FC = d; break; - case 0x00: { + case AM_MOVE: { this->unknown_050C = 0; const int* route = reinterpret_cast(b); this->routeStartTick = route[0]; @@ -4008,15 +4010,15 @@ void CPlayer::SendMsg( g_navigationManager.CheckArrival(this->unknown_0158[5], *reinterpret_cast(this->unknown_0170)); break; } - case 0x08: + case AM_FREEZE: this->SetState(0, 1); break; - case 0x0D: + case AM_CANCELATTACK: this->unknown_0514 = 0; this->unknown_0508 = 0; mode->SendMsg(0x1A, 0, 0, 0, 0); break; - case 0x0F: { + case AM_ATTACKCLICKUP: { const int attackMode = this->unknown_0508; if (attackMode != 1 && attackMode != 5) { if (attackMode == 3) { @@ -4036,10 +4038,10 @@ void CPlayer::SendMsg( } break; } - case 0x5A: + case AM_SET_SKILL_USE_LEVEL: this->unknown_0530 = b; break; - case 0x41: + case AM_PROCEEDGROUNDSKILL: if (this->render.unknown_0070 != 6 && (!StateFlag01(this->stateFlags) || (b == 0x89 && c == 0) || (b == 0xD4 && c == 0) || (b == 0x211 && c == 0) || (b == 0x212 && c == 0))) { @@ -4050,7 +4052,7 @@ void CPlayer::SendMsg( this->unknown_051C = 0; } break; - case 0x29: + case AM_PROCEEDSKILL: if (this->render.unknown_0070 != 6 && (!StateFlag01(this->stateFlags) || (d == 0x89 && e == 0) || (d == 0xD4 && e == 0) || (d == 0x211 && e == 0) || (d == 0x212 && e == 0) || (d == 0x250 && e == 0))) { @@ -4071,7 +4073,7 @@ void CPlayer::SendMsg( this->unknown_04FC = -1; } break; - case 0x0A: + case AM_PROCEEDATTACK: if (this->render.unknown_0070 != 6 && !StateFlag01(this->stateFlags)) { CRenderObject* target = mode->scene->GetGameActorByAID(b); if (target != nullptr) { @@ -4087,13 +4089,13 @@ void CPlayer::SendMsg( } } break; - case 0x12: + case AM_PROCEEDPICKUPITEM: if (this->render.unknown_0070 != 6 && !StateFlag01(this->stateFlags)) { this->unknown_0508 = 2; this->unknown_051C = b; } break; - case 0x67: + case AM_PROCEEDTOUCHSKILL: if (this->render.unknown_0070 != 6 && !StateFlag01(this->stateFlags)) { const int* skill = reinterpret_cast(d); this->unknown_0508 = 6; @@ -4384,18 +4386,18 @@ void CPc::SetState(int state, int resetPosition) { const SpawnArrow spawnArrow = reinterpret_cast(&CGameMode::SpawnArrowEffect); switch (state) { - case 8: + case ST_BEGIN_SKILL: this->RegisterPos(); this->SetAction(action, 6, 1); this->render.isMotionFinished = true; break; - case 6: + case ST_SIT: this->RegisterPos(); this->SetAction(action, 4, 1); this->render.isMotionFinished = true; this->render.curMotion = this->unknown_043C; break; - case 1: + case ST_MOVE: this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -4403,7 +4405,7 @@ void CPc::SetState(int state, int resetPosition) { this->unknown_043C = 0; CGameActor::SetState(1, resetPosition); break; - case 0: + case ST_STAND: CGameActor::SetState(0, resetPosition); if (g_session.m_aid == this->render.accountId) { switch (g_session.m_job) { @@ -4420,9 +4422,9 @@ void CPc::SetState(int state, int resetPosition) { } this->render.curMotion = this->unknown_043C; switch (current) { - case 2: - case 4: - case 8: + case ST_ATTACK: + case ST_DAMAGE: + case ST_BEGIN_SKILL: case 0x34: case 0x35: case 0x36: @@ -4456,7 +4458,7 @@ void CPc::SetState(int state, int resetPosition) { } static_cast(g_modeMgr.GetGameMode())->unknown_02CC = 0; break; - case 7: + case ST_SKILL: if (this->render.unknown_0114 == 1 || this->render.unknown_0070 == 6) { return; } @@ -4482,7 +4484,7 @@ void CPc::SetState(int state, int resetPosition) { } this->unknown_0378 = 6.0f; break; - case 2: { + case ST_ATTACK: { this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -4552,7 +4554,7 @@ void CPc::SetState(int state, int resetPosition) { } break; } - case 9: { + case ST_ATTACK2: { this->unknown_0178 = 0; if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; @@ -4769,18 +4771,18 @@ void CPc::SendMsg( ) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (*reinterpret_cast(&message)) { - case 100: + case AM_SET_HEAD_DIR: if (this->render.unknown_0070 == 0 || this->render.unknown_0070 == 6) { this->render.curMotion = b; } break; - case 35: + case AM_REMOVEGAGE: if (this->unknown_0490) { g_windowMgr.Schedule(this->unknown_0490); this->unknown_0490 = nullptr; } break; - case 34: + case AM_UPDATEGAGE: if (!this->unknown_0490) { this->unknown_0490 = new UIPcGage(); this->unknown_0490->SetSize(60, 5); @@ -4790,7 +4792,7 @@ void CPc::SendMsg( static_cast(this->unknown_0490)->SetLimits(0, 0); this->unknown_0490->Move(this->render.screenX - 30, ScaleByScreenHeight(12) + this->render.screenY); break; - case 3: { + case AM_STANDENTRY: { PcStandEntry* entry = reinterpret_cast(b); mode->CellCenter(entry->cellX, entry->cellY, this->render.position.x, this->render.position.z); this->render.position.y = @@ -4812,13 +4814,13 @@ void CPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -4827,7 +4829,7 @@ void CPc::SendMsg( } break; } - case 124: { + case AM_STANDENTRY2: { PcStandEntry* entry = reinterpret_cast(b); this->unknown_04D0 = entry->unknown_0078; mode->CellCenter(entry->cellX, entry->cellY, this->render.position.x, this->render.position.z); @@ -4852,13 +4854,13 @@ void CPc::SendMsg( this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); this->unknown_04CC = entry->unknown_0074; switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -4883,7 +4885,7 @@ void CPc::SendMsg( this->SetBodyPaletteName(); break; } - case 4: { + case AM_INITSTANDENTRY: { PcStandEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); @@ -4908,13 +4910,13 @@ void CPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -4927,7 +4929,7 @@ void CPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 121: { + case AM_INITSTANDENTRY2: { PcStandEntry* entry = reinterpret_cast(b); this->unknown_04D0 = entry->unknown_0078; this->render.accountId = entry->aid; @@ -4954,13 +4956,13 @@ void CPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -4974,7 +4976,7 @@ void CPc::SendMsg( this->unknown_04CC = entry->unknown_0074; break; } - case 6: { + case AM_INITMOVEENTRY: { PcMoveEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; *reinterpret_cast(&this->unknown_0170[4]) = entry->speed; @@ -5005,7 +5007,7 @@ void CPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 122: { + case AM_INITMOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); this->unknown_04D0 = entry->unknown_007C; this->render.accountId = entry->aid; @@ -5039,7 +5041,7 @@ void CPc::SendMsg( this->unknown_04CC = entry->unknown_0078; break; } - case 5: { + case AM_MOVEENTRY: { PcMoveEntry* entry = reinterpret_cast(b); this->unknown_04D0 = entry->unknown_007C; this->render.accountId = entry->aid; @@ -5065,7 +5067,7 @@ void CPc::SendMsg( this->unknown_04CC = entry->unknown_0078; break; } - case 123: { + case AM_MOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); this->unknown_04D0 = entry->unknown_007C; this->render.accountId = entry->aid; @@ -5097,7 +5099,7 @@ void CPc::SendMsg( this->unknown_0494 = d; this->unknown_0498 = b; break; - case 101: { + case AM_MAKE_BIRD: { if (this->unknown_037C[0] != 0) { break; } @@ -5191,18 +5193,18 @@ void CGrannyPc::SendMsg( ) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (*reinterpret_cast(&message)) { - case 100: + case AM_SET_HEAD_DIR: if (this->render.unknown_0070 == 0 || this->render.unknown_0070 == 6) { this->render.curMotion = b; } break; - case 35: + case AM_REMOVEGAGE: if (this->unknown_0478) { g_windowMgr.Schedule(this->unknown_0478); this->unknown_0478 = nullptr; } break; - case 34: + case AM_UPDATEGAGE: if (!this->unknown_0478) { this->unknown_0478 = new UIPcGage(); this->unknown_0478->SetSize(60, 5); @@ -5212,7 +5214,7 @@ void CGrannyPc::SendMsg( static_cast(this->unknown_0478)->SetLimits(0, 0); this->unknown_0478->Move(this->render.screenX - 30, ScaleByScreenHeight(12) + this->render.screenY); break; - case 3: { + case AM_STANDENTRY: { PcStandEntry* entry = reinterpret_cast(b); mode->CellCenter(entry->cellX, entry->cellY, this->render.position.x, this->render.position.z); this->render.position.y = @@ -5234,13 +5236,13 @@ void CGrannyPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -5249,7 +5251,7 @@ void CGrannyPc::SendMsg( } break; } - case 124: { + case AM_STANDENTRY2: { PcStandEntry* entry = reinterpret_cast(b); mode->CellCenter(entry->cellX, entry->cellY, this->render.position.x, this->render.position.z); this->render.position.y = @@ -5271,13 +5273,13 @@ void CGrannyPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -5297,8 +5299,8 @@ void CGrannyPc::SendMsg( this->SetBodyPaletteName(); break; } - case 4: - case 121: { + case AM_INITSTANDENTRY: + case AM_INITSTANDENTRY2: { PcStandEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; CGameMode* gameMode = static_cast(g_modeMgr.GetGameMode()); @@ -5323,13 +5325,13 @@ void CGrannyPc::SendMsg( this->SetGuildInfo(entry->guildId, entry->guildVersion); this->SetPropensityInfo(entry->unknown_0068, entry->unknown_006C); switch (entry->state) { - case 0: + case PCSTATE_STAND: this->SetState(0, 1); break; - case 1: + case PCSTATE_DEAD: this->SetState(3, 1); break; - case 2: + case PCSTATE_SIT: this->SetState(6, 1); break; default: @@ -5342,7 +5344,7 @@ void CGrannyPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 6: { + case AM_INITMOVEENTRY: { PcMoveEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; *reinterpret_cast(&this->unknown_0170[4]) = entry->speed; @@ -5373,7 +5375,7 @@ void CGrannyPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 122: { + case AM_INITMOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; *reinterpret_cast(&this->unknown_0170[4]) = entry->speed; @@ -5407,8 +5409,8 @@ void CGrannyPc::SendMsg( this->ShowPartyMemberEffect(entry->aid); break; } - case 5: - case 123: { + case AM_MOVEENTRY: + case AM_MOVEENTRY2: { PcMoveEntry* entry = reinterpret_cast(b); this->render.accountId = entry->aid; *reinterpret_cast(&this->unknown_0170[4]) = entry->speed; @@ -5458,7 +5460,7 @@ bool CGrannyPc::ProcessState() { g_modeMgr.GetGameMode(); switch (this->render.unknown_0070) { - case 8: { + case ST_BEGIN_SKILL: { this->ProcessMotion(); const int frames = static_cast(this->GetElapsedFrames()); if (this->hitTargetAid != 0 && frames % 34 == 0) { @@ -5469,25 +5471,25 @@ bool CGrannyPc::ProcessState() { } return true; } - case 7: + case ST_SKILL: this->ProcessMotion(); if (this->render.isMotionFinished) { this->SetState(0, 1); } return true; - case 2: + case ST_ATTACK: this->ProcessMotion(); this->GetElapsedFrames(); if (this->render.isMotionFinished) { this->SetState(0, 1); } return true; - case 3: + case ST_DEAD: this->render.unknown_00C8 = 0; this->render.unknown_00D8 = 0; this->render.unknown_00DC = 0; this->render.isMotionFreezed = false; - case 6: + case ST_SIT: this->ProcessMotion(); return true; default: @@ -5509,7 +5511,7 @@ bool CPc::ProcessState() { g_modeMgr.GetGameMode(); switch (this->render.unknown_0070) { - case 8: { + case ST_BEGIN_SKILL: { this->ProcessMotion(); const int frames = static_cast(this->GetElapsedFrames()); if (this->hitTargetAid != 0 && frames % 34 == 0) { @@ -5520,8 +5522,8 @@ bool CPc::ProcessState() { } return true; } - case 7: - case 45: + case ST_SKILL: + case ST_AB_SPECIAL: case 62: case 63: case 64: @@ -5545,19 +5547,19 @@ bool CPc::ProcessState() { this->SetState(0, 1); } return true; - case 2: + case ST_ATTACK: this->ProcessMotion(); this->GetElapsedFrames(); if (this->render.isMotionFinished) { this->SetState(0, 1); } return true; - case 3: + case ST_DEAD: this->render.unknown_00C8 = 0; this->render.unknown_00D8 = 0; this->render.unknown_00DC = 0; this->render.isMotionFreezed = false; - case 6: + case ST_SIT: case 60: case 61: case 66: diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 9437af9ff..15620777a 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/Npc.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Skills/SkillId.h" #include "Contents/Actors/GrannyGameActor.h" @@ -349,16 +350,16 @@ void CRenderObject::ProcessMotion() { int motion; float progress; switch (this->render.unknown_006C) { - case 0: + case MT_LOOP: this->render.curMotion = static_cast(frame / this->render.speed) % static_cast(action->FrameCount(this->render.previousAnimation)); return; - case 1: + case MT_ONETIME: count = static_cast(action->FrameCount(this->render.previousAnimation)); progress = frame / this->render.speed; motion = static_cast(progress); break; - case 2: { + case MT_STATIC: { if (this->render.unknown_0070 != 2) { return; } @@ -1325,7 +1326,7 @@ void CGameActor::SetState(int state, int resetPosition) { } switch (state) { - case 0xd: + case ST_AUTOCOUNTER: if (g_session.IsPlayerJobId(this->GetEffectiveJob(-1))) { const std::int64_t weapon = this->GetWeapon(); IsJobWeaponAllowed(this->GetEffectiveJob(-1), this->unknown_0260, weapon); @@ -1336,7 +1337,7 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.isMotionFreezed = true; } break; - case 4: { + case ST_DAMAGE: { if (this->render.unknown_00C8 != 0 || this->render.unknown_00D8 != 0 || this->render.unknown_00DC != 0) { return; } @@ -1357,12 +1358,12 @@ void CGameActor::SetState(int state, int resetPosition) { } break; } - case 7: + case ST_SKILL: if (this->render.unknown_0070 == 6) { return; } - case 2: - case 9: + case ST_ATTACK: + case ST_ATTACK2: this->SetAction(action, 3, this->unknown_0404 == 1 ? 2 : 1); if (this->render.unknown_0070 != 9 && this->render.unknown_0070 != 2) { if (this->hitTargetAid == g_session.m_aid) { @@ -1383,7 +1384,7 @@ void CGameActor::SetState(int state, int resetPosition) { this->unknown_0378 = static_cast(this->GetAttackMotion()); this->RegisterPos(); break; - case 3: + case ST_DEAD: this->render.unknown_00C8 = 0; this->render.unknown_00D8 = 0; this->render.unknown_00DC = 0; @@ -1397,46 +1398,46 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.isMotionFreezed = false; this->SetAction(action, 4, 1); break; - case 0: + case ST_STAND: this->SetAction(action, 4, 0); if (!IsObfuscatedMessage(this->render.accountId)) { this->render.isMotionFinished = true; } this->RegisterPos(); break; - case 1: + case ST_MOVE: if (this->unknown_0184 == 0) { this->SetAction(action, 6, 0); } this->UnRegisterPos(); break; - case 5: + case ST_PICKUP: this->unknown_0178 = 0; this->render.isMotionFreezed = false; - case 0xb: + case ST_ATTACKWAIT: this->SetAction(action, 6, 1); break; - case 0xc: + case ST_THROW: this->SetAction(action, 3, 1); this->RegisterPos(); break; - case 0x10: + case ST_DANCE: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 1, 3, 0, 0, 1, 99999999, 1); break; - case 0x11: + case ST_SING: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 1, 3, action, 1, 1, 99999999, 1); break; - case 0x12: + case ST_READYSHOT: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 0, 0, action, 0, 1, 3000, 0); break; - case 0x1c: + case ST_THROW2: this->render.unknown_00C2 = 10; this->SetAnimationSequence(action, 0, action, 1, action, 2, action, 3, action, 4, 1, 1000, 0); break; - case 0x13: + case ST_READYJUMP: if (g_session.IsDoramJob(this->GetEffectiveJob(-1)) == true) { this->render.unknown_00C2 = 10; this->SetAnimationSequence(action, 0, action, 0, action, 0, action, 1, action, 1, 1, 3000, 0); @@ -1453,51 +1454,51 @@ void CGameActor::SetState(int state, int resetPosition) { this->LaunchEffect(0x19b, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); } break; - case 0x14: + case ST_LANDJUMP: this->render.unknown_00C2 = 10; this->SetAnimationSequence(action, 1, action, 1, action, 1, action, 1, 8, 5, 1, 3000, 0); break; - case 0x15: + case ST_R_STORM: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 0, 0, action, 0, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x1e: + case ST_A_STORM: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); break; - case 0x16: + case ST_R_DOWN: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 2, 2, action, 2, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x21: + case ST_SG_DOWN: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 2, 2, action, 2, 1, 1000, 0); break; - case 0x1f: + case ST_A_DOWN: this->render.unknown_00C2 = 5; this->SetAnimationSequence(0x50, 3, 0x50, 5, 0x50, 7, 0x50, 8, 0x50, 2, 1, 500, 0); break; - case 0x17: + case ST_R_TURN: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 3, 3, action, 3, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x22: + case ST_SG_TURN: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 3, 3, action, 3, 1, 1000, 0); break; - case 0x20: + case ST_A_TURN: this->render.unknown_00C2 = 5; this->SetAnimationSequence(action, 4, action, 5, action, 6, action, 7, action, 2, 1, 500, 0); break; - case 0x18: + case ST_R_COUNTER: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 4, 4, action, 4, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x1a: { + case ST_A_COUNTER: { this->render.unknown_00C2 = 4; int frame0; int frame1; @@ -1521,16 +1522,16 @@ void CGameActor::SetState(int state, int resetPosition) { this->SetAnimationSequence(action, frame0, action, frame1, action, frame2, action, frame3, action, frame4, 1, 500, 0); break; } - case 0x19: + case ST_R_DODGE: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 1, 1, action, 1, 1, 2000, 0); this->LaunchEffect(0x1c1, vector3d{0.0f, 0.0f, 0.0f}, 0.0f); break; - case 0x1b: + case ST_A_JUMPKICK: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 5, 5, action, 5, 1, 3000, 0); break; - case 0x24: + case ST_NINJASKILL2: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 2, 5, action, 5, 1, 1000, 0); break; @@ -1540,7 +1541,7 @@ void CGameActor::SetState(int state, int resetPosition) { break; case 0x38: this->render.isMotionFinished = false; - case 0x23: + case ST_NINJASKILL1: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 1, action, 1, 1, 500, 0); break; @@ -1549,7 +1550,7 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 5, 5, action, 5, 1, 500, 0); break; - case 0x25: { + case ST_NINJAREADY: { this->render.unknown_00C2 = 10; int random = rand() % 2; random = random < 0 ? 0 : random; @@ -1557,7 +1558,7 @@ void CGameActor::SetState(int state, int resetPosition) { this->SetFrameSequence(action, frame, frame, action, frame, 1, 500, 0); break; } - case 0x26: { + case ST_GUNSKILL1: { this->render.unknown_00C2 = 6; int random = rand() % 2; random = random < 0 ? 0 : random; @@ -1568,11 +1569,11 @@ void CGameActor::SetState(int state, int resetPosition) { } break; } - case 0x28: + case ST_GUNSKILL3: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 2, action, 2, 1, 500, 0); break; - case 0x29: { + case ST_GUNREADY: { this->render.unknown_00C2 = 10; int random = rand() % 2; random = random < 0 ? 0 : random; @@ -1580,19 +1581,19 @@ void CGameActor::SetState(int state, int resetPosition) { this->SetFrameSequence(action, frame, frame, action, frame, 1, 500, 0); break; } - case 0x2a: + case ST_GUNREADY2: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 0, 0, action, 0, 1, 500, 0); break; - case 0x2b: + case ST_MADOSKILL: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 5, 5, action, 5, 1, 500, 0); break; - case 0x2c: + case ST_MADOSKILL2: this->render.unknown_00C2 = 10; this->SetFrameSequence(action, 4, 4, action, 4, 1, 500, 0); break; - case 0x2d: + case ST_AB_SPECIAL: case 0x34: case 0x35: case 0x36: @@ -1616,7 +1617,7 @@ void CGameActor::SetState(int state, int resetPosition) { this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 0, 3, action, 3, 1, 9999999, 1); break; - case 0x27: + case ST_GUNSKILL2: case 0x30: this->render.unknown_00C2 = 6; this->SetFrameSequence(action, 4, 5, action, 5, 1, 500, 0); @@ -2740,7 +2741,7 @@ void CCharacterNpc::SendMsg( ) { CharacterNpcViewInfo* info = reinterpret_cast(b); switch (static_cast(a) << 32 | static_cast(message)) { - case 4: + case AM_INITSTANDENTRY: this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); this->render.visible = IsVisibleJob(info->job) ? 1 : 0; this->SetGuildInfo(info->unknown_0060, info->unknown_0064); @@ -2750,15 +2751,15 @@ void CCharacterNpc::SendMsg( this->unknown_0440 = reinterpret_cast(new CCharacterRender(0, 0)); FillCharacterNpcRenderPrimary(this, info); return; - case 3: + case AM_STANDENTRY: this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); if (this->unknown_0440 == nullptr) { return; } FillCharacterNpcRenderPrimary(this, info); return; - case 6: - case 0x7a: + case AM_INITMOVEENTRY: + case AM_INITMOVEENTRY2: this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); if (this->unknown_0440 != nullptr) { return; @@ -2766,8 +2767,8 @@ void CCharacterNpc::SendMsg( this->unknown_0440 = reinterpret_cast(new CCharacterRender(0, 0)); FillCharacterNpcRenderSecondary(this, info); return; - case 5: - case 0x7b: + case AM_MOVEENTRY: + case AM_MOVEENTRY2: this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); if (this->unknown_0440 == nullptr) { return; @@ -2959,16 +2960,16 @@ void CRenderObject::UpdateTlvertex(const float* matrix) { int CGameActor::ActionBase(int state) { int base = 16; switch (state) { - case 0: + case ST_STAND: base = 0; break; - case 1: + case ST_MOVE: base = 8; break; - case 4: + case ST_DAMAGE: base = 24; break; - case 3: + case ST_DEAD: base = 32; break; } @@ -3288,15 +3289,15 @@ CActRes* CRenderObject::GetActRes() { int CGameActor::WeaponActionBase(int weaponType) { int base = 0; switch (weaponType) { - case 0: + case ST_STAND: base = 0; break; - case 1: + case ST_MOVE: base = 8; break; - case 2: - case 43: - case 44: + case ST_ATTACK: + case ST_MADOSKILL: + case ST_MADOSKILL2: case 52: case 60: case 62: @@ -3308,20 +3309,20 @@ int CGameActor::WeaponActionBase(int weaponType) { case 79: base = 80; break; - case 3: + case ST_DEAD: base = 64; break; - case 4: + case ST_DAMAGE: base = 48; break; - case 5: - case 20: - case 25: + case ST_PICKUP: + case ST_LANDJUMP: + case ST_R_DODGE: base = 24; break; - case 9: - case 18: - case 32: + case ST_ATTACK2: + case ST_READYSHOT: + case ST_A_TURN: case 49: case 53: case 54: @@ -3332,39 +3333,39 @@ int CGameActor::WeaponActionBase(int weaponType) { case 77: base = 88; break; - case 11: + case ST_ATTACKWAIT: base = 32; break; - case 12: - case 19: - case 28: - case 40: - case 42: + case ST_THROW: + case ST_READYJUMP: + case ST_THROW2: + case ST_GUNSKILL3: + case ST_GUNREADY2: case 50: case 51: case 58: base = 40; break; - case 13: + case ST_AUTOCOUNTER: base = IsJobWeaponAllowed(this->GetEffectiveJob(-1), this->unknown_0260, this->GetWeapon()) ? 88 : 80; break; - case 16: - case 17: - case 21: - case 22: - case 23: - case 24: - case 27: - case 30: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 41: - case 45: + case ST_DANCE: + case ST_SING: + case ST_R_STORM: + case ST_R_DOWN: + case ST_R_TURN: + case ST_R_COUNTER: + case ST_A_JUMPKICK: + case ST_A_STORM: + case ST_SG_DOWN: + case ST_SG_TURN: + case ST_NINJASKILL1: + case ST_NINJASKILL2: + case ST_NINJAREADY: + case ST_GUNSKILL1: + case ST_GUNSKILL2: + case ST_GUNREADY: + case ST_AB_SPECIAL: case 47: case 48: case 55: @@ -3380,7 +3381,7 @@ int CGameActor::WeaponActionBase(int weaponType) { case 81: base = 96; break; - case 26: + case ST_A_COUNTER: switch (this->GetEffectiveJob(-1)) { case JT_LINKER: case JT_LINKER_B: diff --git a/Source/Contents/Actors/Skill.cpp b/Source/Contents/Actors/Skill.cpp index 21964ae6d..fa485309c 100644 --- a/Source/Contents/Actors/Skill.cpp +++ b/Source/Contents/Actors/Skill.cpp @@ -1,4 +1,5 @@ #include "Contents/Actors/Skill.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Skills/SkillId.h" #include "Contents/Skills/SkillUnitId.h" @@ -347,7 +348,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (static_cast(a) << 32 | static_cast(message)) { - case 7: { + case AM_CHAT: { const char* text = reinterpret_cast(b); if (std::strlen(text) == 0) { return; @@ -370,7 +371,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int balloon->Move(this->render.screenX - this->unknown_0288 / 2, this->render.screenY - g_renderer->viewport.height * 110 / 480); return; } - case 0x25: { + case AM_SKILL: { const SkillHitMessage* hit = reinterpret_cast(b); const int skillId = hit->skillId; const int unknown_0014 = hit->unknown_0014; @@ -493,7 +494,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int } return; } - case 0x2D: { + case AM_SKILLSTANDENTRY: { const SkillUnitMessage* unit = reinterpret_cast(b); this->range = unit->range; this->skillAid = unit->aid; @@ -900,7 +901,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int return; } } - case 0x2F: + case AM_SETJOB: this->SetActorJob(b); switch (this->GetEffectiveJob(-1)) { case UNT_WARP_WAITING: { @@ -927,7 +928,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int this->m_model->playback = 1; } return; - case 0x35: + case AM_DISAPPEAR: if (this->GetEffectiveJob(-1) == UNT_CANE_OF_EVIL_EYE) { CEffect* effect = g_effectMgr->Find(this->render.accountId, 0x903); if (effect != nullptr) { @@ -938,7 +939,7 @@ void CSkill::SendMsg(CGameObject* sender, int message, int a, int b, int c, int actions->OnSkillObjectRemove(this->GetEffectiveJob(-1), this); } return; - case 0x77: + case AM_SKILL_UPDATE: if (this->render.enabled) { return; } diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 5b06a84f7..80bb2f302 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UINewSelectCharWnd.h" #include "Contents/CashEmotionMgr.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -1689,7 +1690,7 @@ void UICashEmotionListChildWnd_Abstract::OnWheel(int delta) { // FUNCTION: fn_09345 int UICashEmotionListChildWnd_Abstract::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 7: + case UM_SCROLLVERT: this->scrollPosition += argument1; if (this->scrollPosition < 0) { this->scrollPosition = 0; @@ -1701,7 +1702,7 @@ int UICashEmotionListChildWnd_Abstract::SendMsg(UIWindow* sender, int message, s this->scrollBar->Invalidate(); this->SendMsg(sender, 60, 0, 0, 0, 0); break; - case 60: + case UM_REFRESH: this->Invalidate(); if (this->parent) { this->parent->SendMsg(sender, 60, 0, 0, 0, 0); @@ -2400,7 +2401,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->RefreshCurrentList(); return 0; - case 34: + case UM_SETINFO: this->m_placement = reinterpret_cast(argument1); if (this->m_placement) { if (!this->m_placement->IsValid()) { @@ -2410,7 +2411,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 6: + case UM_COMMAND: switch (argument1) { case 189: if (this->m_searchEdit) { @@ -2433,7 +2434,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(87); return 0; @@ -2527,7 +2528,7 @@ int UICashEmotionListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_cashEmotionMgr->unknown_01C4 = argument1; return this->SetPeriod(argument1); - case 60: + case UM_REFRESH: this->Invalidate(); return 0; } @@ -2855,7 +2856,7 @@ int UICashEmotionMiniWnd::SendMsg( std::pair entry; switch (message) { - case 60: + case UM_REFRESH: this->Invalidate(); return 0; @@ -2864,7 +2865,7 @@ int UICashEmotionMiniWnd::SendMsg( entry.second = static_cast(argument2); break; - case 6: + case UM_COMMAND: if (argument1 == 1) { this->Previous(); } else if (argument1 == 2) { @@ -3118,7 +3119,7 @@ int UICashEmotionPack::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 60: + case UM_REFRESH: this->Invalidate(); if (this->parent) { this->parent->SendMsg(sender, 60, 0, 0, 0, 0); @@ -3224,7 +3225,7 @@ int UICashEmotionPack_Purchase::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 60: + case UM_REFRESH: this->Invalidate(); if (this->parent) { this->parent->SendMsg(sender, 60, 0, 0, 0, 0); @@ -3339,7 +3340,7 @@ int UICashEmotionPack_Search_UnPurchased::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 60: + case UM_REFRESH: this->Invalidate(); if (this->parent) { this->parent->SendMsg(this, 60, 0, 0, 0, 0); @@ -3541,12 +3542,12 @@ int UICashEmotionPiece::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 189 && this->parent) { this->parent->SendMsg(this, 174, this->m_packId, this->m_emotionId, 0, 0); } return 0; - case 60: + case UM_REFRESH: this->Invalidate(); if (this->parent) { this->parent->SendMsg(this, 60, 0, 0, 0, 0); diff --git a/Source/Contents/ClientItemLists.cpp b/Source/Contents/ClientItemLists.cpp index 04d37cad4..7f552c178 100644 --- a/Source/Contents/ClientItemLists.cpp +++ b/Source/Contents/ClientItemLists.cpp @@ -1,3 +1,4 @@ +#include "Network/Packets/NoticeEnums.h" #include "Client/Mode/CGameMode.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Items/InventoryType.h" @@ -363,7 +364,7 @@ void ReceiveFriendAddResult(const unsigned char* data) { char buffer[128]; int message; switch (packet->result) { - case 0: { + case FRIEND_ADD_SUCCEED: { std::sprintf(buffer, LookupMessage(821), name); g_windowMgr.SendNotice(1, reinterpret_cast(buffer), 0xFFFF00, 0, 0, 0); @@ -376,13 +377,13 @@ void ReceiveFriendAddResult(const unsigned char* data) { g_session.RefreshWindow02C8(); return; } - case 1: + case FRIEND_ADD_FALSE: message = 822; break; - case 2: + case FRIEND_ADD_ME_OVERSIZE: g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(819)), 0xFF, 0, 0, 0); return; - case 3: + case FRIEND_ADD_OTHER_OVERSIZE: message = 820; break; case 4: @@ -1192,19 +1193,19 @@ EquipSlots CSession::GetEquipSlots(int location) { case EQP_COSTUME_HEAD_MID: mask = 0x200; break; - case 0xC00: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID: mask = 0x300; break; case EQP_COSTUME_HEAD_LOW: mask = 1; break; - case 0x1400: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_LOW: mask = 0x101; break; - case 0x1800: + case EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW: mask = 0x201; break; - case 0x1C00: + case EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW: mask = 0x301; break; case EQP_COSTUME_GARMENT: diff --git a/Source/Contents/Combat/CombatTypes.h b/Source/Contents/Combat/CombatTypes.h index ffd54c9b9..e7b3c20c9 100644 --- a/Source/Contents/Combat/CombatTypes.h +++ b/Source/Contents/Combat/CombatTypes.h @@ -17,8 +17,6 @@ enum e_damage_type : int { DMG_SPLASH_ENDURE = 14, }; -#endif - enum spirit_charm_types : int { CHARM_TYPE_WATER = 1, CHARM_TYPE_LAND = 2, @@ -83,3 +81,5 @@ enum e_size : int { SZ_MEDIUM = 1, SZ_BIG = 2, }; + +#endif diff --git a/Source/Contents/Configuration/ServiceConfiguration.cpp b/Source/Contents/Configuration/ServiceConfiguration.cpp index 58c74f82b..97468126d 100644 --- a/Source/Contents/Configuration/ServiceConfiguration.cpp +++ b/Source/Contents/Configuration/ServiceConfiguration.cpp @@ -1,4 +1,5 @@ #include "Client/Input/InputCharset.h" +#include "Contents/Configuration/ServiceEnums.h" #include "Client/Input/LanguageTC.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Archive/PakRegistry.h" @@ -197,12 +198,12 @@ void InitializeServiceStrings() { LoadEtcInfo(); switch (g_serviceType) { - case 0: + case ServiceKorea: case 1: - case 2: - case 3: - case 4: - case 5: + case ServiceJapan: + case ServiceChina: + case ServiceTaiwan: + case ServiceThai: case 6: case 7: case 8: @@ -211,9 +212,9 @@ void InitializeServiceStrings() { case 11: case 12: case 13: - case 14: - case 15: - case 17: + case ServiceRussia: + case ServiceVietnam: + case ServiceChile: case 18: case 19: case 20: @@ -307,17 +308,17 @@ void InitializeServiceStrings() { void LoadLoadingScreens(int count) { if (count == 0) { switch (g_serviceType) { - case 0: + case ServiceKorea: count = 7; break; case 1: - case 15: + case ServiceVietnam: count = 12; break; - case 3: + case ServiceChina: count = 4; break; - case 5: + case ServiceThai: case 7: count = 8; break; @@ -390,27 +391,27 @@ void InitializeLanguage() { static CLanguageArabic arabicCharset; switch (g_serviceType) { - case 0: + case ServiceKorea: g_language = 0; g_textCodePage = 949; g_serverLanguage = &defaultCharset; break; - case 2: + case ServiceJapan: g_language = 2; g_textCodePage = 932; g_serverLanguage = &defaultCharset; break; - case 3: + case ServiceChina: g_language = 3; g_serverLanguage = &traditionalChineseCharset; g_textCodePage = 936; break; - case 4: + case ServiceTaiwan: g_language = 4; g_serverLanguage = &traditionalChineseCharset; g_textCodePage = 950; break; - case 5: + case ServiceThai: g_language = 5; g_serverLanguage = &thaiCharset; g_textCodePage = 874; @@ -434,19 +435,19 @@ void InitializeLanguage() { g_textCodePage = 1252; g_serverLanguage = &defaultCharset; break; - case 14: + case ServiceRussia: g_language = 1; g_inlineCharset = 0; g_textCodePage = 1251; g_serverLanguage = &defaultCharset; break; - case 15: + case ServiceVietnam: g_language = 7; g_inlineCharset = 0; g_textCodePage = 1258; g_serverLanguage = &defaultCharset; break; - case 17: + case ServiceChile: g_language = 1; g_inlineCharset = 0; g_textCodePage = 1145; diff --git a/Source/Contents/Configuration/ServiceEnums.h b/Source/Contents/Configuration/ServiceEnums.h new file mode 100644 index 000000000..f650c3a81 --- /dev/null +++ b/Source/Contents/Configuration/ServiceEnums.h @@ -0,0 +1,15 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_CONFIGURATION_SERVICEENUMS_H +#define RAGNAROK_SOURCE_CONTENTS_CONFIGURATION_SERVICEENUMS_H + +enum ServiceType : int { + ServiceKorea = 0, + ServiceJapan = 2, + ServiceChina = 3, + ServiceTaiwan = 4, + ServiceThai = 5, + ServiceRussia = 14, + ServiceVietnam = 15, + ServiceChile = 17, +}; + +#endif diff --git a/Source/Contents/Effects/EffectPrimId.h b/Source/Contents/Effects/EffectPrimId.h new file mode 100644 index 000000000..b58ca3585 --- /dev/null +++ b/Source/Contents/Effects/EffectPrimId.h @@ -0,0 +1,94 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_EFFECTS_EFFECTPRIMID_H +#define RAGNAROK_SOURCE_CONTENTS_EFFECTS_EFFECTPRIMID_H + +enum EFFECTPRIMID : int { + PP_2DTEXTURE = 0, + PP_2DTEXTUREORBIT = 1, + PP_2DQUAD = 2, + PP_2DFLASH = 3, + PP_2DCIRCLE = 4, + PP_3DPARTICLE = 5, + PP_3DPARTICLEGRAVITY = 6, + PP_3DPARTICLEORBIT = 7, + PP_3DPARTICLESPLINE = 8, + PP_3DQUADHORN = 9, + PP_3DSPLINE = 10, + PP_3DSPIRAL = 11, + PP_3DCIRCLE = 12, + PP_3DCYLINDER = 13, + PP_3DSPHERE = 14, + PP_3DTEXTURE = 15, + PP_3DCROSSTEXTURE = 16, + PP_3DCYLINDERHALF = 18, + PP_3DFLASH = 19, + PP_3DLINE = 20, + PP_3DPARTICLE_NOMASTER = 21, + PP_3DTEXTURE_NOMASTER = 22, + PP_3DCASTING = 23, + PP_3DCASTING_2 = 24, + PP_3DCASTING_3 = 25, + PP_MAPPARTICLE = 27, + PP_GI_3 = 34, + PP_GRANDCROSS2 = 37, + PP_LINELINK = 38, + PP_SAKURA = 40, + PP_SHIELDBOOMERANG = 42, + PP_INTIMIDATE = 43, + PP_TEIHIT2 = 45, + PP_BOTTOM = 47, + PP_BOTTOM2 = 48, + PP_BOTTOMOUT = 49, + PP_POKJUK = 52, + PP_THROWITEM = 53, + PP_CHEMICALPROTECTION = 54, + PP_CHEMICAL2 = 55, + PP_CHEMICAL3 = 56, + PP_FIRSTAID = 58, + PP_PARTICLE_UP = 59, + PP_GUARD = 61, + PP_WIND = 62, + PP_RECT_UP = 64, + PP_3DCASTING_4 = 65, + PP_FOREST = 66, + PP_ASURACASTING = 68, + PP_HITLINE = 70, + PP_BLIND = 71, + PP_MAGNUM2 = 73, + PP_SLASH1 = 75, + PP_SAINTWING = 76, + PP_SPHEREWIND = 77, + PP_COLORPAPER = 78, + PP_GHOST = 84, + PP_SUPERANGEL = 85, + PP_RECT_UP2 = 90, + PP_SPHEREWIND2 = 91, + PP_RAINBOW = 93, + PP_PEONG = 94, + PP_EFFECTTEXTURE2 = 95, + PP_PEONGUP = 96, + PP_TANJI2 = 97, + PP_DOUBLEGUMGANG = 99, + PP_HITLINE3 = 100, + PP_ELECTRIC = 101, + PP_ELECTRIC2 = 102, + PP_HALFSPHERE = 104, + PP_ATTACKENERGY2 = 106, + PP_3DCASTING_5 = 107, + PP_FLOWERCAST = 108, + PP_SOULLINK = 109, + PP_HEAL_LOW = 110, + PP_SOULPARTICLE = 111, + PP_HERMODE = 114, + PP_SHIELDBOOMERANG3 = 116, + PP_3DQUADHORN2 = 117, + PP_ACIDDEMON = 118, + PP_SMA = 120, + PP_SMA2 = 121, + PP_TWILIGHT = 123, + PP_KOUENKA = 124, + PP_STIN4 = 125, + PP_BUBBLE_DROP = 127, + PP_EFFECTTEXTURE_ANI = 128, +}; + +#endif diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 58e5c2b4c..644386846 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/EffectPrimitiveMotion.h" +#include "Contents/Effects/EffectPrimId.h" #include "Client/Application/ErrorDialog.h" #include "Render/DeviceContext/DCSurface.h" #include "Client/Mode/CGameMode.h" @@ -7988,12 +7989,12 @@ bool CEffectPrim::OnProcess() { } switch (this->state.count) { - case 0: + case PP_2DTEXTURE: if (this->state.slots[0].life < 98 && g_updateTick == 0) { return true; } break; - case 16: + case PP_3DCROSSTEXTURE: if (this->state.slots[0].life != 99 && g_updateTick == 0) { return true; } @@ -8005,14 +8006,14 @@ bool CEffectPrim::OnProcess() { case 32: case 35: case 60: - case 68: + case PP_ASURACASTING: case 99: case 104: case 105: case 106: - case 108: + case PP_FLOWERCAST: case 109: - case 111: + case PP_SOULPARTICLE: case 130: case 131: case 132: @@ -8038,17 +8039,17 @@ bool CEffectPrim::OnProcess() { } switch (this->state.count) { - case 0: - case 2: + case PP_2DTEXTURE: + case PP_2DQUAD: if (!this->Move2DPrimitive()) { return false; } break; - case 15: - case 16: + case PP_3DTEXTURE: + case PP_3DCROSSTEXTURE: this->MoveEffectPrimitive(); break; - case 1: { + case PP_2DTEXTUREORBIT: { this->state.orgPos.x = this->state.deltaPos2.x + this->state.master->state.tlvertX; this->state.orgPos.y = this->state.deltaPos2.y + this->state.master->state.tlvertY; this->state.radiusSpeed = this->state.radiusAccel + this->state.radiusSpeed; @@ -8076,7 +8077,7 @@ bool CEffectPrim::OnProcess() { } } } break; - case 3: { + case PP_2DFLASH: { this->render.position.x = this->state.deltaPos2.x + this->state.master->state.tlvertX; this->render.position.y = this->state.deltaPos2.y + this->state.master->state.tlvertY; @@ -8103,7 +8104,7 @@ bool CEffectPrim::OnProcess() { this->state.arcAngle = this->state.widthSpeed + this->state.arcAngle; this->state.ProcessAlpha(); } break; - case 4: { + case PP_2DCIRCLE: { this->render.position.x = this->state.deltaPos2.x + this->state.master->state.tlvertX; this->render.position.y = this->state.deltaPos2.y + this->state.master->state.tlvertY; this->state.radiusSpeed = this->state.radiusAccel + this->state.radiusSpeed; @@ -8117,7 +8118,7 @@ bool CEffectPrim::OnProcess() { this->state.ProcessAlpha(); } break; - case 5: + case PP_3DPARTICLE: if (!this->Prim3DParticle()) { return false; } @@ -8127,17 +8128,17 @@ bool CEffectPrim::OnProcess() { return false; } break; - case 6: + case PP_3DPARTICLEGRAVITY: if (!this->Prim3DParticleGravity()) { return false; } break; - case 7: + case PP_3DPARTICLEORBIT: if (!this->Prim3DParticleOrbit()) { return false; } break; - case 8: + case PP_3DPARTICLESPLINE: this->Prim3DParticleSpline(); break; case 9: @@ -8173,13 +8174,13 @@ bool CEffectPrim::OnProcess() { this->render.position.z = this->state.deltaPos.z + this->state.orgPos.z; this->state.ProcessAlpha(); } break; - case 12: + case PP_3DCIRCLE: this->Prim3DCircle(); break; - case 13: + case PP_3DCYLINDER: this->Prim3DCylinder(); break; - case 14: { + case PP_3DSPHERE: { this->state.orgPos.x = this->state.master->render.position.x + this->state.deltaPos2.x; this->state.orgPos.y = this->state.master->render.position.y + this->state.deltaPos2.y; this->state.orgPos.z = this->state.master->render.position.z + this->state.deltaPos2.z; @@ -8191,10 +8192,10 @@ bool CEffectPrim::OnProcess() { this->state.longitude = this->state.longSpeed + this->state.longitude; this->state.ProcessAlpha(); } break; - case 18: + case PP_3DCYLINDERHALF: this->Prim3DCylinderHalf(); break; - case 19: { + case PP_3DFLASH: { this->render.position.y = this->state.deltaPos2.y + this->state.master->state.tlvertY; this->render.position.x = this->state.deltaPos2.x + this->state.master->state.tlvertX; @@ -8221,8 +8222,8 @@ bool CEffectPrim::OnProcess() { this->state.heightSize = this->state.heightSpeed + this->state.heightSize; this->state.ProcessAlpha(); } break; - case 10: - case 11: { + case PP_3DSPLINE: + case PP_3DSPIRAL: { this->state.orgPos.x = this->state.master->render.position.x + this->state.deltaPos2.x; this->state.orgPos.y = this->state.master->render.position.y + this->state.deltaPos2.y; this->state.orgPos.z = this->state.master->render.position.z + this->state.deltaPos2.z; @@ -8248,12 +8249,12 @@ bool CEffectPrim::OnProcess() { case 20: this->render.position.y = this->render.position.y + 5.0f; break; - case 21: + case PP_3DPARTICLE_NOMASTER: if (!this->Prim3DParticleNoMaster()) { return false; } break; - case 22: + case PP_3DTEXTURE_NOMASTER: if (!this->Prim3DTextureNoMaster()) { return false; } @@ -8323,16 +8324,16 @@ bool CEffectPrim::OnProcess() { case 25: this->UpdateFireWall(); break; - case 65: + case PP_3DCASTING_4: this->Prim3DCasting4(); break; - case 107: + case PP_3DCASTING_5: this->Prim3DCasting5(); break; - case 108: + case PP_FLOWERCAST: this->PrimFlowerCast(); break; - case 118: + case PP_ACIDDEMON: this->PrimAcidDemon(); break; case 73: { @@ -8382,7 +8383,7 @@ bool CEffectPrim::OnProcess() { } } } break; - case 68: + case PP_ASURACASTING: this->PrimAsuraCasting(); break; case 147: @@ -8515,7 +8516,7 @@ bool CEffectPrim::OnProcess() { case 135: this->PrimTrailShift(); break; - case 102: + case PP_ELECTRIC2: this->PrimElectric2(); break; case 146: @@ -8525,7 +8526,7 @@ bool CEffectPrim::OnProcess() { case 110: this->PrimPulsingColumns(); break; - case 61: + case PP_GUARD: this->PrimGuard(); break; case 104: { @@ -8632,7 +8633,7 @@ bool CEffectPrim::OnProcess() { slot.vecTNow.z = g_sinTable[angle]; } } break; - case 76: + case PP_SAINTWING: this->PrimSaintWing(); break; case 77: { @@ -8656,7 +8657,7 @@ bool CEffectPrim::OnProcess() { } } } break; - case 91: + case PP_SPHEREWIND2: this->PrimSphereWind2(); break; case 78: { @@ -8703,7 +8704,7 @@ bool CEffectPrim::OnProcess() { } } } break; - case 62: + case PP_WIND: this->PrimWind(); break; case 63: @@ -8774,13 +8775,13 @@ bool CEffectPrim::OnProcess() { case 130: this->PrimDriftingSquares(); break; - case 27: + case PP_MAPPARTICLE: this->PrimMapParticle(); break; case 115: this->PrimParticleSpread(); break; - case 111: + case PP_SOULPARTICLE: this->PrimSoulParticle(); break; case 155: @@ -8835,10 +8836,10 @@ bool CEffectPrim::OnProcess() { case 151: this->PrimSpiralFade(); break; - case 96: + case PP_PEONGUP: this->PrimPeongUp(); break; - case 94: + case PP_PEONG: this->PrimPeong(); break; case 80: @@ -8907,7 +8908,7 @@ bool CEffectPrim::OnProcess() { case 31: this->PrimWaveSpin(); break; - case 34: + case PP_GI_3: this->PrimGI3(); break; case 36: { @@ -9080,7 +9081,7 @@ bool CEffectPrim::OnProcess() { case 137: this->PrimHeightRamp(); break; - case 66: + case PP_FOREST: this->PrimForest(); break; case 129: @@ -9303,7 +9304,7 @@ bool CEffectPrim::OnProcess() { case 90: this->PrimFadingColumns(); break; - case 43: + case PP_INTIMIDATE: this->PrimIntimidate(); break; case 44: @@ -9448,7 +9449,7 @@ bool CEffectPrim::OnProcess() { case 122: this->PrimSTIN3(); break; - case 125: + case PP_STIN4: this->PrimSTIN4(); break; case 126: { @@ -9502,7 +9503,7 @@ bool CEffectPrim::OnProcess() { } } } break; - case 120: + case PP_SMA: this->PrimSMA(); break; case 121: @@ -9583,7 +9584,7 @@ bool CEffectPrim::OnProcess() { return false; } break; - case 38: + case PP_LINELINK: this->PrimLineLink(); break; case 69: { @@ -9635,10 +9636,10 @@ bool CEffectPrim::OnProcess() { case 33: this->PrimFieldFireflies(); break; - case 123: + case PP_TWILIGHT: this->PrimTwilight(); break; - case 52: + case PP_POKJUK: this->PrimPokJuk(); break; case 35: @@ -9733,10 +9734,10 @@ bool CEffectPrim::OnProcess() { } } } break; - case 40: + case PP_SAKURA: this->PrimSakura(); break; - case 124: + case PP_KOUENKA: this->PrimKouenka(); break; case 46: { @@ -9759,7 +9760,7 @@ bool CEffectPrim::OnProcess() { this->ShiftSegment(); this->AnimMotion(); } break; - case 84: + case PP_GHOST: this->PrimGhost(); break; case 152: @@ -9771,7 +9772,7 @@ bool CEffectPrim::OnProcess() { case 168: this->FollowMasterAndAdvance(); break; - case 85: + case PP_SUPERANGEL: this->PrimSuperAngel(); break; case 81: { @@ -9801,19 +9802,19 @@ bool CEffectPrim::OnProcess() { } } } break; - case 42: + case PP_SHIELDBOOMERANG: this->PrimShieldBoomerang(); break; - case 116: + case PP_SHIELDBOOMERANG3: this->PrimShieldBoomerang3(); break; - case 97: + case PP_TANJI2: this->PrimTanji2(); break; case 87: this->PrimBubbleSwirl(); break; - case 127: + case PP_BUBBLE_DROP: this->PrimBubbleDrop(); break; case 89: { @@ -9891,7 +9892,7 @@ bool CEffectPrim::OnProcess() { case 166: this->PrimFramePhase(); break; - case 58: + case PP_FIRSTAID: this->PrimFirstAid(); break; case 98: { @@ -9915,16 +9916,16 @@ bool CEffectPrim::OnProcess() { } } } break; - case 53: + case PP_THROWITEM: this->PrimThrowItem(); break; - case 54: + case PP_CHEMICALPROTECTION: this->PrimChemical(); break; - case 55: + case PP_CHEMICAL2: this->PrimChemical2(); break; - case 56: + case PP_CHEMICAL3: this->PrimChemical3(); break; case 154: @@ -10019,16 +10020,16 @@ bool CEffectPrim::OnProcess() { case 172: this->PrimPoison(); break; - case 45: + case PP_TEIHIT2: this->PrimTeiHit2(); break; - case 59: + case PP_PARTICLE_UP: this->PrimParticleUp(); break; case 136: this->PrimRandomSpin(); break; - case 47: + case PP_BOTTOM: this->PrimBottom(); break; case 156: @@ -10040,13 +10041,13 @@ bool CEffectPrim::OnProcess() { case 160: this->PrimGlowFollow(); break; - case 95: + case PP_EFFECTTEXTURE2: this->PrimEffectTexture2(); break; case 141: this->PrimRiseFollow(); break; - case 128: + case PP_EFFECTTEXTURE_ANI: this->PrimEffectTexture_Ani(); break; case 140: @@ -10085,10 +10086,10 @@ bool CEffectPrim::OnProcess() { } } break; - case 48: + case PP_BOTTOM2: this->PrimBottom2(); break; - case 49: + case PP_BOTTOMOUT: this->PrimBottomOut(); break; case 51: { diff --git a/Source/Contents/Effects/EffectPrimitiveRendering.cpp b/Source/Contents/Effects/EffectPrimitiveRendering.cpp index df5f10a71..3c58b9ad3 100644 --- a/Source/Contents/Effects/EffectPrimitiveRendering.cpp +++ b/Source/Contents/Effects/EffectPrimitiveRendering.cpp @@ -1,3 +1,4 @@ +#include "Contents/Effects/EffectPrimId.h" #include "Contents/Effects/RagEffect.h" #include "Contents/Configuration/ServiceOptions.h" #include "Contents/Effects/EffectPrimitiveState.h" @@ -179,14 +180,14 @@ void CEffectPrim::Render(int argument) { } switch (this->state.count) { - case 0: - case 1: + case PP_2DTEXTURE: + case PP_2DTEXTUREORBIT: this->Render2DPrimitive(); break; - case 2: + case PP_2DQUAD: this->Render2DDiamond(); break; - case 3: { + case PP_2DFLASH: { const float firstCos = ClientCosine(static_cast(this->state.longitude - this->state.arcAngle)); const float firstSin = ClientSine(static_cast(this->state.longitude - this->state.arcAngle)); const float secondCos = ClientCosine(static_cast(this->state.longitude + this->state.arcAngle)); @@ -220,20 +221,20 @@ void CEffectPrim::Render(int argument) { g_renderer->queues.SubmitTriangle(triangle, 1, g_renderer->commands, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd); break; } - case 4: + case PP_2DCIRCLE: this->Render2DCircle(); break; - case 5: - case 6: - case 7: - case 8: - case 21: - case 40: + case PP_3DPARTICLE: + case PP_3DPARTICLEGRAVITY: + case PP_3DPARTICLEORBIT: + case PP_3DPARTICLESPLINE: + case PP_3DPARTICLE_NOMASTER: + case PP_SAKURA: case 46: case 51: - case 84: - case 85: - case 124: + case PP_GHOST: + case PP_SUPERANGEL: + case PP_KOUENKA: this->RenderSegmentSprites2(wtm); break; case 167: @@ -248,14 +249,14 @@ void CEffectPrim::Render(int argument) { case 168: this->RenderGroundSprite(wtm); break; - case 9: - case 117: + case PP_3DQUADHORN: + case PP_3DQUADHORN2: this->RenderPyramid(wtm); break; - case 15: + case PP_3DTEXTURE: this->DrawEffectPrimitive15(wtm); break; - case 22: { + case PP_3DTEXTURE_NOMASTER: { float x; float y; float reciprocalDepth; @@ -314,16 +315,16 @@ void CEffectPrim::Render(int argument) { g_renderer->queues.SubmitTriangle(second, static_cast(this->state.renderFlag), g_renderer->commands, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd); break; } - case 16: + case PP_3DCROSSTEXTURE: this->RenderCrossPlanes(wtm); break; - case 12: + case PP_3DCIRCLE: this->RenderRecordRings(wtm); break; - case 13: + case PP_3DCYLINDER: this->RenderArcBand(wtm); break; - case 104: + case PP_HALFSPHERE: this->RenderHalfSphere(wtm); break; case 146: @@ -344,32 +345,32 @@ void CEffectPrim::Render(int argument) { case 137: this->RenderArcWalls(wtm); break; - case 121: + case PP_SMA2: this->RenderSMA2(wtm); break; - case 73: + case PP_MAGNUM2: this->RenderMagnum2(wtm); break; - case 61: + case PP_GUARD: this->RenderSphereCage(wtm); break; case 105: this->RenderCone(wtm); break; - case 106: + case PP_ATTACKENERGY2: this->RenderAttackEnergy2(wtm); break; - case 76: + case PP_SAINTWING: this->RenderSaintWing(wtm); break; - case 77: - case 91: + case PP_SPHEREWIND: + case PP_SPHEREWIND2: this->RenderSphereWind(wtm); break; - case 78: + case PP_COLORPAPER: this->RenderColorPaper(wtm); break; - case 62: + case PP_WIND: this->RenderRiseArc(wtm); break; case 26: @@ -386,35 +387,35 @@ void CEffectPrim::Render(int argument) { case 148: this->RenderGroundSquareBlend(wtm); break; - case 114: + case PP_HERMODE: this->RenderHermode(wtm); break; - case 68: + case PP_ASURACASTING: case 147: this->RenderHaloLayers(wtm); break; case 131: this->RenderRipple(wtm); break; - case 70: + case PP_HITLINE: this->RenderHitLine(wtm); break; - case 100: + case PP_HITLINE3: this->RenderHitLine3(wtm); break; case 103: this->RenderStackedRings(wtm); break; - case 101: + case PP_ELECTRIC: this->RenderLightningArc(wtm); break; case 135: this->RenderJitterSweeps(wtm); break; - case 102: + case PP_ELECTRIC2: this->RenderLightningTube(wtm); break; - case 27: + case PP_MAPPARTICLE: this->RenderGroundBubbles(wtm); break; case 29: @@ -427,7 +428,7 @@ void CEffectPrim::Render(int argument) { case 130: this->RenderFacingQuads(wtm); break; - case 111: + case PP_SOULPARTICLE: case 115: this->RenderSoulParticle(wtm); break; @@ -438,28 +439,28 @@ void CEffectPrim::Render(int argument) { case 157: this->RenderGlowSquare(wtm); break; - case 109: + case PP_SOULLINK: this->RenderSoulLink(wtm); break; case 151: this->RenderLaunchEffects(wtm); break; - case 96: + case PP_PEONGUP: this->RenderPeongUp(wtm); break; - case 94: + case PP_PEONG: this->RenderPeong(wtm); break; case 35: { this->RenderOrbitIcons(wtm, 1.0f, 100, 100, 255); break; } - case 99: + case PP_DOUBLEGUMGANG: this->RenderDoubleGumGang(wtm); break; - case 23: - case 24: - case 25: + case PP_3DCASTING: + case PP_3DCASTING_2: + case PP_3DCASTING_3: case 30: case 31: case 41: @@ -467,38 +468,38 @@ void CEffectPrim::Render(int argument) { case 57: case 60: case 63: - case 65: - case 107: - case 108: + case PP_3DCASTING_4: + case PP_3DCASTING_5: + case PP_FLOWERCAST: case 113: - case 118: + case PP_ACIDDEMON: case 139: this->Render3DCasting(wtm); break; case 36: - case 110: + case PP_HEAL_LOW: case 169: this->Render3DCasting_LowPolygon(wtm); break; - case 34: + case PP_GI_3: this->Render3DCasting2(wtm); break; - case 37: + case PP_GRANDCROSS2: this->RenderGrandCross2(wtm); break; - case 75: + case PP_SLASH1: this->RenderSlash1(wtm); break; - case 64: + case PP_RECT_UP: this->RenderRectUp(wtm); break; - case 90: + case PP_RECT_UP2: this->RenderRectUp2(wtm); break; case 132: this->RenderColorPanel(wtm); break; - case 43: + case PP_INTIMIDATE: this->RenderOrbitSquare(wtm); break; case 44: @@ -510,13 +511,13 @@ void CEffectPrim::Render(int argument) { break; case 119: case 122: - case 125: + case PP_STIN4: this->RenderFloorSquare2(wtm); break; case 126: this->RenderRotatedRing(wtm); break; - case 120: + case PP_SMA: this->RenderSMA3(wtm); break; case 98: @@ -532,18 +533,18 @@ void CEffectPrim::Render(int argument) { this->RenderTwinFacingSquares(wtm); break; case 33: - case 42: - case 45: - case 47: - case 49: - case 53: - case 58: - case 59: + case PP_SHIELDBOOMERANG: + case PP_TEIHIT2: + case PP_BOTTOM: + case PP_BOTTOMOUT: + case PP_THROWITEM: + case PP_FIRSTAID: + case PP_PARTICLE_UP: case 87: - case 97: - case 116: - case 123: - case 127: + case PP_TANJI2: + case PP_SHIELDBOOMERANG3: + case PP_TWILIGHT: + case PP_BUBBLE_DROP: this->RenderFieldPanel(wtm); break; case 156: @@ -553,8 +554,8 @@ void CEffectPrim::Render(int argument) { this->RenderSpinSquares(wtm); break; case 82: - case 95: - case 128: + case PP_EFFECTTEXTURE2: + case PP_EFFECTTEXTURE_ANI: case 140: this->RenderTeiFacingSlots(wtm); break; @@ -570,7 +571,7 @@ void CEffectPrim::Render(int argument) { case 134: this->RenderBladeTrail(wtm); break; - case 54: + case PP_CHEMICALPROTECTION: this->RenderChemical(wtm); break; case 89: @@ -594,10 +595,10 @@ void CEffectPrim::Render(int argument) { case 166: this->RenderFoldingRibbon(wtm); break; - case 55: + case PP_CHEMICAL2: this->RenderFloorRect(wtm); break; - case 56: + case PP_CHEMICAL3: this->RenderGroundBar(wtm); break; case 154: @@ -609,7 +610,7 @@ void CEffectPrim::Render(int argument) { case 74: this->RenderHalfSphere2(wtm); break; - case 71: + case PP_BLIND: this->RenderBlind(wtm); break; case 72: @@ -646,16 +647,16 @@ void CEffectPrim::Render(int argument) { } break; } - case 52: + case PP_POKJUK: this->RenderTrailSquares(wtm); break; - case 38: + case PP_LINELINK: this->RenderTube(wtm); break; case 69: this->RenderPentaRing(wtm); break; - case 66: + case PP_FOREST: this->RenderPentagon(wtm); break; case 129: { @@ -697,23 +698,23 @@ void CEffectPrim::Render(int argument) { case 142: this->RenderStandingPanels(wtm); break; - case 93: + case PP_RAINBOW: this->RenderRainbow(wtm); break; case 81: this->RenderBeam(wtm); break; - case 48: + case PP_BOTTOM2: this->RenderColorPlane(wtm); break; - case 10: - case 11: + case PP_3DSPLINE: + case PP_3DSPIRAL: this->RenderRecordQuads(wtm); break; - case 14: + case PP_3DSPHERE: this->RenderSphere(wtm); break; - case 19: { + case PP_3DFLASH: { const float firstCos = ClientCosine(static_cast(this->state.longitude - this->state.arcAngle)); const float firstSin = ClientSine(static_cast(this->state.longitude - this->state.arcAngle)); const float secondCos = ClientCosine(static_cast(this->state.longitude + this->state.arcAngle)); @@ -747,7 +748,7 @@ void CEffectPrim::Render(int argument) { g_renderer->queues.SubmitTriangle(triangle, 1, g_renderer->commands, g_renderer->fog.supported != 0, g_depthStart, g_depthEnd); break; } - case 20: { + case PP_3DLINE: { float position[3] = {this->render.position.x, this->render.position.y, this->render.position.z}; RenderVertex top{0, 0, 0, 0, 0, 0xFF000000u, 0, 0}; g_renderer->viewport.Project(position, wtm.values, top); diff --git a/Source/Contents/Effects/MsgEffect.cpp b/Source/Contents/Effects/MsgEffect.cpp index acb1a5815..f6a0fb975 100644 --- a/Source/Contents/Effects/MsgEffect.cpp +++ b/Source/Contents/Effects/MsgEffect.cpp @@ -1,4 +1,6 @@ #include "Contents/Skills/SkillUnitId.h" +#include "Client/Mode/GameModeEnums.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Effects/MsgEffect.h" #include "Client/Mode/CGameMode.h" @@ -92,8 +94,8 @@ vector2d& vector2d::Normalize() { // FUNCTION: fn_24270 bool CMsgEffect::UsesMsgEffect(int type) { switch (type) { - case 3: - case 18: + case MET_CART: + case MET_BIRD: case 27: case 31: return true; @@ -199,15 +201,15 @@ bool CMsgEffect::OnProcess() { this->FollowOwner(); switch (this->m_type) { - case 0xD: - case 0xE: - case 0xF: - case 0x10: - case 0x11: - case 0x12: - case 0x15: - case 0x16: - case 0x19: + case MET_MISS: + case MET_NUMBER: + case MET_CRITICAL_EFFECT: + case MET_NUMBER_CRITICAL: + case MET_LUCKY_EFFECT: + case MET_BIRD: + case MET_NUMBER_HALF: + case MET_NUMBER_TOTAL: + case MET_BLUE_EFFECT: break; default: if (this->m_type != 0x72) { @@ -218,7 +220,7 @@ bool CMsgEffect::OnProcess() { float elapsed; switch (this->m_type) { - case 0x10: + case MET_NUMBER_CRITICAL: elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; MsgEffectDrift(this, elapsed); @@ -253,8 +255,8 @@ bool CMsgEffect::OnProcess() { return true; } - case 0xE: - case 0x15: + case MET_NUMBER: + case MET_NUMBER_HALF: elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; MsgEffectDrift(this, elapsed); @@ -266,7 +268,7 @@ bool CMsgEffect::OnProcess() { this->SetColor(static_cast(250.0f - elapsed * 3.4f), -1, -1, -1); return !(elapsed > 70.0f); - case 0x18: { + case MET_GUARD: { elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; if (this->render.curMotion == 0) { @@ -284,7 +286,7 @@ bool CMsgEffect::OnProcess() { return !(elapsed > 10.0f); } - case 0xD: + case MET_MISS: elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; this->render.position.y = this->m_baseY - elapsed * 0.54f; @@ -293,7 +295,7 @@ bool CMsgEffect::OnProcess() { this->GetActRes(); return !(elapsed > 80.0f); - case 0x16: { + case MET_NUMBER_TOTAL: { elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; this->render.position.y = this->m_baseY - elapsed * 0.1f; @@ -310,7 +312,7 @@ bool CMsgEffect::OnProcess() { return !(elapsed > 120.0f); } - case 0x19: { + case MET_BLUE_EFFECT: { elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; this->render.curMotion = 0; @@ -338,7 +340,7 @@ bool CMsgEffect::OnProcess() { return !(elapsed > 120.0f); } - case 0xF: { + case MET_CRITICAL_EFFECT: { elapsed = MsgEffectElapsedFrames(this); this->render.previousAnimation = this->render.animation; MsgEffectDrift(this, elapsed); @@ -374,10 +376,10 @@ bool CMsgEffect::OnProcess() { return true; } - case 0: - case 1: - case 2: - case 0x11: { + case MET_JUST_ANIMATE: + case MET_EMOTION: + case MET_MVP: + case MET_LUCKY_EFFECT: { CActRes* action = this->GetActRes(); elapsed = MsgEffectElapsedFrames(this); const int frames = static_cast(action->FrameCount(this->render.previousAnimation)); @@ -405,7 +407,7 @@ bool CMsgEffect::OnProcess() { return false; } - case 6: { + case MET_ICEBREAKEFFECT: { elapsed = MsgEffectElapsedFrames(this); CActRes* action = this->GetActRes(); const int frames = static_cast(action->FrameCount(this->render.previousAnimation)); @@ -417,13 +419,13 @@ bool CMsgEffect::OnProcess() { return false; } - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 0x1A: + case MET_PKEFFECT: + case MET_ICEEFFECT: + case MET_CURSE_EFFECT: + case MET_SLEEP_EFFECT: + case MET_STUN_EFFECT: + case MET_SILENCE_EFFECT: + case MET_CURSOR_EFFECT: case 0x25: case 0x26: { elapsed = MsgEffectElapsedFrames(this); @@ -433,8 +435,8 @@ bool CMsgEffect::OnProcess() { return true; } - case 0xB: - case 0xC: + case MET_ANGELUS_EFFECT: + case MET_CRUSIS_EFFECT: if (this->m_owner == nullptr) { return true; } @@ -444,7 +446,7 @@ bool CMsgEffect::OnProcess() { } return true; - case 0x12: + case MET_BIRD: if (this->unknown_01B4 != 0 && this->m_owner != nullptr) { CRenderObject* owner = static_cast(this->m_owner); this->Face(owner->render.position.x, owner->render.position.z); @@ -1200,15 +1202,15 @@ bool CSkill::OnProcess() { // FUNCTION: fn_24289 void CMsgEffect::FollowOwner() { switch (this->m_type) { - case 0xD: - case 0xE: - case 0xF: - case 0x10: - case 0x11: - case 0x15: - case 0x16: - case 0x18: - case 0x19: + case MET_MISS: + case MET_NUMBER: + case MET_CRITICAL_EFFECT: + case MET_NUMBER_CRITICAL: + case MET_LUCKY_EFFECT: + case MET_NUMBER_HALF: + case MET_NUMBER_TOTAL: + case MET_GUARD: + case MET_BLUE_EFFECT: if (this->m_owner != nullptr) { CRenderObject* owner = static_cast(this->m_owner); const float x = owner->render.position.x; @@ -1221,8 +1223,8 @@ void CMsgEffect::FollowOwner() { this->render.unknown_0124 = 0x200; break; - case 4: - case 0xB: + case MET_PKEFFECT: + case MET_ANGELUS_EFFECT: if (this->m_owner != nullptr) { const CRenderObject* owner = static_cast(this->m_owner); this->render.position.x = owner->render.position.x; @@ -1232,7 +1234,7 @@ void CMsgEffect::FollowOwner() { } break; - case 0xC: + case MET_CRUSIS_EFFECT: if (this->m_owner != nullptr) { const CRenderObject* owner = static_cast(this->m_owner); this->render.position.x = owner->render.position.x; @@ -1242,7 +1244,7 @@ void CMsgEffect::FollowOwner() { } break; - case 5: + case MET_ICEEFFECT: if (this->m_owner != nullptr) { const CRenderObject* owner = static_cast(this->m_owner); this->render.position.x = owner->render.position.x; @@ -1291,11 +1293,11 @@ void CMsgEffect::FollowOwner() { } break; - case 1: - case 2: - case 8: - case 9: - case 10: + case MET_EMOTION: + case MET_MVP: + case MET_SLEEP_EFFECT: + case MET_STUN_EFFECT: + case MET_SILENCE_EFFECT: case 0x25: case 0x26: if (this->m_owner != nullptr) { @@ -1311,7 +1313,7 @@ void CMsgEffect::FollowOwner() { } break; - case 7: + case MET_CURSE_EFFECT: if (this->m_owner != nullptr) { const CRenderObject* owner = static_cast(this->m_owner); this->render.position.x = owner->render.position.x; @@ -1376,7 +1378,7 @@ void CMsgEffect::FollowOwner() { } break; - case 3: + case MET_CART: if (this->m_owner != nullptr) { CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; const float dist = static_cast(this->m_owner)->CalcDist(this->render.position.x, this->render.position.z); @@ -1403,7 +1405,7 @@ void CMsgEffect::FollowOwner() { } break; - case 0x12: + case MET_BIRD: if (this->m_owner != nullptr && this->unknown_01B4 == 0) { CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; const float dist = static_cast(this->m_owner)->CalcDist(this->render.position.x, this->render.position.z); @@ -1453,7 +1455,7 @@ void CMsgEffect::FollowOwner() { } break; - case 0x1A: + case MET_CURSOR_EFFECT: if (this->m_owner == nullptr) { break; } @@ -1471,7 +1473,7 @@ void CMsgEffect::FollowOwner() { } break; - case 6: + case MET_ICEBREAKEFFECT: break; } } @@ -1490,12 +1492,12 @@ bool CSummonActorEffect::OnProcess() { // FUNCTION: fn_24293 void CMsgEffect::Render(int argument) { switch (this->m_type) { - case 13: - case 14: - case 15: - case 16: - case 21: - case 22: + case MET_MISS: + case MET_NUMBER: + case MET_CRITICAL_EFFECT: + case MET_NUMBER_CRITICAL: + case MET_NUMBER_HALF: + case MET_NUMBER_TOTAL: case 114: if (!g_msgEffectShowSpecial) { return; @@ -1513,7 +1515,7 @@ void CMsgEffect::Render(int argument) { void CMsgEffect::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) { const vector3d* position = reinterpret_cast(b); switch (static_cast(a) << 32 | static_cast(message)) { - case 29: + case AM_REQ_ATTACK: if (this->m_type == 18) { this->m_velocity.x = (position->x - this->render.position.x) / 10.0f; this->m_velocity.y = (position->y - this->render.position.y) / 10.0f; @@ -1533,18 +1535,18 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 49: + case AM_MSGMASTER_DEAD: this->m_owner = nullptr; switch (this->m_type) { - case 6: - case 13: - case 14: - case 15: - case 16: - case 17: - case 21: - case 22: - case 25: + case MET_ICEBREAKEFFECT: + case MET_MISS: + case MET_NUMBER: + case MET_CRITICAL_EFFECT: + case MET_NUMBER_CRITICAL: + case MET_LUCKY_EFFECT: + case MET_NUMBER_HALF: + case MET_NUMBER_TOTAL: + case MET_BLUE_EFFECT: break; default: @@ -1553,15 +1555,15 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } return; - case 53: + case AM_DISAPPEAR: this->m_finished = 1; return; - case 50: + case AM_SET_MASTER_POINTER: this->m_owner = sender; switch (this->m_type) { - case 3: - case 18: + case MET_CART: + case MET_BIRD: case 27: case 31: if (sender != nullptr) { @@ -1572,7 +1574,7 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } break; - case 6: + case MET_ICEBREAKEFFECT: if (sender != nullptr) { const CRenderObject* owner = static_cast(sender); this->render.position.x = owner->render.position.x; @@ -1583,11 +1585,11 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } return; - case 22: + case AM_SETMASTERGID: this->m_type = d; this->m_value = b; switch (d) { - case 3: + case MET_CART: case 31: this->render.unknown_00A2 = 0; this->render.unknown_0080 = 0; @@ -1595,23 +1597,23 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->render.unknown_0054 = 1.0f; break; - case 4: + case MET_PKEFFECT: this->SetColor(0x7F, 0xFF, 0, 0); break; - case 7: + case MET_CURSE_EFFECT: this->SetColor(0x7F, -1, -1, -1); this->render.unknown_00A2 = 0; this->render.unknown_0080 = 5; break; - case 5: - case 6: + case MET_ICEEFFECT: + case MET_ICEBREAKEFFECT: this->render.unknown_00A2 = 0; this->render.unknown_0080 = 5; break; - case 18: + case MET_BIRD: this->render.unknown_00A2 = 0; this->render.unknown_0080 = 0; break; @@ -1625,18 +1627,18 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } return; - case 64: { + case AM_SETPOS2: { int offset = 0; switch (this->m_type) { - case 13: + case MET_MISS: this->m_baseX = this->render.position.x; return; - case 22: + case MET_NUMBER_TOTAL: offset = 15; - case 14: - case 16: - case 21: + case MET_NUMBER: + case MET_NUMBER_CRITICAL: + case MET_NUMBER_HALF: this->SetSpriteName(ResourceMgr::Instance(), FormatOwnedString("%s.spr", g_session.m_damageResourceName.c_str()).c_str()); this->SetActionName(ResourceMgr::Instance(), FormatOwnedString("%s.act", g_session.m_damageResourceName.c_str()).c_str()); this->render.animation = 0; @@ -1648,9 +1650,9 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->m_baseY = this->render.position.y; break; - case 15: - case 17: - case 18: + case MET_CRITICAL_EFFECT: + case MET_LUCKY_EFFECT: + case MET_BIRD: case 19: case 20: return; @@ -1688,7 +1690,7 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, return; } - case 14: { + case AM_SETPOS: { this->render.visible = 1; this->render.unknown_008C = timeGetTime(); if ((static_cast(e) << 32 | static_cast(d)) != 0) { @@ -1706,24 +1708,24 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, } switch (this->m_type) { - case 3: + case MET_CART: case 27: case 31: break; - case 6: + case MET_ICEBREAKEFFECT: this->render.position.x = position->x; this->render.position.y = position->y; this->render.position.z = position->z; break; - case 11: - case 12: + case MET_ANGELUS_EFFECT: + case MET_CRUSIS_EFFECT: this->render.curMotion = 1; this->render.visible = 0; break; - case 13: + case MET_MISS: this->render.position.x = position->x; this->render.position.y = position->y; this->render.position.z = position->z; @@ -1736,8 +1738,8 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->render.unknown_0080 = static_cast(-5); break; - case 15: - case 25: + case MET_CRITICAL_EFFECT: + case MET_BLUE_EFFECT: this->render.position.x = position->x; this->render.position.y = position->y; this->render.position.z = position->z; @@ -1760,7 +1762,7 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, this->m_baseY = this->render.position.y; break; - case 24: + case MET_GUARD: this->render.position.x = position->x; this->render.position.y = position->y; this->render.position.z = position->z; diff --git a/Source/Contents/Effects/Particle.cpp b/Source/Contents/Effects/Particle.cpp index de0a0be1c..27b1ef0fb 100644 --- a/Source/Contents/Effects/Particle.cpp +++ b/Source/Contents/Effects/Particle.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/Particle.h" +#include "UI/Window/WindowId.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/RenderObject.h" @@ -541,7 +542,7 @@ void CEZ2STRParticle::RenderScreen(EZeffectClip* clip, EZeffectTransform* transf if (this->m_attachToWindow == true) { switch (this->m_windowId) { - case 361: + case WID_RUNESYSTEMWND: case 10022: case 10023: case 10026: diff --git a/Source/Contents/Effects/RagEffect.cpp b/Source/Contents/Effects/RagEffect.cpp index c9b38262b..07f580118 100644 --- a/Source/Contents/Effects/RagEffect.cpp +++ b/Source/Contents/Effects/RagEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/RagEffect.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Actors/Pc.h" #include "Contents/MapSkyMgr.h" #include "Contents/Skills/ClientSkills.h" @@ -15084,7 +15085,7 @@ void CRagEffect::SendMsg( const std::int64_t third = static_cast(thirdHigh) << 32 | static_cast(thirdLow); switch (message) { - case 14: + case AM_SETPOS: if (first != 0) { const float* position = reinterpret_cast(static_cast(first)); this->state.deltaPos[0] = position[0]; @@ -15098,10 +15099,10 @@ void CRagEffect::SendMsg( this->state.deltaPos2[2] = position[2]; } break; - case 24: + case AM_MASTER_DEAD: this->state.parent = nullptr; break; - case 25: + case AM_CHILD_DEAD: if (first == 0) { if (sender == nullptr) { break; @@ -15119,7 +15120,7 @@ void CRagEffect::SendMsg( this->state.primList.erase(this->state.primList.begin(), this->state.primList.end()); } break; - case 44: + case AM_SETCOUNT: if (first == 0xFFFF) { if (second == 130) { this->render.position.x = 200.0f; @@ -15170,7 +15171,7 @@ void CRagEffect::SendMsg( } } break; - case 46: { + case AM_SETPARAM: { const float* param = reinterpret_cast(static_cast(first)); this->state.param[0] = param[0]; this->state.param[1] = param[1]; @@ -15178,7 +15179,7 @@ void CRagEffect::SendMsg( this->state.param[3] = param[3]; break; } - case 80: + case AM_SET_DURATION: this->SetStateDuration(static_cast(first)); break; case 127: diff --git a/Source/Contents/Effects/SpriteParticle.cpp b/Source/Contents/Effects/SpriteParticle.cpp index ed820a4cb..70aceb49f 100644 --- a/Source/Contents/Effects/SpriteParticle.cpp +++ b/Source/Contents/Effects/SpriteParticle.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/SpriteParticle.h" +#include "Contents/Actors/ActorEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/GameActor.h" @@ -77,17 +78,17 @@ void CSpriteParticle::UpdateFrame() { } switch (this->loopMode) { - case 0: + case MT_LOOP: if (this->frame >= frameCount) { this->frame = 0; } break; - case 1: + case MT_ONETIME: if (this->frame >= frameCount) { this->life = -1.0f; } break; - case 2: + case MT_STATIC: if (this->frame >= frameCount) { this->frame = static_cast(frameCount) - 1; } diff --git a/Source/Contents/Effects/ViolentQuakeEffect.cpp b/Source/Contents/Effects/ViolentQuakeEffect.cpp index 057045e3a..f59c51212 100644 --- a/Source/Contents/Effects/ViolentQuakeEffect.cpp +++ b/Source/Contents/Effects/ViolentQuakeEffect.cpp @@ -1,4 +1,5 @@ #include "Contents/Effects/ViolentQuakeEffect.h" +#include "Contents/Effects/EffectTypes.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -58,7 +59,7 @@ void CViolentQuakeEffect::Close() { // FUNCTION: fn_07533 void CViolentQuakeEffect::Open() { switch (this->id) { - case 1760: { + case EF_UNK_1760: { CEZ2STRParticle* emitter = static_cast(CreateEZ2STRParticle(reinterpret_cast(this->position), 5)); emitter->Load(FormatOwnedString("violentquake\\violentquake\\violentquake_%02d.str", std::max(rand() % 3, 0) + 1)); emitter->unknown_00D0 = 0.0f; @@ -68,7 +69,7 @@ void CViolentQuakeEffect::Open() { this->AddEvent(0, "effect\\AG_VIOLENT_QUAKE.wav", 0, 0); break; } - case 1798: + case EF_UNK_1798: this->InitAllBloom(); break; } diff --git a/Source/Contents/EntryQueueMgr.cpp b/Source/Contents/EntryQueueMgr.cpp index 51ff89279..066201df7 100644 --- a/Source/Contents/EntryQueueMgr.cpp +++ b/Source/Contents/EntryQueueMgr.cpp @@ -1,4 +1,5 @@ #include "Contents/EntryQueueMgr.h" +#include "Network/Packets/NoticeEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -119,7 +120,7 @@ void CEntryQueueMgr::SetCharacterName(const EntryQueueName& name) { void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { int message; switch (packet->result) { - case 1: { + case BG_APPLY_ACCEPT: { if (!g_windowMgr.CloseWindow(209)) { g_windowMgr.EnsureWindow(209); } @@ -137,31 +138,31 @@ void CEntryQueueMgr::OnApplyResult(const EntryQueueApplyResult* packet) { this->ready = 1; return; } - case 2: + case BG_APPLY_QUEUE_FINISHED: message = 0x834; break; - case 3: + case BG_APPLY_INVALID_NAME: message = 0x835; break; - case 4: + case BG_APPLY_INVALID_APP: message = 0x836; break; - case 5: + case BG_APPLY_PLAYER_COUNT: message = 0x837; break; - case 6: + case BG_APPLY_PLAYER_LEVEL: message = 0x838; break; - case 7: + case BG_APPLY_DUPLICATE: message = 0x839; break; - case 8: + case BG_APPLY_RECONNECT: message = 0x83A; break; - case 9: + case BG_APPLY_PARTYGUILD_LEADER: message = 0x83C; break; - case 10: + case BG_APPLY_PLAYER_CLASS: message = 0x83B; break; case 15: diff --git a/Source/Contents/Hotkeys/InterfaceHotkey.h b/Source/Contents/Hotkeys/InterfaceHotkey.h new file mode 100644 index 000000000..560aaa47b --- /dev/null +++ b/Source/Contents/Hotkeys/InterfaceHotkey.h @@ -0,0 +1,95 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_HOTKEYS_INTERFACEHOTKEY_H +#define RAGNAROK_SOURCE_CONTENTS_HOTKEYS_INTERFACEHOTKEY_H + +enum InterfaceHotkey : int { + HK_BASICINFOWND_MINI = 0, + HK_EQUIPWND_ONOFF = 1, + HK_SKILLWND_ONOFF = 2, + HK_QUESTWND_ONOFF = 3, + HK_FRIENDWND_ONOFF = 4, + HK_PARTYWND_ONOFF = 5, + HK_CHATWND_MAKE = 6, + HK_CARTWND_ONOFF = 7, + HK_MAPWND_ONOFF = 8, + HK_ITEMWND_ONOFF = 9, + HK_GUILDWND_ONOFF = 10, + HK_EMOTIONWND_ONOFF = 11, + HK_SITORSTAND = 12, + HK_MINIMAP_ONOFF = 13, + HK_MACROWND_ONOFF = 14, + HK_EXEWND_ONOFF = 15, + HK_ALLWND_OFF = 16, + HK_SKILLBAR_ONOFF = 17, + HK_CHATWND_ONOFF = 18, + HK_CHATWND_ZOOM = 19, + HK_GAGE_ONOFF = 20, + HK_SNAPSHOT = 21, + HK_MEMORIALWND_ONOFF = 22, + HK_PETWND_ONOFF = 23, + HK_HOMUNWND_ONOFF = 24, + HK_MERWND_ONOFF = 25, + HK_HOMUN_FOLLOW = 26, + HK_MER_FOLLOW = 27, + HK_FRIEND_OPTIONWND = 28, + HK_PARTY_OPTIONWND = 29, + HK_BATTLEFIELDWND = 30, + HK_FIRST_HIDDEN = 30, + HK_CHATMODE_ONOFF = 31, + HK_BASICINFOWND_BTN_ONOFF = 32, + HK_PARTY_RECRUIT = 33, + HK_PARTY_BOOKING_LIST = 34, + HK_GROUND_CURSOR_ONOFF = 35, + HK_EXMACRO_SETUPWND = 36, + HK_CASHSHOPWND = 37, + HK_REPLAY_ONOFF = 38, + HK_REPLAY_STARTSTOP = 39, + HK_REPLAY_SPEEDP = 40, + HK_REPLAY_SPEEDN = 41, + HK_NAVIGATION_ONOFF = 42, + HK_BUTTONS_RELOCATE = 43, + HK_CLANWND_ONOFF = 44, + HK_MENUICON_HIDE = 45, + HK_BANK = 46, + HK_STATUSWND_ONOFF = 47, + HK_SHORTCUTWND_ROTATE = 48, + HK_ACHIEVEMENT = 49, + HK_SINGLEMAP_ONOFF = 50, + HK_MAIL_ONOFF = 51, + HK_SWAP_EQUIPMENT = 52, + HK_TWITTERWND = 53, + HK_TIPBOXWND_ONOFF = 54, + HK_CHANGE_SKILLBAR = 55, + HK_COSEQUIPWND_ONOFF = 56, + HK_PARTYBOARDWND_ONOFF = 57, + HK_HUNTINGQUEST_INFO_ONOFF = 58, + HK_UNKNOWN_62 = 62, + HK_UNKNOWN_64 = 64, + HK_UNKNOWN_65 = 65, + HK_UNKNOWN_66 = 66, + HK_UNKNOWN_67 = 67, +}; + +enum MacroHotkey : int { + HK_MACRO_1 = 0, + HK_MACRO_2 = 1, + HK_MACRO_3 = 2, + HK_MACRO_4 = 3, + HK_MACRO_5 = 4, + HK_MACRO_6 = 5, + HK_MACRO_7 = 6, + HK_MACRO_8 = 7, + HK_MACRO_9 = 8, + HK_MACRO_10 = 9, + HK_FLAG_1 = 10, + HK_FLAG_2 = 11, + HK_FLAG_3 = 12, + HK_FLAG_4 = 13, + HK_FLAG_5 = 14, + HK_FLAG_6 = 15, + HK_FLAG_7 = 16, + HK_FLAG_8 = 17, + HK_FLAG_9 = 18, + HK_FLAG_10 = 19, +}; + +#endif diff --git a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp index 77b230092..a26f5ebc5 100644 --- a/Source/Contents/Hotkeys/UserHotkeyMgr.cpp +++ b/Source/Contents/Hotkeys/UserHotkeyMgr.cpp @@ -1,26 +1,11 @@ #include "Contents/Hotkeys/UserHotkeyMgr.h" #include "Contents/Hotkeys/HotkeyInfo.h" +#include "Contents/Hotkeys/InterfaceHotkey.h" #include "Network/TextEncoding.h" #include namespace { - enum InterfaceHotkey { - HK_BATTLEFIELDWND = 30, - HK_PARTY_RECRUIT = 33, - HK_PARTY_BOOKING_LIST = 34, - HK_EXMACRO_SETUPWND = 36, - HK_BUTTONS_RELOCATE = 43, - HK_MENUICON_HIDE = 45, - HK_TWITTERWND = 53, - HK_HUNTINGQUEST_INFO_ONOFF = 58, - HK_UNKNOWN_62 = 62, - HK_UNKNOWN_64 = 64, - HK_UNKNOWN_65 = 65, - HK_UNKNOWN_66 = 66, - HK_UNKNOWN_67 = 67, - HK_FIRST_HIDDEN = HK_BATTLEFIELDWND, - }; // INLINED bool HiddenInterfaceIndex(int index) { diff --git a/Source/Contents/Items/ItemId.h b/Source/Contents/Items/ItemId.h index 74bbcf26d..35dd7c102 100644 --- a/Source/Contents/Items/ItemId.h +++ b/Source/Contents/Items/ItemId.h @@ -35,6 +35,215 @@ enum item_itemid : int { HD_Etel_Bradium = 1000369, Etel_Carnium = 1000370, HD_Etel_Carnium = 1000371, + ITEMID_RED_POTION = 501, + Orange_Potion = 502, + ITEMID_YELLOW_POTION = 503, + ITEMID_WHITE_POTION = 504, + ITEMID_BLUE_POTION = 505, + Green_Potion = 506, + Red_Herb = 507, + Yellow_Herb = 508, + White_Herb = 509, + Blue_Herb = 510, + Green_Herb = 511, + ITEMID_APPLE = 512, + Banana = 513, + Grape = 514, + Carrot = 515, + Sweet_Potato = 516, + Meat = 517, + Honey = 518, + Milk = 519, + Leaflet_Of_Hinal = 520, + Leaflet_Of_Aloe = 521, + Fruit_Of_Mastela = 522, + ITEMID_HOLY_WATER = 523, + Royal_Jelly = 526, + Monster = 528, + Candy = 529, + Candy_Striper = 530, + Apple_Juice = 531, + Banana_Juice = 532, + Grape_Juice = 533, + Carrot_Juice = 534, + ITEMID_PUMPKIN = 535, + Ice_Cream = 536, + ITEMID_PET_FOOD = 537, + Well_Baked_Cookie = 538, + Piece_Of_Cake = 539, + Falcon = 540, + Pecopeco = 541, + Festive_Cookie = 542, + Festive_Rainbow_Cake = 543, + Fish_Slice = 544, + ITEMID_RED_SLIM_POTION = 545, + ITEMID_YELLOW_SLIM_POTION = 546, + ITEMID_WHITE_SLIM_POTION = 547, + Cheese = 548, + Nice_Sweet_Potato = 549, + Popped_Rice = 550, + Shusi = 551, + KETUPAT = 552, + Bun = 553, + Mojji = 554, + Rice_Cake = 555, + Long_Rice_Cake = 556, + Hash_Rice_Cake = 557, + Chocolate = 558, + HandMade_Chocolate = 559, + HandMade_Chocolate_ = 560, + White_Chocolate = 561, + Pizza = 562, + Pizza_01 = 563, + Rice_Ball = 564, + Vita500_Bottle = 565, + Tomyumkung = 566, + Prawn = 567, + Lemon = 568, + Novice_Potion = 569, + Lucky_Candy = 570, + Lucky_Candy_Cane = 571, + Lucky_Cookie = 572, + Chocolate_Drink = 573, + Egg = 574, + Piece_Of_Cake_ = 575, + Prickly_Fruit = 576, + Grain = 577, + Strawberry = 578, + Delicious_Fish = 579, + Bread = 580, + Mushroom = 581, + Orange = 582, + KETUPAT_ = 583, + Fish_Ball_Soup = 584, + Wurst = 585, + Mother = 586, + Cute_Strawberry_Choco = 596, + Lovely_Choco_Tart = 597, + Light_Red_Pot = 598, + Light_Orange_Pot = 599, + Yggdrasilberry = 607, + Center_Potion = 645, + Awakening_Potion = 656, + Berserk_Potion = 657, + Inspector_Certificate = 662, + Korea_Rice_Cake = 663, + Magical_Carnation = 680, + Realgar_Wine = 682, + Exorcize_Herb = 683, + Durian = 684, + RAMADAN = 685, + ITEMID_BLOODY_RED = 990, + ITEMID_CRYSTAL_BLUE = 991, + ITEMID_WIND_OF_VERDURE = 992, + ITEMID_YELLOW_LIVE = 993, + Light_Yellow_Pot = 11500, + Light_White_Pot = 11501, + Light_Blue_Pot = 11502, + Siege_White_Potion = 11503, + Siege_Blue_Potion = 11504, + Woe_Violet_Potion = 11547, + Woe_White_Potion = 11548, + Woe_Blue_Potion = 11549, + TE_White_Potion = 11557, + TE_White_Slim_Potion = 11558, + White_Potion_B = 11565, + Yellow_Potion_B = 11566, + Novice_Potion_B = 11567, + Red_Slim_Potion_B = 11568, + Orange_Potion_B = 11569, + Red_Potion_B = 11570, + Green_Potion_B = 11571, + Blue_Potion_B = 11572, + White_Slim_Potion_B = 11573, + Yellow_Slim_Potion_B = 11574, + Rice_Ball_B = 11577, + Candy_Striper_B = 11578, + Candy_B = 11580, + Piece_Of_Cake_B = 11581, + Well_Baked_Cookie_B = 11582, + Chocolate_Drink_B = 11583, + White_Chocolate_B = 11584, + HandMade_Chocolate_B = 11585, + HandMade_Chocolate_B_ = 11586, + Chocolate_B = 11587, + Girl_Bunch_Of_Flower = 11701, + Speed_Up_Potion = 12016, + Slow_Down_Potion = 12017, + Fire_Cracker = 12018, + Giftbox_China = 12023, + Giggling_Box = 12027, + Box_Of_Thunder = 12028, + Gloomy_Box = 12029, + Box_Of_Grudge = 12030, + Sleepy_Box = 12031, + Box_Of_Storm = 12032, + Box_Of_Sunlight = 12033, + Painting_Box = 12034, + Resist_Fire = 12118, + Resist_Water = 12119, + Resist_Earth = 12120, + Resist_Wind = 12121, + Sesame_Pastry = 12122, + Honey_Pastry = 12123, + Rainbow_Cake = 12124, + Lucky_Potion = 12131, + Plain_Rice_Cake = 12195, + Hearty_Rice_Cake = 12196, + Salty_Rice_Cake = 12197, + Lucky_Rice_Cake = 12198, + Assumptio_5_Scroll = 12218, + Cacao99 = 12234, + Choco_Lump = 12237, + New_Year_Rice_Cake_1 = 12238, + New_Year_Rice_Cake_2 = 12239, + Str_Dish10_M = 12250, + Agi_Dish10_M = 12251, + Int_Dish10_M = 12252, + Dex_Dish10_M = 12253, + Luk_Dish10_M = 12254, + Vit_Dish10_M = 12255, + Inspector_Certificate_ = 12262, + Spray_Of_Flowers = 12310, + Large_Spray_Of_Flowers = 12311, + Goddess_Bless = 12315, + Angel_Bless = 12316, + Powder_Snow = 12317, + Little_Heart = 12318, + J_Firecracker = 12326, + ITEMID_ANCILLA = 12333, + Manuk = 12342, + Manuks_Courage = 12343, + Pinguicula = 12344, + Luciola = 12345, + Tiny_Waterbottle = 12353, + Mora_Berry = 12574, + RWC_Cele_Fire = 12696, + RWC_Cele_Fire2 = 12697, + No100_Firecracker = 12788, + J_Aspersio_5_Scroll = 12928, + Light_Center_Pot = 14509, + Light_Awakening_Pot = 14510, + Light_Berserk_Pot = 14511, + Fire_Cracker_Love = 14546, + Fire_Cracker_Wday = 14547, + Fire_Cracker_Vday = 14548, + Fire_Cracker_Bday = 14549, + Fire_Cracker_Xmas = 14550, + Tyr = 14601, + Center_Potion_B = 22542, + Berserk_Potion_B = 22543, + Awakening_Potion_B = 22544, + Speed_Up_Potion_B = 22545, + Slow_Down_Potion_B = 22546, + Sesame_Pastry_B = 22551, + Honey_Pastry_B = 22552, + Rainbow_Cake_B = 22553, + HALLOWEEN_G_BOX = 22669, + Bath_Foam_A = 100147, + Bath_Foam_B = 100148, + Bath_Foam_C = 100149, + Aroma_Oil = 100150, }; #endif diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 183ded583..4ea11578e 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -1,4 +1,5 @@ #include "Contents/Items/ItemInfo.h" +#include "Contents/Items/ItemId.h" #include "Client/Session.h" #include "Client/Input/InputCharset.h" #include "File/File.h" @@ -543,10 +544,10 @@ bool IsNumericText(const char* text) { // FUNCTION: fn_06604 bool ITEM_INFO::IsElementalStone() const { switch (std::atoi(this->itemId.c_str())) { - case 994: - case 995: - case 996: - case 997: + case ITEMID_FLAME_HEART: + case ITEMID_MISTIC_FROZEN: + case ITEMID_ROUGH_WIND: + case ITEMID_GREAT_NATURE: return true; default: return false; diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index e80517a5b..7f3a8f7f0 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -1,4 +1,5 @@ #include "Client/Replay.h" +#include "Contents/Items/ItemType.h" #include "Contents/Items/ItemInfo.h" #include "Contents/Items/ItemNaming.h" #include "Contents/Configuration/ServiceConfiguration.h" @@ -26,15 +27,15 @@ std::map> g_bookItemNames; // FUNCTION: fn_06597 bool Equipment(const ITEM_INFO& item) { switch (item.unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: case 21: return true; default: diff --git a/Source/Contents/Items/ItemType.h b/Source/Contents/Items/ItemType.h new file mode 100644 index 000000000..87634f3f5 --- /dev/null +++ b/Source/Contents/Items/ItemType.h @@ -0,0 +1,24 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ITEMS_ITEMTYPE_H +#define RAGNAROK_SOURCE_CONTENTS_ITEMS_ITEMTYPE_H + +enum ITEMTYPE : int { + TYPE_HEAL = 0, + TYPE_SCHANGE = 1, + TYPE_SPECIAL = 2, + TYPE_EVENT = 3, + TYPE_ARMOR = 4, + TYPE_WEAPON = 5, + TYPE_BOW = 8, + TYPE_BOTHHAND = 9, + TYPE_ARROW = 10, + TYPE_ARMORTM = 11, + TYPE_ARMORTB = 12, + TYPE_ARMORMB = 13, + TYPE_ARMORTMB = 14, + TYPE_GUN = 15, + TYPE_AMMO = 16, + TYPE_THROWWEAPON = 17, + TYPE_CASH_POINT_ITEM = 18, +}; + +#endif diff --git a/Source/Contents/Messenger/ClientMessenger.cpp b/Source/Contents/Messenger/ClientMessenger.cpp index 332d67999..1d5a55f5b 100644 --- a/Source/Contents/Messenger/ClientMessenger.cpp +++ b/Source/Contents/Messenger/ClientMessenger.cpp @@ -1,4 +1,5 @@ #include "Network/Packets/NoticeEnums.h" +#include "Contents/Items/ItemType.h" #include "Contents/Combat/CombatTypes.h" #include "Contents/Messenger/ClientMessenger.h" #include "Utility/EncryptedName.h" @@ -1992,7 +1993,7 @@ int GetEquipLocationIndex(const int& mask) { index = 3; break; case EQP_HAND_R: - case 0x22: + case (EQP_HAND_R | EQP_HAND_L): index = 4; break; case EQP_GARMENT: @@ -2004,7 +2005,7 @@ int GetEquipLocationIndex(const int& mask) { case EQP_SHOES: index = 6; break; - case 0x101: + case (EQP_HEAD_TOP | EQP_HEAD_LOW): index = 1; break; case EQP_HEAD_TOP: @@ -2016,26 +2017,26 @@ int GetEquipLocationIndex(const int& mask) { case EQP_HEAD_MID: index = 11; break; - case 0x201: + case (EQP_HEAD_MID | EQP_HEAD_LOW): index = 1; break; - case 0x300: + case (EQP_HEAD_TOP | EQP_HEAD_MID): index = 10; break; - case 0x301: + case (EQP_HEAD_TOP | EQP_HEAD_MID | EQP_HEAD_LOW): index = 1; break; case EQP_COSTUME_HEAD_TOP: - case 0xC00: - case 0x1400: - case 0x1C00: + case (EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID): + case (EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_LOW): + case (EQP_COSTUME_HEAD_TOP | EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW): index = 20; break; case EQP_COSTUME_HEAD_LOW: index = 22; break; case EQP_COSTUME_HEAD_MID: - case 0x1800: + case (EQP_COSTUME_HEAD_MID | EQP_COSTUME_HEAD_LOW): index = 21; break; case EQP_COSTUME_GARMENT: @@ -5690,15 +5691,15 @@ void CSession::ClearAllItems1784() { void CSession::KeepEquipment() { for (auto entry = this->m_inventoryItems.begin(); entry != this->m_inventoryItems.end();) { switch (entry->unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: ++entry; break; default: @@ -5723,15 +5724,15 @@ void CSession::ClearTradeItems() { void CSession::RemoveEquipment() { for (auto entry = this->m_inventoryItems.begin(); entry != this->m_inventoryItems.end();) { switch (entry->unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: entry = this->m_inventoryItems.erase(entry); break; default: diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index a1a85f7f4..33a2cfd45 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -1,4 +1,5 @@ #include "Contents/Messenger/MessengerMember.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/MessageTable.h" @@ -530,12 +531,12 @@ void UIFriendOptionWnd::Paint() { // FUNCTION: fn_07683 int UIFriendOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(68); break; - case 213: + case ID_CHECK: if (this->option0Box == sender) { g_session.m_autoOpenWhisperWindow = static_cast(b); } else if (this->option2Box == sender) { @@ -546,7 +547,7 @@ int UIFriendOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; } return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -1392,7 +1393,7 @@ void UIMessengerGroupWnd::UpdateGauges() { // FUNCTION: fn_07718 int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0x22: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -1401,7 +1402,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->SendMsg(nullptr, 0xE, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 0x17: { + case UM_REFRESHITEM: { this->members.clear(); for (int index = 0; index < 40; ++index) { this->gauges[index]->Move(-100, -100); @@ -1515,7 +1516,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->LayoutButtons(); return 0; } - case 0x31: + case UM_MAKEMENU: this->menuItems.clear(); if (g_windowMgr.unknown_0210) { g_windowMgr.CloseWindow(0x12); @@ -1565,7 +1566,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, ); } return 0; - case 0x30: { + case UM_MENU_SELECTED: { if (this->menuItems.begin() == this->menuItems.end()) { return 0; } @@ -1578,14 +1579,14 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } switch (this->menuItems[a].value) { - case 0: - case 0x13: + case MENUID_EXPEL: + case MENUID_DELETE_WHISPER_NAME: this->SendMsg(nullptr, 6, 0xEB, 0, 0, 0); return 0; - case 3: + case MENUID_QUERYINFO: this->SendMsg(nullptr, 6, 0xE9, 0, 0, 0); return 0; - case 5: + case MENUID_INVITE_IN_PARTY: if (this->selected != -1) { MessengerMember target = this->MemberAtIndex(this->selected); if (target.valid) { @@ -1593,16 +1594,16 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 6: + case MENUID_SEND_MSG: this->SendMsg(nullptr, 6, 0xE7, 0, 0, 0); return 0; - case 7: + case MENUID_TALKONLYTWO: this->SendMsg(nullptr, 6, 0xE8, 0, 0, 0); return 0; - case 9: + case MENUID_LEAVE: this->SendMsg(nullptr, 6, 0xEC, 0, 0, 0); return 0; - case 0x14: + case MENUID_MAKE_WHISPER_WINDOW: this->SendMsg(nullptr, 0x47, 0, 0, 0, 0); return 0; case 0x2B: @@ -1642,14 +1643,14 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; } - case 6: + case UM_COMMAND: switch (a) { case 0xE7: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); } return 0; - case 0xE8: + case ID_TALK: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid && !(member.name == g_session.DecodePlayerName())) { @@ -1666,7 +1667,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0xE9: + case ID_FRIEND_INFO: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { @@ -1674,7 +1675,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0xEA: + case ID_PARTY_SETTING: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { g_windowMgr.CloseWindow(0xD0); @@ -1703,7 +1704,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0xEB: + case ID_DELETE_FRIEND: if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { @@ -1719,10 +1720,10 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x45); return 0; - case 0xEC: + 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()) { @@ -1732,7 +1733,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } return 0; - case 0xD7: { + case ID_RADIOBTN: { UIWindow* clicked = sender; if (b) { clicked = this->tabs[b - 1]; @@ -1790,7 +1791,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; } - case 0xCA: + case ID_MINI: this->iconIndex = 1; this->iconModeButtons[1]->Enable(1); this->iconModeButtons[0]->Enable(0); @@ -1882,9 +1883,9 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scrollTop; if (message == 9) { this->scrollTop = previous - this->visibleRows + 1; @@ -1899,7 +1900,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return this->scrollTop - previous; } - case 0xE: + case UM_RESIZE: if (a == 7) { int width = static_cast(b); int height = static_cast(c); diff --git a/Source/Contents/PetTalk.cpp b/Source/Contents/PetTalk.cpp index 81baa4fc4..5c24657bb 100644 --- a/Source/Contents/PetTalk.cpp +++ b/Source/Contents/PetTalk.cpp @@ -1,4 +1,5 @@ #include "Client/Session.h" +#include "Contents/Actors/PetEnums.h" #include "Contents/MessageTable.h" #include @@ -9,27 +10,27 @@ // FUNCTION: fn_23805 const char* CSession::GetPetTalkActionName(int action) { switch (action) { - case 0: + case PM_FEEDING: return "feeding"; - case 1: + case PM_HUNTING: return "hunting"; - case 2: + case PM_DANGER: return "danger"; - case 3: + case PM_DEAD: return "dead"; - case 4: + case PM_NORMAL: return "stand"; - case 10: + case PM_CONNENCT: return "connect"; - case 6: + case PM_LEVELUP: return "levelup"; - case 7: + case PM_PERFORMANCE1: return "perfor_1"; - case 8: + case PM_PERFORMANCE2: return "perfor_2"; - case 9: + case PM_PERFORMANCE3: return "perfor_3"; - case 5: + case PM_PERFORMANCE_S: return "perfor_s"; default: return "normal"; @@ -55,16 +56,16 @@ void CSession::GetPetTalkText(int job, int hungerState, int action, char* text) const char* hunger; switch (hungerState) { - case 1: + case PET_HUNGRY: hunger = "bit_hungry"; break; - case 2: + case PET_SATISFIED: hunger = "noting"; break; - case 3: + case PET_ENOUGH: hunger = "full"; break; - case 4: + case PET_FULL: hunger = "so_full"; break; default: diff --git a/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp b/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp index 77e8ee2fc..df3bc2d2a 100644 --- a/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp +++ b/Source/Contents/Skills/SkillActionShinkiroShiranui.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Contents/Combat/CombatTypes.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Actors/GameActor.h" #include "Contents/Actors/RenderObject.h" @@ -350,25 +351,25 @@ void CSkillAction_SS_FOUR_CHARM::OnSkillEffect(int level, CGameActor* source, CG EffectLists* effects; switch (source->charmType) { - case 1: + case CHARM_TYPE_WATER: effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_ice_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_ice"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); break; - case 2: + case CHARM_TYPE_LAND: effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_earth_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_earth"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); break; - case 3: + case CHARM_TYPE_FIRE: effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_fire_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_fire"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); break; - case 4: + case CHARM_TYPE_WIND: effects = g_effectMgr; effects->Spawn(source->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("four_charm_wind_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); effects = g_effectMgr; diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 32c4cfac9..6a311debc 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -1,4 +1,5 @@ #include "Contents/Sound/SoundMaker.h" +#include "Contents/Actors/ActorEnums.h" #include "Contents/Jobs/JobId.h" #include "Contents/Actors/ActorStateFlags.h" @@ -548,18 +549,18 @@ void CBlurPC::SendMsg( ) { if (a == 0) { switch (message) { - case 0: + case BM_RGB: this->SetColor(180, b, d, f); this->unknown_04FC = 0x8000000; return; - case 1: + case BM_ALPHA: this->render.color &= (b << 24) + 0xFFFFFF; this->unknown_04FC = d << 24; return; - case 2: + case BM_MOTIONY: this->unknown_04F8 = *reinterpret_cast(&b); return; - case 3: + case BM_MOTION_FREEZE: this->render.isMotionFreezed = 1; return; } @@ -609,18 +610,18 @@ void CHalluNPC::SendMsg( ) { if (a == 0) { switch (message) { - case 0: + case BM_RGB: this->SetColor(180, b, d, f); this->unknown_0444 = 0x8000000; return; - case 1: + case BM_ALPHA: this->render.color &= (b << 24) + 0xFFFFFF; this->unknown_0444 = d << 24; return; - case 2: + case BM_MOTIONY: this->unknown_0440 = *reinterpret_cast(&b); return; - case 3: + case BM_MOTION_FREEZE: this->render.isMotionFreezed = 1; return; } @@ -636,18 +637,18 @@ void CHalluPC2::SendMsg( ) { if (a == 0) { switch (message) { - case 0: + case BM_RGB: this->SetColor(180, 255, 55, 55); this->unknown_04FC = 0x8000000; return; - case 1: + case BM_ALPHA: this->render.color &= (b << 24) + 0xFFFFFF; this->unknown_04FC = d << 24; return; - case 2: + case BM_MOTIONY: this->unknown_04F8 = *reinterpret_cast(&b); return; - case 3: + case BM_MOTION_FREEZE: this->render.isMotionFreezed = 1; return; } @@ -663,18 +664,18 @@ void CHalluPC::SendMsg( ) { if (a == 0) { switch (message) { - case 0: + case BM_RGB: this->SetColor(180, b, d, f); this->unknown_04FC = 0x8000000; return; - case 1: + case BM_ALPHA: this->render.color &= (b << 24) + 0xFFFFFF; this->unknown_04FC = d << 24; return; - case 2: + case BM_MOTIONY: this->unknown_04F8 = *reinterpret_cast(&b); return; - case 3: + case BM_MOTION_FREEZE: this->render.isMotionFreezed = 1; return; } @@ -1642,7 +1643,7 @@ void CNpc::SetState(int state, int) { } switch (state) { - case 0: + case ST_STAND: this->render.isLieOnGround = false; this->render.unknown_00A4Bytes[1] = 1; this->SetAction(0, 4, 0); @@ -1693,7 +1694,7 @@ void CNpc::SetState(int state, int) { this->RegisterPos(); } break; - case 1: + case ST_MOVE: if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; } @@ -1704,7 +1705,7 @@ void CNpc::SetState(int state, int) { } this->UnRegisterPos(); break; - case 2: + case ST_ATTACK: if (this->bodyState != 1 && this->bodyState != 2) { this->render.isMotionFreezed = false; } @@ -1725,7 +1726,7 @@ void CNpc::SetState(int state, int) { this->RegisterPos(); this->LaunchAttackProjectile(this->hitTargetAid, this->render.speed * this->unknown_0378); break; - case 3: + case ST_DEAD: this->render.unknown_00C8 = 0; this->render.unknown_00D8 = 0; this->render.unknown_00DC = 0; @@ -1745,7 +1746,7 @@ void CNpc::SetState(int state, int) { this->UnRegisterPos(); } break; - case 4: + case ST_DAMAGE: if (this->render.unknown_00C8 != 0 || this->render.unknown_00D8 != 0 || this->render.unknown_00DC != 0) { return; } @@ -1760,7 +1761,7 @@ void CNpc::SetState(int state, int) { this->SetAction(24, 4, 1); this->RegisterPos(); break; - case 7: + case ST_SKILL: switch (this->unknown_0314) { case 8: case 10: @@ -1776,7 +1777,7 @@ void CNpc::SetState(int state, int) { this->SetAction(96, 6, 1); } break; - case 10: + 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); diff --git a/Source/Contents/World/WorldObjects.cpp b/Source/Contents/World/WorldObjects.cpp index 8203c8601..290054538 100644 --- a/Source/Contents/World/WorldObjects.cpp +++ b/Source/Contents/World/WorldObjects.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CGameMode.h" +#include "Client/Mode/GameModeEnums.h" #include "Client/Session.h" #include "Contents/Actors/EffectActors.h" #include "Resource/ResourceMgr.h" @@ -958,120 +959,120 @@ CMsgEffect* CGameMode::SpawnMsgEffect(int effectId, const vector3d* position, st int animation = 0; switch (effectId) { - case 0: + case MAKETYPE_MVP_EFFECT: names[0] = "이팩트\\mvp.spr"; names[1] = "이팩트\\mvp.act"; type = 2; break; - case 1: + case MAKETYPE_CART_EFFECT: names[0] = "이팩트\\손수레.spr"; names[1] = "이팩트\\손수레.act"; type = 3; break; - case 2: + case MAKETYPE_PK_EFFECT: names[0] = "이팩트\\emotion.spr"; names[1] = "이팩트\\emotion.act"; animation = 8; type = 4; break; - case 3: + case MAKETYPE_ICE_EFFECT: names[0] = "이팩트\\얼음땡.spr"; names[1] = "이팩트\\얼음땡.act"; type = 5; break; - case 4: + case MAKETYPE_ICEBREAK_EFFECT: names[0] = "이팩트\\얼음땡.spr"; names[1] = "이팩트\\얼음땡.act"; animation = 1; type = 6; break; - case 5: + case MAKETYPE_SMOKE_EFFECT: names[0] = "이팩트\\smoke.spr"; names[1] = "이팩트\\smoke.act"; type = 6; break; - case 6: + case MAKETYPE_CURSE_EFFECT: names[0] = "이팩트\\Status-curse.spr"; names[1] = "이팩트\\Status-curse.act"; type = 7; break; - case 7: + case MAKETYPE_SLEEP_EFFECT: names[0] = "이팩트\\Status-sleep.spr"; names[1] = "이팩트\\Status-sleep.act"; type = 8; break; - case 8: + case MAKETYPE_STUN_EFFECT: names[0] = "이팩트\\Status-stun.spr"; names[1] = "이팩트\\Status-stun.act"; type = 9; break; - case 9: + case MAKETYPE_SILENCE_EFFECT: names[0] = "이팩트\\emotion.spr"; names[1] = "이팩트\\emotion.act"; animation = 10; type = 10; break; - case 10: + case MAKETYPE_ANGELUS_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text80EC()); names[1] = FormatOwnedString("%s.act", g_session.Text80EC()); animation = 1; type = 11; break; - case 11: + case MAKETYPE_CRUSIS_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text80EC()); names[1] = FormatOwnedString("%s.act", g_session.Text80EC()); animation = 2; type = 12; break; - case 12: + case MAKETYPE_CRITICAL_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text80EC()); names[1] = FormatOwnedString("%s.act", g_session.Text80EC()); animation = 2; type = 15; break; - case 13: + case MAKETYPE_LUCKY_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text80EC()); names[1] = FormatOwnedString("%s.act", g_session.Text80EC()); animation = 3; type = 17; break; - case 14: + case MAKETYPE_BIRD_EFFECT: names[0] = "이팩트\\매.spr"; names[1] = "이팩트\\매.act"; type = 18; break; - case 16: + case MAKETYPE_CART_EFFECT2: names[0] = "이팩트\\손수레1.spr"; names[1] = "이팩트\\손수레1.act"; type = 3; break; - case 17: + case MAKETYPE_CART_EFFECT3: names[0] = "이팩트\\손수레2.spr"; names[1] = "이팩트\\손수레2.act"; type = 3; break; - case 18: + case MAKETYPE_CART_EFFECT4: names[0] = "이팩트\\손수레3.spr"; names[1] = "이팩트\\손수레3.act"; type = 3; break; - case 19: + case MAKETYPE_CART_EFFECT5: names[0] = "이팩트\\손수레4.spr"; names[1] = "이팩트\\손수레4.act"; type = 3; break; - case 20: + case MAKETYPE_GUARD_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text80EC()); names[1] = FormatOwnedString("%s.act", g_session.Text80EC()); animation = 1; type = 24; break; - case 21: + case MAKETYPE_CART_EFFECT6: names[0] = "이팩트\\슈노손수레.spr"; names[1] = "이팩트\\슈노손수레.act"; type = 3; break; - case 22: + case MAKETYPE_BLUE_EFFECT: names[0] = FormatOwnedString("%s.spr", g_session.Text8104()); if (g_session.m_damageSkinIndex == 0) { names[1] = "이팩트\\msg.act"; @@ -1081,63 +1082,63 @@ CMsgEffect* CGameMode::SpawnMsgEffect(int effectId, const vector3d* position, st animation = 2; type = 25; break; - case 23: + case MAKETYPE_BIRD_EFFECT2: names[0] = "이팩트\\매2.spr"; names[1] = "이팩트\\매2.act"; type = 18; break; - case 24: + case MAKETYPE_BIRD_EFFECT3: names[0] = "이팩트\\매.spr"; names[1] = "이팩트\\베이비매.act"; type = 18; break; - case 25: + case MAKETYPE_CART_EFFECT11: names[0] = "이팩트\\손수레.spr"; names[1] = "이팩트\\베이비손수레.act"; type = 3; break; - case 26: + case MAKETYPE_CART_EFFECT12: names[0] = "이팩트\\손수레1.spr"; names[1] = "이팩트\\베이비손수레1.act"; type = 3; break; - case 27: + case MAKETYPE_CART_EFFECT13: names[0] = "이팩트\\손수레2.spr"; names[1] = "이팩트\\베이비손수레2.act"; type = 3; break; - case 28: + case MAKETYPE_CART_EFFECT14: names[0] = "이팩트\\손수레3.spr"; names[1] = "이팩트\\베이비손수레3.act"; type = 3; break; - case 29: + case MAKETYPE_CART_EFFECT15: names[0] = "이팩트\\손수레4.spr"; names[1] = "이팩트\\베이비손수레4.act"; type = 3; break; - case 30: + case MAKETYPE_CART_EFFECT16: names[0] = "이팩트\\슈노손수레.spr"; names[1] = "이팩트\\베이비슈노손수레.act"; type = 3; break; - case 31: + case MAKETYPE_CURSOR_EFFECT: names[0] = "cursors.spr"; names[1] = "cursors.act"; animation = 10; type = 26; break; - case 32: + case MAKETYPE_BIRD_EFFECT4: names[0] = "몬스터\\demon_pungus.spr"; names[1] = "몬스터\\demon_pungus.act"; type = 18; break; - case 33: + case MAKETYPE_BIRD_EFFECT5: names[0] = "몬스터\\explosion.spr"; names[1] = "몬스터\\explosion.act"; type = 18; break; - case 34: + case MAKETYPE_BIRD_EFFECT6: names[0] = "몬스터\\lude.spr"; names[1] = "몬스터\\lude.act"; type = 18; diff --git a/Source/Network/Packets/ModeResultEnums.h b/Source/Network/Packets/ModeResultEnums.h index f1d99d8c6..f9f026820 100644 --- a/Source/Network/Packets/ModeResultEnums.h +++ b/Source/Network/Packets/ModeResultEnums.h @@ -9,8 +9,6 @@ enum e_enchantgrade_result : int { ENCHANTGRADE_UPGRADE_PROTECTED = 4, }; -#endif - enum pincode_state : int { PINCODE_OK = 0, PINCODE_ASK = 1, @@ -22,3 +20,30 @@ enum pincode_state : int { PINCODE_PASSED = 7, PINCODE_WRONG = 8, }; + +enum LOGINREFUSEREASON : int { + REFUSE_INVALID_ID = 0, + REFUSE_INVALID_PASSWD = 1, + REFUSE_ID_EXPIRED = 2, + REFUSE_NOT_CONFIRMED = 4, + REFUSE_INVALID_VERSION = 5, + REFUSE_BLOCK_TEMPORARY = 6, + REFUSE_NONSAKRAY_ID_BLOCKED = 8, + REFUSE_BAN_BY_DBA = 9, + REFUSE_EMAIL_NOT_CONFIRMED = 10, + REFUSE_BAN_BY_GM = 11, + REFUSE_TEMP_BAN_FOR_DBWORK = 12, + REFUSE_SELF_LOCK = 13, + REFUSE_NOT_PERMITTED_GROUP = 14, + REFUSE_WAIT_FOR_SAKRAY_ACTIVE = 15, + REFUSE_DELETED_ACCOUNT = 99, + REFUSE_ALREADY_CONNECT = 100, + REFUSE_TEMP_BAN_HACKING_INVESTIGATION = 101, + REFUSE_TEMP_BAN_BUG_INVESTIGATION = 102, + REFUSE_TEMP_BAN_DELETING_CHAR = 103, + REFUSE_TEMP_BAN_DELETING_SPOUSE_CHAR = 104, + REFUSE_USER_PHONE_BLOCK = 105, + ACCEPT_LOGIN_USER_PHONE_BLOCK = 106, +}; + +#endif diff --git a/Source/Network/Packets/NoticeEnums.h b/Source/Network/Packets/NoticeEnums.h index 0fc94b125..64602b03e 100644 --- a/Source/Network/Packets/NoticeEnums.h +++ b/Source/Network/Packets/NoticeEnums.h @@ -74,8 +74,6 @@ enum _sp : int { SP_UCRT = 252, }; -#endif - enum mail_inbox_type : int { MAIL_INBOX_NORMAL = 0, MAIL_INBOX_ACCOUNT = 1, @@ -294,6 +292,10 @@ enum e_refuse_enter_room : int { ENTERROOM_FULL = 0, ENTERROOM_WRONG_PASSWORD = 1, ENTERROOM_KICKED = 2, + REFUSETYPE_ZENY = 4, + REFUSETYPE_LOWLEVEL = 5, + REFUSETYPE_HIGHLEVEL = 6, + REFUSETYPE_JOB = 7, }; enum e_ack_remember_warppoint_result : int { @@ -342,3 +344,287 @@ enum e_searchstore_failure : int { SSI_FAILED_LIMIT_SEARCH_TIME = 3, SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE = 4, }; + +enum PICKUPRESULT : int { + PICKUP_SUCCEED = 0, + PICKUP_FAILED = 1, + PICKUP_OVERWEIGHT = 2, + RECEIVE_ITEM = 3, + PICKUP_OVERCOUNT = 4, + PICKUP_OVERCOUNT_ONEITEM = 5, + PICKUP_REFUSED_TIME = 6, +}; + +enum BANREASON : int { + BAN_UNFAIR = 0, + BAN_SERVER_SHUTDOWN = 1, + BAN_ANOTHER_LOGIN = 2, + BAN_DETECTED_SPEEDHACK = 3, + BAN_PC_OVERFLOW = 4, + BAN_UNDER_AGE = 5, + BAN_NOT_SETTLED = 6, + BAN_ACCOUNT_BUSY = 7, + BAN_INFORMATION_REMAINED = 8, + BAN_IP_OVERFLOW = 9, + BAN_PAY_OUT = 10, + BAN_PAY_SUSPEND = 11, + BAN_PAY_CHANGE = 12, + BAN_PAY_WRONGIP = 13, + BAN_PAY_PNGAMEROOM = 14, + BAN_OP_FORCE = 15, + BAN_JAPAN_REFUSE1 = 16, + BAN_JAPAN_REFUSE2 = 17, + BAN_INFORMATION_REMAINED_ANOTHER_ACCOUNT = 18, + BAN_PC_IP_UNFAIR = 100, + BAN_PC_IP_COUNT_ALL = 101, + BAN_PC_IP_COUNT = 102, + BAN_GRAVITY_MEM_AGREE = 103, + BAN_GAME_MEM_AGREE = 104, + BAN_HAN_VALID = 105, +}; + +enum BASICSKILLTYPE : int { + ZCSK_ITEMEXCHANGE = 0, + ZCSK_EMOTION = 1, + ZCSK_SIT = 2, + ZCSK_CHAT = 3, + ZCSK_PARTY = 4, + ZCSK_SHOUT = 5, + ZCSK_PK = 6, + ZCSK_MANNERPOINT = 7, + ZCSK_JOINPARTY = 8, +}; + +enum PACKETOBJECTTYPE : int { + PC_TYPE = 0, + NPC_MOB_TYPE = 5, + NPC_HO_TYPE = 8, + NPC_MERSOL_TYPE = 9, + NPC_ELEMENTAL_TYPE = 10, + NPC_ABR_TYPE = 13, + NPC_BIONIC_TYPE = 14, +}; + +enum BOSS_INFO_TYPE : int { + BOSS_INFO_NOT = 0, + BOSS_INFO_ALIVE = 1, + BOSS_INFO_ALIVE_WITHMSG = 2, + BOSS_INFO_DEAD = 3, +}; + +enum SELLRESULT : int { + SELL_SUCCEED = 0, + SELL_FAIL = 1, +}; + +enum ROOMEXITTYPE : int { + ROOMEXITTYPE_EXIT = 0, + ROOMEXITTYPE_EXPEL = 1, +}; + +enum EXCHANGECONCLUDETYPE : int { + EXI_CONCLUDE_ME = 0, + EXI_CONCLUDE_OTHER = 1, +}; + +enum EXCHANGERESULT : int { + EXITEM_EXCHANGE_SUCCEED = 0, + EXITEM_EXCHANGE_FAILED = 1, +}; + +enum GROUPMAKERESULT : int { + GROUP_MAKE_SUCCEED = 0, + GROUP_MAKE_FAILED_SAMENAME = 1, + GROUP_MAKE_FAILED_ALEADY_GROUP_MEMBER = 2, +}; + +enum MANNERRESULT : int { + MP_SUCCESS = 0, + MP_SUCCESS_BY_ADMIN = 3, + MP_BYSELF = 4, +}; + +enum GUILDDISBANDRESULT : int { + DISRESULT_SUCCESS = 0, + DISRESULT_INVALIDKEY = 1, + DISRESULT_MEMBEREXIST = 2, +}; + +enum GUILD_MAKE_RESULT : int { + GM_SUCCESS = 0, + GM_ALREADY_MEMBER = 1, + GM_GUILD_EXIST = 2, + GM_NONE_ITEM = 3, +}; + +enum GUILDJOINRESULT : int { + REQJOINGUILD_ALREADY_OTHERGUILDM = 0, + REQJOINGUILD_REJECT = 1, + REQJOINGUILD_ACCEPT = 2, + REQJOINGUILD_OVERSIZE = 3, +}; + +enum GUILDALLYRESULT : int { + REQALLYGUILD_ALREADY_ALLIED = 0, + REQALLYGUILD_REJECT = 1, + REQALLYGUILD_ACCEPT = 2, + REQALLYGUILD_OVERSIZE = 3, + REQMYGUILD_OVERSIZE = 4, +}; + +enum ITEMIDENTIFYRESULT : int { + ITEMIDENTIFY_SUCCESS = 0, + ITEMIDENTIFY_FAIL = 1, +}; + +enum GUILDHOSTILERESULT : int { + RESULT_HOSTILE_SUCCESS = 0, + RESULT_HOSTILE_OVERSIZE = 1, + RESULT_HOSTILE_ALREADY_HOSTILE = 2, +}; + +enum MAPINFORESULT : int { + TELEPORT_IMPOSSIBLE_AREA = 0, + IMPOSSIBLE_AREA_SKILL = 2, + IMPOSSIBLE_AREA_USEITEM = 3, +}; + +enum DISCONNECTRESULT : int { + DISCONNECTABLE_STATE = 0, + NOTDISCONNECTABLE_STATE = 1, +}; + +enum ITEMREPAIRRESULT : int { + ITEMREPAIR_SUCCESS = 0, + ITEMREPAIR_FAIL = 1, +}; + +enum WEAPONREFINERESULT : int { + MSG_WEAPONREFINE_SUCCESS = 0, + MSG_WEAPONREFINE_FAIL = 1, + MSG_WEAPONREFINE_FAIL_LEVEL = 2, + MSG_WEAPONREFINE_FAIL_ITEM = 3, +}; + +enum GROUPMEMBERDELETETYPE : int { + GROUPMEMBER_DELETE_LEAVE = 0, + GROUPMEMBER_DELETE_EXPEL = 1, +}; + +enum HOMUNSTATECHANGE : int { + HO_PRE_INIT = 0, + HO_RELATIONSHIP_CHANGED = 1, + HO_FULLNESS_CHANGED = 2, + HO_ACCESSARY_CHANGED = 3, +}; + +enum WHISPER_TYPE : int { + WT_EXCLUDE_WHISPER = 0, + WT_INCLUDE_WHISPER = 1, +}; + +enum WHISPER_SETTING_RESULT : int { + WHISPER_SETTING_SUCCEED = 0, + WHIPSER_SETTING_FAILED = 1, + WHISPER_SETTING_FAILED_OVERCOUNT = 2, +}; + +enum LEGACYEQUIPRESULT : int { + ACK_REQ_EQUIP_FAILURE = 0, + ACK_REQ_EQUIP_SUCCESS = 1, + ACK_REQ_EQUIP_FAILURE_LEVEL = 2, +}; + +enum clif_equipitemack_flag : int { + ITEM_EQUIP_ACK_OK = 0, + ITEM_EQUIP_ACK_FAILLEVEL = 1, + ITEM_EQUIP_ACK_FAIL = 2, +}; + +enum e_additem_result : int { + ADDITEM_STACKLIMIT = 7, +}; + +enum e_purchase_result : int { + PURCHASE_SUCCEED = 0, + PURCHASE_FAIL_MONEY = 1, + PURCHASE_FAIL_WEIGHT = 2, + PURCHASE_FAIL_COUNT = 3, + PURCHASE_FAIL_EACHITEM_COUNT = 9, +}; + +enum FRIENDADDRESULT : int { + FRIEND_ADD_SUCCEED = 0, + FRIEND_ADD_FALSE = 1, + FRIEND_ADD_ME_OVERSIZE = 2, + FRIEND_ADD_OTHER_OVERSIZE = 3, +}; + +enum PCSTATE : int { + PCSTATE_STAND = 0, + PCSTATE_DEAD = 1, + PCSTATE_SIT = 2, +}; + +enum SOUND_ACT : int { + SOUND_ACT_PLAY = 0, + SOUND_ACT_REPEAT = 1, + SOUNT_ACT_STOP = 2, +}; + +enum EXP_SHARE : int { + EXP_NOTSHARED = 0, + EXP_SHARED = 1, + EXP_CHANGE_IMPOSSIBLE = 2, +}; + +enum e_CASHSHOP_ACK : int { + ERROR_TYPE_NONE = 0, + ERROR_TYPE_NPC = 1, + ERROR_TYPE_SYSTEM = 2, + ERROR_TYPE_INVENTORY_WEIGHT = 3, + ERROR_TYPE_EXCHANGE = 4, + ERROR_TYPE_ITEM_ID = 5, + ERROR_TYPE_MONEY = 6, + ERROR_TYPE_AMOUNT = 7, +}; + +enum out_ui_type : int { + OUT_UI_TIP = 5, + OUT_UI_QUEST = 6, + OUT_UI_ATTENDANCE = 7, + OUT_UI_ENCHANTGRADE = 8, +}; + +enum ITEMCOMPOSITION_RESULT : int { + ITEMCOMPOSITON_SUCCESS = 0, + ITEMCOMPOSITION_FAILURE = 1, +}; + +enum NOTIFYEFFECT : int { + LEVELUP_EFFECT = 0, + JOBLEVELUP_EFFECT = 1, + REFINING_FAIL_EFFECT = 2, + REFINING_SUCCESS_EFFECT = 3, + GAME_OVER_EFFECT = 4, + MAKEITEM_AM_SUCCESS_EFFECT = 5, + MAKEITEM_AM_FAIL_EFFECT = 6, + LEVELUP_EFFECT2 = 7, + JOBLEVELUP_EFFECT2 = 8, + LEVELUP_EFFECT3 = 9, +}; + +enum e_bg_queue_apply_ack : int { + BG_APPLY_ACCEPT = 1, + BG_APPLY_QUEUE_FINISHED = 2, + BG_APPLY_INVALID_NAME = 3, + BG_APPLY_INVALID_APP = 4, + BG_APPLY_PLAYER_COUNT = 5, + BG_APPLY_PLAYER_LEVEL = 6, + BG_APPLY_DUPLICATE = 7, + BG_APPLY_RECONNECT = 8, + BG_APPLY_PARTYGUILD_LEADER = 9, + BG_APPLY_PLAYER_CLASS = 10, +}; + +#endif diff --git a/Source/Network/Packets/PacketId.h b/Source/Network/Packets/PacketId.h index 32108110e..d5f7da197 100644 --- a/Source/Network/Packets/PacketId.h +++ b/Source/Network/Packets/PacketId.h @@ -896,6 +896,189 @@ enum PacketId : std::int16_t { ID_HC_ACK_CHANGE_CHARACTER_SLOT = 0xb70, ID_HC_ACK_CHARINFO_PER_PAGE = 0xb72, ID_ZC_REPUTE_OPEN = 0xb8e, + ID_AC_ACCEPT_LOGIN_V1 = 0x69, + ID_AC_REFUSE_LOGIN_V1 = 0x6a, + ID_HC_ACCEPT_MAKECHAR_V1 = 0x6d, + ID_HC_NOTIFY_ZONESVR_V1 = 0x71, + ID_ZC_ACCEPT_ENTER_V1 = 0x73, + ID_ZC_NOTIFY_ACT_008a = 0x8a, + ID_ZC_NPCACK_SERVERMOVE_0092 = 0x92, + ID_ZC_ACK_WHISPER_0098 = 0x98, + ID_ZC_ITEM_FALL_ENTRY = 0x9e, + ID_ZC_ITEM_PICKUP_ACK_00a0 = 0xa0, + ID_ZC_USE_ITEM_ACK = 0xa8, + ID_ZC_REQ_WEAR_EQUIP_ACK_00aa = 0xaa, + ID_ZC_REQ_TAKEOFF_EQUIP_ACK_00ac = 0xac, + ID_ZC_SPRITE_CHANGE = 0xc3, + ID_ZC_PC_PURCHASE_ITEMLIST_00c6 = 0xc6, + ID_ZC_PC_SELL_RESULT = 0xcb, + ID_ZC_ACK_DISCONNECT_CHARACTER = 0xcd, + ID_ZC_REQ_EXCHANGE_ITEM_00e5 = 0xe5, + ID_ZC_ACK_EXCHANGE_ITEM_00e7 = 0xe7, + ID_ZC_GROUP_LIST = 0xfb, + ID_ZC_ACK_REQ_JOIN_GROUP = 0xfd, + ID_ZC_REQ_JOIN_GROUP = 0xfe, + ID_ZC_GROUPINFO_CHANGE = 0x101, + ID_ZC_ADD_MEMBER_TO_GROUP = 0x104, + ID_ZC_NOTIFY_HP_TO_GROUPM_0106 = 0x106, + ID_ZC_NOTIFY_SKILL_0114 = 0x114, + ID_ZC_STATE_CHANGE_0119 = 0x119, + ID_ZC_USE_SKILL_011a = 0x11a, + ID_ZC_WARPLIST_011c = 0x11c, + ID_ZC_SKILL_ENTRY = 0x11f, + ID_ZC_ADD_ITEM_TO_CART_0124 = 0x124, + ID_ZC_PC_PURCHASE_ITEMLIST_FROMMC_0133 = 0x133, + ID_ZC_DELETEITEM_FROM_MCSTORE_0137 = 0x137, + ID_ZC_RECOVERY_013d = 0x13d, + ID_ZC_USESKILL_ACK_013e = 0x13e, + ID_ZC_SHOW_IMAGE_0145 = 0x145, + ID_ZC_ACK_GIVE_MANNER_POINT = 0x14a, + ID_ZC_GUILD_INFO_0150 = 0x150, + ID_ZC_GUILD_EMBLEM_IMG_0152 = 0x152, + ID_ZC_MEMBERMGR_INFO_0154 = 0x154, + ID_ZC_ACK_LEAVE_GUILD = 0x15a, + ID_ZC_BAN_LIST_0163 = 0x163, + ID_ZC_UPDATE_GDID_016c = 0x16c, + ID_ZC_UPDATE_CHARSTAT_016d = 0x16d, + ID_ZC_ITEMIDENTIFY_LIST = 0x177, + ID_ZC_ITEMCOMPOSITION_LIST = 0x17b, + ID_ZC_ADD_RELATED_GUILD = 0x185, + ID_ZC_ACK_REQ_DISCONNECT = 0x18b, + ID_ZC_ACK_REQNAME_BYGID_0194 = 0x194, + ID_ZC_ACK_REQNAMEALL_0195 = 0x195, + ID_ZC_NOTIFY_MAPPROPERTY = 0x199, + ID_ZC_NOTIFY_RANKING = 0x19a, + ID_ZC_PETEGG_LIST = 0x1a6, + ID_ZC_CHANGE_GUILD_01b4 = 0x1b4, + ID_ZC_GUILD_INFO2 = 0x1b6, + ID_ZC_ADD_ITEM_TO_STORE2 = 0x1c4, + ID_ZC_ADD_ITEM_TO_CART2 = 0x1c5, + ID_ZC_USE_ITEM_ACK2 = 0x1c8, + ID_ZC_AUTOSPELLLIST_01cd = 0x1cd, + ID_ZC_DEVOTIONLIST = 0x1cf, + ID_ZC_SPRITE_CHANGE2 = 0x1d7, + ID_ZC_ACK_ACCOUNTNAME = 0x1e0, + ID_ZC_REQ_COUPLE = 0x1e2, + ID_ZC_ADD_MEMBER_TO_GROUP2 = 0x1e9, + ID_ZC_REQ_BABY = 0x1f6, + ID_ZC_REPAIRITEMLIST_01fc = 0x1fc, + ID_ZC_REQ_ADD_FRIENDS = 0x207, + ID_ZC_ADD_FRIENDS_LIST = 0x209, + ID_ZC_STARSKILL = 0x20e, + ID_ZC_ACK_STATUS_GM = 0x214, + ID_ZC_BABYMSG = 0x216, + ID_ZC_PROPERTY_HOMUN_022e = 0x22e, + ID_ZC_STARPLACE = 0x253, + ID_ZC_NOTIFY_EFFECT3_0284 = 0x284, + ID_ZC_PC_CASH_POINT_UPDATE = 0x289, + ID_HC_ACK_CHANGE_CHARNAME_V1 = 0x290, + ID_ZC_READ_BOOK = 0x294, + ID_ZC_ITEM_PICKUP_ACK2 = 0x29a, + ID_ZC_MER_INIT = 0x29b, + ID_ZC_MER_SKILLINFO_LIST = 0x29d, + ID_ZC_MER_PAR_CHANGE = 0x2a2, + ID_ZC_DEL_QUEST = 0x2b4, + ID_ZC_ACTIVE_QUEST = 0x2b7, + ID_ZC_ITEM_PICKUP_PARTY_02b8 = 0x2b8, + ID_ZC_NPC_CHAT = 0x2c1, + ID_ZC_ITEM_PICKUP_ACK3 = 0x2d4, + ID_ZC_EQUIPWIN_MICROSCOPE_02d7 = 0x2d7, + ID_ZC_CONFIG = 0x2d9, + ID_ZC_BATTLEFIELD_NOTIFY_CAMPINFO = 0x2dd, + ID_ZC_BATTLEFIELD_NOTIFY_POINT = 0x2de, + ID_ZC_BATTLEFIELD_NOTIFY_POSITION = 0x2df, + ID_ZC_BATTLEFIELD_NOTIFY_HP_02e0 = 0x2e0, + ID_ZC_NOTIFY_ACT2 = 0x2e1, + ID_ZC_NOTIFY_FONT = 0x2ef, + ID_ZC_PROGRESS = 0x2f0, + ID_ZC_QUEST_NOTIFY_EFFECT = 0x446, + ID_ZC_REQ_GROUPINFO_CHANGE_V2 = 0x7d8, + ID_ZC_HO_PAR_CHANGE_07db = 0x7db, + ID_ZC_USESKILL_ACK2 = 0x7fb, + ID_ZC_PLAY_NPC_BGM_07fe = 0x7fe, + ID_ZC_PC_PURCHASE_ITEMLIST_FROMMC_0800 = 0x800, + ID_ZC_PARTY_BOOKING_ACK_REGISTER = 0x803, + ID_ZC_PARTY_BOOKING_ACK_SEARCH = 0x805, + ID_ZC_PARTY_BOOKING_ACK_DELETE = 0x807, + ID_ZC_PARTY_BOOKING_NOTIFY_INSERT = 0x809, + ID_ZC_PARTY_BOOKING_NOTIFY_UPDATE = 0x80a, + ID_ZC_PARTY_BOOKING_NOTIFY_DELETE = 0x80b, + ID_ZC_ADD_EXCHANGE_ITEM2 = 0x80f, + ID_ZC_OPEN_BUYING_STORE = 0x810, + ID_ZC_FAILED_OPEN_BUYING_STORE_TO_BUYER = 0x812, + ID_ZC_FAILED_TRADE_BUYING_STORE_TO_BUYER = 0x81a, + ID_ZC_UPDATE_ITEM_FROM_BUYING_STORE = 0x81b, + ID_ZC_ITEM_DELETE_BUYING_STORE = 0x81c, + ID_ZC_SEARCH_STORE_INFO_ACK_0836 = 0x836, + ID_ZC_ACK_BAN_GUILD_SSO = 0x839, + ID_ZC_SE_CASHSHOP_OPEN_0845 = 0x845, + ID_ZC_ITEM_FALL_ENTRY4 = 0x84b, + ID_ZC_EQUIPWIN_MICROSCOPE_0859 = 0x859, + ID_ZC_SKILL_ENTRY3 = 0x8c7, + ID_ZC_PERSONAL_INFOMATION_08cb = 0x8cb, + ID_ZC_REQ_WEAR_EQUIP_ACK2 = 0x8d0, + ID_ZC_REQ_TAKEOFF_EQUIP_ACK2 = 0x8d1, + ID_ZC_FASTMOVE = 0x8d2, + ID_HC_ACK_CHANGE_CHARACTER_SLOT_V1 = 0x8d5, + ID_ZC_EFST_SET_ENTER_08ff = 0x8ff, + ID_ZC_EQUIPWIN_MICROSCOPE_0906 = 0x906, + ID_ZC_NOTIFY_NEWENTRY7 = 0x90f, + ID_ZC_NOTIFY_MOVEENTRY8 = 0x914, + ID_ZC_NOTIFY_STANDENTRY9 = 0x915, + ID_ZC_SELECTCART = 0x97f, + ID_ZC_MSG_STATE_CHANGE3 = 0x983, + ID_ZC_ITEM_PICKUP_ACK_V5 = 0x990, + ID_ZC_EQUIPWIN_MICROSCOPE_0997 = 0x997, + ID_HC_ACK_CHARINFO_PER_PAGE_V1 = 0x99d, + ID_ZC_SKILL_ENTRY4 = 0x99f, + ID_ZC_SKILL_ENTRY5 = 0x9ca, + ID_ZC_NPC_MARKET_OPEN_09d5 = 0x9d5, + ID_ZC_NOTIFY_MOVEENTRY10 = 0x9db, + ID_ZC_NOTIFY_NEWENTRY10 = 0x9dc, + ID_ZC_NOTIFY_STANDENTRY10 = 0x9dd, + ID_ZC_UPDATE_ITEM_FROM_BUYING_STORE2 = 0x9e6, + ID_ZC_ACK_READ_MAIL = 0x9eb, + ID_ZC_ALL_QUEST_LIST3 = 0x9f8, + ID_ZC_ADD_QUEST_EX = 0x9f9, + ID_ZC_UPDATE_MISSION_HUNT_EX = 0x9fa, + ID_ZC_PET_EVOLUTION_RESULT = 0x9fc, + ID_ZC_NOTIFY_MOVEENTRY11 = 0x9fd, + ID_ZC_NOTIFY_NEWENTRY11 = 0x9fe, + ID_ZC_NOTIFY_STANDENTRY11 = 0x9ff, + ID_ZC_ACK_ADD_ITEM_TO_MAIL = 0xa05, + ID_ZC_ADD_EXCHANGE_ITEM3 = 0xa09, + ID_ZC_ADD_ITEM_TO_STORE3 = 0xa0a, + ID_ZC_ADD_ITEM_TO_CART3 = 0xa0b, + ID_ZC_ITEM_PICKUP_ACK_V6 = 0xa0c, + ID_ZC_ACK_OPEN_ROULETTE = 0xa1a, + ID_ZC_SE_CASHSHOP_OPEN_0a2b = 0xa2b, + ID_ZC_EQUIPWIN_MICROSCOPE_0a2d = 0xa2d, + ID_ZC_ACK_CHANGE_TITLE = 0xa2f, + ID_ZC_ITEM_PICKUP_ACK_V7 = 0xa37, + ID_ZC_UI_OPEN_0a38 = 0xa38, + ID_ZC_ADD_MEMBER_TO_GROUP3 = 0xa43, + ID_ZC_ACK_MAIL_LIST2 = 0xa7d, + ID_ZC_ACK_BAN_GUILD_DELNAME = 0xa82, + ID_ZC_ACK_LEAVE_GUILD_DELNAME = 0xa83, + ID_ZC_GUILD_INFO3 = 0xa84, + ID_ZC_BAN_LIST2 = 0xa87, + ID_ZC_ADD_EXCHANGE_ITEM_0a96 = 0xa96, + ID_ZC_MEMBERMGR_INFO2 = 0xaa5, + ID_ZC_CHANGE_ITEM_OPTION_0ab9 = 0xab9, + ID_ZC_ACK_MAIL_LIST3 = 0xac2, + ID_ZC_ITEM_FALL_ENTRY5 = 0xadd, + ID_ZC_ALL_QUEST_LIST4 = 0xaff, + ID_ZC_EQUIPWIN_MICROSCOPE_0b03 = 0xb03, + ID_ZC_NPC_BARTER_MARKET_ITEMINFO_0b0e = 0xb0e, + ID_ZC_CHANGE_ITEM_OPTION_0b13 = 0xb13, + ID_ZC_PROPERTY_HOMUN_0b2f = 0xb2f, + ID_ZC_ADD_SKILL2 = 0xb31, + ID_ZC_SKILLINFO_LIST3 = 0xb32, + ID_ZC_SKILLINFO_UPDATE3 = 0xb33, + ID_ZC_NPC_EXPANDED_BARTER_MARKET_ITEMINFO_0b56 = 0xb56, + ID_ZC_PROPERTY_HOMUN_0b76 = 0xb76, + ID_ZC_BATTLEFIELD_NOTIFY_HP_0baa = 0xbaa, + ID_ZC_NOTIFY_HP_TO_GROUPM_0bab = 0xbab, }; #endif diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 0f95680b7..c83161585 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -1,4 +1,6 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" +#include "Contents/Items/ItemType.h" #include "Client/Mode/CLoginMode.h" #include "Contents/UserData/NormalItemSlots.h" #include "Client/Application/ApplicationWindow.h" @@ -793,20 +795,20 @@ int UIMinimapZoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } switch (argument1) { - case 189: + 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); } return 0; - case 216: + case ID_PLUS: g_windowMgr.unknown_0050 += (g_windowMgr.unknown_0050 / 3.0f + g_windowMgr.unknown_0050) * 0.25f; if (g_windowMgr.unknown_0050 > 4.0f) { g_windowMgr.unknown_0050 = 4.0f; } return 0; - case 217: + case ID_MINUS: g_windowMgr.unknown_0050 -= g_windowMgr.unknown_0050 * 0.25f; if (g_windowMgr.unknown_0050 < 1.0f) { g_windowMgr.unknown_0050 = 1.0f; @@ -1010,7 +1012,7 @@ int UINpcEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } switch (message) { - case 6: { + 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); @@ -1018,7 +1020,7 @@ int UINpcEditDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } return 0; } - case 28: { + case UM_SETNAID: { this->unknown_00B8 = static_cast(argument1); return 0; } @@ -1150,9 +1152,9 @@ int UIPartyInvitationToWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_12368 int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { if (this->m_mode != 50) { g_windowMgr.CloseWindow(53); } @@ -1186,12 +1188,12 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } return 0; } - case 185: - case 201: + case ID_CANCEL: + case ID_CLOSE: g_windowMgr.CloseWindow(53); g_windowMgr.CloseWindow(207); return 0; - case 215: + case ID_RADIOBTN: if (g_session.PartyCount() == 0 || g_session.unknown_5464 != 0) { if (sender == this->m_expShareButtons[0] || sender == this->m_expShareButtons[1]) { for (int i = 0; i < 2; ++i) { @@ -1221,14 +1223,14 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s default: return 0; } - case 34: + case UM_SETINFO: this->m_placement = reinterpret_cast(a); if (!static_cast(this->m_placement)->IsValid()) { static_cast(this->m_placement)->Reset(); } this->Move(this->m_placement->x, this->m_placement->y); break; - case 60: + case UM_REFRESH: if (this->m_mode == 5) { g_windowMgr.CloseWindow(53); } else { @@ -1257,14 +1259,14 @@ int UIPartySettingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_12369 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 6: + case UM_COMMAND: if (a == 184) { CMode* mode = g_modeMgr.gameMode; mode->SendMsg(45, this->unknown_00BC, reinterpret_cast(this->m_edit->Text()), 0, 0); g_windowMgr.CloseWindow(29); } return 0; - case 47: + case UM_SETROOMID: this->unknown_00BC = static_cast(a); return 0; default: @@ -1368,23 +1370,23 @@ void UISkillNameChangeWnd::Paint() { // FUNCTION: fn_12381 int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 31: { + case UM_ADDITEM: { 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); return 0; } - case 27: + case UM_SETCHOOSE: this->unknown_00FC = static_cast(argument1); return 0; - case 60: + case UM_REFRESH: this->UpdateScroll(); this->Invalidate(); return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; if (message == 9) { this->m_scroll = previous - this->m_rows + 1; @@ -1399,7 +1401,7 @@ int UISpellListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } return this->m_scroll - previous; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); CMode* mode = g_modeMgr.gameMode; if (argument1 == 184) { @@ -2132,13 +2134,13 @@ void UIMenuWnd::AddItem(const char* text, const std::uint32_t& color) { // FUNCTION: fn_12356 int UIMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 72: { + case UM_ADDBOUNDARY: { const std::uint32_t color = 0; this->AddItem(g_menuSeparator, color); this->Invalidate(); return 0; } - case 31: { + case UM_ADDITEM: { std::uint32_t color = static_cast(b); this->AddItem(reinterpret_cast(a), color); color = static_cast(b); @@ -2146,11 +2148,11 @@ int UIMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->Invalidate(); return 0; } - case 83: + case UM_SET_CALLER_WID: this->m_menuId = static_cast(a); this->unknown_00CC = static_cast(b); return 0; - case 30: { + case UM_ADJUSTSIZE: { int width = 20; const int count = static_cast(this->m_items.end() - this->m_items.begin()); for (int index = 0; index < count; ++index) { @@ -2163,7 +2165,7 @@ int UIMenuWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->Invalidate(); return 0; } - case 75: + case UM_CLEAR_ITEM: this->m_items.clear(); this->m_colors.clear(); return 0; @@ -2700,7 +2702,7 @@ int UICombinedCardItemCollectionWnd::SendMsg(UIWindow* sender, int message, std: // FUNCTION: fn_12348 int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0x22: { + case UM_SETINFO: { ItemCompositionWndInfo* placement = reinterpret_cast(a); this->m_compositionPlacement = placement; if (!placement->IsValid()) { @@ -2709,7 +2711,7 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->Move(placement->x, placement->y); return 0; } - case 0x4D: + case UM_SET_CARD_ITEM_INDEX: this->m_compositionState = static_cast(a); if (a != 0) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(a)); @@ -2719,13 +2721,13 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } } return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, this->m_selected, d); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(c); } switch (a) { - case 184: + case ID_OK: if (this->m_selected != -1) { int found; ITEM_INFO item = this->GetItem(this->m_selected, &found); @@ -2737,7 +2739,7 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_windowMgr.CloseWindow(0x4A); } break; - case 185: + case ID_CANCEL: g_modeMgr.gameMode->SendMsg(0x7C, -1, -1, 0, 0); g_windowMgr.CloseWindow(0x4A); break; @@ -2780,7 +2782,7 @@ int UIItemCompositionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a // FUNCTION: fn_12349 int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0x22: { + case UM_SETINFO: { ItemIdentifyWndInfo* placement = reinterpret_cast(a); this->m_placement = placement; if (!placement->IsValid()) { @@ -2789,26 +2791,26 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Move(placement->x, placement->y); return 0; } - case 0x4B: + case UM_CLEAR_ITEM: this->m_items.clear(); return 0; - case 0x3C: + case UM_REFRESH: this->UpdateScroll(); this->Invalidate(); return 0; - case 0x1F: { + 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); return 0; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, this->m_selected, d); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(c); } switch (a) { - case 184: + case ID_OK: if (this->m_selected != -1) { int found; ITEM_INFO item = this->GetItem(this->m_selected, &found); @@ -2818,16 +2820,16 @@ int UIItemIdentifyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_windowMgr.CloseWindow(0x49); } break; - case 185: + case ID_CANCEL: g_modeMgr.gameMode->SendMsg(0x79, -1, 0, 0, 0); g_windowMgr.CloseWindow(0x49); break; } return 0; } - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; if (message == 9) { this->m_scroll = previous - this->m_rows + 1; @@ -2938,7 +2940,7 @@ bool IsEquipViewHidden(); // FUNCTION: fn_12342 int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 22: + case UM_TAB: this->m_page = a; if (a == 2) { this->m_titleList->Show(1); @@ -3041,7 +3043,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->SendMsg(this, 106, 575, 0, 0, 0); this->Invalidate(); return 0; - case 34: + case UM_SETINFO: this->m_placement = reinterpret_cast(a); if (!reinterpret_cast(this->m_placement)->IsValid()) { reinterpret_cast(this->m_placement)->Reset(); @@ -3055,7 +3057,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } this->Move(this->m_placement->x, this->m_placement->y); return 0; - case 60: { + case UM_REFRESH: { if (this->m_page == 2) { this->RefreshTitleList(); this->Invalidate(); @@ -3074,12 +3076,12 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->Invalidate(); return 0; } - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(this->m_viewOther == 1 ? 139 : 10); return 0; - case 202: { + case ID_MINI: { const int height = this->geometry.height; if (height == 17) { this->Resize(this->geometry.width, this->m_show); @@ -3095,7 +3097,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } return 0; } - case 213: + case ID_CHECK: if (this->m_viewOther != 0) { return 0; } @@ -3105,7 +3107,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } g_modeMgr.gameMode->SendMsg(253, b, 0, 0, 0); return 0; - case 215: + case ID_RADIOBTN: for (int index = 0; index < 4; ++index) { this->unknown_0138[index + 2]->Invalidate(); if (sender == this->unknown_0138[index + 2]) { @@ -3116,7 +3118,7 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } } return 0; - case 248: { + 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); @@ -3179,13 +3181,13 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->Invalidate(); return 0; } - case 249: + 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); } return 0; - case 271: { + case ID_APPLY: { if (this->m_hoverSlot >= 0) { g_session.m_damageSkinIndex = this->m_hoverSlot; } @@ -3275,10 +3277,10 @@ int UIEquipWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } } return 0; - case 48: + case UM_MENU_SELECTED: this->UpdateCharacterView(a); return 0; - case 8: { + case UM_SCROLLHORZ: { const int previous = this->m_firstSlot; if (a != 0) { this->m_firstSlot = previous + a; @@ -3547,21 +3549,21 @@ void UISayDialogWnd::Resize(int width, int height) { // FUNCTION: fn_12325 int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(110); g_modeMgr.gameMode->SendMsg(173, this->identity, 1, 0, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(110); g_modeMgr.gameMode->SendMsg(173, this->identity, 0, 0, 0); break; } return 0; } - case 91: { + case UM_SET_BABY_MSG: { this->identity = static_cast(a); const std::string text = LookupMessage(2965); this->viewer->Clear(); @@ -3597,21 +3599,21 @@ int UIBabyAcceptWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // FUNCTION: fn_12326 int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(105); g_windowMgr.EnsureWindow(110)->SendMsg(nullptr, 91, 184, b, 0, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(105); g_modeMgr.gameMode->SendMsg(173, this->identity, 0, 0, 0); break; } return 0; } - case 91: { + case UM_SET_BABY_MSG: { this->identity = static_cast(a); std::string text = "("; text += reinterpret_cast(b); @@ -3658,31 +3660,31 @@ int UIBabyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std // FUNCTION: fn_12327 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 20: + case UM_LEFTPUSH: this->SendMsg(this, 6, 354, 0, 0, 0); break; - case 21: + case UM_RIGHTPUSH: this->SendMsg(this, 6, 355, 0, 0, 0); break; - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: this->SendMsg(this, 6, 356, 0, 0, 0); g_windowMgr.CloseWindow(106); break; - case 354: + case ID_PREVIEW: if (this->m_autoRead == 0) { this->SendMsg(this, 92, this->m_page == 1 ? 1 : this->m_page - 1, 0, 0, 0); } break; - case 355: + 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); } break; - case 356: { + case ID_BOOKMARK: { DWORD page = this->m_page; char path[512]; std::strcpy(path, g_subKey); @@ -3703,7 +3705,7 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } break; - case 94: { + case UM_GETBOOKCONTENTS: { const char* name = reinterpret_cast(a); const char* title = FindItemDescription(std::atoi(name)).identifiedName; std::intptr_t page; @@ -3759,7 +3761,7 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } break; } - case 92: { + case UM_READBOOK: { this->m_autoRead = 0; this->Show(1); if (this->unknown_00B8) { @@ -3796,7 +3798,7 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp break; } - case 93: + case UM_AUTOREAD: this->m_autoRead = this->m_autoRead == 0; this->Show(0); if (this->m_autoRead) { @@ -3817,7 +3819,7 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp break; } - case 114: + case UM_ENDPUSH: if (this->unknown_00B8) { g_windowMgr.Schedule(this->unknown_00B8); this->unknown_00B8 = nullptr; @@ -3834,21 +3836,21 @@ int UIBookWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp // FUNCTION: fn_12332 int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + case UM_COMMAND: { const int response = static_cast(a); this->RecordResponse(response, b, c, d); if (this->geometry.visible != 0) { switch (response) { - case 185: + case ID_CANCEL: g_modeMgr.gameMode->SendMsg(40, 0, 0, 0, 0); g_windowMgr.CloseWindow(25); break; - case 223: + case ID_SELL: g_modeMgr.gameMode->SendMsg(37, this->identity, 0, 0, 0); g_windowMgr.LookupWindow(25)->Show(0); break; - case 224: + case ID_BUY: g_modeMgr.gameMode->SendMsg(38, this->identity, 0, 0, 0); g_windowMgr.LookupWindow(25)->Show(0); break; @@ -3861,7 +3863,7 @@ int UIChooseSellBuyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } - case 28: { + case UM_SETNAID: { this->identity = static_cast(a); return 0; } @@ -4594,7 +4596,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 154: this->m_chatHistory->ResolvePlayerTags(reinterpret_cast(a)); return 0; - case 34: { + case UM_SETINFO: { WhisperWndInfo* info = reinterpret_cast(a); this->unknown_0100 = info; if (info->IsValid() == 0) { @@ -4604,7 +4606,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->Move(this->unknown_0100->x, this->unknown_0100->y); return 0; } - case 6: { + case UM_COMMAND: { if (a != 184) { if (a == 201) { g_windowMgr.Schedule(this); @@ -4664,12 +4666,12 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i g_modeMgr.gameMode->SendMsg(11, reinterpret_cast(this->m_target.c_str()), 0, 0, 0); return 0; } - case 48: + case UM_MENU_SELECTED: if (this->m_log[a].unknown_0018 == 11) { this->SaveChatLog(); } return 0; - case 49: { + case UM_MAKEMENU: { this->m_log.clear(); if (g_windowMgr.unknown_0210 != nullptr) { g_windowMgr.CloseWindow(0x12); @@ -4696,7 +4698,7 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i ); return 0; } - case 37: { + case UM_ADDCHAT: { char* line = reinterpret_cast(a); if (g_forbiddenWords.Contains(line)) { std::string masked; @@ -4712,17 +4714,17 @@ int UIWhisperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->m_chatHistory->AddLinkRecord(line, color, ""); return 0; } - case 3: + case UM_PAGEUPPUSH: if (this->m_chatHistory->verticalOverflow != 0) { this->m_chatHistory->SendMsg(nullptr, 9, 0, 0, 0, 0); } return 0; - case 4: + case UM_PAGEDOWNPUSH: if (this->m_chatHistory->verticalOverflow != 0) { this->m_chatHistory->SendMsg(nullptr, 10, 0, 0, 0, 0); } return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 512 ? static_cast(b) : 512; int height = c <= 384 ? static_cast(c) : 384; @@ -4832,15 +4834,15 @@ int UIQuitWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s } switch (argument1) { - case 220: + case ID_RESTART: mode->SendMsg(25, 1, 0, 0, 0); g_windowMgr.CloseWindow(48); break; - case 221: + case ID_EXIT: mode->SendMsg(88, 0, 0, 0, 0); g_windowMgr.CloseWindow(48); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(48); break; } @@ -4857,18 +4859,18 @@ int UIRestartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } switch (argument1) { - case 252: + case ID_TO_CHARACTER_SELECT: mode->SendMsg(25, 1, 0, 0, 0); g_windowMgr.CloseWindow(19); g_windowMgr.CloseWindow(269); break; - case 220: + case ID_RESTART: mode->SendMsg(25, 0, 0, 0, 0); [[fallthrough]]; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(19); break; - case 251: + case ID_QUIT: g_windowMgr.CloseWindow(19); mode->SendMsg(88, 0, 0, 0, 0); break; @@ -5072,27 +5074,27 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } switch (message) { - case 80: + case UM_SET_TARGET: this->unknown_00C8 = static_cast(a); return 0; - case 34: + case UM_SETINFO: this->m_placement = reinterpret_cast(a); static_cast(this->m_placement)->IsValid(); this->Move(this->m_placement->x, this->m_placement->y); return 0; - case 18: + case UM_UPPUSH: this->m_viewer->SendMsg(nullptr, 18, 0, 0, 0, 0); return 0; - case 19: + case UM_DOWNPUSH: this->m_viewer->SendMsg(nullptr, 19, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, this->unknown_00C8); if (g_replayAnimationScaling != 0) { this->unknown_00C8 = static_cast(d); } switch (a) { - case 218: { + case ID_NEXT: { const DWORD tick = GetTickCount(); if (tick - *reinterpret_cast(&g_session.unknown_5490[0x04]) < 300) { return 0; @@ -5111,7 +5113,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 26: + case UM_SETSAYDIALOG: if (a != 0) { if (this->unknown_00D4 != 0) { static_cast(this->m_viewer)->Clear(); @@ -5121,19 +5123,19 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } this->unknown_00CC = static_cast(b); return 0; - case 25: + case UM_ENABLENEXTBUTTON: this->m_message0 = 218; this->unknown_00C8 = 22; this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_next"), 0, 0); this->Invalidate(); return 0; - case 63: + case UM_ENABLECLOSEBUTTON: this->m_message0 = 201; this->unknown_00C8 = 89; this->SendMsg(nullptr, 85, 218, reinterpret_cast("btn_close"), 0, 0); this->Invalidate(); return 0; - case 85: { + case UM_ADD_BUTTON: { const std::string prefix("유저인터페이스\\"); UIBitmapButton* button = new UIBitmapButton(); const char* name = reinterpret_cast(b); @@ -5147,12 +5149,12 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->m_buttons.push_back(button); return 0; } - case 32: + case UM_DISABLENEXTBUTTON: this->m_message0 = 600; this->SendMsg(nullptr, 86, 218, 0, 0, 0); this->Invalidate(); return 0; - case 86: + case UM_DELETE_BUTTON: for (auto it = this->m_buttons.begin(); it != this->m_buttons.end(); ++it) { if ((*it)->geometry.id == a) { (*it)->Move(-100, -100); @@ -5194,7 +5196,7 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 75: + case UM_CLEAR_ITEM: static_cast(this->m_viewer)->Clear(); return 0; default: @@ -5206,28 +5208,28 @@ int UISayDialogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // FUNCTION: fn_12344 int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 50: + case UM_SET_EXCHANGE_CHAR_NAME: this->unknown_00F0 = reinterpret_cast(a); this->unknown_0108 = static_cast(b); this->unknown_010C = static_cast(c); return 0; - case 51: + case UM_MYDRAGCLOSED: this->unknown_00CC = 1; this->CancelInput(); this->LayoutButtons(); return 0; - case 52: + case UM_OTHERDRAGCLOSED: this->unknown_00D0 = 1; this->CancelInput(); this->LayoutButtons(); return 0; - case 6: { + case UM_COMMAND: { CMode* mode = g_modeMgr.GetGameMode(); switch (a) { - case 213: + case ID_CHECK: this->unknown_011C = b != 0; return 0; - case 184: + case ID_OK: if (this->unknown_00D4 != 0) { return 0; } @@ -5256,7 +5258,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: mode->SendMsg(52, 0, 0, 0, 0); this->unknown_00D4 = 1; return 0; - case 230: + case ID_EXCHANGE: if (this->unknown_00D8 != 0) { return 0; } @@ -5268,14 +5270,14 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->unknown_00D8 = 1; this->LayoutButtons(); return 0; - case 185: + case ID_CANCEL: if (this->unknown_00DC != 0) { return 0; } mode->SendMsg(53, 0, 0, 0, 0); this->unknown_00DC = 1; return 0; - case 226: { + case ID_RIGHT: { if (!this->unknown_00C0) { return 0; } @@ -5293,7 +5295,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 23: + case UM_REFRESHITEM: this->m_myItems.erase(this->m_myItems.begin(), this->m_myItems.end()); this->m_otherItems.erase(this->m_otherItems.begin(), this->m_otherItems.end()); for (int index = 0; index < 10; ++index) { @@ -5308,7 +5310,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } this->Invalidate(); return 0; - case 38: { + 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); @@ -5388,7 +5390,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 7: + case UM_SCROLLVERT: return 0; default: return UIFrameWnd::SendMsg(sender, message, a, b, c, d); @@ -5399,7 +5401,7 @@ int UIExchangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // FUNCTION: fn_12345 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 6: { + case UM_COMMAND: { if (a == 184) { struct { int area[4]; @@ -5418,7 +5420,7 @@ int UIGraffiStrboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_windowMgr.Schedule(this); return 0; } - case 68: { + case UM_SET_SKILL_INFO: { const int* area = reinterpret_cast(a); this->area[0] = area[0]; this->area[1] = area[1]; @@ -5574,13 +5576,13 @@ void UISayDialogWnd::OnCreate(int width, int height) { // FUNCTION: fn_12359 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 6: { + case UM_COMMAND: { if (argument1 == 201) { g_windowMgr.CloseWindow(201); } return 0; } - case 62: { + case UM_CARDITEMILLUSTRATE: { this->m_name = reinterpret_cast(argument1); this->Invalidate(); g_windowMgr.Promote(this); @@ -5825,9 +5827,9 @@ void UIChatRoomMakeWnd::OnCreate(int width, int height) { // FUNCTION: fn_12330 int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { if (g_windowMgr.HasTitleAtActorCell(g_session.m_aid)) { g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(661)), 0xFF, 0, 0, 0); break; @@ -5857,11 +5859,11 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); break; } - case 185: - case 201: + case ID_CANCEL: + case ID_CLOSE: g_windowMgr.CloseWindow(27); break; - case 215: + case ID_RADIOBTN: for (int i = 0; i < 2; ++i) { this->m_publicButtons[i]->Invalidate(); if (sender == this->m_publicButtons[i]) { @@ -5872,8 +5874,8 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } } break; - case 228: - case 229: { + case ID_NUMCOMBO: + case ID_CLASSCOMBO: { if (g_windowMgr.unknown_0214) { g_windowMgr.CloseWindow(26); } @@ -5905,7 +5907,7 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } } break; - case 39: + case UM_COMBOBOX_SELECTED: if (this->m_listKind == 0) { this->m_limitText->SetText(this->m_limitLabels[a].c_str(), 0); this->m_limit = this->m_limits[a]; @@ -5924,9 +5926,9 @@ int UIChatRoomMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_12329 int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { int error; if (this->m_titleEdit->Length() == 0) { error = 13; @@ -5951,12 +5953,12 @@ int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, g_windowMgr.Confirm(LookupMessage(error), 0, true, false, 0, "Message", 280, 120, 0); return 0; } - case 185: - case 201: + case ID_CANCEL: + case ID_CLOSE: g_windowMgr.CloseWindow(30); return 0; - case 228: - case 229: { + case ID_NUMCOMBO: + case ID_CLASSCOMBO: { if (g_windowMgr.unknown_0214) { g_windowMgr.CloseWindow(26); } @@ -5988,7 +5990,7 @@ int UIChatRoomChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } break; - case 34: { + case UM_SETINFO: { const ChatRoomSetting* setting = reinterpret_cast(a); this->m_limit = setting->limit; this->m_limitText->SetText(this->m_limitLabels[this->m_limitLabels.size() - 1].c_str(), 0); @@ -6106,12 +6108,12 @@ void UIStatusWnd::StoreInfo() { // FUNCTION: fn_12388 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 6: + case UM_COMMAND: if (argument1 == 185) { g_modeMgr.gameMode->SendMsg(10021, 0, 0, 0, 0); } break; - case 88: + case UM_ENABLE_CANCEL: this->m_button->Move((this->geometry.width - this->m_button->BitmapWidth()) / 2, this->geometry.height - this->m_button->BitmapHeight() - 5); break; } @@ -6125,7 +6127,7 @@ int UINoticeConfirmWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: { + case UM_COMMAND: { if (argument1 == 184) { g_modeMgr.gameMode->SendMsg(this->m_event, 0, 0, 0, 0); } else if (argument1 == 185) { @@ -6134,7 +6136,7 @@ int UINoticeConfirmWnd::SendMsg( return 0; } - case 80: { + case UM_SET_TARGET: { this->m_event = static_cast(argument1); return 0; } @@ -6399,7 +6401,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, char key[512]; switch (message) { - case 34: + case UM_SETINFO: this->m_placement = reinterpret_cast(argument1); if (!static_cast(this->m_placement)->IsValid()) { static_cast(this->m_placement)->Reset(); @@ -6453,7 +6455,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->SendMsg(this, 60, 0, 0, 0, 0); return 0; - case 7: + case UM_SCROLLVERT: if (g_session.GetList2Size() < 4) { return 0; } @@ -6472,7 +6474,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_otherScroll->Invalidate(); return 0; - case 9: + case UM_SCROLLVERTPAGEUP: if (--this->m_firstOther < 0) { this->m_firstOther = 0; } @@ -6480,7 +6482,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_otherScroll->Invalidate(); return 0; - case 10: + case UM_SCROLLVERTPAGEDOWN: ++this->m_firstOther; if (this->m_firstOther > std::min(g_session.GetList2Size() - 3, 4)) { this->m_firstOther = std::min(g_session.GetList2Size() - 3, 4); @@ -6489,7 +6491,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_otherScroll->Invalidate(); return 0; - case 60: { + case UM_REFRESH: { this->items.clear(); const int count = g_session.GetList1788(this->m_tab); for (int index = 0; index < count; ++index) { @@ -6502,7 +6504,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, return 0; } - case 6: + case UM_COMMAND: switch (argument1) { case 386: this->m_totalPrice = 0; @@ -6515,7 +6517,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Invalidate(); return 0; - case 224: { + case ID_BUY: { if (this->m_totalPrice <= 0) { break; } @@ -6567,7 +6569,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, return 0; } - case 201: { + case ID_CLOSE: { NCashClosePacket packet; packet.packetType = 0x84A; GetRagConnection().Send(g_packetLengths.FixedLength(packet.packetType), &packet); @@ -6602,14 +6604,14 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_page = 1; return 0; - case 316: + case ID_PREV_PAGE: if (this->m_page > 1) { --this->m_page; return 0; } break; - case 317: + case ID_NEXT_PAGE: if (this->m_page < this->m_pageCount) { ++this->m_page; return 0; @@ -6672,7 +6674,7 @@ int UInCashWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode->drag.source == 4) { ITEM_INFO item; @@ -6796,15 +6798,15 @@ __declspec(noinline) int UIItemCollectionWnd::CardSlotAt(int x, int y, int* slot int slots = ItemSlotsCount(this->m_item); bool equipment; switch (this->m_item.unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: case 21: equipment = true; break; @@ -7584,23 +7586,23 @@ UIJoinGuildAcceptWnd::UIJoinGuildAcceptWnd() // FUNCTION: fn_12352 int UIJoinGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + 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); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(70); g_modeMgr.gameMode->SendMsg(114, this->identity, 0, 0, 0); break; } break; - case 73: { + case UM_SET_JOIN_GUILD_MSG: { char name[260] = {}; strcpy_s(name, sizeof(name), reinterpret_cast(b)); if (g_forbiddenWords.Contains(name) == true) { @@ -7915,19 +7917,19 @@ void UIPartyInvitationToWnd::OnCreate(int, int) { // FUNCTION: fn_12339 int UICoupleAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(104); g_modeMgr.gameMode->SendMsg(167, this->identity, 1, 0, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(104); g_modeMgr.gameMode->SendMsg(167, this->identity, 0, 0, 0); break; } break; - case 90: { + case UM_SET_COUPLE_MSG: { this->identity = static_cast(a); std::string text = "("; text += reinterpret_cast(b); @@ -7947,7 +7949,7 @@ int UICoupleAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_12350 int UIItemParamChangeDisplayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: { + case UM_SETINFO: { this->m_placement = reinterpret_cast(a); auto* info = static_cast(this->m_placement); if (!info->IsValid()) { @@ -7956,7 +7958,7 @@ int UIItemParamChangeDisplayWnd::SendMsg(UIWindow* sender, int message, std::int this->Move(this->m_placement->x, this->m_placement->y); return 0; } - case 60: { + case UM_REFRESH: { this->SumEquippedStats(); this->unknown_00CC = 0; this->unknown_00D0 = 0; @@ -7971,7 +7973,7 @@ int UIItemParamChangeDisplayWnd::SendMsg(UIWindow* sender, int message, std::int } break; } - case 64: { + case UM_PARAM: { this->SumEquippedStats(); this->m_label = reinterpret_cast(a); this->unknown_00EC = static_cast(b); @@ -8007,20 +8009,20 @@ int UIItemParamChangeDisplayWnd::SendMsg(UIWindow* sender, int message, std::int // FUNCTION: fn_12351 int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(109); g_modeMgr.gameMode->SendMsg(175, this->m_accountId, this->m_characterId, 1, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(109); g_modeMgr.gameMode->SendMsg(175, this->m_accountId, this->m_characterId, 0, 0); break; } break; - case 95: { + case UM_SET_JOIN_FRIEND_MSG: { this->m_accountId = static_cast(a); this->m_characterId = static_cast(b); char text[128]; @@ -8067,21 +8069,21 @@ int UIJoinFriendAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_12358 int UIMixAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: + 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_session.ClearTradeItems(); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(163); break; } break; - case 91: { + case UM_SET_BABY_MSG: { this->m_kind = static_cast(a); std::string text; text = LookupMessage(1584); @@ -8099,10 +8101,10 @@ int UIMixAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // FUNCTION: fn_12361 int UINotifyItemObtainWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->m_item = *reinterpret_cast(a); return 0; - case 36: { + case UM_SETTITLE: { this->m_kind = static_cast(a); char text[128]; if (a != 0) { @@ -8132,7 +8134,7 @@ int UINotifyItemObtainWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->m_shownTick = timeGetTime(); return 0; } - case 76: + case UM_SET_IDENTIFIY_INFO: this->m_identified = a != 0; return 0; default: @@ -8144,12 +8146,12 @@ int UINotifyItemObtainWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_12379 int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(46); break; - case 343: { + case ID_HELP: { UIWindow* window = g_windowMgr.EnsureWindow(10030); if (window) { static_cast(window)->SetSkill(this->m_skillId); @@ -8160,7 +8162,7 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } } break; - case 61: { + case UM_SKILLDESCRIBE: { if (d != 0) { this->m_closeButton->Move(-100, -100); } else { @@ -8247,7 +8249,7 @@ int UISkillDescribeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, // FUNCTION: fn_12380 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 6: + case UM_COMMAND: if (a == 184) { 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); @@ -8255,7 +8257,7 @@ int UISkillNameChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_windowMgr.CloseWindow(55); } break; - case 68: + case UM_SET_SKILL_INFO: this->m_skillId = static_cast(a); this->m_name = CSkillInfo::DisplayName(*g_session.m_hotkeyScript, static_cast(a)); this->m_edit->SetText(this->m_name.c_str()); @@ -8272,7 +8274,7 @@ int UISkillNameChangeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a // FUNCTION: fn_12382 int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); if (a == 184) { CMode* mode = g_modeMgr.GetGameMode(); @@ -8283,7 +8285,7 @@ int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; } - case 91: { + case UM_SET_BABY_MSG: { this->m_place = static_cast(a); std::string text; if (this->m_place == 10) { @@ -8331,9 +8333,9 @@ int UIStarPlaceAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a // FUNCTION: fn_12390 int UIYourItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { g_modeMgr.GetGameMode(); WearEquipPacket packet; packet.packetType = ID_CZ_REQ_WEAR_EQUIP_V5; @@ -8343,12 +8345,12 @@ int UIYourItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_windowMgr.CloseWindow(138); break; } - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(138); break; } break; - case 91: { + case UM_SET_BABY_MSG: { std::string text; text = LookupMessage(1327); this->viewer->Clear(); @@ -8413,12 +8415,12 @@ UIStatusWnd::UIStatusWnd() // FUNCTION: fn_12385 int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(38); break; - case 213: { + case ID_CHECK: { this->m_showTipsAtStartup = static_cast(b); g_window315Enabled = static_cast(b); HKEY key; @@ -8429,7 +8431,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } break; } - case 218: + case ID_NEXT: if (g_tipOfTheDay.Size() != 0) { ++this->m_tipIndex; if (this->m_tipIndex >= g_tipOfTheDay.Size()) { @@ -8438,7 +8440,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st this->SendMsg(nullptr, 29, reinterpret_cast(&g_tipOfTheDay.GetTip(this->m_tipIndex)), 0, 0, 0); } break; - case 246: + case ID_PREV: if (g_tipOfTheDay.Size() != 0) { if (--this->m_tipIndex < 0) { this->m_tipIndex = g_tipOfTheDay.Size() - 1; @@ -8449,7 +8451,7 @@ int UITipOfTheDayWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } return 0; - case 29: { + 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); @@ -8486,12 +8488,12 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in const int* statCosts = reinterpret_cast(g_session.unknown_169C); const int statusPoint = *reinterpret_cast(g_session.unknown_1654); switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(11); break; - case 202: { + case ID_MINI: { const int height = this->geometry.height; if (height == 17) { this->Resize(this->geometry.width, this->m_expandedHeight); @@ -8507,22 +8509,22 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } break; } - case 205: + case ID_STR: RequestStatusPointUp(this, mode, statCosts, statusPoint, 0); break; - case 206: + case ID_AGI: RequestStatusPointUp(this, mode, statCosts, statusPoint, 1); break; - case 207: + case ID_VIT: RequestStatusPointUp(this, mode, statCosts, statusPoint, 2); break; - case 208: + case ID_INT: RequestStatusPointUp(this, mode, statCosts, statusPoint, 3); break; - case 209: + case ID_DEX: RequestStatusPointUp(this, mode, statCosts, statusPoint, 4); break; - case 210: + case ID_LUK: RequestStatusPointUp(this, mode, statCosts, statusPoint, 5); break; case 550: { @@ -8567,7 +8569,7 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in return 0; } break; - case 34: + case UM_SETINFO: this->m_info = reinterpret_cast(a); if (!this->m_info->IsValid()) { this->m_info->Reset(); @@ -8581,7 +8583,7 @@ int UIStatusWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->m_extended = this->m_info->unknown_0018 != 1; this->SendMsg(nullptr, 6, 550, 0, 0, 0); break; - case 35: + case UM_REFRESHBUTTON: if (this->geometry.unknown_0030 == 0) { int costs[6]; std::memcpy(costs, statCosts, sizeof(costs)); @@ -8625,14 +8627,14 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ if (message == 6) { switch (a) { - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(115); if (mode->cursorType == 9) { g_windowMgr.EnsureWindow(277); } break; - case 184: + case ID_OK: switch (this->unknown_00F4) { case 0: if (std::strlen(this->unknown_00D0) < 9 && std::strlen(this->unknown_00D0) > 3) { @@ -8737,7 +8739,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } break; - case 292: + case ID_CHANGE_STORE_PASSWORD: g_session.m_storePasswordMode = 2; this->unknown_0108 = 1; this->unknown_00F4 = 1; @@ -8750,7 +8752,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->Paint(); break; - case 294: + case ID_STORE_PASSWORD_NUM1: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8771,10 +8773,10 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 304: + case ID_STORE_RETURN: this->SendMsg(this, 6, 184, 0, 0, 0); break; - case 293: + case ID_STORE_PASSWORD_NUM0: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8795,7 +8797,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 295: + case ID_STORE_PASSWORD_NUM2: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8816,7 +8818,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 296: + case ID_STORE_PASSWORD_NUM3: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8837,7 +8839,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 297: + case ID_STORE_PASSWORD_NUM4: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8858,7 +8860,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 298: + case ID_STORE_PASSWORD_NUM5: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8879,7 +8881,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 299: + case ID_STORE_PASSWORD_NUM6: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8900,7 +8902,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 300: + case ID_STORE_PASSWORD_NUM7: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8921,7 +8923,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 301: + case ID_STORE_PASSWORD_NUM8: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8942,7 +8944,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 302: + case ID_STORE_PASSWORD_NUM9: if (++this->unknown_00EC > 8) { g_windowMgr.Confirm(LookupMessage(1011), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -8963,7 +8965,7 @@ int UIStorePasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 303: + case ID_STORE_PASSWORD_NUM_RESET: if (this->unknown_00F4 == 0) { this->unknown_00F4 = 0; this->unknown_00F8 = this->unknown_00FC; @@ -9053,7 +9055,7 @@ void UISelectCartWnd::OnCreate(int, int) { int UISelectCartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { std::vector& carts = *reinterpret_cast*>(&this->unknown_00B8); switch (message) { - case 34: { + case UM_SETINFO: { this->DeleteChildren(); this->AddCloseButton("", 0); carts.clear(); @@ -9071,7 +9073,7 @@ int UISelectCartWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std } break; } - case 6: + case UM_COMMAND: if (a != 201) { const int type = static_cast(a) - 9000; std::vector::iterator cart = carts.begin(); @@ -9390,12 +9392,12 @@ int UIAutoMessageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // FUNCTION: fn_12328 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 6: + case UM_COMMAND: if (a == 201) { g_windowMgr.CloseWindow(47); } break; - case 62: { + case UM_CARDITEMILLUSTRATE: { const char* id = reinterpret_cast(a); this->unknown_00E4 = b != 0; const char* name = FindItemCardName(std::atoi(id)).name; @@ -9738,17 +9740,17 @@ UISpellListWnd::UISpellListWnd() : UIItemIdentifyWnd() { // FUNCTION: fn_12370 int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 31: + case UM_ADDITEM: this->m_items.push_back(LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(argument2))); this->SendMsg(nullptr, 60, 0, 0, 0, 0); return 0; - case 60: + case UM_REFRESH: this->UpdateScroll(); this->Invalidate(); return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; if (message == 9) { this->m_scroll = previous - this->m_rows + 1; @@ -9763,13 +9765,13 @@ int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } return this->m_scroll - previous; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(argument1), argument2, this->m_selected, argument4); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(argument3); } switch (argument1) { - case 184: { + case ID_OK: { int found = 0; ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found) { @@ -9777,7 +9779,7 @@ int UIPetEggListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; } - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(90); break; } @@ -10168,10 +10170,10 @@ void UInCashWnd::OnLBtnDblClk(int x, int y) { // FUNCTION: fn_12355 int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0x4B: + case UM_CLEAR_ITEM: this->m_items.clear(); break; - case 0x1F: { + case UM_ADDITEM: { ITEM_INFO item; item.SetItemId(*reinterpret_cast(a)); item.identified = 1; @@ -10179,16 +10181,16 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: this->SendMsg(nullptr, 0x3C, 0, 0, 0, 0); break; } - case 0x3C: + case UM_REFRESH: this->UpdateScroll(); this->Invalidate(); break; - case 0x22: + case UM_SETINFO: this->unknown_00F0 = static_cast(a); break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; if (message == 9) { this->m_scroll = previous - this->m_rows + 1; @@ -10203,14 +10205,14 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: } return this->m_scroll - previous; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, this->m_selected); if (g_replayAnimationScaling != 0) { this->m_selected = static_cast(d); this->Invalidate(); } switch (a) { - case 184: { + case ID_OK: { int found; ITEM_INFO item = this->GetItem(this->m_selected, &found); if (found != 0) { @@ -10223,7 +10225,7 @@ int UIMakingArrowListWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std:: } break; } - case 185: + case ID_CANCEL: if (this->unknown_00F0 == 2) { g_modeMgr.gameMode->SendMsg(0x99, -1, 0, 0, 0); } else { @@ -10312,16 +10314,16 @@ void UITipboxWnd::OnProcess() { // FUNCTION: fn_12333 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 0x13: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); return 0; - case 0x12: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: { + 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); @@ -10329,17 +10331,17 @@ int UIChooseWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std } break; } - case 185: + case ID_CANCEL: g_modeMgr.GetGameMode()->SendMsg(0x4A, reinterpret_cast("cancel"), this->unknown_00B8, 0, 0); g_windowMgr.CloseWindow(0x27); break; } return 0; } - case 0x3B: + case UM_SETSKID: this->unknown_00B8 = static_cast(a); return 0; - case 0x1B: + case UM_SETCHOOSE: if (a != 0) { const char* choice = reinterpret_cast(a); if (std::string(choice) == "Random") { @@ -10801,15 +10803,15 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr std::memset(this->unknown_00D9, 0, sizeof(this->unknown_00D9)); std::memset(this->unknown_00E2, 0, sizeof(this->unknown_00E2)); break; - case 185: + 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_windowMgr.Schedule(this); } break; - case 184: - case 218: + case ID_OK: + case ID_NEXT: switch (this->unknown_00F4) { case 0: if (std::strlen(this->unknown_00D0) == static_cast(this->unknown_010C)) { @@ -10919,7 +10921,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr } break; - case 292: + case ID_CHANGE_STORE_PASSWORD: g_session.m_storePasswordMode = 2; this->unknown_0108 = 1; this->unknown_00F4 = 1; @@ -10938,7 +10940,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->Invalidate(); break; - case 294: + case ID_STORE_PASSWORD_NUM1: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -10958,11 +10960,11 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 304: + case ID_STORE_RETURN: this->SendMsg(this, 6, 184, 0, 0, 0); break; - case 293: + case ID_STORE_PASSWORD_NUM0: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -10982,7 +10984,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 295: + case ID_STORE_PASSWORD_NUM2: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11002,7 +11004,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 296: + case ID_STORE_PASSWORD_NUM3: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11022,7 +11024,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 297: + case ID_STORE_PASSWORD_NUM4: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11042,7 +11044,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 298: + case ID_STORE_PASSWORD_NUM5: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11062,7 +11064,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 299: + case ID_STORE_PASSWORD_NUM6: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11082,7 +11084,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 300: + case ID_STORE_PASSWORD_NUM7: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11102,7 +11104,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 301: + case ID_STORE_PASSWORD_NUM8: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11122,7 +11124,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 302: + case ID_STORE_PASSWORD_NUM9: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11143,7 +11145,7 @@ int UISecondPasswordInputWnd::SendMsg(UIWindow* sender, int message, std::intptr this->unknown_00F0 += 5; break; - case 303: + case ID_STORE_PASSWORD_NUM_RESET: if (this->unknown_00F4 == 0) { this->unknown_00F4 = 0; this->unknown_00EC = 0; @@ -11209,15 +11211,15 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ std::memset(this->unknown_00D9, 0, sizeof(this->unknown_00D9)); std::memset(this->unknown_00E2, 0, sizeof(this->unknown_00E2)); break; - case 185: + 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_windowMgr.Schedule(this); } break; - case 184: - case 218: + case ID_OK: + case ID_NEXT: switch (this->unknown_00F4) { case 0: if (std::strlen(this->unknown_00D0) == static_cast(this->unknown_010C)) { @@ -11311,7 +11313,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } break; - case 292: + case ID_CHANGE_STORE_PASSWORD: g_session.m_storePasswordMode = 2; this->unknown_0108 = 1; this->unknown_00F4 = 1; @@ -11330,7 +11332,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->Invalidate(); break; - case 294: + case ID_STORE_PASSWORD_NUM1: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11350,11 +11352,11 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 304: + case ID_STORE_RETURN: this->SendMsg(this, 6, 184, 0, 0, 0); break; - case 293: + case ID_STORE_PASSWORD_NUM0: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11374,7 +11376,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 295: + case ID_STORE_PASSWORD_NUM2: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11394,7 +11396,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 296: + case ID_STORE_PASSWORD_NUM3: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11414,7 +11416,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 297: + case ID_STORE_PASSWORD_NUM4: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11434,7 +11436,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 298: + case ID_STORE_PASSWORD_NUM5: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11454,7 +11456,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 299: + case ID_STORE_PASSWORD_NUM6: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11474,7 +11476,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 300: + case ID_STORE_PASSWORD_NUM7: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11494,7 +11496,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 301: + case ID_STORE_PASSWORD_NUM8: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11514,7 +11516,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->DrawTextAt(this->unknown_00F0 + 416, this->unknown_00F8, "*", 0, 0, 12, 0, 0, 0); this->unknown_00F0 += 5; break; - case 302: + case ID_STORE_PASSWORD_NUM9: if (++this->unknown_00EC > this->unknown_010C) { g_windowMgr.Confirm(LookupMessage(1887), 0, true, false, 0, "Message", 280, 120, 0); break; @@ -11535,7 +11537,7 @@ int UISecondPasswordEditWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->unknown_00F0 += 5; break; - case 303: + case ID_STORE_PASSWORD_NUM_RESET: if (this->unknown_00F4 == 0) { this->unknown_00F4 = 0; this->unknown_00EC = 0; @@ -11730,15 +11732,15 @@ int UIFrameWnd::BuildItemName( }; const auto isEquipment = [&]() { switch (item->unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: case 21: return true; default: @@ -11949,23 +11951,23 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } switch (message) { - case 0x13: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); return 0; - case 0x22: { + case UM_SETINFO: { ChooseWndInfo* placement = reinterpret_cast(a); this->m_placement = placement; placement->IsValid(); this->Move(placement->x, placement->y); return 0; } - case 0x12: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: { + case ID_OK: { const std::uint32_t tick = GetTickCount(); if (tick - *reinterpret_cast(&g_session.unknown_5490[0x04]) >= 300) { *reinterpret_cast(&g_session.unknown_5490[0x04]) = tick; @@ -11981,13 +11983,13 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } break; } - case 185: + case ID_CANCEL: g_modeMgr.GetGameMode()->SendMsg(0x28, 0, 0, 0, 0); break; } return 0; } - case 0x1B: + case UM_SETCHOOSE: if (a != 0) { const char* value = reinterpret_cast(a); if (std::strstr(value, LookupMessage(0x29A)) == nullptr) { @@ -12010,7 +12012,7 @@ int UIChooseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } } return 0; - case 0x1C: + case UM_SETNAID: this->unknown_00C8 = static_cast(a); return 0; case 0x7B: { @@ -12159,7 +12161,7 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } switch (a) { - case 0xD5: { + case ID_CHECK: { DWORD disposition = 0; this->unknown_0100 = static_cast(b); g_window315Enabled = static_cast(b); @@ -12170,7 +12172,7 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } break; } - case 0xDA: { + case ID_NEXT: { const int page = (std::max)(0, g_itemTagOwner->unknown_00B4); g_itemTagOwner->unknown_00B4 = page + 1; if (g_itemTagOwner->IsLastTip() == true) { @@ -12184,7 +12186,7 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->RefreshTip(); break; } - case 0xB8: + case ID_OK: this->unknown_00D0->Enable(1); this->unknown_00D4->Enable(1); g_itemTagOwner->SelectTip(this->unknown_00B8->lines[this->unknown_00B8->selected].id); @@ -12197,10 +12199,10 @@ int UITipboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->RefreshTip(); this->BuildAnimations(); break; - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x13B); break; - case 0xF6: { + case ID_PREV: { const int page = (std::max)(0, g_itemTagOwner->unknown_00B4); g_itemTagOwner->unknown_00B4 = page - 1; this->unknown_00D4->SetDisabled(0); @@ -12355,7 +12357,7 @@ void UIFrameWnd::DrawItemNameText( // FUNCTION: fn_12372 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 6: { + case UM_COMMAND: { if (a == 0xC9) { g_windowMgr.CloseWindow(0x67); } else if (a == 0x10C) { @@ -12375,11 +12377,11 @@ int UIProhibitListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; } - case 0x22: + case UM_SETINFO: this->m_aid = static_cast(a); break; - case 0x27: { + case UM_COMBOBOX_SELECTED: { CMode* mode = g_modeMgr.GetGameMode(); int text; UICntWnd* counter; @@ -12520,7 +12522,7 @@ void UIExchangeWnd::Paint() { // FUNCTION: fn_12346 int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: { + case UM_SETINFO: { this->m_placement = reinterpret_cast(argument1); ItemCollectionWndInfo* placement = static_cast(this->m_placement); if (!placement->IsValid()) { @@ -12531,18 +12533,18 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar this->Move(placement->x, placement->y); return 0; } - case 6: + case UM_COMMAND: switch (argument1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(this->m_kind); return 0; - case 250: { + 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); return 0; } - case 287: - case 288: { + case ID_BOOKITEM: + case ID_AUTOBOOKITEM: { char path[260]; if (g_serviceType == 10) { std::sprintf(path, "%sbook\\%s.txt", g_serverLanguage->servicePrefix.c_str(), this->m_item.itemId.c_str()); @@ -12560,7 +12562,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar file.Close(); return 0; } - case 354: { + case ID_PREVIEW: { UIWindow* window = g_windowMgr.EnsureWindow(294); if (window) { window->SendMsg(this, 23, reinterpret_cast(&this->m_item), 0, 0, 0); @@ -12568,7 +12570,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar } break; } - case 343: { + case ID_HELP: { UIWindow* window = g_windowMgr.EnsureWindow(10012); if (window) { static_cast(window)->SetItem(this->m_item.GetItemId()); @@ -12579,7 +12581,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar } } return 0; - case 24: { + case UM_ITEMEXPLANATION: { const ITEM_INFO* item = reinterpret_cast(argument1); if (item->itemId == this->m_item.itemId && item->unknown_0060 == this->m_item.unknown_0060 && std::memcmp(item->unknown_001C, this->m_item.unknown_001C, sizeof(item->unknown_001C)) == 0 && argument2 == 0) { @@ -12789,7 +12791,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar this->Invalidate(); return 0; } - case 29: { + case UM_SETTEXT: { const std::vector& descriptions = this->m_item.Description(); std::vector lines; std::string text; @@ -12833,7 +12835,7 @@ int UIItemCollectionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t ar g_windowMgr.Promote(this); return 0; } - case 14: + case UM_RESIZE: if (argument1 == 7) { this->SetHeight(argument3); } diff --git a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp index 285e9a00e..2ec40c7c7 100644 --- a/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/Renderer.h" @@ -78,27 +79,27 @@ void UIExchangeAcceptWnd::OnCreate(int width, int height) { // FUNCTION: fn_12343 int UIExchangeAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(32); g_modeMgr.gameMode->SendMsg(50, 3, 0, 0, 0); return 0; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(32); g_modeMgr.gameMode->SendMsg(50, 4, 0, 0, 0); return 0; } return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!reinterpret_cast(this->saved)->IsValid()) { reinterpret_cast(this->saved)->Reset(); } this->Move(this->saved->x, this->saved->y); return 0; - case 50: { + case UM_SET_EXCHANGE_CHAR_NAME: { std::string text = "("; text += reinterpret_cast(a); text += ")"; diff --git a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp index 8360e9acf..bad01bfa0 100644 --- a/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp +++ b/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" @@ -23,15 +24,15 @@ UIJoinPartyAcceptWnd::~UIJoinPartyAcceptWnd() = default; // FUNCTION: fn_12353 int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(35); g_modeMgr.gameMode->SendMsg(60, this->identity, 1, 0, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(35); g_modeMgr.gameMode->SendMsg(60, this->identity, 0, 0, 0); break; @@ -39,7 +40,7 @@ int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; - case 56: { + case UM_SET_JOIN_PARTY_MSG: { this->identity = static_cast(a); std::string text = "("; text += reinterpret_cast(b); diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 9dfa7e08d..25660d3b9 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1,4 +1,5 @@ #include "Client/Input/InputCharset.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/Renderer.h" @@ -886,7 +887,7 @@ int UIComboBoxV2Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume // FUNCTION: fn_11550 int UIImgMenu::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: { + case UM_SETINFO: { this->horizontal = argument1; this->count = argument2; std::string name(reinterpret_cast(argument3)); @@ -904,11 +905,11 @@ int UIImgMenu::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s return 0; } - case 102: + case UM_SETID: this->geometry.id = argument1; return 0; - case 83: + case UM_SET_CALLER_WID: this->unknown_00C8 = argument1; return 0; @@ -916,7 +917,7 @@ int UIImgMenu::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s this->unknown_0090[argument1 - 1] = argument2 != 0; return 0; - case 106: + case UM_SET_DISABLE: this->unknown_0094[argument1 - 1] = argument2 != 0; return 0; diff --git a/Source/UI/CashShop/UICashShopWnd.cpp b/Source/UI/CashShop/UICashShopWnd.cpp index acde2b8ad..bfe7f8aec 100644 --- a/Source/UI/CashShop/UICashShopWnd.cpp +++ b/Source/UI/CashShop/UICashShopWnd.cpp @@ -1,4 +1,5 @@ #include "UI/CashShop/UICashShopWnd.h" +#include "UI/Window/UIEnums.h" #include "Utility/EncryptedName.h" #include "Client/Mode/CGameMode.h" @@ -763,7 +764,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument CSession& itemLists = g_session; const CSession& lists = g_session; switch (message) { - case 0x22: + case UM_SETINFO: if (g_session.unknown_5912) { if (g_session.m_hotkeyScript->Call("set_stoveshop_banner", "") == true) { this->m_banner->CreateButtons(); @@ -800,7 +801,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->Invalidate(); return 0; - case 0x17: + case UM_REFRESHITEM: this->m_items.clear(); for (int index = 0; index < lists.GetList1788(this->m_selectedTab); ++index) { ITEM_INFO item = g_session.GetItem1784At(this->m_selectedTab, index); @@ -817,17 +818,17 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->LayoutPage(); return 0; - case 0: + case UM_DEFPUSH: if (sender == this->unknown_00E0) { this->SendMsg(nullptr, 6, 0x141, 0, 0, 0); } return 0; - case 0x1F: + case UM_ADDITEM: this->m_cart->SendMsg(sender, 0x1F, argument1, 1, 0, 0); return 0; - case 0x26: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode == nullptr) { return 0; @@ -902,15 +903,15 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument return 0; } - case 6: + case UM_COMMAND: switch (argument1) { - case 0xC9: + case ID_CLOSE: if (g_session.unknown_5912) { g_modeMgr.GetGameMode()->SendMsg(0x14B, 5, 0, 0, 0); } g_windowMgr.CloseWindow(0x13E); return 0; - case 0xD7: { + case ID_RADIOBTN: { int 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 && sender == tab->second) { @@ -937,7 +938,7 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument RegCloseKey(key); return 0; } - case 0xE0: { + case ID_BUY: { std::vector& cartItems = this->m_cart->m_cartItems; const int count = cartItems.size(); if (cartItems.empty()) { @@ -1000,18 +1001,18 @@ int UICashShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument GetRagConnection().Send(static_cast(length), &packet); return 0; } - case 0x11C: + case ID_CHARGE: ShellExecuteA(nullptr, "OPEN", LookupMessage(0xCE5), LookupMessage(0xCE5), nullptr, SW_SHOW); return 0; - case 0x13C: + case ID_PREV_PAGE: this->m_page = std::max(this->m_page - 1, 0); this->LayoutPage(); return 0; - case 0x13D: + case ID_NEXT_PAGE: this->m_page = std::min(this->m_page + 1, this->m_pageCount - 1); this->LayoutPage(); return 0; - case 0x141: { + case ID_SEARCH: { std::string query(this->unknown_00E0->Text()); if (query.size() != 0 && strcmp(query.c_str(), LookupMessage(0xCE6)) != 0) { itemLists.ClearItems1784(10); @@ -1112,9 +1113,9 @@ int UICashShopWnd_Banner::SendMsg(UIWindow* sender, int message, std::intptr_t a // FUNCTION: fn_09560 int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int count = this->m_cartItems.size(); if (count == 0) { break; @@ -1153,7 +1154,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); break; } - case 0x1F: { + case UM_ADDITEM: { if (argument1 == 0) { return -1; } @@ -1230,7 +1231,7 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); return UIWindow::SendMsg(sender, message, argument1, quantity, argument3, argument4); } - case 0x68: { + case UM_DECITEM: { if (sender == nullptr) { break; } @@ -1267,19 +1268,19 @@ int UICashShopWnd_Cart::SendMsg(UIWindow* sender, int message, std::intptr_t arg 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) { switch (argument1) { - case 0xD3: + case ID_DELETE: if (this->parent != nullptr) { this->parent->SendMsg(this, 0x68, atoi(this->m_item.itemId.c_str()), 0, 0, 0); this->Invalidate(); } break; - case 0x117: + case ID_UP: if (this->parent != nullptr) { this->parent->SendMsg(this, 0x1F, reinterpret_cast(&this->m_item), 1, 0, 0); } this->Invalidate(); break; - case 0x118: + case ID_DOWN: if (this->parent != nullptr) { this->parent->SendMsg(this, 0x1F, reinterpret_cast(&this->m_item), -1, 0, 0); } diff --git a/Source/UI/Chat/UINewChatWnd.cpp b/Source/UI/Chat/UINewChatWnd.cpp index acc2d8f51..cfb9204e1 100644 --- a/Source/UI/Chat/UINewChatWnd.cpp +++ b/Source/UI/Chat/UINewChatWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Chat/UINewChatWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" #include "Client/Mode/CMode.h" @@ -207,7 +208,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->FillSurface(0xFFFF00FF, &rectangle); return 0; } - case 0x16: + case UM_TAB: if (a != this->m_currentTab) { this->m_currentTab = a; this->RefreshTabs(true); @@ -215,7 +216,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->RefreshTabs(false); } return 0; - case 0x46: { + case UM_DELETE_WHISPER_NAME: { std::string name(reinterpret_cast(a)); const int count = static_cast(static_cast(this->unknown_00C0)->history.size()); int index = 0; @@ -233,7 +234,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; } - case 0x27: + case UM_COMBOBOX_SELECTED: switch (this->unknown_00F0) { case 1: *reinterpret_cast(&g_session.unknown_5490[0x8]) = a; @@ -265,11 +266,11 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i default: return 0; } - case 0x36: + case UM_GET_EDIT_FOCUS: g_windowMgr.SetFocus(static_cast(this->m_chatEdit)); return 0; - case 0x25: - case 0x73: + case UM_ADDCHAT: + case UM_ADDCHAT2: if (message != 0x73) { std::vector lines; char name[25] = {}; @@ -337,7 +338,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } } return 0; - case 0x22: + case UM_SETINFO: if (g_windowMgr.unknown_0030 < 0 || g_windowMgr.unknown_0034 < 0 || g_windowMgr.unknown_0030 > g_renderer->viewport.width - this->geometry.width || g_windowMgr.unknown_0034 > g_renderer->viewport.height - this->geometry.height) { g_windowMgr.unknown_0030 = 0; @@ -348,9 +349,9 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->ResizeRows(g_windowMgr.unknown_004C); this->Move(this->geometry.x, this->geometry.y); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 0xC1: + case ID_OPTION: if (UIWindow* window = g_windowMgr.EnsureWindow(0x84)) { window->SendMsg(this, 6, 0xC1, this->m_currentTab, 1, 0); } @@ -370,7 +371,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 0x166: this->SendMsg(this, 0x75, this->m_currentTab, 0, 0, 0); return 0; - case 0xEE: { + case ID_TALKTOWHOCOMBO: { this->unknown_00F0 = 1; if (g_windowMgr.unknown_0214 != nullptr) { g_windowMgr.CloseWindow(0x1A); @@ -390,7 +391,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i menu->Move(x + 1, y - 0x2F); return 0; } - case 0xE1: { + case ID_WHISPERCOMBO: { this->unknown_00F0 = 0; if (g_windowMgr.unknown_0214 != nullptr) { g_windowMgr.CloseWindow(0x1A); @@ -420,7 +421,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i menu->Move(x + 1, y - height + 1); return 0; } - case 0xB8: { + case ID_OK: { if (!g_windowMgr.inputSuggestionsEnabled && g_windowMgr.chatModeChanged) { return 0; } @@ -498,7 +499,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i g_modeMgr.gameMode->SendMsg(0x2A, talkType, reinterpret_cast(parts), 0, 0); return 0; } - case 0xD4: + case ID_HIS: this->SendMsg(nullptr, 2, 0, 0, 0, 0); return 0; case 0x176: { @@ -540,7 +541,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; } - case 0xCA: { + case ID_MINI: { std::map& names = g_session.m_noSubChatWnds; if (names.size() <= 1) { return 0; @@ -588,7 +589,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i default: return 0; } - case 0xE: + case UM_RESIZE: if (a == 2 && static_cast(g_windowMgr.unknown_03F4) != 0) { const int top = this->m_inputOffsetY + 0x38; if (c < top) { @@ -606,7 +607,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } } return 0; - case 2: + case UM_TOGGLEPUSH: if (static_cast(g_windowMgr.unknown_03F4) != 0) { const int step = a == 0 ? 1 : -1; int rows = step; @@ -620,7 +621,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } } return 0; - case 4: { + case UM_PAGEDOWNPUSH: { UIListBox* tab = static_cast(this->m_tabs[this->m_currentTab]); if (tab != nullptr && tab->verticalOverflow != 0) { if (HIBYTE(GetKeyState(VK_CONTROL))) { @@ -631,7 +632,7 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; } - case 3: { + case UM_PAGEUPPUSH: { UIListBox* tab = static_cast(this->m_tabs[this->m_currentTab]); if (tab != nullptr && tab->verticalOverflow != 0) { if (HIBYTE(GetKeyState(VK_CONTROL))) { @@ -642,10 +643,10 @@ int UINewChatWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } return 0; } - case 0xF: + case UM_CHANGESTATUS: this->ResizeRows(a); return 0; - case 0x10: + case UM_OPENCHATWND: if (static_cast(g_windowMgr.unknown_03F4) != 0 && this->geometry.unknown_0030 == 0) { this->ResizeRows(1); } diff --git a/Source/UI/Clan/UIClanWnd.cpp b/Source/UI/Clan/UIClanWnd.cpp index 972b09946..ed769d829 100644 --- a/Source/UI/Clan/UIClanWnd.cpp +++ b/Source/UI/Clan/UIClanWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Clan/UIClanWnd.h" +#include "UI/Window/UIEnums.h" #include "Contents/ClanInfo.h" #include "Contents/MapInfoMgr.h" #include "Contents/MessageTable.h" @@ -169,12 +170,12 @@ void UIClanInfoManageWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_10633 int UIClanInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 6: + case UM_COMMAND: if (a1 == 201) { g_windowMgr.CloseWindow(237); } return 0; - case 60: + case UM_REFRESH: this->LoadEmblem(); this->InvalidateChildren(); return 0; @@ -187,10 +188,10 @@ int UIClanInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1 // FUNCTION: fn_10634 int UIClanWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 60: + case UM_REFRESH: this->InvalidateChildren(); return 0; - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(a1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); diff --git a/Source/UI/Dialogs/UIEditctrlWnd.cpp b/Source/UI/Dialogs/UIEditctrlWnd.cpp index ff01cd12a..68e871f38 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/UIEnums.h" #include "UI/Dialogs/UIEditctrlWnd.h" #include "Client/Application/Launcher.h" @@ -247,9 +248,9 @@ void UIMiniMapWnd::ResetCursor(int, int) { // FUNCTION: fn_13562 int UIEditctrlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 184: { + case ID_OK: { std::string text = FormatOwnedString(g_miniMapMemoPath, g_applicationDirectory, g_session.m_navigationPlayerMap); FILE* file = std::fopen(text.c_str(), "ab"); if (file) { @@ -264,12 +265,12 @@ int UIEditctrlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument } return 0; } - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(274); return 0; } return 0; - case 0: + case UM_DEFPUSH: if (this->edit == sender && this->edit->Length() > 0) { this->SendMsg(this->edit, 6, 184, 0, 0, 0); return 0; @@ -373,7 +374,7 @@ void UIMiniMapWnd::Paint() { // FUNCTION: fn_13563 int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { case 194: { const bool enabled = this->unknown_0120->geometry.unknown_0030 != 0; @@ -385,7 +386,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } case 200: return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(273); return 0; case 356: @@ -452,7 +453,7 @@ int UIMiniMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; } - 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/Edit/UIEditBoxEx.cpp b/Source/UI/Edit/UIEditBoxEx.cpp index 1a8346abe..3ab7f82cc 100644 --- a/Source/UI/Edit/UIEditBoxEx.cpp +++ b/Source/UI/Edit/UIEditBoxEx.cpp @@ -1,4 +1,5 @@ #include "UI/Edit/UIEditBoxEx.h" +#include "UI/Window/UIEnums.h" #include "Network/TextEncoding.h" #include "UI/Buttons/UIButton.h" #include "UI/Lists/UIScrollBar.h" @@ -420,23 +421,23 @@ void CUIEditCtrlEx::HandleKeyDown(int key, std::intptr_t lparam) { int CUIEditCtrlEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { int position; switch (message) { - case 7: + case UM_SCROLLVERT: position = this->scrollPosition + a; break; - case 9: + case UM_SCROLLVERTPAGEUP: position = this->unknown_01F0 + this->scrollPosition; break; - case 10: + case UM_SCROLLVERTPAGEDOWN: position = this->scrollPosition - this->unknown_01F0; break; - case 0: + case UM_DEFPUSH: if (reinterpret_cast(&this->unknown_0184)[1] != 0 && HIBYTE(GetKeyState(VK_SHIFT))) { g_serverLanguage->Insert("\r\n"); return 0; } UIWindow::SendMsg(sender, 0, a, b, c, d); return 0; - case 18: + case UM_UPPUSH: if (this->line > 0) { if (this->unknown_01D4 == this->line - 1) { g_serverLanguage->RetreatCursor(this->unknown_01D8); @@ -485,7 +486,7 @@ int CUIEditCtrlEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_serverLanguage->Character(a, b); this->selectedAll = 1; return 3; - case 19: + case UM_DOWNPUSH: if (this->lines.size() - 1 > static_cast(this->line)) { if (this->unknown_01D4 == this->line + 1) { g_serverLanguage->AdvanceCursor(this->unknown_01D8); diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index 5539fb12c..3d3de472f 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -1,4 +1,6 @@ #include "Render/Text/FontCache.h" +#include "Contents/Items/ItemType.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Input/Language.h" #include "Client/Input/Mouse.h" @@ -1391,13 +1393,13 @@ UIMerchantShopMakeWnd::UIMerchantShopMakeWnd(int mode) : UIFrameWnd(0), mode(mod // FUNCTION: fn_13427 int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 36: { + case UM_SETTITLE: { char text[40]; std::sprintf(text, "%s : %s", LookupMessage(this->unknown_0100 != 0 ? 1734 : 226), g_session.unknown_550C.c_str()); this->title->SetTextFitted(text); return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -1406,7 +1408,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 240 ? c : 240; @@ -1441,7 +1443,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } break; - case 6: { + case UM_COMMAND: { CMode* mode = g_modeMgr.gameMode; this->RecordResponse(static_cast(a), b, c, d); if (a == 201) { @@ -1505,7 +1507,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } break; } - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList9Size(); for (int i = 0; i < size; ++i) { @@ -1567,7 +1569,7 @@ int UIMerchantItemMyShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_ // FUNCTION: fn_13420 int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 36: { + case UM_SETTITLE: { this->unknown_00FC = a; if (a) { this->quantityEdit->Move(110, this->geometry.height - 50); @@ -1591,7 +1593,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->title->SetTextAutoWidth(text); return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -1600,19 +1602,19 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; switch (drag.type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + 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); @@ -1665,7 +1667,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { @@ -1747,7 +1749,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_session.ClearTradeItems(); return 0; } - case 14: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -1789,7 +1791,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); int total = 0; const int size = g_session.GetList2Size(); @@ -1856,13 +1858,13 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_13419 int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0: + case UM_DEFPUSH: if (this->m_message0 != 0 && this->geometry.visible != 0) { this->SendMsg(this, 6, this->m_message0, 0, 0, 0); return 0; } return 0; - case 13: + case UM_SETSTATE: this->geometry.unknown_0030 = static_cast(a); if (a == 20) { char text[24]; @@ -1874,14 +1876,14 @@ int UIItemDropCntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } } return 0; - case 29: + case UM_SETTEXT: if (b != 0) { reinterpret_cast(this->unknown_00B8)->SetText(reinterpret_cast(b), 0); this->Invalidate(); return 0; } return 0; - case 6: { + case UM_COMMAND: { if (a != 184 || this->m_edit->Length() == 0) { return 0; } @@ -2961,15 +2963,15 @@ void UIItemWnd::OnLBtnDblClk(int x, int y) { } } break; - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: if (!item.identified) { break; } @@ -3797,16 +3799,16 @@ int ItemTypeSortRank(int type) { return 0; case 18: return 1; - case 4: - case 11: - case 12: - case 13: - case 14: + case TYPE_ARMOR: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: return 2; - case 5: - case 8: - case 9: - case 15: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_GUN: return 3; case 10: case 16: @@ -4098,15 +4100,15 @@ void UIItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 3) { switch (drag->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: this->SendMsg(nullptr, 38, 0, 0, 0, 0); return; default: @@ -5047,15 +5049,15 @@ void UIMerchantItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 12) { switch (drag->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + 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); @@ -5449,7 +5451,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } switch (message) { - case 0x22: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -5457,7 +5459,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->Move(this->saved->x, this->saved->y); this->SendMsg(nullptr, 0xE, 3, this->saved->width, this->saved->height, 0); return 0; - case 0xE: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 288 ? c : 288; @@ -5493,7 +5495,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 0x3A: { + case UM_USESKILL: { const CSkillInfo* skill = reinterpret_cast(a); if (skill->level != 0) { CMode* mode = g_modeMgr.gameMode; @@ -5508,9 +5510,9 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } break; } - case 6: + case UM_COMMAND: switch (a) { - case 0xC9: + case ID_CLOSE: if (this->skillTab == 0) { g_windowMgr.CloseWindow(0x72); return 0; @@ -5520,7 +5522,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 0xB8: + case ID_OK: if (this->hovered != -1) { CSkillInfo skill = this->GetSkillByIndex(this->hovered); if (skill.available != 0 && skill.level != 0 && skill.unknown_0014 != 0) { @@ -5529,13 +5531,13 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 0xEF: - case 0xF0: - case 0xF1: - case 0xF2: - case 0xF3: - case 0xF4: - case 0xF5: { + case ID_LVLUP1: + case ID_LVLUP2: + case ID_LVLUP3: + case ID_LVLUP4: + case ID_LVLUP5: + case ID_LVLUP6: + case ID_LVLUP7: { if (this->skillTab == 0) { if (reinterpret_cast(g_session.unknown_1664)[0] == 0) { return 0; @@ -5560,13 +5562,13 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 0xFD: - case 0xFE: - case 0xFF: - case 0x100: - case 0x101: - case 0x102: - case 0x103: { + case ID_LVLSELECTDN1: + case ID_LVLSELECTDN2: + case ID_LVLSELECTDN3: + case ID_LVLSELECTDN4: + case ID_LVLSELECTDN5: + case ID_LVLSELECTDN6: + case ID_LVLSELECTDN7: { CSkillInfo skill = this->GetSkillByIndex(this->scroll - 0xFD + a); if (skill.available != 0) { const int id = skill.id; @@ -5593,13 +5595,13 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 0x104: - case 0x105: - case 0x106: - case 0x107: - case 0x108: - case 0x109: - case 0x10A: { + case ID_LVLSELECTUP1: + case ID_LVLSELECTUP2: + case ID_LVLSELECTUP3: + case ID_LVLSELECTUP4: + case ID_LVLSELECTUP5: + case ID_LVLSELECTUP6: + case ID_LVLSELECTUP7: { CSkillInfo skill = this->GetSkillByIndex(this->scroll - 0x104 + a); if (skill.available != 0) { const int id = skill.id; @@ -5628,9 +5630,9 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; int position; if (message == 9) { @@ -5648,7 +5650,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return this->scroll - previous; } - case 0x17: { + case UM_REFRESHITEM: { this->skills.clear(); int count = 0; if (this->skillTab == 0) { @@ -5701,7 +5703,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->UpdateRowButtons(); return 0; } - case 0x31: + case UM_MAKEMENU: this->unknown_0138.clear(); if (g_windowMgr.unknown_0210) { g_windowMgr.CloseWindow(0x12); @@ -5730,7 +5732,7 @@ int UISkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 0x30: + case UM_MENU_SELECTED: if (this->hovered != -1) { CSkillInfo skill = this->GetSkillByIndex(this->hovered); if (skill.available != 0) { @@ -6022,7 +6024,7 @@ void UIItemBaseWnd::UpdateScrollBar() { // FUNCTION: fn_13418 int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 240 ? c : 240; @@ -6051,9 +6053,9 @@ int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; if (message == 9) { this->scroll = previous - this->visibleRows + 1; @@ -6070,19 +6072,19 @@ int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return this->scroll - previous; } - case 4: + case UM_PAGEDOWNPUSH: if (this->unknown_00E4 == 1) { this->SendMsg(this->scrollBar, 7, this->visibleRows, 0, 0, 0); return 0; } break; - case 3: + case UM_PAGEUPPUSH: if (this->unknown_00E4 == 1) { this->SendMsg(this->scrollBar, 7, -this->visibleRows, 0, 0, 0); } break; - case 6: - case 23: + case UM_COMMAND: + case UM_REFRESHITEM: break; default: return UIFrameWnd::SendMsg(sender, message, a, b, c, d); @@ -6095,7 +6097,7 @@ int UIItemBaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // FUNCTION: fn_13431 int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -6104,13 +6106,13 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: if (a == 201) { g_windowMgr.CloseWindow(40); return 0; } break; - case 38: { + 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); @@ -6121,7 +6123,7 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 240 ? c : 240; @@ -6150,7 +6152,7 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList6Size(); for (int i = 0; i < size; ++i) { @@ -6164,7 +6166,7 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->UpdateScrollBar(); return 0; } - case 55: { + case UM_SETCOUNTINFO: { char text[128]; std::sprintf(text, "Num: %d/%d Weight: %d/%d", g_session.cartCount, g_session.cartMaxCount, g_session.cartWeight, g_session.cartMaxWeight); this->info->SetText(text, 0); @@ -6182,7 +6184,7 @@ int UIMerchantItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_13432 int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; ITEM_INFO item; @@ -6213,7 +6215,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -6222,7 +6224,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 240 ? c : 240; @@ -6249,7 +6251,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList8Size(); for (int i = 0; i < size; ++i) { @@ -6281,7 +6283,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } break; } - case 6: + case UM_COMMAND: break; default: return UIItemBaseWnd::SendMsg(sender, message, a, b, c, d); @@ -6294,7 +6296,7 @@ int UIMerchantMirrorItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_ // FUNCTION: fn_13421 int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -6303,7 +6305,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; ITEM_INFO item; @@ -6322,7 +6324,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { const int count = g_session.GetList4Size(); CMode* mode = g_modeMgr.gameMode; if (a == 184) { @@ -6343,7 +6345,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } break; } - case 14: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -6378,7 +6380,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 23: { + case UM_REFRESHITEM: { if (a) { this->unknown_00FC = a; } @@ -6436,7 +6438,7 @@ int UIItemSellWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // FUNCTION: fn_13429 int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -6449,7 +6451,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt this->unknown_0104 = b; this->unknown_00F8 = a; return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; ITEM_INFO item; @@ -6526,7 +6528,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { @@ -6575,7 +6577,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt } return 0; } - case 14: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -6601,7 +6603,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt g_windowMgr.StoreSnapRectangle(this); } return 0; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); int sum = 0; const int count = g_session.GetList10Size(); @@ -6657,7 +6659,7 @@ int UIMerchantItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intpt // FUNCTION: fn_13430 int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid(this->unknown_010C != 0)) { this->saved->Reset(this->unknown_010C != 0); @@ -6669,10 +6671,10 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case 28: this->unknown_0100 = a; return 0; - case 36: + case UM_SETTITLE: this->unknown_00F4->SetTextAutoWidth(LookupMessage(186)); return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (this->unknown_010C == 0) { ITEM_INFO item; @@ -6688,7 +6690,7 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 14: + case UM_RESIZE: if (a == 3) { int width; if (this->unknown_010C) { @@ -6715,7 +6717,7 @@ int UIMerchantItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList7Size(); for (int i = 0; i < size; ++i) { @@ -8107,7 +8109,7 @@ UIItemWnd::~UIItemWnd() = default; // FUNCTION: fn_13423 int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!static_cast(this->saved)->IsValid()) { static_cast(this->saved)->Reset(); @@ -8116,13 +8118,13 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: if (a == 213) { g_windowMgr.unknown_0064 = b; return 0; } break; - case 38: + case UM_DROP: switch (a) { case 0: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); @@ -8154,13 +8156,13 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } break; - case 36: + case UM_SETTITLE: this->unknown_00F8 = 1; this->showQuantity = 1; this->title->SetTextAutoWidth(LookupMessage(1568)); this->checkBox->m_disabled = 0; return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -8188,7 +8190,7 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList1Size(); for (int i = 0; i < size; ++i) { @@ -8213,7 +8215,7 @@ int UIItemShopWnd2::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: // FUNCTION: fn_13424 int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -8222,7 +8224,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); if (a == 213) { if (g_replayAnimationScaling != 0) { @@ -8235,7 +8237,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } break; } - case 38: + case UM_DROP: if (a == 0) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ITEM_INFO item; @@ -8265,7 +8267,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } break; - case 36: + case UM_SETTITLE: this->unknown_010C = b; if (a) { this->unknown_00F8 = 1; @@ -8287,7 +8289,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } this->Invalidate(); return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -8315,7 +8317,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList1Size(); for (int i = 0; i < size; ++i) { @@ -8340,7 +8342,7 @@ int UIItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // FUNCTION: fn_45489 int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(this->tabIndex); @@ -8349,7 +8351,7 @@ 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); return 0; - case 38: { + 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); @@ -8360,7 +8362,7 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList5Size(); for (int i = 0; i < size; ++i) { @@ -8384,21 +8386,21 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s break; case 2: switch (type) { - case 4: - case 11: - case 12: - case 13: - case 14: + case TYPE_ARMOR: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: matches = true; break; } break; case 3: switch (type) { - case 5: - case 8: - case 9: - case 15: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_GUN: matches = true; break; } @@ -8434,7 +8436,7 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->UpdateScrollBar(); return 0; } - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -8460,7 +8462,7 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_windowMgr.StoreSnapRectangle(this); } return 0; - case 55: { + case UM_SETCOUNTINFO: { char text[64]; std::sprintf(text, "%d/%d", a, b); this->unknown_0120 = text; @@ -8502,13 +8504,13 @@ int UIItemStoreSubWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_45490 int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 55: + case UM_SETCOUNTINFO: this->unknown_0188 = a; this->unknown_018C = b; this->unknown_0144 = FormatThreadText("%d/%d", a, b); this->Invalidate(); return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -8529,9 +8531,9 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->Invalidate(); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 201: { + case ID_CLOSE: { const int openTabs = this->saved->unknown_0010; for (int index = 0; index < 7; ++index) { g_windowMgr.CloseWindow(index + 146); @@ -8652,7 +8654,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: break; } return 0; - case 38: { + 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); @@ -8663,7 +8665,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 14: + case UM_RESIZE: if (a == 3) { int height = c; const int maximum = g_windowMgr.unknown_0480 * 7 / 10; @@ -8695,7 +8697,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: g_windowMgr.StoreSnapRectangle(this); } return 0; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList5Size(); for (int i = 0; i < size; ++i) { @@ -8719,21 +8721,21 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: break; case 2: switch (type) { - case 4: - case 11: - case 12: - case 13: - case 14: + case TYPE_ARMOR: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: matches = true; break; } break; case 3: switch (type) { - case 5: - case 8: - case 9: - case 15: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_GUN: matches = true; break; } @@ -8801,7 +8803,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 22: + case UM_TAB: this->unknown_0180 = a; if (this->unknown_0180 < 0) { this->unknown_0180 = 0; @@ -8830,7 +8832,7 @@ int UIItemStoreWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->sortCombo) { g_session.m_itemDefaultSort = a == 0; g_session.m_itemAscendingOrder = a == 1; @@ -9744,7 +9746,7 @@ bool g_sortPrivateTab; // FUNCTION: fn_13426 int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { case 456: Singleton::GetInstance()->ToggleOption(264); @@ -9794,7 +9796,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->RefreshSortButton(); this->RefreshItems(); return 0; - case 201: + case ID_CLOSE: if (this->unknown_0128 == sender) { this->RemoveChild(this->unknown_0128, 0); this->unknown_0128 = nullptr; @@ -9803,7 +9805,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp g_windowMgr.CloseWindow(8); } return 0; - case 202: { + case ID_MINI: { const int height = this->geometry.height; if (height == 17) { this->Resize(this->geometry.width, this->unknown_0110); @@ -9819,13 +9821,13 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } return 0; } - case 213: + case ID_CHECK: g_session.m_lockItemDrop = !g_session.m_lockItemDrop; return 0; default: return 0; } - case 14: { + case UM_RESIZE: { if (a != 7) { return 0; } @@ -9870,11 +9872,11 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->unknown_012C->Move(157, this->geometry.height - 19); return 0; } - case 22: + case UM_TAB: this->unknown_010C = static_cast(a); this->SendMsg(nullptr, 23, 0, 0, 0, 0); return 0; - case 23: + case UM_REFRESHITEM: if (this->unknown_010C == 3) { this->RefreshItems(); return 0; @@ -9901,15 +9903,15 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } } else if (this->unknown_010C == 1) { switch (type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: if (this->unknown_0104 == 0) { include = type == 5 || type == 9 || type == 8; } else if (this->unknown_0104 == 1) { @@ -9933,7 +9935,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp this->Invalidate(); this->UpdateScrollBar(); return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (this->saved->IsValid() == 0) { this->saved->Reset(); @@ -9951,7 +9953,7 @@ int UIItemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intp } this->Move(this->saved->x, this->saved->y); return 0; - case 38: { + case UM_DROP: { CMode* mode = g_modeMgr.GetGameMode(); ModeDragState& drag = static_cast(mode)->drag; switch (drag.source) { @@ -10013,9 +10015,9 @@ int UIMerchantItemPurchaseMSGWnd::SendMsg(UIWindow* sender, int message, std::in } switch (a) { - case 184: + case ID_OK: g_modeMgr.gameMode->SendMsg(83, this->purchaseIndex, this->unknown_00D0, 0, 0); - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(230); g_session.ClearItems1760And1748(); break; @@ -10805,7 +10807,7 @@ void UIItemShopWnd2::Paint() { // FUNCTION: fn_13422 int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -10814,7 +10816,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; ITEM_INFO item; @@ -10833,7 +10835,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { @@ -10850,7 +10852,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_session.ClearTradeItems(); return 0; } - case 14: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -10886,7 +10888,7 @@ int UIItemSellWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); int totalPrice = 0; const int size = g_session.GetList4Size(); @@ -11193,7 +11195,7 @@ void UIItemPurchaseWnd::OnCreate(int width, int height) { // FUNCTION: fn_13425 int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -11202,7 +11204,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); return 0; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList5Size(); for (int i = 0; i < size; ++i) { @@ -11226,13 +11228,13 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->UpdateScrollBar(); return 0; } - case 6: + case UM_COMMAND: if (a == 201) { g_windowMgr.CloseWindow(153); static_cast(g_windowMgr.LookupWindow(33))->unknown_0140 = 0; return 0; } - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -11259,7 +11261,7 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, g_windowMgr.StoreSnapRectangle(this); } return 0; - case 38: { + 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); @@ -11274,7 +11276,7 @@ int UIItemStoreFindWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->sorted = false; this->SendMsg(nullptr, 23, 0, 0, 0, 0); return 0; - case 55: { + case UM_SETCOUNTINFO: { char text[64]; std::sprintf(text, "%d/%d", a, b); this->unknown_0124.assign(text, std::strlen(text)); @@ -11349,14 +11351,14 @@ void UIItemDropCntWnd::Show(int visible) { int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { int error; switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); } this->Move(this->saved->x, this->saved->y); break; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ITEM_INFO item; item.Assign(reinterpret_cast(mode->drag)); @@ -11438,7 +11440,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t mode->SendMsg(18, 0, 0, 0, 0); break; } - case 23: { + case UM_REFRESHITEM: { this->items.clear(); const int count = g_session.GetList11Size(); for (int i = 0; i < count; ++i) { @@ -11483,9 +11485,9 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Invalidate(); break; } - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scroll; if (message == 9) { this->scroll = previous - this->unknown_0140 + 1; @@ -11540,7 +11542,7 @@ int UIMerchantShopMakeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } break; } - case 6: + case UM_COMMAND: if (a == 213) { g_session.m_skipPriceWarning = !g_session.m_skipPriceWarning; } else if (a == 343) { diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index 5d0f1fa9c..67fbd1036 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -1,4 +1,5 @@ #include "Client/Input/InputCharset.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Language.h" #include "Contents/SkinMgr.h" #include "Render/Text/FontCache.h" @@ -57,7 +58,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in unsigned char* const lineMove = reinterpret_cast(&this->unknown_0184); switch (message) { - case 0: + case UM_DEFPUSH: if (lineMove[1] == 0 || HIBYTE(GetKeyState(VK_SHIFT)) != 0 || lineMove[1] == 0) { char newline[3] = {'\r', '\n', '\0'}; g_serverLanguage->Insert(newline); @@ -65,9 +66,9 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->UIWindow::SendMsg(sender, 0, a, b, c, d); } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_0158; scrolling[0] = 1; @@ -97,7 +98,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in return this->unknown_0158 - previous; } - case 18: { + case UM_UPPUSH: { lineMove[0] = 0; const unsigned count = this->unknown_0168.size(); @@ -147,7 +148,7 @@ int UIEditCtrl3::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in lineMove[0] = 1; break; } - case 19: { + case UM_DOWNPUSH: { lineMove[0] = 0; const unsigned count = this->unknown_0168.size(); @@ -392,7 +393,7 @@ void UIEditCtrl3::Resize(int width, int height) { // FUNCTION: fn_10922 int UIWhisperEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 18: + case UM_UPPUSH: if (this->history.size() != 0) { if (this->historyIndex != 0) { --this->historyIndex; @@ -401,7 +402,7 @@ int UIWhisperEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->OnBeginEdit(); } break; - case 19: + case UM_DOWNPUSH: if (this->history.size() != 0 && static_cast(this->historyIndex) < this->history.size()) { ++this->historyIndex; if (this->historyIndex == static_cast(this->history.size())) { @@ -924,7 +925,7 @@ void UIChatEditCtrl::OnLBtnDown(int x, int y) { // FUNCTION: fn_10909 int UIChatEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 18: + case UM_UPPUSH: if (this->history.size() != 0) { if (this->unknown_0140 == this->history.size()) { this->pending = this->Text(); @@ -937,7 +938,7 @@ int UIChatEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: this->OnBeginEdit(); } break; - case 19: + case UM_DOWNPUSH: if (this->history.size() != 0 && this->unknown_0140 < this->history.size()) { ++this->unknown_0140; this->SetText((this->unknown_0140 == this->history.size() ? this->pending : this->history[this->unknown_0140]).c_str()); @@ -1033,10 +1034,10 @@ void UIWhisperEditCtrl::SetText(const char* value) { // FUNCTION: fn_10916 int UIEditCtrl_OldList::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 18: + case UM_UPPUSH: this->RecallHistory(-1); return 0; - case 19: + case UM_DOWNPUSH: this->RecallHistory(1); return 0; default: diff --git a/Source/UI/Emotion/UIEmotionWnd.cpp b/Source/UI/Emotion/UIEmotionWnd.cpp index 49e770408..6d65c6884 100644 --- a/Source/UI/Emotion/UIEmotionWnd.cpp +++ b/Source/UI/Emotion/UIEmotionWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Emotion/UIEmotionWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/CashEmotionMgr.h" @@ -116,12 +117,12 @@ int UIEmotionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 switch (message) { case 0: break; - case 6: + case UM_COMMAND: switch (argument1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(0x56); break; - case 283: + case ID_OPEN_EMOTIONLIST: if (static_cast(g_windowMgr.unknown_0384) == nullptr) { g_windowMgr.EnsureWindow(0x57); } else { diff --git a/Source/UI/EntryQueue/UIEntryQueueWnd.cpp b/Source/UI/EntryQueue/UIEntryQueueWnd.cpp index d1688aaa1..9ceaad769 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/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -464,7 +465,7 @@ void __stdcall Nullsub429() { int UIEntryQueueWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { EntryQueueInfo* info = g_entryQueueMgr->current; switch (message) { - case 6: { + case UM_COMMAND: { int error; switch (a) { case 0: @@ -534,7 +535,7 @@ int UIEntryQueueWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std g_windowMgr.Confirm(LookupMessage(error), 0, false, false, 0, "Message", 280, 120, 0); return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); diff --git a/Source/UI/Exchange/UIExchangeUI.cpp b/Source/UI/Exchange/UIExchangeUI.cpp index 940bf3efc..fe4712051 100644 --- a/Source/UI/Exchange/UIExchangeUI.cpp +++ b/Source/UI/Exchange/UIExchangeUI.cpp @@ -1,4 +1,5 @@ #include "UI/Exchange/UIExchangeUI.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Client/Mode/CGameMode.h" @@ -433,7 +434,7 @@ void CUIListBoxEx::UpdateScrollBar() // FUNCTION: fn_15304 int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0x32: + case UM_SET_EXCHANGE_CHAR_NAME: if (argument1 == 0) { break; } @@ -450,7 +451,7 @@ int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->unknown_00DC->SetText(this->partnerName); } break; - case 0x33: + case UM_MYDRAGCLOSED: this->zenyEdit->Show(0); this->FreezeItems(true); this->UpdateZeny(true); @@ -464,7 +465,7 @@ int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument button->Invalidate(); } break; - case 0x34: + case UM_OTHERDRAGCLOSED: this->FreezeItems(false); this->UpdateZeny(false); { @@ -477,7 +478,7 @@ int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument button->Invalidate(); } break; - case 0x17: + case UM_REFRESHITEM: this->firstList->ClearData(); for (int index = 0; index < 10; ++index) { ITEM_INFO item = g_session.GetExchangeItem(index); @@ -504,7 +505,7 @@ int CUIExchangeUI::SendMsg(UIWindow* sender, int message, std::intptr_t argument } this->secondList->UpdateScrollBar(); break; - case 0x26: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (mode != nullptr) { mode->SendMsg(0x33, mode->drag.id, mode->drag.quantity, 0, 0); diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 8298a9b6f..a797db724 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Guild/UIAgitWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Client/Replay.h" @@ -41,10 +42,10 @@ int UIAgitMessageBox::SendMsg(UIWindow*, int message, std::intptr_t a, std::intp const int response = static_cast(a); this->RecordResponse(response, b, c, d); switch (response) { - case 187: + case ID_YES: g_modeMgr.GetGameMode()->SendMsg(315, this->m_agitId, 0, 0, 0); [[fallthrough]]; - case 188: + case ID_NO: g_windowMgr.Schedule(this); } } diff --git a/Source/UI/Guild/UIGuildHelperWnd.cpp b/Source/UI/Guild/UIGuildHelperWnd.cpp index c4dc0b6c9..9d223092b 100644 --- a/Source/UI/Guild/UIGuildHelperWnd.cpp +++ b/Source/UI/Guild/UIGuildHelperWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Guild/UIGuildHelperWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" @@ -156,7 +157,7 @@ int UICreateGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s } switch (a1) { - case 184: { + case ID_OK: { CMode* mode = g_modeMgr.GetGameMode(); std::string name = ""; name = this->m_nameEdit->Text(); @@ -175,7 +176,7 @@ int UICreateGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s } break; } - case 185: + case ID_CANCEL: if (this->m_mode == 0) { g_windowMgr.CloseWindow(213); } else { @@ -191,20 +192,20 @@ int UICreateGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s // FUNCTION: fn_13124 int UIGuildBanReasonDescWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 6: + case UM_COMMAND: switch (a1) { - case 184: { + case ID_OK: { g_windowMgr.CloseWindow(76); CMode* mode = g_modeMgr.gameMode; mode->SendMsg(111, reinterpret_cast(&this->m_target), reinterpret_cast(this->m_reasonEdit->Text()), 0, 0); break; } - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(76); break; } return 0; - case 34: { + case UM_SETINFO: { const GuildBanTarget* target = reinterpret_cast(a1); this->m_target.unknown_0000 = target->unknown_0000; this->m_target.unknown_0004 = target->unknown_0004; @@ -220,14 +221,14 @@ int UIGuildBanReasonDescWnd::SendMsg(UIWindow* sender, int message, std::intptr_ // FUNCTION: fn_13126 int UIGuildHelperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 6: + case UM_COMMAND: switch (a1) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(214); g_windowMgr.CloseWindow(213); g_windowMgr.CloseWindow(212); break; - case 343: + case ID_HELP: if (!g_windowMgr.CloseWindow(214)) { g_windowMgr.EnsureWindow(214); } @@ -245,7 +246,7 @@ int UIGuildHelperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s break; } return 0; - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(a1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index 9fcca760d..a610c2599 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/UIEnums.h" #include "UI/Guild/UIGuildWnd.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CMode.h" @@ -620,17 +621,17 @@ __declspec(noinline) void UIGuildWnd::CreateTabs() { // FUNCTION: fn_13135 int UIGuildWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(a1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); } this->Move(this->m_saved->x, this->m_saved->y); break; - case 60: + case UM_REFRESH: this->InvalidateChildren(); return 0; - case 69: { + case UM_CHANGE_GUILD_TAB: { int permissions[7] = {0, 1, 2, 4, 16, 128, 64}; switch (a1) { case 1: @@ -746,15 +747,15 @@ void UIGuildBanishedMemberWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_13125 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 6: + case UM_COMMAND: if (a1 == 201) { g_windowMgr.CloseWindow(59); return 0; } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; if (message == 9) { @@ -769,7 +770,7 @@ int UIGuildBanishedMemberWnd::SendMsg(UIWindow* sender, int message, std::intptr } return this->m_scrollTop - previous; } - case 60: + case UM_REFRESH: this->InvalidateChildren(); this->UpdateScroll(); break; @@ -848,14 +849,14 @@ void UIGuildTotalInfoWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_13134 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 6: + case UM_COMMAND: if (a1 == 201) { g_windowMgr.CloseWindow(59); } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; if (message == 9) { @@ -1086,11 +1087,11 @@ int UIGuildLeaveReasonDescWnd::SendMsg(UIWindow* sender, int message, std::intpt } switch (a1) { - case 184: + case ID_OK: g_modeMgr.gameMode->SendMsg(110, reinterpret_cast(this->m_reasonEdit->Text()), 0, 0, 0); g_windowMgr.CloseWindow(75); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(75); break; } @@ -2008,12 +2009,12 @@ void UIGuildNoticeWnd::OnCreate(int, int) { // FUNCTION: fn_13130 int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 6: + case UM_COMMAND: switch (a1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(59); break; - case 277: { + case ID_SEND_GUILD_NOTICE: { std::string body(this->m_bodyEdit->Text()); if (g_forbiddenWords.Contains(this->m_titleEdit->Text()) == true || g_forbiddenWords.Contains(body.c_str()) == true) { g_windowMgr.Confirm(LookupMessage(14), 0, true, false, 0, "Message", 280, 120, 0); @@ -2027,7 +2028,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s } } break; - case 60: + case UM_REFRESH: this->InvalidateChildren(); break; default: @@ -2041,12 +2042,12 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s // FUNCTION: fn_13132 int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 6: + case UM_COMMAND: switch (a1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(59); return 0; - case 184: + case ID_OK: if (this->m_hoverIndex != -1) { CSkillInfo skill = this->SkillAt(this->m_hoverIndex); if (skill.level != 0) { @@ -2055,13 +2056,13 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st return 0; } break; - case 239: - case 240: - case 241: - case 242: - case 243: - case 244: - case 245: + case ID_LVLUP1: + case ID_LVLUP2: + case ID_LVLUP3: + case ID_LVLUP4: + case ID_LVLUP5: + case ID_LVLUP6: + case ID_LVLUP7: if (g_session.m_guildSkillPoint != 0) { CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 239); if (skill.available != 0) { @@ -2070,13 +2071,13 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st return 0; } break; - case 253: - case 254: - case 255: - case 256: - case 257: - case 258: - case 259: { + case ID_LVLSELECTDN1: + case ID_LVLSELECTDN2: + case ID_LVLSELECTDN3: + case ID_LVLSELECTDN4: + case ID_LVLSELECTDN5: + case ID_LVLSELECTDN6: + case ID_LVLSELECTDN7: { CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 253); if (skill.available != 0) { int level = g_session.UseLevel(skill.id) - 1; @@ -2091,13 +2092,13 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st } return 0; } - case 260: - case 261: - case 262: - case 263: - case 264: - case 265: - case 266: { + case ID_LVLSELECTUP1: + case ID_LVLSELECTUP2: + case ID_LVLSELECTUP3: + case ID_LVLSELECTUP4: + case ID_LVLSELECTUP5: + case ID_LVLSELECTUP6: + case ID_LVLSELECTUP7: { CSkillInfo skill = this->SkillAt(this->m_scrollTop + a1 - 260); if (skill.available != 0) { int level = g_session.UseLevel(skill.id) + 1; @@ -2115,9 +2116,9 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; if (message == 9) { @@ -2136,7 +2137,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st return this->m_scrollTop - previous; } - case 23: { + case UM_REFRESHITEM: { this->m_skills.clear(); const int count = static_cast(g_session.m_additionalSkills.size()); for (int index = 0; index < count; ++index) { @@ -2151,7 +2152,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st return 0; } - case 49: + case UM_MAKEMENU: this->m_menuItems.clear(); if (g_windowMgr.unknown_0210 != 0) { g_windowMgr.CloseWindow(18); @@ -2186,7 +2187,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st } break; - case 48: + case UM_MENU_SELECTED: if (this->m_hoverIndex != -1) { CSkillInfo skill = this->SkillAt(this->m_hoverIndex); if (skill.available != 0) { @@ -2201,7 +2202,7 @@ int UIGuildSkillWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, st } break; - case 58: { + 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); @@ -2333,9 +2334,9 @@ void UIGuildSkillWnd::OnCreate(int, int height) { // FUNCTION: fn_13131 int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; if (message == 9) { @@ -2352,9 +2353,9 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr return this->m_scrollTop - previous; } - case 6: + case UM_COMMAND: switch (a1) { - case 184: + 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); @@ -2367,10 +2368,10 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr return 0; } return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(59); return 0; - case 213: + case ID_CHECK: if (this->unknown_00D0[0] && this->unknown_00FC[0] && this->unknown_0128[0]) { for (int index = 0; index < 11; ++index) { if (this->unknown_00D0[index] == sender) { @@ -2401,7 +2402,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr break; } return 0; - case 275: + case ID_POSNAME_EDIT: if (this->unknown_0180[0]) { int row = a1 - 275; for (int index = 0; index < 11; ++index) { @@ -2420,7 +2421,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr break; } return 0; - case 276: + case ID_PAYRATE_EDIT: if (this->unknown_0154[0]) { int row = a1 - 276; for (int index = 0; index < 11; ++index) { @@ -2459,7 +2460,7 @@ int UIGuildPositionManageWnd::SendMsg(UIWindow* sender, int message, std::intptr this->InvalidateChildren(); return 0; - case 60: + case UM_REFRESH: this->m_positions = reinterpret_cast&>(g_guildInfo.unknown_00D4); this->InvalidateChildren(); if (g_guildInfo.unknown_00B4 && this->m_positionMap.size()) { @@ -2555,7 +2556,7 @@ void UIGuildMemberManageWnd::Paint() { // FUNCTION: fn_13129 int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 39: { + case UM_COMBOBOX_SELECTED: { int index = 0; for (auto member = this->m_members.begin(); member != this->m_members.end(); ++member, ++index) { if (this->m_hoverRow == index) { @@ -2580,9 +2581,9 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Invalidate(); return 0; } - case 6: + case UM_COMMAND: switch (a1) { - case 184: + case ID_OK: if (!this->unknown_0180.empty()) { g_guildInfo.unknown_0104 = this->unknown_0180; g_modeMgr.gameMode->SendMsg(103, 0, 0, 0, 0); @@ -2594,14 +2595,14 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(59); return 0; - case 213: + case ID_CHECK: g_session.m_guildMemberListSort = !g_session.m_guildMemberListSort; this->Invalidate(); return 0; - case 273: + case ID_OPEN_MEMBER_POS_COMBO: if (this->m_rowButtons[0]) { int row = 0; int index; @@ -2640,9 +2641,9 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t break; } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollTop; int top; if (message == 9) { @@ -2659,7 +2660,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } return this->m_scrollTop - previous; } - case 49: + case UM_MAKEMENU: this->unknown_0150.clear(); if (g_windowMgr.unknown_0210 != 0) { g_windowMgr.CloseWindow(18); @@ -2725,7 +2726,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 48: { + case UM_MENU_SELECTED: { GuildInfo::Member member; if ((this->GetMember(this->m_hoverRow, member) && member.name.find(g_guildNamelessTag, 0) != std::string::npos) || !g_playerNameDictionary->Contains(member.characterId)) { @@ -2734,7 +2735,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } switch (this->unknown_0150[a1].value) { - case 16: { + case MENUID_REMOVE_GUILE_MEMBER: { GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target)) { struct { @@ -2746,7 +2747,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } break; } - case 17: { + case MENUID_LEAVE_GUILD: { 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)); @@ -2754,21 +2755,21 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } break; } - case 18: { + 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); } break; } - case 5: { + 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); } break; } - case 20: { + case MENUID_MAKE_WHISPER_WINDOW: { GuildInfo::Member target; if (this->GetMember(this->m_hoverRow, target) == true) { const char* relation; @@ -2810,7 +2811,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } return 0; } - case 60: { + case UM_REFRESH: { this->unknown_0180.clear(); this->m_members = g_guildInfo.m_members; this->InvalidateChildren(); @@ -2824,7 +2825,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->UpdateScroll(); return 0; } - case 106: { + case UM_SET_DISABLE: { this->m_members = g_guildInfo.m_members; const bool enabled = g_guildInfo.unknown_00B4 != 0; for (int index = 0; index < 6; ++index) { @@ -2985,7 +2986,7 @@ void UIGuildPositionManageWnd::OnCreate(int, int) { // FUNCTION: fn_13127 int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4) { switch (message) { - case 48: { + case UM_MENU_SELECTED: { CMode* gameMode = g_modeMgr.GetGameMode(); if (this->unknown_00E0[a1].value != 27) { break; @@ -3026,7 +3027,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } break; } - case 49: + 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); @@ -3056,12 +3057,12 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } break; - case 6: + case UM_COMMAND: switch (a1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(59); return 0; - case 278: { + case ID_CHANGE_GUILE_EMBLEM: { if (g_windowMgr.unknown_0214 != 0) { g_windowMgr.CloseWindow(26); } @@ -3095,9 +3096,9 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a return 0; } break; - case 13: + case UM_SETSTATE: break; - case 39: { + case UM_COMBOBOX_SELECTED: { if (this->unknown_00D8.size() == 0) { break; } @@ -3138,7 +3139,7 @@ int UIGuildInfoManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; } - case 60: + case UM_REFRESH: this->m_guildId = g_guildInfo.m_guildId; if (g_guildInfo.unknown_00B4 != 0) { this->m_editButton->Move(this->geometry.width - this->m_editButton->geometry.width - 8, 69); diff --git a/Source/UI/Guild/UIGuild_Storage_Log.cpp b/Source/UI/Guild/UIGuild_Storage_Log.cpp index c1fc4c61c..b316b8446 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/UIEnums.h" #include "Contents/MessageTable.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -41,13 +42,13 @@ UIGuild_Storage_Log::UIGuild_Storage_Log() : UIFrameWnd(0) { // FUNCTION: fn_12941 int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(253); break; - case 218: { + case ID_NEXT: { const unsigned page = this->m_page; if (this->m_category == 0) { if (page >= this->m_pageCounts[0]) { @@ -69,7 +70,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } - case 246: { + case ID_PREV: { const unsigned page = this->m_page; if (page > 1) { const int state = this->m_state; @@ -95,7 +96,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; - case 22: + case UM_TAB: this->m_category = static_cast(a); this->m_page = 1; this->m_state = 1; @@ -105,7 +106,7 @@ int UIGuild_Storage_Log::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->SendMsg(this, 60, 0, 0, 0, 0); return 0; - case 60: + case UM_REFRESH: for (int i = 0; i < 10; ++i) { this->m_dateTexts[i]->SetText("", 0); this->m_nameTexts[i]->SetText("", 0); diff --git a/Source/UI/Item/UIMerchantItemLogWnd.cpp b/Source/UI/Item/UIMerchantItemLogWnd.cpp index 837d81a6f..bcecaeddd 100644 --- a/Source/UI/Item/UIMerchantItemLogWnd.cpp +++ b/Source/UI/Item/UIMerchantItemLogWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Item/UIMerchantItemLogWnd.h" @@ -210,12 +211,12 @@ void UIMerchantItemLogWnd::OnRBtnDown(int x, int y) { // FUNCTION: fn_13580 int UIMerchantItemLogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: if (a == 201) { g_windowMgr.CloseWindow(this->unknown_00FC != 0 ? 258 : 257); } break; - case 14: + case UM_RESIZE: if (a == 3) { int height = c <= 336 ? c : 336; if (height < 120) { @@ -237,7 +238,7 @@ int UIMerchantItemLogWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_windowMgr.StoreSnapRectangle(this); } break; - case 23: { + case UM_REFRESHITEM: { ITEM_INFO item(*reinterpret_cast(a)); this->items.push_back(item); diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 1bef8cde2..410fb8385 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -1,4 +1,6 @@ #include "Render/Text/FontCache.h" +#include "Contents/Items/ItemType.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Item/UIParaItemShopWnd.h" @@ -104,15 +106,15 @@ void UIParaItemPurchaseWnd::DragAndDrop(int x, int y, std::intptr_t value) { const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 3) { switch (drag->type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: this->SendMsg(nullptr, 38, 0, 0, 0, 0); return; default: @@ -266,10 +268,10 @@ void UIParaResultWnd::OnCreate(int width, int height) { // FUNCTION: fn_13757 int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 36: + case UM_SETTITLE: this->title->SetTextAutoWidth("Total : 0 Zeny"); return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -278,19 +280,19 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->SendMsg(nullptr, 14, 3, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ModeDragState& drag = mode->drag; switch (drag.type) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: { + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + 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); @@ -366,11 +368,11 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t mode->SendMsg(18, 0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; switch (a) { - case 184: { + case ID_OK: { ITEM_INFO item = g_session.GetItem1720At(0); if (item.unknown_0074[3] == 1) { mode->SendMsg(263, 0, 0, 0, 0); @@ -380,7 +382,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_session.ClearTradeItems(); return 0; } - case 185: + case ID_CANCEL: mode->SendMsg(292, 0, 0, 0, 0); mode->SendMsg(40, 0, 0, 0, 0); g_session.ClearTradeItems(); @@ -388,7 +390,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } break; } - case 14: + case UM_RESIZE: if (a == 3) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -421,7 +423,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); int sum = 0; const int size = g_session.GetList2Size(); @@ -479,7 +481,7 @@ int UIParaItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_13758 int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -488,7 +490,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); if (a == 213) { if (g_replayAnimationScaling != 0) { @@ -500,7 +502,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 38: + case UM_DROP: if (a == 0) { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); ITEM_INFO item; @@ -520,7 +522,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 36: + case UM_SETTITLE: if (a == 1) { this->unknown_00F8 = 1; this->showQuantity = 1; @@ -533,7 +535,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->checkBox->m_disabled = 1; } return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -561,7 +563,7 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 23: { + case UM_REFRESHITEM: { this->items.erase(this->items.begin(), this->items.end()); const int size = g_session.GetList1Size(); for (int i = 0; i < size; ++i) { @@ -586,10 +588,10 @@ int UIParaItemShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s // FUNCTION: fn_13759 int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->total->SetTextAutoWidth("Total : 0 Zeny"); return 0; - case 6: { + case UM_COMMAND: { this->RecordResponse(static_cast(a), b, c, d); CMode* mode = g_modeMgr.gameMode; if (a == 184) { @@ -600,12 +602,12 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std } break; } - case 36: + case UM_SETTITLE: this->showQuantity = 0; this->title->SetTextAutoWidth(LookupMessage(2530)); this->SendMsg(nullptr, 14, 7, this->geometry.width, a, 0); return 0; - case 14: + case UM_RESIZE: if (a == 7) { int width = b <= 320 ? b : 320; int height = c <= 336 ? c : 336; @@ -635,7 +637,7 @@ int UIParaResultWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std return 0; } break; - case 23: { + case UM_REFRESHITEM: { int sum = 0; for (const ITEM_INFO& item : this->items) { sum += item.unknown_0014[1] * item.quantity; diff --git a/Source/UI/Items/MergeItemWnd.cpp b/Source/UI/Items/MergeItemWnd.cpp index 0e5be66cf..ad8ce7f11 100644 --- a/Source/UI/Items/MergeItemWnd.cpp +++ b/Source/UI/Items/MergeItemWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Items/MergeItemWnd.h" @@ -324,7 +325,7 @@ void CMergeItemWnd::FitToGrid(int width, int height) { // FUNCTION: fn_09675 int CMergeItemWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t) { switch (message) { - case 34: { + case UM_SETINFO: { this->m_itemCount = argument2; const std::int16_t* ids = reinterpret_cast(argument1); for (int index = 0; index < this->m_itemCount; ++index) { @@ -340,20 +341,20 @@ int CMergeItemWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std: this->FitToGrid(this->geometry.width, this->geometry.height); break; } - case 60: { + case UM_REFRESH: { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, argument1); g_session.RemoveItem1710(item.unknown_0000[1], item.quantity); item.quantity = argument2; g_session.AddItem1710(item, 1); break; } - case 6: + case UM_COMMAND: switch (argument1) { - case 184: + case ID_OK: this->RequestMerge(); break; - case 185: - case 201: { + case ID_CANCEL: + case ID_CLOSE: { MergeItemCancelPacket packet; packet.id = 0x974; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); @@ -362,19 +363,19 @@ int CMergeItemWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std: } } break; - case 14: + case UM_RESIZE: if (argument1 == 7) { this->FitToGrid(argument2, argument3); } break; - case 7: + case UM_SCROLLVERT: if (argument1 != 0) { this->m_scrollRow += argument1; this->UpdateScroll(); this->Invalidate(); } break; - case 2: + case UM_TOGGLEPUSH: this->SelectSameItems(argument1); break; } diff --git a/Source/UI/Items/UIIllustWnd.cpp b/Source/UI/Items/UIIllustWnd.cpp index e75bed7b8..ed4ebf39e 100644 --- a/Source/UI/Items/UIIllustWnd.cpp +++ b/Source/UI/Items/UIIllustWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UIIllustWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -99,13 +100,13 @@ void UIMultiIllustWnd::OnMouseMove(int x, int y) { // FUNCTION: fn_13190 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 6: + case UM_COMMAND: if (argument1 == 201) { g_modeMgr.GetGameMode()->SendMsg(100, reinterpret_cast(""), -1, 1, 0); g_windowMgr.ReleaseCapture(); } return 0; - case 34: + case UM_SETINFO: if (argument1 == -1) { this->m_titled = 0; this->m_closable = 0; @@ -120,7 +121,7 @@ int UIIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->m_closable = 1; this->Invalidate(); return 0; - case 78: { + case UM_SET_BITMAP: { const char* name = reinterpret_cast(argument1); this->m_bitmapName = "유저인터페이스\\Illust\\"; this->m_bitmapName += name; @@ -159,13 +160,13 @@ int UIIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, // FUNCTION: fn_13191 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 6: + case UM_COMMAND: if (argument1 == 201) { g_modeMgr.GetGameMode()->SendMsg(100, reinterpret_cast(""), -1, 0, 0); g_windowMgr.ReleaseCapture(); } return 0; - case 34: + case UM_SETINFO: switch (argument1) { case 10: this->m_closable = 0; @@ -199,7 +200,7 @@ int UIMultiIllustWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->m_closable = 1; this->Invalidate(); return 0; - case 78: { + case UM_SET_BITMAP: { const char* name = reinterpret_cast(argument1); this->m_bitmapName = "유저인터페이스\\Illust\\"; this->m_bitmapName += name; diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index 6aa9ab9c3..de5d0d226 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/UIEnums.h" #include "UI/Items/UIItemRepairWnd.h" #include "Client/Input/InputCharset.h" @@ -210,7 +211,7 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std ITEM_INFO item; switch (message) { - case 31: { + case UM_ADDITEM: { const UIItemRepairEntry& entry = *reinterpret_cast(a); this->entries.push_back(entry); this->itemIds.push_back(entry.itemId); @@ -223,20 +224,20 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std return 0; } - case 18: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); return 0; - case 19: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { const int response = static_cast(a); this->RecordResponse(response, b, c, this->m_list->selected); switch (response) { - case 184: { + case ID_OK: { if (g_replayAnimationScaling) { UIListBox* list = this->m_list; list->selected = static_cast(d); @@ -266,7 +267,7 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std break; } - case 185: + case ID_CANCEL: g_modeMgr.gameMode->SendMsg(174, -1, 0, 0, 0); g_windowMgr.CloseWindow(107); return 0; @@ -316,11 +317,11 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std // FUNCTION: fn_13618 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 6: + case UM_COMMAND: g_windowMgr.CloseWindow(81); return 0; - case 40: + case UM_SETCURITEM: this->makeType = static_cast(a); if (b) { this->succeeded = true; diff --git a/Source/UI/Items/UIMakeTargetListWnd.cpp b/Source/UI/Items/UIMakeTargetListWnd.cpp index adaab6902..09f666f04 100644 --- a/Source/UI/Items/UIMakeTargetListWnd.cpp +++ b/Source/UI/Items/UIMakeTargetListWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UIMakeTargetListWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/ModeMgr.h" @@ -52,7 +53,7 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, ITEM_INFO item; switch (message) { - case 31: { + case UM_ADDITEM: { const int itemId = static_cast(a); this->itemIds.push_back(itemId); @@ -63,20 +64,20 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } - case 18: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); return 0; - case 19: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { const int response = static_cast(a); this->RecordResponse(response, b, c, this->m_list->selected); switch (response) { - case 184: { + case ID_OK: { if (g_replayAnimationScaling) { this->m_list->selected = static_cast(d); this->m_list->Invalidate(); @@ -112,7 +113,7 @@ int UIMakeTargetListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } break; } - case 185: { + case ID_CANCEL: { ITEM_INFO materials[3]; g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast(materials), 0, 0); g_windowMgr.CloseWindow(79); diff --git a/Source/UI/Items/UIMakeTargetProcessWnd.cpp b/Source/UI/Items/UIMakeTargetProcessWnd.cpp index 1c38203ac..5a7e26a41 100644 --- a/Source/UI/Items/UIMakeTargetProcessWnd.cpp +++ b/Source/UI/Items/UIMakeTargetProcessWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UIMakeTargetProcessWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeDragState.h" #include "Client/Mode/ModeMgr.h" @@ -172,12 +173,12 @@ void UIMakeTargetProcessWnd::OnLBtnDown(int x, int y) { // FUNCTION: fn_13617 int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 40: + case UM_SETCURITEM: this->makeType = static_cast(a); this->Invalidate(); return 0; - case 75: { + case UM_CLEAR_ITEM: { const char* name = reinterpret_cast(a); for (int index = 2; index >= 0; --index) { ITEM_INFO& material = this->materials[index]; @@ -192,17 +193,17 @@ int UIMakeTargetProcessWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } - case 6: { + case UM_COMMAND: { const int response = static_cast(a); this->RecordResponse(response, b, c, d); switch (response) { - case 184: + case ID_OK: g_modeMgr.GetGameMode()->SendMsg(130, this->makeType, reinterpret_cast(this->materials), 0, 0); g_windowMgr.CloseWindow(80); return 0; - case 185: { + case ID_CANCEL: { g_modeMgr.GetGameMode()->SendMsg(130, 0, reinterpret_cast(this->materials), 0, 0); bool restored = false; for (int index = 0; index < 3; ++index) { diff --git a/Source/UI/Items/UISwapEquipmentWnd.cpp b/Source/UI/Items/UISwapEquipmentWnd.cpp index 2370bf913..9e37bde48 100644 --- a/Source/UI/Items/UISwapEquipmentWnd.cpp +++ b/Source/UI/Items/UISwapEquipmentWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UISwapEquipmentWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/CGameMode.h" @@ -189,15 +190,15 @@ void UISwapEquipmentWnd::OnRBtnDown(int x, int y) { // FUNCTION: fn_10401 int UISwapEquipmentWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 0xB9: + case ID_CANCEL: g_session.m_swapEquipmentMode = 0; if (g_windowMgr.unknown_01E0) { g_windowMgr.unknown_01E0->SendMsg(nullptr, 6, 0x1FC, 0, 0, 0); } break; - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x128); return 1; case 0x1FC: @@ -219,7 +220,7 @@ int UISwapEquipmentWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg return 1; } break; - case 60: + case UM_REFRESH: this->Invalidate(); this->InvalidateChildren(); return 1; diff --git a/Source/UI/Items/UIWeaponRefineWnd.cpp b/Source/UI/Items/UIWeaponRefineWnd.cpp index 7f9d2f676..8e1b27b4d 100644 --- a/Source/UI/Items/UIWeaponRefineWnd.cpp +++ b/Source/UI/Items/UIWeaponRefineWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Items/UIWeaponRefineWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/ModeMgr.h" @@ -69,7 +70,7 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s ITEM_INFO item; switch (message) { - case 31: { + case UM_ADDITEM: { const int itemId = static_cast(a); this->itemIds.push_back(itemId); this->indices.push_back(b); @@ -81,20 +82,20 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } - case 18: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); return 0; - case 19: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); return 0; - case 6: { + case UM_COMMAND: { const int response = static_cast(a); this->RecordResponse(response, b, c, this->m_list->selected); switch (response) { - case 184: { + case ID_OK: { if (g_replayAnimationScaling) { this->m_list->selected = static_cast(d); this->m_list->Invalidate(); @@ -116,7 +117,7 @@ int UIWeaponRefineWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } break; } - case 185: + case ID_CANCEL: g_modeMgr.gameMode->SendMsg(182, -1, 0, 0, 0); g_windowMgr.CloseWindow(111); return 0; diff --git a/Source/UI/Lists/UIComboBox.cpp b/Source/UI/Lists/UIComboBox.cpp index c09568c3d..cd7a5df15 100644 --- a/Source/UI/Lists/UIComboBox.cpp +++ b/Source/UI/Lists/UIComboBox.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Lists/UIComboBox.h" #include "UI/Lists/UIListBoxID.h" #include "UI/Lists/UIScrollBar.h" @@ -11,7 +12,7 @@ int UIComboBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, const int value = static_cast(argument1); switch (message) { - case 0: + case UM_DEFPUSH: if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); } @@ -21,7 +22,7 @@ int UIComboBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } return 0; - case 18: + case UM_UPPUSH: if (this->lines.size() == 0) { return 0; } @@ -36,7 +37,7 @@ int UIComboBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } break; - case 19: + case UM_DOWNPUSH: if (this->lines.size() == 0) { return 0; } @@ -55,14 +56,14 @@ int UIComboBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } break; - case 31: + case UM_ADDITEM: this->AddLine(reinterpret_cast(argument1)); this->Invalidate(); return 0; - case 83: + case UM_SET_CALLER_WID: this->targetId = value; return 0; - case 40: + case UM_SETCURITEM: this->selected = value; if (value < 0) { this->selected = 0; @@ -88,7 +89,7 @@ int UIComboBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 const int value = static_cast(argument1); switch (message) { - case 0: + case UM_DEFPUSH: if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { int extra = 0; const auto found = this->unknown_00C4.find(this->selected); @@ -106,7 +107,7 @@ int UIComboBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } return 0; - case 18: + case UM_UPPUSH: if (this->lines.size() == 0) { return 0; } @@ -121,7 +122,7 @@ int UIComboBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } break; - case 19: + case UM_DOWNPUSH: if (this->lines.size() == 0) { return 0; } @@ -140,14 +141,14 @@ int UIComboBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } break; - case 31: + case UM_ADDITEM: this->AddLine(reinterpret_cast(argument1), static_cast(argument2), static_cast(argument3)); this->Invalidate(); return 0; - case 83: + case UM_SET_CALLER_WID: this->targetId = value; return 0; - case 40: + case UM_SETCURITEM: this->selected = value; if (value < 0) { this->selected = 0; diff --git a/Source/UI/Lists/UIComboBoxDefWnd.cpp b/Source/UI/Lists/UIComboBoxDefWnd.cpp index f6c291093..b1abd079f 100644 --- a/Source/UI/Lists/UIComboBoxDefWnd.cpp +++ b/Source/UI/Lists/UIComboBoxDefWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Replay.h" #include "UI/Window/WindowPolicy.h" #include "Render/DeviceContext/DeviceContext.h" @@ -166,7 +167,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st const int value = static_cast(a); switch (message) { - case 6: + case UM_COMMAND: if (value == 273) { this->expanded = this->expanded == 0; this->Resize( @@ -185,7 +186,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } return 0; - case 39: + case UM_COMBOBOX_SELECTED: if (g_windowMgr.WindowPolicy(3, this->parent->geometry.id) == 0 || value < 0) { return 0; @@ -195,7 +196,7 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st this->SendMsg(nullptr, 6, 273, 0, 0, 0); this->parent->SendMsg(this, 39, value, 0, 0, 0); return 0; - case 57: + case UM_CHANGEMSG: if (value >= 0) { this->label->SetText(this->list->lines[value].text.c_str(), 0); this->Invalidate(); @@ -213,7 +214,7 @@ int UIItemStoreComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t const int value = static_cast(a); switch (message) { - case 6: + case UM_COMMAND: if (value == 273) { this->expanded = this->expanded == 0; @@ -237,7 +238,7 @@ int UIItemStoreComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } return 0; - case 39: + case UM_COMBOBOX_SELECTED: if (value < 0) { return 0; } diff --git a/Source/UI/Lists/UIComboBoxEx.cpp b/Source/UI/Lists/UIComboBoxEx.cpp index 9e6643770..24d440da9 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/UIEnums.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -137,7 +138,7 @@ void UIComboBoxEx::Refresh() { // FUNCTION: fn_11545 int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0: + case UM_DEFPUSH: if (UIWindow* target = g_windowMgr.LookupWindow(this->targetId)) { target->SendMsg(nullptr, 39, this->selected, 0, 0, 0); } @@ -148,7 +149,7 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i return 0; - case 18: + case UM_UPPUSH: if (this->lines.size() == 0) { return 0; } @@ -165,7 +166,7 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i break; - case 19: { + case UM_DOWNPUSH: { const unsigned count = static_cast(this->lines.size()); if (count == 0) { @@ -189,16 +190,16 @@ int UIComboBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i break; } - case 31: + case UM_ADDITEM: this->AddLine(reinterpret_cast(a), static_cast(b)); this->Invalidate(); return 0; - case 83: + case UM_SET_CALLER_WID: this->targetId = static_cast(a); return 0; - case 40: + case UM_SETCURITEM: this->selected = static_cast(a); if (this->selected < 0) { diff --git a/Source/UI/Lists/UIListBox.cpp b/Source/UI/Lists/UIListBox.cpp index a24dc282e..ca7d5f4a7 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/UIEnums.h" #include "Render/DeviceContext/DeviceContext.h" #include "Render/Text/TextContext.h" #include "Resource/Bitmap/BitmapResource.h" @@ -352,8 +353,8 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s const int value = static_cast(argument1); switch (message) { - case 19: - case 40: { + case UM_DOWNPUSH: + case UM_SETCURITEM: { this->selected = message == 19 ? (this->selected + 1) : value; if (message == 40 && this->selected < 0) { @@ -384,7 +385,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s break; } - case 18: + case UM_UPPUSH: this->selected = (this->selected - 1); if (this->selected < 0) { @@ -397,9 +398,9 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + 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; @@ -426,9 +427,9 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s return (this->topLine - previous); } - case 8: - case 11: - case 12: { + case UM_SCROLLHORZ: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; const int delta = message == 11 ? -15 : message == 12 ? 15 : value; this->horizontalOffset = (previous + delta); @@ -454,7 +455,7 @@ int UIListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, s return (this->horizontalOffset - previous); } - case 98: + case UM_TEXT_LBTN_UP: if (argument3 > 0) { if (UIWindow* window = g_windowMgr.LookupWindow(12)) { window->SendMsg(nullptr, 24, argument3, 0, 0, 0); diff --git a/Source/UI/Lists/UIListBoxEx.cpp b/Source/UI/Lists/UIListBoxEx.cpp index 866c9f0d8..656558b03 100644 --- a/Source/UI/Lists/UIListBoxEx.cpp +++ b/Source/UI/Lists/UIListBoxEx.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DeviceContext.h" +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/SkinPalette.h" @@ -186,7 +187,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in const int value = static_cast(a); switch (message) { - case 40: + case UM_SETCURITEM: this->selected = value; if (this->selected < 0) { @@ -207,7 +208,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in break; - case 18: + case UM_UPPUSH: if (--this->selected < 0) { this->selected = 0; } @@ -218,7 +219,7 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in break; - case 19: + case UM_DOWNPUSH: ++this->selected; if (static_cast(this->selected) > this->lines.size() - 1) { @@ -231,9 +232,9 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + 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; @@ -263,9 +264,9 @@ int UIListBoxEx::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in return (this->topLine - previous); } - case 8: - case 11: - case 12: { + case UM_SCROLLHORZ: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; const int delta = message == 11 ? -15 : message == 12 ? 15 : value; this->horizontalOffset = previous + delta; diff --git a/Source/UI/Lists/UIListBoxID.cpp b/Source/UI/Lists/UIListBoxID.cpp index 7795a27e6..017a5c14b 100644 --- a/Source/UI/Lists/UIListBoxID.cpp +++ b/Source/UI/Lists/UIListBoxID.cpp @@ -1,4 +1,5 @@ #include "UI/Lists/UIListBoxID.h" +#include "UI/Window/UIEnums.h" #include "UI/Lists/UIScrollBar.h" @@ -61,7 +62,7 @@ void UIComboBoxID::OnCreate(int width, int height) { // FUNCTION: fn_11554 int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 40: + case UM_SETCURITEM: this->selected = argument1; if (this->selected < 0) { this->selected = 0; @@ -78,7 +79,7 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Invalidate(); this->Refresh(); return 0; - case 18: + case UM_UPPUSH: --this->selected; if (this->selected < 0) { this->selected = 0; @@ -89,7 +90,7 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Invalidate(); this->Refresh(); return 0; - case 19: + case UM_DOWNPUSH: ++this->selected; if (static_cast(this->selected) > this->lines.size() - 1) { this->selected = static_cast(this->lines.size() - 1); @@ -100,9 +101,9 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Invalidate(); this->Refresh(); return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; if (message == 9) { this->topLine = previous - this->geometry.height / this->lineHeight + 1; @@ -129,9 +130,9 @@ int UIListBoxID::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } return this->topLine - previous; } - case 8: - case 11: - case 12: { + case UM_SCROLLHORZ: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int previous = this->horizontalOffset; int delta = argument1; if (message == 11) { diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index ee1146b88..db6a52fa9 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -1,4 +1,5 @@ #include "Network/TextEncoding.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/FontCache.h" #include "Client/Mode/ModeMgr.h" #include "Render/DeviceContext/DeviceContext.h" @@ -248,40 +249,40 @@ void UIScrollBar::OnLBtnDown(int x, int y) { switch (this->vertical) { case 0: switch (part) { - case 0: + case SB_UPBTN: this->parent->SendMsg(this, 8, -this->horizontalStep, 0, 0, 0); break; - case 1: + case SB_UPPAGE: this->parent->SendMsg(this, 11, 0, 0, 0, 0); break; - case 2: + case SB_THUMB: g_windowMgr.SetCapture(this); this->state = 6; break; - case 3: + case SB_DNPAGE: this->parent->SendMsg(this, 12, 0, 0, 0, 0); break; - case 4: + case SB_DNBTN: this->parent->SendMsg(this, 8, this->horizontalStep, 0, 0, 0); break; } break; case 1: switch (part) { - case 0: + case SB_UPBTN: this->parent->SendMsg(this, 7, -this->verticalStep, 0, 0, 0); break; - case 1: + case SB_UPPAGE: this->parent->SendMsg(this, 9, 0, 0, 0, 0); break; - case 2: + case SB_THUMB: g_windowMgr.SetCapture(this); this->state = 6; break; - case 3: + case SB_DNPAGE: this->parent->SendMsg(this, 10, 0, 0, 0, 0); break; - case 4: + case SB_DNBTN: this->parent->SendMsg(this, 7, this->verticalStep, 0, 0, 0); break; } @@ -318,18 +319,18 @@ void UIScrollBar::OnMouseMove(int x, int y) { const int previous = this->state; switch (this->Part(x, y)) { - case -1: - case 1: - case 3: + case SB_NULL: + case SB_UPPAGE: + case SB_DNPAGE: this->state = 0; break; - case 0: + case SB_UPBTN: this->state = 1; break; - case 2: + case SB_THUMB: this->state = 3; break; - case 4: + case SB_DNBTN: this->state = 2; break; default: @@ -1469,14 +1470,14 @@ void UIChatHisBox::Paint() { // FUNCTION: fn_11563 int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0: + case UM_DEFPUSH: if (sender == this->edit && this->editNode) { this->SendMsg(nullptr, 110, 0, 1, 0, 0); } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { this->HideNodes(this->root->children); const int previous = this->unknown_00A8; const int visible = this->geometry.height / this->itemHeight; @@ -1505,25 +1506,25 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } return this->unknown_00A8 - previous; } - case 18: + case UM_UPPUSH: if (this->verticalOverflow) { this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); } break; - case 19: + case UM_DOWNPUSH: if (this->verticalOverflow) { this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); } break; - case 97: + 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); } break; - case 98: - case 99: - case 100: + case UM_TEXT_LBTN_UP: + case UM_TEXT_RBTN_UP: + case UM_BMP_LBTN_UP: this->unknown_008C = nullptr; this->unknown_0090 = nullptr; this->unknown_0088 = reinterpret_cast(a); @@ -1561,14 +1562,14 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->unknown_008C = nullptr; this->unknown_0090 = nullptr; break; - case 107: + case UM_BEGIN_DRAG_BTN: this->unknown_008C = reinterpret_cast(a); this->unknown_0088 = reinterpret_cast(a); if (this->unknown_008C->draggable == 0) { this->unknown_008C = nullptr; } break; - case 108: + case UM_MOUSE_HOVER_BTN: g_modeMgr.gameMode->SetCursorAction(0); if (this->unknown_008C && this->unknown_008C->id != a) { UITreeNode* target = reinterpret_cast(a); @@ -1580,7 +1581,7 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->Invalidate(); } break; - case 109: + case UM_END_DRAG_BTN: if (sender == this->parent) { this->unknown_0090 = nullptr; } @@ -1616,7 +1617,7 @@ int UITreeView::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->unknown_0090 = nullptr; this->Invalidate(); break; - case 110: + case UM_CHANGE_TVITEM_TEXT: if (b == 0) { this->editNode = reinterpret_cast(a); this->edit->maximum = c > 361 ? 361 : static_cast(c); diff --git a/Source/UI/Lists/UITagListBox.cpp b/Source/UI/Lists/UITagListBox.cpp index e36e07408..cad622df4 100644 --- a/Source/UI/Lists/UITagListBox.cpp +++ b/Source/UI/Lists/UITagListBox.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Lists/UITagListBox.h" #include "Client/Input/InputCharset.h" @@ -320,27 +321,27 @@ int UITagListBox::DecodeCards(std::vector& fields, const char* text, int& p // FUNCTION: fn_13887 int UITagListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 18: + case UM_UPPUSH: if (this->verticalOverflow) { this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); return 0; } break; - case 19: + case UM_DOWNPUSH: if (this->verticalOverflow) { this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); return 0; } break; - case 29: + case UM_SETTEXT: this->AppendText(argument1, argument2, argument3, argument4); return 0; - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: { + case UM_SCROLLVERT: + case UM_SCROLLHORZ: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { UIListBox::SendMsg(sender, message, argument1, argument2, argument3, argument4); const int offset = this->horizontalOffset; for (unsigned int index = 0; index < this->m_tagWindows.size(); ++index) { @@ -357,7 +358,7 @@ int UITagListBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } break; } - case 98: + case UM_TEXT_LBTN_UP: this->OnTagClick(argument1, sender); break; default: diff --git a/Source/UI/Menu/UIMenuIconWnd.cpp b/Source/UI/Menu/UIMenuIconWnd.cpp index 14c3e3c72..d598efa85 100644 --- a/Source/UI/Menu/UIMenuIconWnd.cpp +++ b/Source/UI/Menu/UIMenuIconWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Renderer.h" +#include "UI/Window/UIEnums.h" #include "UI/Menu/UIMenuIconWnd.h" #include "Client/Application/ApplicationWindow.h" @@ -137,9 +138,9 @@ void UIMenuIconWnd::OnCreate(int width, int height) { this->unknown_00B4[ids[index]] = icon; switch (ids[index]) { - case 192: - case 194: - case 196: + case ID_STATUS: + case ID_ITEMS: + case ID_SKILL: case 473: case 476: { UIMenuIcon* badge = new UIMenuIcon(); @@ -242,30 +243,30 @@ void UIMenuIcon::OnMouseMove(int x, int y) { int message = 4698; bool known = true; switch (this->geometry.id) { - case 192: + case ID_STATUS: behaviorId = 11; message = 105; break; case 193: message = 265; break; - case 194: + case ID_ITEMS: behaviorId = 8; message = 106; break; - case 195: + case ID_EQUIP: behaviorId = 10; message = 104; break; - case 196: + case ID_SKILL: behaviorId = 37; message = 283; break; - case 199: + case ID_FRIEND: behaviorId = 69; message = 103; break; - case 219: + case ID_MAP: behaviorId = 140; message = 2859; break; @@ -363,7 +364,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (message == 6) { if (!Replay::Instance().AllowsEvent(argument1)) { switch (argument1) { - case 201: + case ID_CLOSE: g_session.m_showMenuIcon = false; this->Invalidate(); break; @@ -380,19 +381,19 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->Invalidate(); break; } - case 192: + case ID_STATUS: this->ToggleWindow(11); break; - case 195: + case ID_EQUIP: this->ToggleWindow(10); break; - case 194: + case ID_ITEMS: this->ToggleWindow(8); break; - case 196: + case ID_SKILL: this->ToggleWindow(37); break; - case 199: + case ID_FRIEND: this->ToggleWindow(69); break; case 373: @@ -401,7 +402,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument case 361: this->ToggleWindow(10008); break; - case 219: + case ID_MAP: this->ToggleWindow(140); break; case 430: diff --git a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp index a3be38359..fca2b2866 100644 --- a/Source/UI/Party/UIAdvenPartyBoardWnd.cpp +++ b/Source/UI/Party/UIAdvenPartyBoardWnd.cpp @@ -1,4 +1,5 @@ #include "Contents/MessageTable.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Language.h" #include "Contents/Party/AdventurerAgencyMgr.h" #include "Contents/UserData/NormalItemSlots.h" @@ -464,7 +465,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a const int value = static_cast(a); switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { @@ -473,18 +474,18 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->Move(this->saved->x, this->saved->y); return 0; - case 60: + case UM_REFRESH: this->RefreshRows(); return 0; case 165: this->UpdatePagination(); return 0; - case 6: + case UM_COMMAND: switch (value) { - case 363: + case ID_RESET: this->ResetSearch(); break; - case 246: + case ID_PREV: this->page = (this->page - 1); if (this->searching == 1) { @@ -494,7 +495,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } break; - case 218: + case ID_NEXT: this->page = (this->page + 1); DisableButton(this->previous, 1); this->previous->Invalidate(); @@ -511,7 +512,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a case 365: this->Search(static_cast(c)); break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(324); break; case 379: { @@ -571,7 +572,7 @@ int UIAdvenPartyBoardWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->types) { this->selectedType = value; } diff --git a/Source/UI/Party/UIApplyForPartyWnd.cpp b/Source/UI/Party/UIApplyForPartyWnd.cpp index b3acb4bd1..bb6150b6e 100644 --- a/Source/UI/Party/UIApplyForPartyWnd.cpp +++ b/Source/UI/Party/UIApplyForPartyWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Session.h" +#include "UI/Window/UIEnums.h" #include "File/ShortcutFilename.h" #include "Render/Renderer.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -151,9 +152,9 @@ void UIApplyForPartyWnd::OnMouseHover(int x, int y) { // FUNCTION: fn_09313 int UIApplyForPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (static_cast(a)) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(345); break; case 271: @@ -176,7 +177,7 @@ int UIApplyForPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index e3cd2bc0c..16e13e0ca 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Party/UIMiniPartyWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/Mouse.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -156,7 +157,7 @@ void UIMiniPartyInfoWnd::OnRBtnUp(int, int) { // FUNCTION: fn_07735 int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 23: { + case UM_REFRESHITEM: { if (this->m_owner->GetMember().valid && !this->m_owner->GetMember().valid) { return 0; } @@ -196,7 +197,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->m_gauge->SetValues(current, maximum); return 0; } - case 49: + case UM_MAKEMENU: this->m_entries.clear(); if (g_windowMgr.unknown_0210) { g_windowMgr.CloseWindow(18); @@ -240,7 +241,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg return 0; } return 0; - case 48: + case UM_MENU_SELECTED: if (!this->m_owner->GetMember().valid) { return 0; } @@ -249,26 +250,26 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg return 0; } switch (this->m_entries[argument1].value) { - case 6: + case MENUID_SEND_MSG: this->SendMsg(nullptr, 6, 231, 0, 0, 0); return 0; - case 7: + case MENUID_TALKONLYTWO: this->SendMsg(nullptr, 6, 232, 0, 0, 0); return 0; - case 3: + case MENUID_QUERYINFO: this->SendMsg(nullptr, 6, 233, 0, 0, 0); return 0; - case 0: + case MENUID_EXPEL: case 19: this->SendMsg(nullptr, 6, 235, 0, 0, 0); return 0; - case 9: + case MENUID_LEAVE: this->SendMsg(nullptr, 6, 236, 0, 0, 0); return 0; - case 20: + case MENUID_MAKE_WHISPER_WINDOW: this->SendMsg(nullptr, 71, 0, 0, 0, 0); return 0; - case 5: + 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); return 0; @@ -302,15 +303,15 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } return 0; - case 6: + case UM_COMMAND: switch (argument1) { - case 231: + case ID_SENDMSG: if (!g_session.m_lockMouse) { this->m_owner->GetMember(); return 0; } break; - case 232: + case ID_TALK: if (!g_session.m_lockMouse) { if (this->m_owner->GetMember().valid && !(this->m_owner->GetMember().name == g_session.DecodePlayerName())) { const char* group; @@ -327,13 +328,13 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } } break; - case 233: + case ID_FRIEND_INFO: if (!g_session.m_lockMouse && this->m_owner->GetMember().valid) { g_windowMgr.Confirm(LookupMessage(191), 0, true, false, 0, "Message", 280, 120, 0); return 0; } break; - case 234: + case ID_PARTY_SETTING: if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { g_windowMgr.CloseWindow(208); @@ -352,7 +353,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } } break; - case 235: + case ID_DELETE_FRIEND: 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) { @@ -362,7 +363,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } } break; - case 236: + case ID_LEAVE: 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) { @@ -427,7 +428,7 @@ void UIMiniPartyWnd::OnLBtnUp(int x, int y) { // FUNCTION: fn_07744 int UIMiniPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 23: { + case UM_REFRESHITEM: { const MessengerMember* member = reinterpret_cast(argument1); if (member && member->valid) { this->m_member = *member; @@ -437,13 +438,13 @@ int UIMiniPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } return 0; } - case 6: + case UM_COMMAND: if (argument1 == 34 && this->m_member.accountId == static_cast(argument2) && this->m_member.offline == 0 && this->m_infoWnd) { this->m_infoWnd->SendMsg(sender, message, 34, argument2, argument3, argument4); this->InvalidateChildren(); } return 0; - case 14: { + case UM_RESIZE: { if (argument1 != 7) { return 0; } @@ -504,10 +505,10 @@ int UIMiniPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } return 0; } - case 48: + case UM_MENU_SELECTED: this->m_infoWnd->SendMsg(sender, message, argument1, argument2, argument3, argument4); return 0; - case 49: + case UM_MAKEMENU: if (this->m_infoWnd) { this->m_infoWnd->SendMsg(sender, message, argument1, argument2, argument3, argument4); } diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index affb2516e..ca7f391d9 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIWindowMgr.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Contents/MessageTable.h" #include "Resource/TextureNames.h" @@ -255,13 +256,13 @@ void UIRegisterPartyWnd::Paint() { // FUNCTION: fn_09314 int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->types) { this->selectedType = static_cast(a); } return 0; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { @@ -270,9 +271,9 @@ int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: break; case 564: case 565: diff --git a/Source/UI/Party/UIRequestJoinPartyWnd.cpp b/Source/UI/Party/UIRequestJoinPartyWnd.cpp index e2318a039..e61cd5c9f 100644 --- a/Source/UI/Party/UIRequestJoinPartyWnd.cpp +++ b/Source/UI/Party/UIRequestJoinPartyWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/MessageTable.h" #include "Client/Mode/ModeEvents.h" @@ -97,9 +98,9 @@ void UIRequestJoinPartyWnd::Paint() { // FUNCTION: fn_09315 int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: this->SendMsg(nullptr, 6, 542, 0, 0, 0); break; case 541: @@ -119,7 +120,7 @@ int UIRequestJoinPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } return 0; - case 56: { + case UM_SET_JOIN_PARTY_MSG: { const auto& request = *reinterpret_cast(a); this->characterId = request.characterId; this->level = request.job; diff --git a/Source/UI/Quest/UIQuestDisplay.cpp b/Source/UI/Quest/UIQuestDisplay.cpp index 3a0d4b603..fc39bde00 100644 --- a/Source/UI/Quest/UIQuestDisplay.cpp +++ b/Source/UI/Quest/UIQuestDisplay.cpp @@ -1,4 +1,5 @@ #include "UI/Chat/UINewChatWnd.h" +#include "UI/Window/UIEnums.h" #include "UI/Quest/UIQuestDisplay.h" #include "Client/Input/Mouse.h" #include "Contents/MessageTable.h" @@ -209,7 +210,7 @@ void UIQuestDisplay::StoreInfo() { // FUNCTION: fn_12947 int UIQuestDisplay::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: { + case UM_SETINFO: { this->m_visibleSetting = reinterpret_cast(argument1); QuestDisplayInfo* info = reinterpret_cast(argument1); if (!info->IsValid()) { @@ -218,7 +219,7 @@ int UIQuestDisplay::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->Show(*this->m_visibleSetting); break; } - case 48: { + case UM_MENU_SELECTED: { int index = 0; const auto end = g_renewQuestMgr->m_ongoingQuests.end(); for (auto it = g_renewQuestMgr->m_ongoingQuests.begin(); it != end; ++it, ++index) { @@ -242,7 +243,7 @@ int UIQuestDisplay::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } break; } - case 49: { + case UM_MAKEMENU: { this->m_menuItems.clear(); if (g_windowMgr.unknown_0210 != 0) { this->Show(0); diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index 0a2cd2d72..6eafee936 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -1,4 +1,5 @@ #include "UI/Quest/UIRenewQuestUI.h" +#include "UI/Window/UIEnums.h" #include "Utility/EncryptedName.h" #include "Client/Replay.h" #include "Contents/MessageTable.h" @@ -1082,7 +1083,7 @@ void RenewQuestUI::CUIQuestItem::SetSelected(bool selected) { // FUNCTION: fn_16632 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 6: + case UM_COMMAND: if (a == 0xD5) { const bool checked = b != 0; this->checkBox->checked = checked; @@ -1093,7 +1094,7 @@ int CUIRenewQuestUI::SendMsg(UIWindow* sender, int message, std::intptr_t a, std } } break; - case 0x16: + case UM_TAB: this->tab->SelectIndex(static_cast(std::log2(static_cast(a)))); break; } diff --git a/Source/UI/Quest/UIRenewQuestWnd.cpp b/Source/UI/Quest/UIRenewQuestWnd.cpp index d497bf6d7..5c817c793 100644 --- a/Source/UI/Quest/UIRenewQuestWnd.cpp +++ b/Source/UI/Quest/UIRenewQuestWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/DeviceContext/DCSurface.h" @@ -252,12 +253,12 @@ void UIOngoingQuestScrollWnd::RefreshHuntTexts() { int UIOngoingQuestScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 0xC9) { g_windowMgr.CloseWindow(0x142); } break; - case 0x17: + case UM_REFRESHITEM: this->RefreshHuntTexts(); break; } @@ -635,12 +636,12 @@ void UIRenewDetailQuestInfoWnd::OnLBtnDown(int x, int y) { int UIRenewDetailQuestInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 0xC9) { g_windowMgr.CloseWindow(0x142); } return 0; - case 0x17: + case UM_REFRESHITEM: if (this->m_recommended) { this->m_recommendedWnd->SendMsg(this, 0x17, 0, 0, 0, 0); } else { @@ -1061,12 +1062,12 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x141); return 0; - case 0xD5: + case ID_CHECK: if (g_windowMgr.window_0428) { g_windowMgr.window_0428->Show(argument2); return 0; @@ -1110,7 +1111,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume break; } break; - case 0x16: + case UM_TAB: if (this->m_tab != argument1) { this->m_tab = argument1; if (argument1 < 0) { @@ -1156,7 +1157,7 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Invalidate(); } break; - case 0x17: + case UM_REFRESHITEM: if (argument2 != 0) { bool found = false; for (int tab = 0; tab <= 2; ++tab) { @@ -1176,9 +1177,9 @@ int UIRenewQuestWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->UpdateScroll(); this->Invalidate(); break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; int delta = argument1; if (message == 9) { diff --git a/Source/UI/Rodex/UIRodexComposeWnd.cpp b/Source/UI/Rodex/UIRodexComposeWnd.cpp index 0f7db7763..22ee316f3 100644 --- a/Source/UI/Rodex/UIRodexComposeWnd.cpp +++ b/Source/UI/Rodex/UIRodexComposeWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Rodex/UIRodexComposeWnd.h" #include "Client/Mode/CMode.h" @@ -311,7 +312,7 @@ std::int64_t UIRodexComposeWnd::GetZeny() { // FUNCTION: fn_10013 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 6: + case UM_COMMAND: if (argument1 == 201) { g_windowMgr.CloseWindow(264); } else if (argument1 == 213) { @@ -404,7 +405,7 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu g_modeMgr.GetGameMode()->SendMsg(0xC0, reinterpret_cast(&mail), 0, 0, 0); } return 0; - case 23: + case UM_REFRESHITEM: this->m_items.clear(); for (int i = 0; i < 5; ++i) { ITEM_INFO item = g_session.GetItem5C68(i); @@ -414,13 +415,13 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } this->Invalidate(); return 0; - case 38: { + 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); return 0; } - case 98: + case UM_TEXT_LBTN_UP: if (argument3 > 0) { UIWindow* window = g_windowMgr.EnsureWindow(12); if (window) { @@ -428,7 +429,7 @@ int UIRodexComposeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } } return 0; - case 104: { + 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); diff --git a/Source/UI/Rodex/UIRodexInboxWnd.cpp b/Source/UI/Rodex/UIRodexInboxWnd.cpp index ef1b6ab7e..de2e69b66 100644 --- a/Source/UI/Rodex/UIRodexInboxWnd.cpp +++ b/Source/UI/Rodex/UIRodexInboxWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Rodex/UIRodexInboxWnd.h" +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "Client/Mode/CGameMode.h" @@ -880,9 +881,9 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 0xD7: + case ID_RADIOBTN: if (argument2 == 0x141) { for (int i = 0; i < 2; ++i) { UIRadioBtn* radio = this->unknown_01C0[i]; @@ -972,11 +973,11 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x107); break; - case 0xD3: + case ID_DELETE: if (this->unknown_01D4 == 1) { std::vector selected; for (int i = 0; i < 6; ++i) { @@ -1034,7 +1035,7 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; - case 0x141: + case ID_SEARCH: if (this->unknown_01C0[0]->geometry.unknown_0030 == 1) { this->SearchByTitle(this->unknown_01C8->Text()); } else if (this->unknown_01C0[1]->geometry.unknown_0030 == 1) { @@ -1197,11 +1198,11 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; - case 0x3C: + case UM_REFRESH: this->Invalidate(); break; - case 0x62: + case UM_TEXT_LBTN_UP: if (argument1 == 0x142) { if (g_rodexMailStore->unknown_0010 == MAIL_INBOX_NORMAL) { std::map::iterator mail = g_rodexMailStore->m_mails0.find(argument2); @@ -1224,14 +1225,14 @@ int UIRodexInboxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } break; - case 0x17: + case UM_REFRESHITEM: this->RefreshMailLists(); this->InitializeMailActions(); this->SetButtonsDisabled(0); this->Invalidate(); break; - case 0: + case UM_DEFPUSH: if (this->unknown_01C8 == sender) { this->SendMsg(this->unknown_01CC, 6, 0x141, 0, 0, 0); } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index a69675190..e826f84e8 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Contents/Items/RuneSystem.h" #include "Contents/MessageTable.h" @@ -520,7 +521,7 @@ void UIRuneSet_Info::UpdateActivation() { // FUNCTION: fn_10221 int UIRuneSetList::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 0x3C: + case UM_REFRESH: if (argument1 > 0 && this->total != argument1) { this->SetRange(std::max(argument1 - this->visible, 0), this->visible, argument1); this->SetPosition(0); @@ -541,7 +542,7 @@ int UIRuneSetReWard::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 0x22: + case UM_SETINFO: if (static_cast(argument1) <= 2 && argument2) { this->m_texts[argument1] = reinterpret_cast(argument2); } @@ -572,15 +573,15 @@ int UIRuneSetReWard::SendMsg( // FUNCTION: fn_10224 int UIRuneSystemTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 0x4E: + case UM_SET_BITMAP: this->m_label = reinterpret_cast(argument1); this->Invalidate(); return 0; - case 0x16: + case UM_TAB: this->m_count = argument1; this->Invalidate(); return 0; - case 0x0D: + case UM_SETSTATE: this->geometry.unknown_0030 = argument1; this->Invalidate(); this->parent->SendMsg(this, 0x16, this->geometry.unknown_0030, 0, 0, 0); @@ -594,14 +595,14 @@ int UIRuneSystemTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, st // FUNCTION: fn_10227 int UIRuneSystem_tagListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t, std::intptr_t) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 0x13C: + case ID_PREV_PAGE: --this->m_firstTag; this->m_firstTag = this->m_firstTag < 0 ? 0 : this->m_firstTag; this->Invalidate(); break; - case 0x13D: { + case ID_NEXT_PAGE: { ++this->m_firstTag; const int first = this->m_firstTag; if (g_runeSystemMgr->GetTagCount() < first + 10) { @@ -906,12 +907,12 @@ void UIRuneSystemWnd::SelectTab() { // FUNCTION: fn_10229 int UIRune_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 0x23C && (!this->parent || this->parent->SendMsg(this, 0x6A, 3000, 0, 0, 0) != 0) && this->m_rune) { g_runeSystemMgr->SendRequest(0xBCE, this->m_rune, -1); } [[fallthrough]]; - case 0x3C: + case UM_REFRESH: this->m_activeWnd->Invalidate(); this->m_activateButton->Invalidate(); reinterpret_cast(this)->UpdateActivation(); @@ -1023,7 +1024,7 @@ void UIRuneSystemWnd::Paint() { // FUNCTION: fn_10226 int UIRuneSystem_DecomResultWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 0x0D: { + case UM_SETSTATE: { const RuneDecomResultPacket* packet = reinterpret_cast(argument1); this->m_total = 0; for (int index = 0; index < 8; ++index) { @@ -1034,7 +1035,7 @@ int UIRuneSystem_DecomResultWnd::SendMsg(UIWindow*, int message, std::intptr_t a this->Invalidate(); break; } - case 6: + case UM_COMMAND: if (argument1 == 0xB8) { g_windowMgr.CloseWindow(0x16A); } @@ -1586,7 +1587,7 @@ UIRune_Info::UIRune_Info() : UIWindow(0), m_rune(nullptr) { // FUNCTION: fn_10223 int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0x16: + case UM_TAB: if (!this->m_runeSet) { break; } @@ -1598,12 +1599,12 @@ int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } this->Refresh(); break; - case 0x3C: + case UM_REFRESH: this->Refresh(); break; - case 6: + case UM_COMMAND: switch (argument1) { - case 0xC3: + case ID_EQUIP: if (this->m_runeSet && (!this->parent || this->parent->SendMsg(this, 0x6A, 1500, 0, 0, 0) != 0)) { this->parent->SendMsg(this, 0xAB, 0xC3, reinterpret_cast(this->m_runeSet), 0, 0); } @@ -1642,9 +1643,9 @@ int UIRuneSet_Info::SendMsg(UIWindow* sender, int message, std::intptr_t argumen break; } break; - case 7: - case 9: - case 10: + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: this->m_infoList->ScrollBy(argument1); this->Invalidate(); break; @@ -2198,24 +2199,24 @@ void UIRune_Decom::Paint() { // FUNCTION: fn_10225 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 6: + case UM_COMMAND: if (argument1 == 0xC9) { g_windowMgr.CloseWindow(0x169); } break; - case 7: - case 9: - case 10: + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: if (this->m_lists[this->m_tab->geometry.unknown_0030]) { this->m_lists[this->m_tab->geometry.unknown_0030]->ScrollBy(argument1); this->Invalidate(); } break; - case 0x16: + case UM_TAB: g_windowMgr.CloseWindow(0x16A); this->SelectTab(); break; - case 0x3C: { + case UM_REFRESH: { UIRuneSetList* list = this->m_lists[this->m_tab->geometry.unknown_0030]; if (!list) { break; diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index 5a0b4cd55..9151950ad 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Window/UINewSelectCharWnd.h" #include "Client/Session.h" #include "Contents/UserData/NormalItemSlots.h" @@ -553,15 +554,15 @@ void UISeekPartyMBWnd::StoreInfo() { // FUNCTION: fn_12757 int UISeekPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 201: { + case ID_CLOSE: { std::int16_t packetType = 0x806; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packetType), &packetType); g_windowMgr.CloseWindow(170); break; } - case 202: + case ID_MINI: if (this->m_minimized) { this->Resize(this->geometry.width, this->unknown_01E0); } else { @@ -581,7 +582,7 @@ int UISeekPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen 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/Shortcuts/ShortcutDrop.cpp b/Source/UI/Shortcuts/ShortcutDrop.cpp index d9888d301..fb2f1893a 100644 --- a/Source/UI/Shortcuts/ShortcutDrop.cpp +++ b/Source/UI/Shortcuts/ShortcutDrop.cpp @@ -1,3 +1,4 @@ +#include "Contents/Items/ItemType.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/ModeDragState.h" @@ -138,10 +139,10 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } switch (item.unknown_0000[0]) { - case 3: - case 10: - case 16: - case 17: + case TYPE_EVENT: + case TYPE_ARROW: + case TYPE_AMMO: + case TYPE_THROWWEAPON: case 19: { const int column = grid.HitTest(x, y, g_session.ItemSlotActive(), g_session.m_hotkeyPage); if (column != -1 && 9 * grid.rows <= 9 * g_session.m_hotkeyPage + column) { @@ -160,24 +161,24 @@ void UIShortCutWnd::DragAndDrop(int x, int y, std::intptr_t argument) { } switch (item.unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: if (item.unknown_0000[2] == 0) { break; } - case 0: - case 1: - case 2: - case 10: - case 16: - case 17: + case TYPE_HEAL: + case TYPE_SCHANGE: + case TYPE_SPECIAL: + case TYPE_ARROW: + case TYPE_AMMO: + case TYPE_THROWWEAPON: case 19: { const int column = grid.HitTest(x, y, g_session.ItemSlotActive(), g_session.m_hotkeyPage); if (column != -1) { @@ -277,24 +278,24 @@ void UIQuickSlotWnd::DragAndDrop(int x, int y, std::intptr_t argument) { ITEM_INFO item = LookupClientItemByIdentity(g_session.m_inventoryItems, value.id); if (item.unknown_0000[1] != 0 && item.identified != 0) { switch (item.unknown_0000[0]) { - case 4: - case 5: - case 8: - case 9: - case 11: - case 12: - case 13: - case 14: - case 15: + case TYPE_ARMOR: + case TYPE_WEAPON: + case TYPE_BOW: + case TYPE_BOTHHAND: + case TYPE_ARMORTM: + case TYPE_ARMORTB: + case TYPE_ARMORMB: + case TYPE_ARMORTMB: + case TYPE_GUN: if (item.unknown_0000[2] == 0) { break; } - case 0: - case 1: - case 2: - case 10: - case 16: - case 17: + case TYPE_HEAL: + case TYPE_SCHANGE: + case TYPE_SPECIAL: + case TYPE_ARROW: + case TYPE_AMMO: + case TYPE_THROWWEAPON: case 19: { const int slot = this->SlotAt(x, y); if (slot != -1) { diff --git a/Source/UI/Shortcuts/ShortcutVisibility.cpp b/Source/UI/Shortcuts/ShortcutVisibility.cpp index a404aaa83..f589ef48b 100644 --- a/Source/UI/Shortcuts/ShortcutVisibility.cpp +++ b/Source/UI/Shortcuts/ShortcutVisibility.cpp @@ -1,4 +1,5 @@ #include "Client/Replay.h" +#include "UI/Window/WindowId.h" #include "Contents/Configuration/ServiceOptions.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" @@ -44,7 +45,7 @@ namespace { // FUNCTION: fn_17269 bool UIWindowMgr::ShowWindowById(int id, int visible) { switch (id) { - case 1: { + case WID_CHATWND: { if (g_replayAnimationScaling && !Replay::Instance().header.options.recordRestricted) { return false; } @@ -67,7 +68,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return true; } - case 15: + case WID_ITEMDROPCNTWND: g_windowMgr.EnsureWindow(15); if (this->window_01EC->geometry.visible != visible) { @@ -80,7 +81,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return false; - case 36: + case WID_SHORTCUTWND: if (g_replayAnimationScaling && !Replay::Instance().header.options.unknown_0007) { return false; } @@ -107,7 +108,7 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return true; - case 46: { + case WID_SKILLDESCRIBEWND: { this->unknown_0048 = visible; if (!this->window_0230) { @@ -134,11 +135,11 @@ bool UIWindowMgr::ShowWindowById(int id, int visible) { return true; } - case 273: + case WID_MINIMAPWND: g_windowMgr.LookupWindow(273)->Show(visible); return true; - case 276: + case WID_ROUNDBOXTOOLTIPWND: this->visible_276 = visible; if (!this->window_4F1E4) { diff --git a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp index 3cf15d721..e284fea7a 100644 --- a/Source/UI/Shortcuts/UIQuickSlotWnd.cpp +++ b/Source/UI/Shortcuts/UIQuickSlotWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Shortcuts/UIQuickSlotWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CMode.h" @@ -187,7 +188,7 @@ UIQuickSlotWnd::UIQuickSlotWnd() // FUNCTION: fn_12752 int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 23: { + case UM_REFRESHITEM: { const NormalItemSlot* saved = &g_session.unknown_06EB; for (int index = 0; index < 2; ++index) { const NormalItemSlot source = saved[index]; @@ -241,7 +242,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen return 0; } - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(argument1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); @@ -250,7 +251,7 @@ int UIQuickSlotWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->Move(this->m_saved->x, this->m_saved->y); return 0; - case 41: { + case UM_USE_SHORTEN_ITEM: { const QuickSlotEntry entry = this->m_entries[argument1]; if (entry.skill == 0) { if (entry.id == 0) { diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index ca5629d80..de4e00db6 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -1,3 +1,5 @@ +#include "Contents/Items/ItemType.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Client/Input/Mouse.h" #include "Client/Mode/ModeDragState.h" @@ -157,7 +159,7 @@ void UIShortCutWnd::OnLBtnUp(int x, int y) { // INLINED __forceinline void UIShortCutWnd::ClickControl(int id) { switch (id) { - case 217: + case ID_MINUS: if (this->m_grid.rows > 1) { --this->m_grid.rows; } @@ -165,7 +167,7 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { this->SendMsg(nullptr, 14, 0, 0, 0, 0); return; - case 216: + case ID_PLUS: if (this->geometry.visible == 0) { g_windowMgr.ShowWindowById(36, 1); return; @@ -180,7 +182,7 @@ __forceinline void UIShortCutWnd::ClickControl(int id) { this->SendMsg(nullptr, 14, 0, 0, 0, 0); return; - case 201: + case ID_CLOSE: g_windowMgr.ShowWindowById(36, 0); return; @@ -352,16 +354,16 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { CMode* mode = g_modeMgr.GetGameMode(); switch (item.unknown_0000[0]) { - case 0: - case 1: - case 2: + case TYPE_HEAL: + 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); } break; - case 18: + case TYPE_CASH_POINT_ITEM: if (*reinterpret_cast(&g_session.unknown_16F4[4]) >= 0) { const int result = g_windowMgr.Confirm(FormatOwnedString(LookupMessage(1226), item.DisplayName(0).c_str()).c_str(), 2, false, false, 0, "Message", 280, 120, 0); @@ -372,9 +374,9 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { break; - case 10: - case 16: - case 17: + case TYPE_ARROW: + case TYPE_AMMO: + case TYPE_THROWWEAPON: case 19: if (item.unknown_0000[3] == 0x8000) { mode->SendMsg(87, item.unknown_0000[1], item.unknown_0000[2], 0, 0); @@ -395,11 +397,11 @@ __forceinline void UseShortcutSlot(const NormalItemSlot& slot) { // FUNCTION: fn_12760 int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 41: + case UM_USE_SHORTEN_ITEM: UseShortcutSlot(*this->m_slots[a + 9 * b]); return 0; - case 23: { + case UM_REFRESHITEM: { const int bank = g_session.GetOption(10); std::list& cooldowns = g_session.m_requestTimers; for (int index = 0; index < 36; ++index) { @@ -452,15 +454,15 @@ int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } - case 34: + case UM_SETINFO: this->RestoreLayout(reinterpret_cast(a)); return 0; - case 6: + case UM_COMMAND: this->ClickControl(static_cast(a)); return 0; - case 14: + case UM_RESIZE: this->ResizeRows(); return 0; @@ -874,7 +876,7 @@ int UISubChatMiniWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st case 197: this->Move(b, c - this->m_offsetY); break; - case 202: + case ID_MINI: this->OnLBtnDown(this->m_rowHeight * b + 1, 0); break; } @@ -1029,16 +1031,16 @@ void UIMemorialDunWnd::ArrangeButtons() { // FUNCTION: fn_12747 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 0: { + case UM_DEFPUSH: { this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); return 0; } - case 6: { + case UM_COMMAND: { switch (argument1) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(137); return 0; - case 185: { + case ID_CANCEL: { MemorialDungeonCommandPacket packet; packet.id = 0x2CF; if (g_session.unknown_5948 == 0) { @@ -1049,13 +1051,13 @@ int UIMemorialDunWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum GetRagConnection().Send(g_packetLengths.FixedLength(packet.id), &packet); return 0; } - case 201: + case ID_CLOSE: this->Show(0); if (g_session.unknown_5948 == 2) { g_session.unknown_593C = 0; } return 0; - case 211: + case ID_DELETE: if (g_session.unknown_5464 != 0) { g_modeMgr.GetGameMode()->SendMsg(0x132, 0, 0, 0, 0); } @@ -1063,7 +1065,7 @@ int UIMemorialDunWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } return 0; } - case 0x3C: { + case UM_REFRESH: { this->ArrangeButtons(); return 0; } @@ -1179,7 +1181,7 @@ void UISubChatHisWnd::Resize(int width, int height) { // FUNCTION: fn_12761 int UISubChatHisWnd::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: if (sender == this->m_edit && this->m_edit->geometry.x != -100) { std::string local(this->m_edit->Text()); const int previousWidth = this->m_inputWidth; @@ -1224,27 +1226,27 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } return 0; - case 3: + case UM_PAGEUPPUSH: if (this->m_chatBox->verticalOverflow != 0) { this->m_chatBox->SendMsg(nullptr, 9, 0, 0, 0, 0); return 0; } return 0; - case 4: + case UM_PAGEDOWNPUSH: if (this->m_chatBox->verticalOverflow != 0) { this->m_chatBox->SendMsg(nullptr, 10, 0, 0, 0, 0); return 0; } return 0; - case 6: + case UM_COMMAND: switch (argument1) { - case 0xC1: + case ID_OPTION: if (UIWindow* window = g_windowMgr.EnsureWindow(0x84)) { window->SendMsg(this, 6, 0xC1, this->m_index, 0, 0); return 0; } return 0; - case 0xCA: { + case ID_MINI: { std::map& names = g_session.m_subChatWnds; const auto found = names.find(this->m_index); if (found == names.end()) { @@ -1278,10 +1280,10 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } return 0; } - case 0x15B: + case ID_NAME: g_windowMgr.SelectWhisperName(reinterpret_cast(argument2)); return 0; - case 0x165: + case ID_STICK_ON: if (ChatWindow() != nullptr) { ChatWindow()->SendMsg(this, 0x76, 0, 0, 0, 0); return 0; @@ -1290,7 +1292,7 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume default: return 0; } - case 0xE: + case UM_RESIZE: if (g_session.m_canDragWnd != 0 && argument1 == 7) { int width = static_cast(argument2); int height = static_cast(argument3); @@ -1316,7 +1318,7 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } return 0; - case 0x22: { + case UM_SETINFO: { this->m_saved = reinterpret_cast(argument1); if (this->m_saved->IsValid() == 0) { this->m_saved->Reset(this->geometry.id); @@ -1325,7 +1327,7 @@ int UISubChatHisWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->Resize(this->m_saved->width, this->m_saved->height); return 0; } - case 0x25: { + case UM_ADDCHAT: { char detail[25]; std::memset(detail, 0, sizeof(detail)); if (argument3 != 0) { diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index a1866e797..e8ddfffd0 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Replay.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/WindowPolicy.h" #include "UI/Window/UINewSelectCharWnd.h" #include "Client/Mode/ModeMgr.h" @@ -381,7 +382,7 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } } else { switch (argument1) { - case 201: + case ID_CLOSE: if (g_windowMgr.Confirm(LookupMessage(2816), 2, false, false, 0, "Message", 280, 120, 0) != 188) { for (int i = 0; i < 2; ++i) { if (sender == this->unknown_0094[i]) { @@ -395,7 +396,7 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 this->Invalidate(); } break; - case 204: + case ID_SLOT: if (this->geometry.visible) { this->m_selectedSlot = argument2 / (this->geometry.width / 2); } @@ -418,8 +419,8 @@ int UIMyStyleWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } this->Invalidate(); break; - case 226: - case 227: + case ID_RIGHT: + 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); @@ -1102,26 +1103,26 @@ int UIDisplayCharacter::SendMsg(UIWindow* sender, int message, std::intptr_t arg } switch (argument1) { - case 185: + case ID_CANCEL: this->LoadSessionStyle(); break; - case 226: + case ID_RIGHT: if (this->unknown_0084 > 0) { --this->unknown_0084; } else { this->unknown_0084 = 7; } break; - case 227: + case ID_LEFT: this->unknown_0084 = this->unknown_0084 < 7 ? this->unknown_0084 + 1 : 0; break; - case 354: + case ID_PREVIEW: this->SelectPreviousStyle(this->GetStyleTable(3).c_str(), &this->unknown_0098); break; - case 355: + case ID_NEXTVIEW: this->SelectNextStyle(this->GetStyleTable(3).c_str(), &this->unknown_0098); break; - case 356: + case ID_BOOKMARK: if (this->m_favoriteButton->m_argument == 0) { if (shop->AddToMyStyle() == true) { g_windowMgr.Confirm(LookupMessage(2819), 0, true, false, 0, "Message", 280, 120, 0); @@ -1342,7 +1343,7 @@ int UIAccessoryShowCase::SendMsg(UIWindow* sender, int message, std::intptr_t ar char table[64]; UIWindow* shop = g_windowMgr.LookupWindow(281); switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 189 && sender) { UIAccBitmapButton* button = static_cast(sender); for (unsigned int i = 0; i < this->m_itemFrames.size(); ++i) { @@ -1373,7 +1374,7 @@ int UIAccessoryShowCase::SendMsg(UIWindow* sender, int message, std::intptr_t ar } break; - case 101: + case UM_BMP_RBTN_UP: if (sender) { UIAccBitmapButton* button = static_cast(sender); memset(table, 0, sizeof(table)); @@ -1418,7 +1419,7 @@ int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } switch (argument1) { - case 200: + case ID_BASE: case 496: case 497: case 498: @@ -1454,10 +1455,10 @@ int UIStylingShopWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum this->Invalidate(); } break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(281); break; - case 224: + case ID_BUY: if (this->m_buyButton->Argument() == 0 && g_windowMgr.Confirm(LookupMessage(2818), 2, false, false, 0, "Message", 280, 120, 0) != 188) { for (std::map::iterator it = this->m_tabs.begin(); it != this->m_tabs.end(); ++it) { diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index abb3e6be0..f87e83fac 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -1,4 +1,5 @@ #include "Script/LuaScript.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Items/ItemInfo.h" @@ -850,9 +851,9 @@ int UIAchSummaryWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, st // FUNCTION: fn_09246 int UIAchTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 7: - case 9: - case 10: + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: break; default: return 0; @@ -902,7 +903,7 @@ int UIAchUpperWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument // FUNCTION: fn_09248 int UIAchViewWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 474) { PACKET_CZ_REQ_ACH_REWARD packet; packet.packetType = ID_CZ_REQ_ACH_REWARD; @@ -1136,14 +1137,14 @@ void UIAchTracingWnd::Paint() { // FUNCTION: fn_09270 int UIAchTracingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: + case UM_SETINFO: this->info = reinterpret_cast(argument1); if (!this->info->IsValid()) { this->info->Reset(); } this->Move(this->info->x, this->info->y); break; - case 98: + case UM_TEXT_LBTN_UP: switch (argument1) { case 478: { auto it = std::find_if(g_achievementTracking.begin(), g_achievementTracking.end(), [argument2](AchTracingEntry entry) { @@ -1241,7 +1242,7 @@ void UIAchSummaryWnd::OnCreate(int, int) { // FUNCTION: fn_09244 int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 6: + case UM_COMMAND: if (g_session.ToggleTrackedAchievement(this->ids[this->unknown_008C + argument1])) { UIWindow* window = g_windowMgr.EnsureWindow(271); if (window) { @@ -1249,9 +1250,9 @@ int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: } } break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_008C; if (message == 9) { this->unknown_008C = previous - this->rowCount + 1; @@ -1279,7 +1280,7 @@ int UIAchListWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: // FUNCTION: fn_09249 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 6: + case UM_COMMAND: if (argument1 == 201) { g_windowMgr.CloseWindow(270); this->Invalidate(); @@ -1287,7 +1288,7 @@ int UIAchievementWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } break; - case 22: + case UM_TAB: if (argument1 == -1 && argument2 == -1) { this->SelectTab(this->group, this->sub); this->Invalidate(); @@ -1314,7 +1315,7 @@ int UIAchievementWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; } - case 60: { + case UM_REFRESH: { this->view->UpdateInfo(); this->summary->UpdateInfo(); diff --git a/Source/UI/Text/UITagTextViewer.cpp b/Source/UI/Text/UITagTextViewer.cpp index 05be39a6d..4336c809b 100644 --- a/Source/UI/Text/UITagTextViewer.cpp +++ b/Source/UI/Text/UITagTextViewer.cpp @@ -1,4 +1,5 @@ #include "UI/Text/UITagTextViewer.h" +#include "UI/Window/UIEnums.h" #include @@ -137,15 +138,15 @@ int TagTextViewer::UIScroll::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 0x12: + case UM_UPPUSH: this->SendMsg(this->m_scrollBar, 9, 0, 0, 0, 0); break; - case 0x13: + case UM_DOWNPUSH: this->SendMsg(this->m_scrollBar, 10, 0, 0, 0, 0); break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollPos; int delta = argument1; if (message == 9) { @@ -169,12 +170,12 @@ int UITagTextViewer::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 0x1D: + case UM_SETTEXT: if (argument1 != 0) { this->AddText(std::string(reinterpret_cast(argument1))); } break; - case 0x62: + case UM_TEXT_LBTN_UP: switch (argument1) { case LINE_SEGMENT_URL: OpenTextButtonLink(static_cast(sender)); @@ -193,12 +194,12 @@ int UITagTextViewer::SendMsg( break; } break; - case 0x3C: + case UM_REFRESH: this->Layout(); break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollPos; if (message == 9) { this->m_scrollPos = previous - 30; diff --git a/Source/UI/Text/UITextViewer.cpp b/Source/UI/Text/UITextViewer.cpp index 10102b90a..c6c09ca1d 100644 --- a/Source/UI/Text/UITextViewer.cpp +++ b/Source/UI/Text/UITextViewer.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DeviceContext.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -278,21 +279,21 @@ void UIItemTagOnMegaPhone::AddTagButton(UIWindow* button) { // FUNCTION: fn_11561 int UITextViewEX::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 18: + case UM_UPPUSH: if (this->verticalOverflow != 0) { this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); } return 0; - case 19: + case UM_DOWNPUSH: if (this->verticalOverflow != 0) { this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->topLine; if (message == 9) { this->topLine = previous - this->geometry.height / this->lineHeight + 1; @@ -322,7 +323,7 @@ int UITextViewEX::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return this->topLine - previous; } - case 29: { + case UM_SETTEXT: { std::string text(reinterpret_cast(argument1)); for (UIWindow* link : this->extraLinks) { this->RemoveChild(link, 1); diff --git a/Source/UI/Text/UITextViewerMessages.cpp b/Source/UI/Text/UITextViewerMessages.cpp index 61311d56d..6a459f358 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/UIEnums.h" #include "Client/Application/ApplicationWindow.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -207,21 +208,21 @@ __forceinline void UITextViewer::AppendText(char* text, int width, int carriageR // FUNCTION: fn_11562 int UITextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 18: + case UM_UPPUSH: if (this->verticalOverflow != 0) { this->SendMsg(this->verticalBar, 7, -1, 0, 0, 0); } return 0; - case 19: + case UM_DOWNPUSH: if (this->verticalOverflow != 0) { this->SendMsg(this->verticalBar, 7, 1, 0, 0, 0); } return 0; - case 29: + case UM_SETTEXT: { char* text = reinterpret_cast(argument1); const int width = static_cast(argument2); @@ -290,12 +291,12 @@ int UITextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; } - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: { + case UM_SCROLLVERT: + case UM_SCROLLHORZ: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int previousX = this->horizontalOffset; UIListBox::SendMsg(sender, message, argument1, argument2, argument3, argument4); @@ -319,7 +320,7 @@ int UITextViewer::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 return 0; } - case 98: + case UM_TEXT_LBTN_UP: { auto* button = static_cast(sender); const int id = static_cast(argument1); diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index 18ac7c4ba..c694e20b4 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIBartermarketWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/CMode.h" @@ -487,7 +488,7 @@ void UIExpandedBartermarketWnd::UpdateScrollBar() { // FUNCTION: fn_10598 int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); std::pair found = g_expandedBarterMarketItemMgr->FindItem(mode->drag.unknown_03B0); if (!found.first) { @@ -578,7 +579,7 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: return 0; } - case 6: { + case UM_COMMAND: { CMode* mode = g_modeMgr.GetGameMode(); if (a == 184) { if (this->Purchase()) { @@ -593,7 +594,7 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: return 0; } - case 14: { + case UM_RESIZE: { if (a != 3) { return 0; } @@ -621,9 +622,9 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: return 0; } - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; if (message == 9) { this->unknown_00C4 = previous - this->rowCount + 1; @@ -641,7 +642,7 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: return this->unknown_00C4 - previous; } - case 23: { + case UM_REFRESHITEM: { this->Entries().erase(this->Entries().begin(), this->Entries().end()); std::vector* entries = g_expandedBarterMarketItemMgr->GetEntries(); for (std::vector::iterator it = entries->begin(); it != entries->end(); ++it) { @@ -661,7 +662,7 @@ int UIExpandedBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std: // FUNCTION: fn_10599 int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); std::pair found = g_expandedBarterMarketItemMgr->FindEntry(mode->drag.unknown_03B0); if (found.first) { @@ -674,7 +675,7 @@ int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intpt return 0; } - case 14: { + case UM_RESIZE: { if (a != 7) { return 0; } @@ -705,9 +706,9 @@ int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intpt return 0; } - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; if (message == 9) { this->unknown_00C4 = previous - this->rowCount + 1; @@ -725,7 +726,7 @@ int UIExpandedBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intpt return this->unknown_00C4 - previous; } - case 23: { + case UM_REFRESHITEM: { this->Entries().clear(); std::vector* items = g_expandedBarterMarketItemMgr->GetItems(); for (std::vector::iterator it = items->begin(); it != items->end(); ++it) { @@ -1245,7 +1246,7 @@ void UIBarterItemPurchaseWnd::OnCreate(int width, int height) { // FUNCTION: fn_10563 int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: { + case UM_SETINFO: { this->saved = reinterpret_cast(a); if (!this->saved) { return 0; @@ -1258,7 +1259,7 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (!mode) { return 0; @@ -1330,7 +1331,7 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - case 6: { + case UM_COMMAND: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (!mode) { return 0; @@ -1350,7 +1351,7 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - case 14: { + case UM_RESIZE: { if (a != 3) { return 0; } @@ -1387,7 +1388,7 @@ int UIBarterItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_ return 0; } - case 23: { + case UM_REFRESHITEM: { this->items.clear(); std::list* items = g_barterMarketItemMgr->GetAllItems(); for (std::list::iterator it = items->begin(); it != items->end(); ++it) { @@ -1451,7 +1452,7 @@ void UIExpandedBarterItemPurchaseWnd::OnCreate(int width, int height) { // FUNCTION: fn_10564 int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: { + case UM_SETINFO: { this->saved = reinterpret_cast(a); if (a == 0) { return 0; @@ -1464,7 +1465,7 @@ int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } - case 38: { + case UM_DROP: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); if (!mode) { return 0; @@ -1487,7 +1488,7 @@ int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } - case 14: { + case UM_RESIZE: { if (a == 7) { int width = b <= 320 ? static_cast(b) : 320; int height = c <= 336 ? static_cast(c) : 336; @@ -1516,7 +1517,7 @@ int UIBartermarketWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } - case 23: { + case UM_REFRESHITEM: { this->items.clear(); std::list* items = g_barterMarketItemMgr->GetItems(); for (std::list::iterator it = items->begin(); it != items->end(); ++it) { diff --git a/Source/UI/UICaptchaRegisterWnd.cpp b/Source/UI/UICaptchaRegisterWnd.cpp index 074aa539f..d370bb840 100644 --- a/Source/UI/UICaptchaRegisterWnd.cpp +++ b/Source/UI/UICaptchaRegisterWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UICaptchaRegisterWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Application/Launcher.h" #include "Client/Input/InputCharset.h" @@ -114,7 +115,7 @@ int UICaptchaRegisterWnd::SendMsg( UIWindow* sender, int message, std::intptr_t a1, std::intptr_t a2, std::intptr_t a3, std::intptr_t a4 ) { switch (message) { - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->m_fileComboBox) { this->m_selectedFile = this->m_fileComboBox->GetSelectedText(); if (!this->m_selectedFile.empty()) { @@ -150,7 +151,7 @@ int UICaptchaRegisterWnd::SendMsg( } } break; - case 6: + case UM_COMMAND: switch (a1) { case 345: if (this->m_editCtrl->Length() < 4) { @@ -177,7 +178,7 @@ int UICaptchaRegisterWnd::SendMsg( } } break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(284); break; } diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index a636ccb28..47b1f4026 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/UIChangeMaterialWnd.h" #include "Client/Mode/CMode.h" @@ -359,20 +360,20 @@ int UIChangeMaterialWnd::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: 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); } break; - case 6: + case UM_COMMAND: switch (argument1) { - case 0xb8: + case ID_OK: this->SendChangeMaterial(); break; - case 0xc9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x158); break; - case 0x141: + case ID_SEARCH: this->unknown_00B4->SendMsg(nullptr, 6, 0x141, reinterpret_cast(this->unknown_00B8->Text()), 0, 0); break; case 0x16c: @@ -385,13 +386,13 @@ int UIChangeMaterialWnd::SendMsg( break; } break; - case 0x12: + case UM_UPPUSH: this->unknown_00B4->SendMsg(nullptr, 0x12, 0, 0, 0, 0); break; - case 0x13: + case UM_DOWNPUSH: this->unknown_00B4->SendMsg(nullptr, 0x13, 0, 0, 0, 0); break; - case 0x17: + case UM_REFRESHITEM: if (argument1 != 0) { auto* entry = reinterpret_cast(argument1); this->m_materials.clear(); @@ -442,24 +443,24 @@ int UIChangeMaterialWnd_List::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 0x17: + case UM_REFRESHITEM: this->RefreshVisibleEntries(); break; - case 0x12: + case UM_UPPUSH: this->ShiftSelectedIndex(1); break; - case 0x13: + case UM_DOWNPUSH: this->SelectNextItem(1); break; - case 3: + case UM_PAGEUPPUSH: this->ShiftSelectedIndex(this->m_pageSize); break; - case 4: + case UM_PAGEDOWNPUSH: this->SelectNextItem(this->m_pageSize); break; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scrollOffset; int delta = static_cast(argument1); if (message == 9) { @@ -473,7 +474,7 @@ int UIChangeMaterialWnd_List::SendMsg( } return this->m_scrollOffset - previous; } - case 6: + case UM_COMMAND: if (argument1 == 0x141 && argument2 != 0) { std::string filter(reinterpret_cast(argument2)); if (filter.compare(LookupMessage(0xec0)) == 0) { diff --git a/Source/UI/UICheckAttendanceWnd.cpp b/Source/UI/UICheckAttendanceWnd.cpp index ec922fed2..c67048c71 100644 --- a/Source/UI/UICheckAttendanceWnd.cpp +++ b/Source/UI/UICheckAttendanceWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/UICheckAttendanceWnd.h" @@ -365,7 +366,7 @@ void UICheckAttendanceWnd_Banner::CreateButtons() { // FUNCTION: fn_09651 int UICheckAttendanceWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: + case UM_SETINFO: if (g_session.m_hotkeyScript->Call("set_checkAttendance_banner", "") == true) { this->m_banner->CreateButtons(); } @@ -383,15 +384,15 @@ int UICheckAttendanceWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->m_blinking = this->m_checkedDays < this->m_rewardCount && this->m_blinking; this->Invalidate(); break; - case 6: + case UM_COMMAND: switch (argument1) { - case 184: + case ID_OK: if (this->m_blinking) { CheckAttendanceRequestPacket packet = {0xAEF}; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); } break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(328); break; } diff --git a/Source/UI/UIGradeEnchantWnd.cpp b/Source/UI/UIGradeEnchantWnd.cpp index aff38a54a..fd17261bf 100644 --- a/Source/UI/UIGradeEnchantWnd.cpp +++ b/Source/UI/UIGradeEnchantWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Shop/ItemDrawing.h" @@ -507,9 +508,9 @@ int UIGradeEnchantWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 184: + case ID_OK: if (this->unknown_0220 != 1 && this->item.unknown_0000[1] > 0 && this->selectedMaterial != -1) { const int quantity = LookupClientItem(g_session.m_inventoryItems, this->materials[this->selectedMaterial].itemId, 0).quantity; if (quantity >= this->materials[this->selectedMaterial].amount && g_session.m_zeny >= this->SelectedMaterialZeny()) { @@ -529,21 +530,21 @@ int UIGradeEnchantWnd::SendMsg( } } break; - case 185: - case 201: { + case ID_CANCEL: + case ID_CLOSE: { GradeEnchantClosePacket packet; packet.id = 0xB5C; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.id), &packet); g_windowMgr.CloseWindow(343); break; } - case 279: + case ID_UP: if (this->info.unknown_0000 > 0 && this->unknown_0114 < this->info.unknown_0008 * this->info.unknown_0004 && LookupClientItem(g_session.m_inventoryItems, this->info.unknown_0000, 0).quantity >= this->unknown_0114 + this->info.unknown_0004) { this->unknown_0114 += this->info.unknown_0004; } break; - case 280: + case ID_DOWN: if (this->info.unknown_0000 > 0 && this->unknown_0114 > 0) { this->unknown_0114 -= this->info.unknown_0004; } @@ -553,7 +554,7 @@ int UIGradeEnchantWnd::SendMsg( break; } break; - case 23: + case UM_REFRESHITEM: 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) { diff --git a/Source/UI/UIHotkeyGuideWnd.cpp b/Source/UI/UIHotkeyGuideWnd.cpp index aee29098f..ec8bbbe65 100644 --- a/Source/UI/UIHotkeyGuideWnd.cpp +++ b/Source/UI/UIHotkeyGuideWnd.cpp @@ -1,4 +1,5 @@ #include "Script/LuaScript.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "UI/Window/UIWindowMgr.h" #include "UI/UIHotkeyGuideWnd.h" @@ -297,7 +298,7 @@ int UIHotkeyGuideWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } } [[fallthrough]]; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(303); } } diff --git a/Source/UI/UIItemReformWnd.cpp b/Source/UI/UIItemReformWnd.cpp index 7c95d22ee..b1a948f61 100644 --- a/Source/UI/UIItemReformWnd.cpp +++ b/Source/UI/UIItemReformWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIItemReformWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Input/Mouse.h" @@ -442,16 +443,16 @@ int UIItemReformWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 23: + case UM_REFRESHITEM: this->reformItem.SetItemId(argument1); if (this->list->SendMsg(this, 23, argument1, 0, 0, 0) == -1) { this->warning = LookupMessage(3856); } this->Invalidate(); break; - case 6: + case UM_COMMAND: switch (argument1) { - case 184: + case ID_OK: if (this->selectedItem && this->reformItem.GetItemId() != 0) { PACKET_CZ_ITEM_REFORM packet; packet.packetType = ID_CZ_ITEM_REFORM; @@ -460,7 +461,7 @@ int UIItemReformWnd::SendMsg( GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.packetType), &packet); } break; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(348); break; case 336: @@ -491,9 +492,9 @@ int UIItemReformWnd_List::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const unsigned int previous = this->scrollPosition; if (message == 9) { argument1 = -1; @@ -506,7 +507,7 @@ int UIItemReformWnd_List::SendMsg( } return this->scrollPosition - previous; } - case 23: { + case UM_REFRESHITEM: { this->items.clear(); std::vector baseItems = CItemReformMgr::Instance()->GetReformBaseItems(argument1); for (std::vector::iterator base = baseItems.begin(); base != baseItems.end(); ++base) { diff --git a/Source/UI/UILapineBoxWnd.cpp b/Source/UI/UILapineBoxWnd.cpp index d135cc1ff..3c4a9bcef 100644 --- a/Source/UI/UILapineBoxWnd.cpp +++ b/Source/UI/UILapineBoxWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UILapineScrollBar.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -335,7 +336,7 @@ void UILapineBox_IngredientListWnd::OnWheel(int argument) { // FUNCTION: fn_04172 int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { case 0xC9: g_windowMgr.CloseWindow(0x122); @@ -384,7 +385,7 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } break; - case 0x68: { + case UM_DECITEM: { const auto found = std::find_if(this->items.begin(), this->items.end(), [a](ITEM_INFO item) { return a == item.unknown_0000[1]; }); if (found != this->items.end()) { @@ -399,7 +400,7 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } break; } - case 0x6F: + case UM_RECEIVE_MSG: this->noticeTick = timeGetTime(); this->notice = reinterpret_cast(a); this->Invalidate(); @@ -415,7 +416,7 @@ int UILapineBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0x17: + case UM_REFRESHITEM: for (std::vector::iterator material = this->materials.begin(); material != this->materials.end(); ++material) { std::vector ids = g_session.FindInventoryIndicesByItemId(std::atoi(material->itemId.c_str()), 1); for (std::vector::iterator id = ids.begin(); id != ids.end(); ++id) { @@ -432,7 +433,7 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i this->SendMsg(this, 0x57, 0, 0, 0, 0); break; - case 6: + case UM_COMMAND: for (std::vector::iterator it = this->items.begin(); it != this->items.end(); ++it) { UIIngredientInfoWnd* entry = *it; if (sender != entry) { @@ -443,7 +444,7 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i this->Invalidate(); break; - case 0x68: { + case UM_DECITEM: { std::vector::iterator it; for (it = this->items.begin(); it != this->items.end(); ++it) { if (static_cast(a) == (*it)->item.unknown_0000[1]) { @@ -490,7 +491,7 @@ int UILapineBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::i break; } - case 0x57: { + case UM_SETPOS: { int y = 7; for (std::vector::iterator it = this->items.begin(); it != this->items.end();) { UIIngredientInfoWnd* entry = *it; diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index f1fbd0c98..0ca3e26c7 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UINewSelectCharWnd.h" #include "UI/UILapineUpgradeBoxWnd.h" @@ -324,7 +325,7 @@ void UILapineUpgradeBox_IngredientListWnd::DragAndDrop(int x, int y, std::intptr int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: for (auto it = this->items.begin(); it != this->items.end(); ++it) { UILapineUpgradeBox_IngredientInfoWnd* entry = *it; if (sender != entry) { @@ -335,7 +336,7 @@ int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, this->Invalidate(); break; - case 0x17: + case UM_REFRESHITEM: for (auto material = this->materials.begin(); material != this->materials.end(); ++material) { std::vector identities = g_session.FindInventoryIndicesByItemId(std::atoi(material->itemId.c_str()), 1); for (auto identity = identities.begin(); identity != identities.end(); ++identity) { @@ -351,11 +352,11 @@ int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, this->SendMsg(this, 0x57, 0, 0, 0, 0); break; - case 0x1F: + case UM_ADDITEM: this->parent->SendMsg(this, 0x68, a, 0, 0, 0); break; - case 0x57: { + case UM_SETPOS: { int y = 7; for (auto it = this->items.begin(); it != this->items.end();) { if ((*it)->geometry.visible == 0) { @@ -373,7 +374,7 @@ int UILapineUpgradeBox_IngredientListWnd::SendMsg(UIWindow* sender, int message, break; } - case 0x68: + case UM_DECITEM: this->parent->SendMsg(this, 0x1F, a, 0, 0, 0); break; } @@ -605,12 +606,12 @@ bool UILapineUpgradeBox_IngredientListWnd::CanUseIngredient(std::uint32_t identi // FUNCTION: fn_04215 int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 23: + case UM_REFRESHITEM: this->SetIngredient(static_cast(a)); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(302); return 0; case 505: { @@ -637,7 +638,7 @@ int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t break; } break; - case 31: + case UM_ADDITEM: if (this->item.unknown_0000[1] == 0 && this->ingredientList->CanUseIngredient(static_cast(a)) == 1) { ITEM_INFO owned = LookupClientItemByIdentity(g_session.m_inventoryItems, static_cast(a)); if (owned.unknown_0000[1] != 0) { @@ -661,7 +662,7 @@ int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 104: + 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); @@ -670,7 +671,7 @@ int UILapineUpgradeBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t return 0; } break; - case 111: + case UM_RECEIVE_MSG: this->noticeTick = timeGetTime(); this->notice = reinterpret_cast(a); this->Invalidate(); diff --git a/Source/UI/UIMacroBlackListCheckWnd.cpp b/Source/UI/UIMacroBlackListCheckWnd.cpp index 9a327179a..c4703385d 100644 --- a/Source/UI/UIMacroBlackListCheckWnd.cpp +++ b/Source/UI/UIMacroBlackListCheckWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIMacroBlackListCheckWnd.h" +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "UI/Buttons/UIBitmapButton.h" @@ -198,7 +199,7 @@ int UIMacroBlackListCheckWnd::SendMsg( } switch (argument1) { - case 184: + case ID_OK: if (static_cast(this->inputLength - 4) <= 4) { MacroBlackListCheckPacket packet; packet.id = 0x0BDC; @@ -209,7 +210,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 293: + case ID_STORE_PASSWORD_NUM0: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '0'; @@ -217,7 +218,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 294: + case ID_STORE_PASSWORD_NUM1: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '1'; @@ -225,7 +226,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 295: + case ID_STORE_PASSWORD_NUM2: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '2'; @@ -233,7 +234,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 296: + case ID_STORE_PASSWORD_NUM3: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '3'; @@ -241,7 +242,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 297: + case ID_STORE_PASSWORD_NUM4: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '4'; @@ -249,7 +250,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 298: + case ID_STORE_PASSWORD_NUM5: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '5'; @@ -257,7 +258,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 299: + case ID_STORE_PASSWORD_NUM6: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '6'; @@ -265,7 +266,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 300: + case ID_STORE_PASSWORD_NUM7: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '7'; @@ -273,7 +274,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 301: + case ID_STORE_PASSWORD_NUM8: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '8'; @@ -281,7 +282,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 302: + case ID_STORE_PASSWORD_NUM9: this->ShuffleDigitButtons(); if (this->inputLength < 8) { this->input[this->inputLength] = '9'; @@ -289,7 +290,7 @@ int UIMacroBlackListCheckWnd::SendMsg( return 0; } break; - case 303: + case ID_STORE_PASSWORD_NUM_RESET: this->inputLength = 0; std::memset(this->input, 0, sizeof(this->input)); this->ShuffleDigitButtons(); diff --git a/Source/UI/UIMacroUserInfoWnd.cpp b/Source/UI/UIMacroUserInfoWnd.cpp index 116faf04a..f4720ee8e 100644 --- a/Source/UI/UIMacroUserInfoWnd.cpp +++ b/Source/UI/UIMacroUserInfoWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIMacroUserInfoWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -575,7 +576,7 @@ int UIMacroReporterWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 34: { + case UM_SETINFO: { this->m_state = reinterpret_cast(argument1); if (!reinterpret_cast(this->m_state)->IsValid()) { reinterpret_cast(this->m_state)->Reset(); @@ -594,13 +595,13 @@ int UIMacroReporterWnd::SendMsg( break; } - case 6: + case UM_COMMAND: switch (argument1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(286); break; - case 211: { + case ID_DELETE: { for (auto it = this->m_entries.begin(); it != this->m_entries.end(); ++it) { if (argument2 == it->id) { for (auto next = it + 1; next != this->m_entries.end(); ++next, ++it) { @@ -628,7 +629,7 @@ int UIMacroReporterWnd::SendMsg( break; } - case 213: + case ID_CHECK: if (this->unknown_00D4 != sender) { break; } @@ -651,7 +652,7 @@ int UIMacroReporterWnd::SendMsg( } break; - case 345: + case ID_SEND: if (this->m_mode == 2 || this->m_mode == 3) { this->m_namesValid = this->ValidateNames(1); this->m_targetValid = this->ValidateTarget(1); @@ -708,7 +709,7 @@ int UIMacroReporterWnd::SendMsg( } break; - case 215: { + case ID_RADIOBTN: { if (this->unknown_010C == true) { switch (this->m_mode) { case 0: @@ -791,7 +792,7 @@ int UIMacroReporterWnd::SendMsg( } break; - case 0: + case UM_DEFPUSH: if (this->m_mode == 2) { if (sender) { const int index = (sender->geometry.y - 56) / 22; @@ -818,7 +819,7 @@ int UIMacroReporterWnd::SendMsg( } break; - case 98: { + case UM_TEXT_LBTN_UP: { auto entry = this->m_entries.begin(); for (; entry != this->m_entries.end(); ++entry) { if (argument1 == entry->id) { @@ -848,9 +849,9 @@ int UIMacroReporterWnd::SendMsg( break; } - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; if (message == 9) { this->m_firstRow = previous - this->m_visibleRows + 1; diff --git a/Source/UI/UIPreviewEquipWnd.cpp b/Source/UI/UIPreviewEquipWnd.cpp index 9d92cf7f9..3fbef3f5b 100644 --- a/Source/UI/UIPreviewEquipWnd.cpp +++ b/Source/UI/UIPreviewEquipWnd.cpp @@ -1,4 +1,5 @@ #include "UI/UIPreviewEquipWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" @@ -175,10 +176,10 @@ void UIPreviewEquipWnd::SyncFromPlayer() { 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) { switch (a) { - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x126); break; - case 0x16B: + case ID_RESET: this->SyncFromPlayer(); break; case 0x180: diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index 5e50d272f..c03b5ddf1 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UINewSelectCharWnd.h" +#include "UI/Window/UIEnums.h" #include "UI/UIRefiningWnd.h" #include "Client/Application/ApplicationWindow.h" @@ -777,12 +778,12 @@ int UIRefiningWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { case 510: ShellExecuteA(hWnd, "open", LookupMessage(4123), nullptr, nullptr, SW_SHOWNORMAL); break; - case 184: + case ID_OK: if (this->unknown_01F0 != 1) { const std::uint32_t index = this->item.unknown_0000[1]; if (index != 0) { @@ -800,8 +801,8 @@ int UIRefiningWnd::SendMsg( } } break; - case 185: - case 201: + case ID_CANCEL: + case ID_CLOSE: if (this->state != 2) { RefiningClosePacket packet; packet.id = 0xAA4; @@ -824,7 +825,7 @@ int UIRefiningWnd::SendMsg( break; } break; - case 23: + case UM_REFRESHITEM: 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) { diff --git a/Source/UI/UIReputeWnd.cpp b/Source/UI/UIReputeWnd.cpp index edbcfecbc..7d702a94b 100644 --- a/Source/UI/UIReputeWnd.cpp +++ b/Source/UI/UIReputeWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "UI/UIReputeWnd.h" #include "Contents/MessageTable.h" @@ -222,7 +223,7 @@ void UIReputeWnd::Paint() { // FUNCTION: fn_04315 int UIReputeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->m_groupCombo) { std::string group = this->m_groupCombo->GetSelectedText(); if (group.size() != 0) { @@ -234,23 +235,23 @@ int UIReputeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } } break; - case 6: + case UM_COMMAND: switch (a) { - case 316: + case ID_PREV_PAGE: this->ClearUpdated(); this->SetPage(this->m_page - 1); this->Invalidate(); break; - case 317: + case ID_NEXT_PAGE: this->ClearUpdated(); this->SetPage(this->m_page + 1); this->Invalidate(); break; - case 201: + case ID_CLOSE: this->ClearUpdated(); g_windowMgr.CloseWindow(346); break; - case 321: { + 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); @@ -265,7 +266,7 @@ int UIReputeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } } break; - case 22: + case UM_TAB: if (a) { int index; if (std::string(reinterpret_cast(a)) == LookupMessage(3829)) { diff --git a/Source/UI/UIScrollWnd.cpp b/Source/UI/UIScrollWnd.cpp index bb46d59c4..2710faa20 100644 --- a/Source/UI/UIScrollWnd.cpp +++ b/Source/UI/UIScrollWnd.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/UIEnums.h" #include "UI/UIScrollWnd.h" #include "Render/DeviceContext/DCBitmap.h" #include "Render/Primitives/RenderPrimitivePool.h" @@ -438,9 +439,9 @@ void UIScrollWnd::Resize(int width, int height) { int UIScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { int delta = argument1; switch (message) { - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->scrollPosition; if (message == 9) { delta = -1; @@ -459,9 +460,9 @@ int UIScrollWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, this->Invalidate(); return this->scrollPosition - previous; } - case 8: - case 11: - case 12: { + case UM_SCROLLHORZ: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int previous = this->unknown_009C; if (message == 11) { delta = -1; diff --git a/Source/UI/UISlotBitmap.cpp b/Source/UI/UISlotBitmap.cpp index 9ed3b846d..ec99b99df 100644 --- a/Source/UI/UISlotBitmap.cpp +++ b/Source/UI/UISlotBitmap.cpp @@ -1,4 +1,5 @@ #include "UI/UISlotBitmap.h" +#include "UI/Window/UIEnums.h" #include "UI/Buttons/UIBitmapButton.h" // OFFSET: 0x0085ADA0 @@ -49,12 +50,12 @@ void UISlotBitmap::OnRBtnDown(int, int) { // FUNCTION: fn_10920 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 6: + case UM_COMMAND: if (argument1 == 203 && this->parent) { this->parent->SendMsg(this, 6, 203, this->slot, 0, 0); } return 0; - case 13: + case UM_SETSTATE: this->geometry.unknown_0030 = argument1; return 0; default: diff --git a/Source/UI/Window/FrameFocus.cpp b/Source/UI/Window/FrameFocus.cpp index e23e55693..3be39589b 100644 --- a/Source/UI/Window/FrameFocus.cpp +++ b/Source/UI/Window/FrameFocus.cpp @@ -19,8 +19,8 @@ // FUNCTION: fn_17192 bool UIWindowMgr::IsOrderFixed(int id) { switch (id) { - case WID_BASICINFOWND: case WID_NEWCHATWND: case WID_SELECTSERVERWND: case WID_LOGINWND: case WID_MAKECHARWND: case WID_WAITWND: case WID_LOADINGWND: case WID_TOOLTIPWND: case WID_MINIMAPZOOMWND: case WID_ITEMDROPCNTWND: case WID_SAYDIALOGWND_DIALOG: case WID_CHOOSE3WND: case WID_MENUWND: case WID_NOTICECONFIRMWND: case WID_NOTIFYLEVELUPWND: case WID_ITEMSHOPWND: case WID_ITEMPURCHASEWND: - case WID_ITEMSELLWND: case WID_COMBOBOXWND: case WID_CHATROOMWND: case WID_PASSWORDWND: case 31: case WID_EXCHANGEACCEPTWND: case WID_ITEMSTOREWND: case WID_MESSENGERGROUPWND: case WID_JOINPARTYACCEPTWND: case WID_SHORTCUTWND: case WID_CHOOSEWARPWND: case WID_MERCHANTMIRRORITEMWND_MODE_0: case WID_MERCHANTITEMMYSHOPWND_MODE_0: case WID_NOTIFYJOBLEVELUPWND: case WID_ITEMPARAMCHANGEDISPLAYWND: case WID_NPCEDITDIALOGWND: + case WID_BASICINFOWND: case WID_CHATWND: case WID_SELECTSERVERWND: case WID_LOGINWND: case WID_MAKECHARWND: case WID_WAITWND: case WID_LOADINGWND: case WID_TOOLTIPWND: case WID_MINIMAPZOOMWND: case WID_ITEMDROPCNTWND: case WID_SAYDIALOGWND: case WID_CHOOSEWND: case WID_MENUWND: case WID_NOTICECONFIRMWND: case WID_NOTIFYLEVELUPWND: case WID_ITEMSHOPWND: case WID_ITEMPURCHASEWND: + case WID_ITEMSELLWND: case WID_COMBOBOXWND: case WID_CHATROOMWND: case WID_PASSWORDWND: case 31: case WID_EXCHANGEACCEPTWND: case WID_ITEMSTOREWND: case WID_MESSENGERGROUPWND: case WID_JOINPARTYACCEPTWND: case WID_SHORTCUTWND: case WID_CHOOSEWARPWND: case WID_MERCHANTMIRRORITEMWND: case WID_MERCHANTITEMMYSHOPWND: case WID_NOTIFYJOBLEVELUPWND: case WID_ITEMPARAMCHANGEDISPLAYWND: case WID_NPCEDITDIALOGWND: case WID_NOTIFYITEMOBTAINWND: case WID_GUILDINFOMANAGEWND: case WID_GUILDMEMBERMANAGEWND: case WID_GUILDPOSITIONMANAGEWND: case WID_GUILDSKILLWND: case WID_GUILDBANISHEDMEMBERWND: case WID_GUILDNOTICEWND: case WID_GUILDTOTALINFOWND: case 67: case WID_JOINGUILDACCEPTWND: case WID_ITEMIDENTIFYWND: case WID_ITEMCOMPOSITIONWND: case WID_ILLUSTWND: case WID_MAKETARGETLISTWND: case WID_MAKETARGETPROCESSWND: case WID_MAKETARGETRESULTWND: case WID_PETEGGLISTWND: case WID_PETTAMINGDECEIVEWND: case WID_MAKINGARROWLISTWND: case WID_SELECTCARTWND: case WID_SPELLLISTWND: case WID_NPCTEXTEDITDIALOGWND: case WID_GRAFFISTRBOXWND: case WID_COUPLEACCEPTWND: case WID_BABYACCEPTWND: case WID_ITEMREPAIRWND: case WID_JOINFRIENDACCEPTWND: case WID_WEAPONREFINEWND: case 115: case WID_AUTOMESSAGEWND: case 123: case 124: case WID_SELCHARFORUSERVERWND: case WID_CHANGENAMEWND: case WID_SUBCHATHISWND_UNKNOWN_03E4: case WID_SUBCHATHISWND_UNKNOWN_03E8: case WID_SUBCHATMINIWND: case 136: case WID_MEMORIALDUNWND: case WID_YOURITEMWND: case 144: case 154: case WID_HOTKEYWND: case WID_RELOADLUASCRIPTWND: case WID_QUIKSLOTWND: @@ -124,11 +124,11 @@ bool UIWindowMgr::IsSharedWindowId(int id) { switch (id) { case WID_TOOLTIPWND: case 13: - case WID_SAYDIALOGWND_DIALOG: - case WID_CHOOSE3WND: + case WID_SAYDIALOGWND: + case WID_CHOOSEWND: case WID_MENUWND: case WID_NOTICECONFIRMWND: - case WID_MERCHANTITEMMYSHOPWND_MODE_0: + case WID_MERCHANTITEMMYSHOPWND: case 112: case WID_HOMUNINFOWND: case WID_SKILLLISTWND_SKILLTAB_0: diff --git a/Source/UI/Window/UIAccountLimitedToolWnd.cpp b/Source/UI/Window/UIAccountLimitedToolWnd.cpp index 56d80141e..cb8ef4ce2 100644 --- a/Source/UI/Window/UIAccountLimitedToolWnd.cpp +++ b/Source/UI/Window/UIAccountLimitedToolWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIAccountLimitedToolWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -180,7 +181,7 @@ void UIAccountLimitedToolWnd::Paint() { // FUNCTION: fn_12938 int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 64: + case UM_PARAM: switch (argument1) { case 2: if (argument2 == 1) { @@ -293,19 +294,19 @@ int UIAccountLimitedToolWnd::SendMsg(UIWindow* sender, int message, std::intptr_ } } break; - case 6: + case UM_COMMAND: switch (argument1) { - case 211: { + case ID_DELETE: { AccountLimitedDeletePacket packet; packet.id = 0xB4A; packet.accountId = std::atoi(this->m_accountIdText->GetText().c_str()); GetRagConnection().Send(g_packetLengths.FixedLength(packet.id), &packet); break; } - case 201: + case ID_CLOSE: g_modeMgr.GetGameMode()->SendMsg(319, 0, 0, 0, 0); break; - case 321: { + 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); diff --git a/Source/UI/Window/UIBasicInfoWnd.cpp b/Source/UI/Window/UIBasicInfoWnd.cpp index 6f1a484d0..aad204676 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/UIEnums.h" #include "UI/Window/UIBasicInfoWnd.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -218,7 +219,7 @@ void UIBasicInfoWnd::OnMouseHover(int x, int y) { // FUNCTION: fn_13498 int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { case 192: if (!g_windowMgr.CloseWindow(11)) { @@ -341,7 +342,7 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen } } break; - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(argument1); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -351,7 +352,7 @@ int UIBasicInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen this->SetHeight(this->saved->height); this->Move(this->saved->x, this->saved->y); break; - case 60: + case UM_REFRESH: if (this->geometry.height != this->expandedHeight) { this->Invalidate(); } diff --git a/Source/UI/Window/UIBattleMsgOptionWnd.cpp b/Source/UI/Window/UIBattleMsgOptionWnd.cpp index 977524986..37c42b310 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/UIEnums.h" #include "UI/Window/UIBattleMsgOptionWnd.h" #include "Client/Session.h" @@ -242,9 +243,9 @@ void UIBattleMsgOptionWnd::Paint() { // FUNCTION: fn_12742 int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 193: { + case ID_OPTION: { if (this->unknown_0108 == b && this->unknown_0110 == (c != 0)) { if (d != 2) { g_windowMgr.CloseWindow(132); @@ -275,10 +276,10 @@ int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->UpdateScrollBar(); return 0; } - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(132); return 0; - case 213: + case ID_CHECK: this->unknown_010C = b; for (int i = 0; i < 25; ++i) { const bool checked = this->unknown_010C != 0; @@ -290,9 +291,9 @@ int UIBattleMsgOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->unknown_00C4; if (message == 9) { this->unknown_00C4 = previous - this->m_visibleRows + 1; diff --git a/Source/UI/Window/UIBitmapTab.cpp b/Source/UI/Window/UIBitmapTab.cpp index 7a60b60ac..e7f2f1012 100644 --- a/Source/UI/Window/UIBitmapTab.cpp +++ b/Source/UI/Window/UIBitmapTab.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" #include "Resource/TextureNames.h" @@ -53,14 +54,14 @@ void UIBitmapTab::DragAndDrop(int argument1, int argument2, std::intptr_t argume // FUNCTION: fn_10908 int UIBitmapTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 13: + case UM_SETSTATE: this->geometry.unknown_0030 = argument1; this->Invalidate(); break; - case 75: + case UM_CLEAR_ITEM: this->tabs.clear(); break; - case 78: + case UM_SET_BITMAP: if (argument1) { const char* tabName = reinterpret_cast(argument1); const std::string name = FormatOwnedString(tabName, 'a'); @@ -70,7 +71,7 @@ int UIBitmapTab::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::i } } break; - case 14: + case UM_RESIZE: if (!this->tabs.empty()) { int width = 0; int height = 0; diff --git a/Source/UI/Window/UIChangeNameWnd.cpp b/Source/UI/Window/UIChangeNameWnd.cpp index 618d05883..68b8a36b7 100644 --- a/Source/UI/Window/UIChangeNameWnd.cpp +++ b/Source/UI/Window/UIChangeNameWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIChangeNameWnd.h" +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -93,12 +94,12 @@ UIChangeNameWnd::UIChangeNameWnd() // FUNCTION: fn_12743 int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 0: + case UM_DEFPUSH: this->SendMsg(nullptr, 6, this->m_message0, 0, 0, 0); break; - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { if (g_navigationLinkParser->HasLink(this->m_edit->Text()) == true) { g_windowMgr.Confirm(LookupMessage(2812), 0, true, false, 0, "Message", 280, 120, 0); this->m_edit->SetText(""); @@ -173,12 +174,12 @@ int UIChangeNameWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intpt } break; } - case 185: + case ID_CANCEL: g_windowMgr.Schedule(this); break; } break; - case 34: + case UM_SETINFO: this->m_character = reinterpret_cast(a); this->m_edit->SetText(this->m_character->name); break; diff --git a/Source/UI/Window/UIEmblemWnd.cpp b/Source/UI/Window/UIEmblemWnd.cpp index e6e22d361..cc097af2b 100644 --- a/Source/UI/Window/UIEmblemWnd.cpp +++ b/Source/UI/Window/UIEmblemWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Session.h" +#include "UI/Window/UIEnums.h" #include "Contents/Actors/RenderObject.h" #include "Contents/Configuration/ServiceOptions.h" #include "Contents/GuildMgr.h" @@ -74,11 +75,11 @@ void UIEmblemWnd::OnProcess() { // FUNCTION: fn_10917 int UIEmblemWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: + case UM_SETINFO: this->aid = argument1; this->guildId = argument2; break; - case 60: + case UM_REFRESH: if (this->guildId == static_cast(argument1)) { this->Invalidate(); } diff --git a/Source/UI/Window/UIEnums.h b/Source/UI/Window/UIEnums.h new file mode 100644 index 000000000..413989a57 --- /dev/null +++ b/Source/UI/Window/UIEnums.h @@ -0,0 +1,298 @@ +#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIENUMS_H +#define RAGNAROK_SOURCE_UI_WINDOW_UIENUMS_H + +enum UIMESSAGE : int { + UM_DEFPUSH = 0, + UM_CANCELPUSH = 1, + UM_TOGGLEPUSH = 2, + UM_PAGEUPPUSH = 3, + UM_PAGEDOWNPUSH = 4, + UM_CLOSE = 5, + UM_COMMAND = 6, + UM_SCROLLVERT = 7, + UM_SCROLLHORZ = 8, + UM_SCROLLVERTPAGEUP = 9, + UM_SCROLLVERTPAGEDOWN = 10, + UM_SCROLLHORZPAGEUP = 11, + UM_SCROLLHORZPAGEDOWN = 12, + UM_SETSTATE = 13, + UM_RESIZE = 14, + UM_CHANGESTATUS = 15, + UM_OPENCHATWND = 16, + UM_UPPUSH = 18, + UM_DOWNPUSH = 19, + UM_LEFTPUSH = 20, + UM_RIGHTPUSH = 21, + UM_TAB = 22, + UM_REFRESHITEM = 23, + UM_ITEMEXPLANATION = 24, + UM_ENABLENEXTBUTTON = 25, + UM_SETSAYDIALOG = 26, + UM_SETCHOOSE = 27, + UM_SETNAID = 28, + UM_SETTEXT = 29, + UM_ADJUSTSIZE = 30, + UM_ADDITEM = 31, + UM_DISABLENEXTBUTTON = 32, + UM_DELETE = 33, + UM_SETINFO = 34, + UM_REFRESHBUTTON = 35, + UM_SETTITLE = 36, + UM_ADDCHAT = 37, + UM_DROP = 38, + UM_COMBOBOX_SELECTED = 39, + UM_SETCURITEM = 40, + UM_USE_SHORTEN_ITEM = 41, + UM_CLEARMEMBER = 43, + UM_ADDMEMBER = 44, + UM_MEMBER_EXIT = 45, + UM_ROLE_CHANGE = 46, + UM_SETROOMID = 47, + UM_MENU_SELECTED = 48, + UM_MAKEMENU = 49, + UM_SET_EXCHANGE_CHAR_NAME = 50, + UM_MYDRAGCLOSED = 51, + UM_OTHERDRAGCLOSED = 52, + UM_SETINFO2 = 53, + UM_GET_EDIT_FOCUS = 54, + UM_SETCOUNTINFO = 55, + UM_SET_JOIN_PARTY_MSG = 56, + UM_CHANGEMSG = 57, + UM_USESKILL = 58, + UM_SETSKID = 59, + UM_REFRESH = 60, + UM_SKILLDESCRIBE = 61, + UM_CARDITEMILLUSTRATE = 62, + UM_ENABLECLOSEBUTTON = 63, + UM_PARAM = 64, + UM_SETCOUNTMSG = 67, + UM_SET_SKILL_INFO = 68, + UM_CHANGE_GUILD_TAB = 69, + UM_DELETE_WHISPER_NAME = 70, + UM_ADDBOUNDARY = 72, + UM_SET_JOIN_GUILD_MSG = 73, + UM_SET_ALLY_GUILD_MSG = 74, + UM_CLEAR_ITEM = 75, + UM_SET_IDENTIFIY_INFO = 76, + UM_SET_CARD_ITEM_INDEX = 77, + UM_SET_BITMAP = 78, + UM_SET_MONSTER_INFO = 79, + UM_SET_TARGET = 80, + UM_SET_COUNT = 81, + UM_SET_CALLER_WID = 83, + UM_ADD_BUTTON = 85, + UM_DELETE_BUTTON = 86, + UM_SETPOS = 87, + UM_ENABLE_CANCEL = 88, + UM_SET_COUPLE_MSG = 90, + UM_SET_BABY_MSG = 91, + UM_READBOOK = 92, + UM_AUTOREAD = 93, + UM_GETBOOKCONTENTS = 94, + UM_SET_JOIN_FRIEND_MSG = 95, + UM_TEXT_LBTN_DblClk = 97, + UM_TEXT_LBTN_UP = 98, + UM_TEXT_RBTN_UP = 99, + UM_BMP_LBTN_UP = 100, + UM_BMP_RBTN_UP = 101, + UM_SETID = 102, + UM_DECITEM = 104, + UM_SET_DISABLE = 106, + UM_BEGIN_DRAG_BTN = 107, + UM_MOUSE_HOVER_BTN = 108, + UM_END_DRAG_BTN = 109, + UM_CHANGE_TVITEM_TEXT = 110, + UM_RECEIVE_MSG = 111, + UM_ENDPUSH = 114, + UM_ADDCHAT2 = 115, +}; + +enum UIID : int { + ID_OK = 184, + ID_CANCEL = 185, + ID_LOGIN = 186, + ID_YES = 187, + ID_NO = 188, + ID_BUTTON1 = 189, + ID_STATUS = 192, + ID_OPTION = 193, + ID_ITEMS = 194, + ID_EQUIP = 195, + ID_SKILL = 196, + ID_FRIEND = 199, + ID_BASE = 200, + ID_CLOSE = 201, + ID_MINI = 202, + ID_MAKE = 203, + ID_SLOT = 204, + ID_STR = 205, + ID_AGI = 206, + ID_VIT = 207, + ID_INT = 208, + ID_DEX = 209, + ID_LUK = 210, + ID_DELETE = 211, + ID_HIS = 212, + ID_CHECK = 213, + ID_RADIOBTN = 215, + ID_PLUS = 216, + ID_MINUS = 217, + ID_NEXT = 218, + ID_MAP = 219, + ID_RESTART = 220, + ID_EXIT = 221, + ID_SELL = 223, + ID_BUY = 224, + ID_WHISPERCOMBO = 225, + ID_RIGHT = 226, + ID_LEFT = 227, + ID_NUMCOMBO = 228, + ID_CLASSCOMBO = 229, + ID_EXCHANGE = 230, + ID_SENDMSG = 231, + ID_TALK = 232, + ID_FRIEND_INFO = 233, + ID_PARTY_SETTING = 234, + ID_DELETE_FRIEND = 235, + ID_LEAVE = 236, + ID_TALKTOWHOCOMBO = 238, + ID_LVLUP1 = 239, + ID_LVLUP2 = 240, + ID_LVLUP3 = 241, + ID_LVLUP4 = 242, + ID_LVLUP5 = 243, + ID_LVLUP6 = 244, + ID_LVLUP7 = 245, + ID_PREV = 246, + ID_EQUIP_OPTION_OFF = 248, + ID_EQUIP_OPTION_OPEN = 249, + ID_CARDITEM = 250, + ID_QUIT = 251, + ID_TO_CHARACTER_SELECT = 252, + ID_LVLSELECTDN1 = 253, + ID_LVLSELECTDN2 = 254, + ID_LVLSELECTDN3 = 255, + ID_LVLSELECTDN4 = 256, + ID_LVLSELECTDN5 = 257, + ID_LVLSELECTDN6 = 258, + ID_LVLSELECTDN7 = 259, + ID_LVLSELECTUP1 = 260, + ID_LVLSELECTUP2 = 261, + ID_LVLSELECTUP3 = 262, + ID_LVLSELECTUP4 = 263, + ID_LVLSELECTUP5 = 264, + ID_LVLSELECTUP6 = 265, + ID_LVLSELECTUP7 = 266, + ID_MAKEACCOUNT = 267, + ID_APPLY = 271, + ID_OPEN_MEMBER_POS_COMBO = 273, + ID_POSNAME_EDIT = 275, + ID_PAYRATE_EDIT = 276, + ID_SEND_GUILD_NOTICE = 277, + ID_CHANGE_GUILE_EMBLEM = 278, + ID_UP = 279, + ID_DOWN = 280, + ID_OPEN_EMOTIONLIST = 283, + ID_CHARGE = 284, + ID_NOTICE = 286, + ID_BOOKITEM = 287, + ID_AUTOBOOKITEM = 288, + ID_OPEN_HOMUNSKILLLIST = 289, + ID_FEED_TO_HOMUN = 290, + ID_DELETE_HOMUN = 291, + ID_CHANGE_STORE_PASSWORD = 292, + ID_STORE_PASSWORD_NUM0 = 293, + ID_STORE_PASSWORD_NUM1 = 294, + ID_STORE_PASSWORD_NUM2 = 295, + ID_STORE_PASSWORD_NUM3 = 296, + ID_STORE_PASSWORD_NUM4 = 297, + ID_STORE_PASSWORD_NUM5 = 298, + ID_STORE_PASSWORD_NUM6 = 299, + ID_STORE_PASSWORD_NUM7 = 300, + ID_STORE_PASSWORD_NUM8 = 301, + ID_STORE_PASSWORD_NUM9 = 302, + ID_STORE_PASSWORD_NUM_RESET = 303, + ID_STORE_RETURN = 304, + ID_SEND_MAIL = 305, + ID_PREV_PAGE = 316, + ID_NEXT_PAGE = 317, + ID_SEARCH = 321, + ID_SELECT_ITEM = 336, + ID_HELP = 343, + ID_SEND = 345, + ID_NAME = 347, + ID_OPEN_MERSKILLLIST = 349, + ID_FIRE_MER = 350, + ID_CHANGE_NAME = 351, + ID_CHANGE_NAME_SUCCESS = 352, + ID_REBIRTH = 353, + ID_PREVIEW = 354, + ID_NEXTVIEW = 355, + ID_BOOKMARK = 356, + ID_STICK_ON = 357, + ID_RESET = 363, +}; + +enum MENUID : int { + MENUID_EXPEL = 0, + MENUID_QUERYINFO = 3, + MENUID_DEAL = 4, + MENUID_INVITE_IN_PARTY = 5, + MENUID_SEND_MSG = 6, + MENUID_TALKONLYTWO = 7, + MENUID_LEAVE = 9, + MENUID_ADD_TO_FRIEND_CHAR_LIST = 10, + MENUID_WRITE_CHAT_TO_FILE = 11, + MENUID_REQ_EX_LIST = 12, + MENUID_REQ_IN = 13, + MENUID_REMOVE_GUILE_MEMBER = 16, + MENUID_LEAVE_GUILD = 17, + MENUID_VIEW_GUILD_MEMBER_INFO = 18, + MENUID_DELETE_WHISPER_NAME = 19, + MENUID_MAKE_WHISPER_WINDOW = 20, + MENUID_ADD_TO_FRIEND_CHAR_LIST_FROM_WINDOW = 21, + MENUID_INVITE_IN_GUILD = 22, + MENUID_ALLY_GUILD = 25, + MENUID_HOSTILE_GUILD = 26, + MENUID_DISCONNECT_CHARACTER = 28, + MENUID_PET_FEEDING = 29, + MENUID_PET_PERFORMANCE = 30, + MENUID_PET_RETURN_EGG = 31, + MENUID_PET_ACC_OFF = 32, + MENUID_PET_SHOWINFO = 33, + MENUID_COPY_GID = 34, + MENUID_SHOW_CHAT_PROHIBIT_LOG = 35, + MENUID_INVITE_IN_BABY = 36, + MENUID_HOMUN_SHOWINFO = 37, + MENUID_HOMUN_FEEDING = 38, + MENUID_HOMUN_FOLLOW = 39, + MENUID_MER_SHOWINFO = 40, + MENUID_MER_FOLLOW = 41, + MENUID_VIEW_OTHERUSER_EQUIPWND = 42, +}; + +enum UIMANAGERMESSAGE : int { + UIM_PUSHINTOCHATHISTORY = 1, + UIM_CHANGECHATWNDSTATUS = 2, + UIM_OPENCHATWND = 3, + UIM_LOADINGPERCENT = 4, + UIM_PUSH_INTO_CHATROOM = 5, + UIM_SAVE_CHAT_TO_FILE = 6, + UIM_SAVE_CHAT_TO_FILE_FROM_CHATROOM = 7, + UIM_IME_OPENCANDIDATE = 8, + UIM_IME_CHANGECANDIDATE = 9, + UIM_IME_CLOSECANDIDATE = 10, + UIM_MAKE_WHISPER_WINDOW = 14, + UIM_PUSHINTOCHATHISTORY2 = 19, +}; + +enum SCROLLBARPART : int { + SB_NULL = -1, + SB_UPBTN = 0, + SB_UPPAGE = 1, + SB_THUMB = 2, + SB_DNPAGE = 3, + SB_DNBTN = 4, +}; + +#endif diff --git a/Source/UI/Window/UIEscOptionWnd.cpp b/Source/UI/Window/UIEscOptionWnd.cpp index 2cffc3375..59687c0d9 100644 --- a/Source/UI/Window/UIEscOptionWnd.cpp +++ b/Source/UI/Window/UIEscOptionWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIEscOptionWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -97,7 +98,7 @@ int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen g_windowMgr.EnsureWindow(0x9C); } break; - case 0xFB: + case ID_QUIT: g_windowMgr.CloseWindow(0x9B); mode->SendMsg(0x58, 0, 0, 0, 0); break; @@ -129,7 +130,7 @@ int UIEscOptionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argumen g_windowMgr.CloseWindow(0x9B); } break; - case 0xB9: + case ID_CANCEL: g_windowMgr.CloseWindow(0x9B); break; } diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index f6b3020db..354f78755 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -1,4 +1,5 @@ #include "Client/Mode/CMode.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "Client/Session.h" #include "Contents/MessageTable.h" @@ -204,17 +205,17 @@ void UIFrameWnd::RefreshSnap() { // FUNCTION: fn_11802 int UIFrameWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0: + case UM_DEFPUSH: if (this->m_message0) { this->SendMsg(this, 6, this->m_message0, 0, 0, 0); } break; - case 1: + case UM_CANCELPUSH: if (this->m_message1) { this->SendMsg(this, 6, this->m_message1, 0, 0, 0); } break; - case 98: + case UM_TEXT_LBTN_UP: if (c > 0) { if (UIWindow* window = g_windowMgr.EnsureWindow(12)) { window->SendMsg(nullptr, 24, c, 0, 0, 0); @@ -457,20 +458,20 @@ void UIMonsterInfoWnd::OnMouseHover(int x, int y) { // FUNCTION: fn_11798 int UIAllyGuildAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: + case ID_OK: g_windowMgr.CloseWindow(72); g_modeMgr.gameMode->SendMsg(120, this->identity, 1, 0, 0); break; - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(72); g_modeMgr.gameMode->SendMsg(120, this->identity, 0, 0, 0); break; } return 0; - case 74: { + case UM_SET_ALLY_GUILD_MSG: { this->identity = static_cast(a); std::string text = "("; text += reinterpret_cast(b); @@ -502,7 +503,7 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: int step; switch (a) { - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(0x113); return 0; case 0x117: @@ -596,18 +597,18 @@ int UIBank_NewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: // FUNCTION: fn_11801 int UICntWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 29: + case UM_SETTEXT: this->m_text->SetText(reinterpret_cast(a), 0); return 0; - case 81: { + case UM_SET_COUNT: { char buffer[16]; this->m_edit->SetText(_itoa(static_cast(a), buffer, 10)); return 0; } - case 80: + case UM_SET_TARGET: this->m_event = static_cast(a); return 0; - case 6: + case UM_COMMAND: if (a == 184) { CMode* mode = g_modeMgr.gameMode; mode->SendMsg(this->m_event, std::atoi(this->m_edit->Text()), 0, 0, 0); @@ -656,7 +657,7 @@ struct ChatRoomRecordHeader { // FUNCTION: fn_11800 int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 53: + case UM_SETINFO2: this->saved = reinterpret_cast(a); if (this->saved->IsValid() == 0) { this->saved->Reset(); @@ -664,9 +665,9 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->SendMsg(nullptr, 14, 7, this->saved->width, this->saved->height, 0); this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { if (this->edit->Length() == 0) { return 0; } @@ -730,7 +731,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_windowMgr.SetFocus(this->edit); return 0; } - case 201: + case ID_CLOSE: g_modeMgr.gameMode->SendMsg(48, 0, 0, 0, 0); return 0; case 347: @@ -739,7 +740,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: default: return 0; } - case 48: { + case UM_MENU_SELECTED: { CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); switch (this->unknown_0114[a].second) { case 0: { @@ -779,7 +780,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: return 0; } } - case 49: { + case UM_MAKEMENU: { this->unknown_0114.clear(); if (g_windowMgr.unknown_0210 != nullptr) { g_windowMgr.CloseWindow(18); @@ -855,7 +856,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 34: { + case UM_SETINFO: { const ChatRoomTitleInfo* settings = reinterpret_cast(a); this->title = settings->title; this->unknown_00CC = settings->unknown_0018; @@ -881,7 +882,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->Invalidate(); return 0; } - case 46: { + case UM_ROLE_CHANGE: { if (this->unknown_010C.find(std::string(reinterpret_cast(a))) != this->unknown_010C.end()) { this->unknown_010C[std::string(reinterpret_cast(a))] = static_cast(b); } @@ -891,7 +892,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 45: { + case UM_MEMBER_EXIT: { const std::map::iterator found = this->unknown_010C.find(std::string(reinterpret_cast(a))); if (found == this->unknown_010C.end()) { return 0; @@ -903,11 +904,11 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 43: + case UM_CLEARMEMBER: this->memberList->Clear(); this->unknown_010C.erase(this->unknown_010C.begin(), this->unknown_010C.end()); return 0; - case 44: { + case UM_ADDMEMBER: { this->unknown_010C[std::string(reinterpret_cast(a))] = static_cast(b); int color = 0; if (b != 0) { @@ -920,7 +921,7 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: this->memberList->AddText(reinterpret_cast(a), color, nullptr); return 0; } - case 37: { + case UM_ADDCHAT: { char* text = reinterpret_cast(a); if (g_forbiddenWords.Contains(text)) { std::string masked(""); @@ -978,17 +979,17 @@ int UIChatRoomWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: } return 0; } - case 3: + case UM_PAGEUPPUSH: if (this->history->verticalOverflow != 0) { this->history->SendMsg(nullptr, 9, 0, 0, 0, 0); } return 0; - case 4: + case UM_PAGEDOWNPUSH: if (this->history->verticalOverflow != 0) { this->history->SendMsg(nullptr, 10, 0, 0, 0, 0); } return 0; - case 14: { + case UM_RESIZE: { if (a != 7) { return 0; } diff --git a/Source/UI/Window/UIHotKeyWnd.cpp b/Source/UI/Window/UIHotKeyWnd.cpp index c80dc1dad..7269afd5c 100644 --- a/Source/UI/Window/UIHotKeyWnd.cpp +++ b/Source/UI/Window/UIHotKeyWnd.cpp @@ -1,3 +1,5 @@ +#include "Contents/Hotkeys/InterfaceHotkey.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" #include "Render/Text/FontCache.h" @@ -31,19 +33,19 @@ namespace { bool HiddenHotkeyIndex(int index) { switch (index) { - case 30: - case 33: - case 34: - case 36: - case 43: - case 45: - case 53: - case 58: - case 62: - case 64: - case 65: - case 66: - case 67: + case HK_BATTLEFIELDWND: + case HK_PARTY_RECRUIT: + case HK_PARTY_BOOKING_LIST: + case HK_EXMACRO_SETUPWND: + case HK_BUTTONS_RELOCATE: + case HK_MENUICON_HIDE: + case HK_TWITTERWND: + case HK_HUNTINGQUEST_INFO_ONOFF: + case HK_UNKNOWN_62: + case HK_UNKNOWN_64: + case HK_UNKNOWN_65: + case HK_UNKNOWN_66: + case HK_UNKNOWN_67: return true; default: return false; @@ -679,22 +681,22 @@ int UIHotKeyWnd::SendMsg( ) { if (message == 6) { switch (argument1) { - case 184: + case ID_OK: ++g_userHotkeyMgr->m_changes; this->SaveHotkeys(); g_windowMgr.CloseWindow(156); return 0; - case 185: + case ID_CANCEL: this->m_selectedRow = -1; for (auto& map : this->hotkeys) { map.clear(); } this->Invalidate(); return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(156); return 0; - case 213: + case ID_CHECK: if (sender != this->unknown_0108) { return 0; } @@ -709,19 +711,19 @@ int UIHotKeyWnd::SendMsg( ChatWindow()->ToggleInput(); } return 0; - case 316: + case ID_PREV_PAGE: if (this->m_page > 1) { --this->m_page; } this->UpdatePageButtons(); return 0; - case 317: + case ID_NEXT_PAGE: if (this->m_page < this->m_pageCount) { ++this->m_page; } this->UpdatePageButtons(); return 0; - case 363: + case ID_RESET: this->ReloadHotkeys(); return 0; default: diff --git a/Source/UI/Window/UIJobListWnd.cpp b/Source/UI/Window/UIJobListWnd.cpp index 4c829ba49..fcd28ac40 100644 --- a/Source/UI/Window/UIJobListWnd.cpp +++ b/Source/UI/Window/UIJobListWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIJobListWnd.h" +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "Contents/UserData/NormalItemSlots.h" @@ -99,7 +100,7 @@ int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } switch (argument1) { - case 184: { + case ID_OK: { PartyBookingUpdatePacket packet{}; packet.packetType = ID_CZ_PARTY_BOOKING_REQ_UPDATE; for (int i = 0; i < 6; ++i) { @@ -132,7 +133,7 @@ int UIJobListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.packetType), &packet); } [[fallthrough]]; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(170); break; } diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index ec1b1fccc..517d89b14 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/FontCache.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Combat/CombatTypes.h" @@ -763,29 +764,29 @@ int UIMessageBox::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i case 156: this->modal = static_cast(a); return 0; - case 67: + case UM_SETCOUNTMSG: this->format = reinterpret_cast(a); return 0; - case 57: + case UM_CHANGEMSG: this->viewer->Clear(); this->viewer->SendMsg(nullptr, 29, a, 38, 0, 0); return 0; - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); if (this->modal != 0) { g_windowMgr.unknown_0474 = static_cast(a); } else { switch (a) { - case 184: - case 187: - case 188: + case ID_OK: + case ID_YES: + case ID_NO: g_windowMgr.Schedule(this); } } return 0; - case 98: + case UM_TEXT_LBTN_UP: if (a == 426) { ShellExecuteA(hWnd, "open", LookupMessage(3445), nullptr, nullptr, SW_SHOWNORMAL); } @@ -816,13 +817,13 @@ int UIMessageBoxAutoreturn::SendMsg(UIWindow* sender, int message, std::intptr_t // FUNCTION: fn_11810 int UIMonsterInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: if (a == 184) { g_windowMgr.Schedule(this); } return 0; - case 79: + case UM_SET_MONSTER_INFO: if (a) { const int* source = reinterpret_cast(a); int* destination = reinterpret_cast(&this->info); @@ -847,16 +848,16 @@ int UIMonsterInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st // FUNCTION: fn_11817 int UITalkboxTrapInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { TalkboxTrapRequest request; request.target = this->target; request.text = this->edit->Text(); g_modeMgr.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); } [[fallthrough]]; - case 185: + case ID_CANCEL: g_windowMgr.Schedule(this); } return 0; @@ -953,26 +954,26 @@ void UIMerInfoWnd::StoreInfo() { // FUNCTION: fn_11807 int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 0: + case UM_DEFPUSH: return 0; - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: + case ID_OK: this->Invalidate(); return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(125); return 0; - case 349: + case ID_OPEN_MERSKILLLIST: if (!g_windowMgr.CloseWindow(126)) { g_windowMgr.EnsureWindow(126); return 0; } return 0; - case 350: { + case ID_FIRE_MER: { CMode* mode = g_modeMgr.GetGameMode(); if (g_windowMgr.Confirm(LookupMessage(1370), 2, false, false, 0, "Message", 280, 120, 0) == 187) { @@ -989,7 +990,7 @@ int UIMerInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i default: return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { @@ -1328,12 +1329,12 @@ void UINoticeWnd::Paint() { // FUNCTION: fn_11811 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 0: + case UM_DEFPUSH: this->SendMsg(nullptr, 6, 184, 0, 0, 0); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { g_soundMgr->PlayWave("버튼소리.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); FILE* file = std::fopen("notice_read.txt", "wb"); const int index = this->m_index; @@ -1359,7 +1360,7 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in g_windowMgr.CloseWindow(93); break; } - case 218: + case ID_NEXT: ++this->m_index; if (this->m_index > this->m_noticeCount) { @@ -1370,7 +1371,7 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in this->m_scroll = this->m_scrollPositions[this->m_index]; this->LoadNotice(); break; - case 246: + case ID_PREV: if (--this->m_index < 0) { this->m_index = 0; return 0; @@ -1382,9 +1383,9 @@ int UINoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::in } return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_scroll; std::intptr_t delta = a; @@ -2293,7 +2294,7 @@ void UIReplayRECControlWnd::UpdateRecordTime() { // FUNCTION: fn_11814 int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { @@ -2302,7 +2303,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->Move(this->saved->x, this->saved->y); return 0; - case 6: + case UM_COMMAND: switch (a) { case 420: if (!this->replayPathEnabled) { @@ -2359,7 +2360,7 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t this->mode = 0; g_windowMgr.CloseWindow(198); return 0; - case 213: + case ID_CHECK: if (sender == this->window_0128) { ReplayFileList::Instance().pathEnabled = b != 0; this->replayPathEnabled = ReplayFileList::Instance().pathEnabled; @@ -2418,11 +2419,11 @@ int UIReplayRECControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t case 116: this->UpdateRecordTime(); return 0; - case 87: + case UM_SETPOS: Replay::Instance().unknown_01F4 = this->geometry.x; Replay::Instance().unknown_01F8 = this->geometry.y; return 0; - case 60: + case UM_REFRESH: this->Invalidate(); this->InvalidateChildren(); return 0; @@ -2755,7 +2756,7 @@ void UICntWnd::OnCreate(int, int) { // FUNCTION: fn_11813 int UIReplayControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { case 401: g_modeMgr.gameMode->SendMsg(276, 0, 0, 0, 0); @@ -2782,7 +2783,7 @@ int UIReplayControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg return 0; } return 0; - case 35: + case UM_REFRESHBUTTON: if (!this->m_paused) { this->m_playButton->Move(-100, -100); this->m_pauseButton->Move(5, 89); @@ -2795,7 +2796,7 @@ int UIReplayControlWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); this->InvalidateChildren(); return 0; - case 60: + case UM_REFRESH: this->RefreshInfo(); return 0; case 251: @@ -2851,30 +2852,30 @@ bool UIReplayControlWnd::RefreshInfo() { // FUNCTION: fn_11815 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 40: + case UM_SETCURITEM: this->m_list->SendMsg(nullptr, 40, a, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; - case 18: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; - case 19: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); this->UpdateInfo(); this->Invalidate(); return 0; - case 6: + case UM_COMMAND: switch (a) { - case 185: + case ID_CANCEL: case 400: Replay::Instance().SetState(1); g_windowMgr.Schedule(this); g_modeMgr.gameMode->SendMsg(10025, 0, 0, 0, 0); return 0; - case 184: + case ID_OK: if (this->m_list->selected != -1) { this->UpdateInfo(); this->Invalidate(); @@ -2892,7 +2893,7 @@ int UISelectReplayDataWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } } break; - case 221: + 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_windowMgr.Schedule(this); @@ -2998,13 +2999,13 @@ bool UISelectReplayDataWnd::UpdateInfo() { // FUNCTION: fn_11816 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 40: + case UM_SETCURITEM: this->m_serverList->SendMsg(nullptr, 40, this->m_selectedServer, 0, 0, 0); return 0; - case 18: + case UM_UPPUSH: this->m_serverList->SendMsg(nullptr, 18, 0, 0, 0, 0); return 0; - case 19: + case UM_DOWNPUSH: this->m_serverList->SendMsg(nullptr, 19, 0, 0, 0, 0); return 0; case 80: { @@ -3026,7 +3027,7 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } break; } - case 6: + case UM_COMMAND: switch (a) { case 400: reinterpret_cast(ReplayFileList::Instance()).SetBaseFrame(reinterpret_cast(&Replay::Instance())); @@ -3035,7 +3036,7 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s g_modeMgr.gameMode->SendMsg(10026, 0, 0, 0, 0); g_windowMgr.Schedule(this); return 0; - case 184: + case ID_OK: if (this->m_serverList->selected != -1) { g_windowMgr.Schedule(this); g_modeMgr.gameMode->SendMsg(this->m_event, this->m_serverList->selected, 0, 0, 0); @@ -3051,11 +3052,11 @@ int UISelectServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } } break; - case 185: + case ID_CANCEL: g_windowMgr.Schedule(this); g_modeMgr.gameMode->SendMsg(10006, 0, 0, 0, 0); return 0; - case 221: + 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_windowMgr.Schedule(this); @@ -3311,7 +3312,7 @@ EncryptedName<80, 0xF3CB6F7711A71B6DULL>& HangameJoinUrl::operator()() const { // FUNCTION: fn_11805 int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->unknown_00E8) { if (a == 0) { const char source[] = {'\x1A', '\x3D', '\x79', '\xB9', '\xA1'}; @@ -3330,9 +3331,9 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } } return 0; - case 6: + case UM_COMMAND: switch (a) { - case 267: + case ID_MAKEACCOUNT: if (g_serviceType == 0) { if (g_session.m_channelCopId == 1) { g_modeMgr.Quit(); @@ -3349,7 +3350,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int g_modeMgr.Quit(); this->OpenWebPage(); break; - case 186: { + case ID_LOGIN: { const char soundSource[] = {'\xDC', '\xA3', '\x0F', '\xCF', '\xB1', '\x3D', '\x97', '\xEB', '\x4B', '\x22', '\xA8', '\x09', '\x0D'}; thread_local EncryptedName soundName(soundSource); g_soundMgr->PlayWave(soundName.Text(), 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); @@ -3368,17 +3369,17 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } break; } - case 185: + case ID_CANCEL: g_loginCancelRequested = 1; g_modeMgr.gameMode->SendMsg(10018, 0, 0, 0, 0); break; - case 221: + case ID_EXIT: this->SaveLogin(); if (g_windowMgr.Confirm(LookupMessage(17), 2, true, false, 0, "Message", 280, 120, 0) == 187) { goto quit; } break; - case 213: + case ID_CHECK: this->saveId = b; this->SaveLogin(); break; @@ -3431,7 +3432,7 @@ quit: // FUNCTION: fn_11804 int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + 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); @@ -3452,7 +3453,7 @@ int UILoginOTPWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: break; } - case 60: { + case UM_REFRESH: { this->unknown_00B4->SetText(""); return 0; } @@ -3634,13 +3635,13 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } switch (message) { - case 0: + case UM_DEFPUSH: return 0; - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(a), b, c, d); switch (a) { - case 184: { + case ID_OK: { char* const name = reinterpret_cast(&g_session.unknown_5570[0x0C]); if (std::strlen(this->nameEdit->Text()) >= 24) { g_windowMgr.Confirm(LookupMessage(938), 0, true, false, 0, "Message", 280, 120, 0); @@ -3666,10 +3667,10 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } return 0; } - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(113); return 0; - case 213: + case ID_CHECK: if (sender == this->unknown_00D4) { if (b > 0) { g_session.SendHomunculusAutoFeedOption(1); @@ -3678,17 +3679,17 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: } } return 0; - case 289: + case ID_OPEN_HOMUNSKILLLIST: if (!g_windowMgr.CloseWindow(114)) { g_windowMgr.EnsureWindow(114); } return 0; - case 290: + case ID_FEED_TO_HOMUN: this->unknown_00D0 = new UINormalMB(); this->unknown_00D0->Create(this, LookupMessage(601), 2, true, nullptr, 280, 120, nullptr); g_windowMgr.AddRendered(this->unknown_00D0); return 0; - case 291: { + 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); @@ -3715,7 +3716,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: default: return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -3801,9 +3802,9 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i } switch (message) { - case 0: + case UM_DEFPUSH: return 0; - case 39: { + case UM_COMBOBOX_SELECTED: { CMode* mode = g_modeMgr.GetGameMode(); switch (a) { case 467: @@ -3844,13 +3845,13 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i g_windowMgr.CloseWindow(260); return 0; } - case 6: + case UM_COMMAND: if (a == 184 || a == 201) { this->RecordResponse(static_cast(a), b, c, d); } switch (a) { - case 184: + case ID_OK: if (std::strlen(this->nameEdit->Text()) >= 24) { g_windowMgr.Confirm(LookupMessage(682), 0, true, false, 0, "Message", 280, 120, 0); } else if (_mbsstr(reinterpret_cast(this->nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkOpening.c_str())) || @@ -3874,10 +3875,10 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i this->nameEdit->Invalidate(); } return 0; - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(88); return 0; - case 213: + case ID_CHECK: if (sender == this->unknown_00E8) { if (b > 0) { g_session.SendPetAutoFeedOption(1); @@ -3940,7 +3941,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i default: return 0; } - case 34: + case UM_SETINFO: this->saved = reinterpret_cast(a); if (!this->saved->IsValid()) { this->saved->Reset(); @@ -4204,9 +4205,9 @@ void UIMessageBoxAutoreturn::Configure(const char* text, int timeout) { // FUNCTION: fn_11806 int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { int error; if (_mbsstr(reinterpret_cast(this->m_nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkOpening.c_str())) || _mbsstr(reinterpret_cast(this->m_nameEdit->Text()), reinterpret_cast(s_messageBoxItemLinkClosing.c_str()))) { @@ -4282,7 +4283,7 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: g_modeMgr.gameMode->SendMsg(10017, reinterpret_cast(values), 0, 0, 0); return 0; } - case 185: + case ID_CANCEL: g_windowMgr.Schedule(this); g_modeMgr.gameMode->SendMsg(0, 10004, 0, 0, 0); return 0; @@ -4304,16 +4305,16 @@ int UIMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: default: return 0; } - case 0: { + case UM_DEFPUSH: { 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); return 0; } - case 8: - case 11: - case 12: { + case UM_SCROLLHORZ: + case UM_SCROLLHORZPAGEUP: + case UM_SCROLLHORZPAGEDOWN: { const int sex = this->m_info.sex; if (sender == this->unknown_02CC) { const int previous = this->unknown_02D4; diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index fd80a9ef3..d15ca88fa 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/UIEnums.h" #include "Client/Application/Launcher.h" #include "Client/Replay.h" @@ -616,19 +617,19 @@ void UINavigationWnd::Paint() { int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0x22: + case UM_SETINFO: this->m_saved = reinterpret_cast(argument1); reinterpret_cast(this->m_saved)->Clamp(); this->Move(this->m_saved->x, this->m_saved->y); this->Invalidate(); return 0; - case 6: + case UM_COMMAND: if (argument1 != 0x150 && argument1 != 0x1B9) { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); } switch (argument1) { - case 0xB8: { + case ID_OK: { this->Invalidate(); int result = g_navigationManager.SaveCurrentTarget(); if (result == 0) { @@ -647,7 +648,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume g_navigationManager.ShowRouteResult(result, 1); return 0; } - case 0x141: + case ID_SEARCH: if (this->m_titleBar->Length() != 0) { g_navigationManager.unknown_1264 = this->m_titleBar->Text(); g_navigationManager.RefreshSearch(); @@ -658,7 +659,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } } break; - case 0x150: + case ID_SELECT_ITEM: if (g_replayAnimationScaling == 0) { argument2 = this->m_routePanel->selected; } @@ -696,7 +697,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume this->ApplyMinimized(); this->Invalidate(); return 0; - case 0xCA: + case ID_MINI: g_navigationManager.unknown_1254 = !g_navigationManager.unknown_1254; this->ApplyMinimized(); this->RefreshHeaderTexts(g_navigationManager.unknown_1258); @@ -705,7 +706,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } break; - case 0xC9: + case ID_CLOSE: if (g_navigationManager.unknown_1258 == 2) { const int response = g_windowMgr.Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 280, 120, 0); if (response != 0xBB) { @@ -763,7 +764,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume } return 0; } - case 0xD5: + case ID_CHECK: if (sender == this->unknown_0114) { g_navigationManager.unknown_127C = argument2 != 0; return 0; @@ -777,7 +778,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } break; - case 0x157: + case ID_HELP: if (!g_windowMgr.CloseWindow(0xE5)) { g_windowMgr.EnsureWindow(0xE5); return 0; @@ -802,7 +803,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume break; } break; - case 0x27: + case UM_COMBOBOX_SELECTED: if (this->unknown_00EC == sender) { g_navigationManager.unknown_1260 = static_cast(argument1); this->Invalidate(); @@ -817,21 +818,21 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } break; - case 0x1F: + case UM_ADDITEM: switch (argument1) { - case 0x150: + case ID_SELECT_ITEM: this->m_routePanel->AddLine(reinterpret_cast(argument2)); break; case 0x1B9: this->m_searchPanel->AddLine(reinterpret_cast(argument2)); break; } - case 0: + case UM_DEFPUSH: if (this->m_titleBar == sender && this->m_titleBar->Length() > 0) { this->SendMsg(this->m_titleBar, 6, 0x141, 0, 0, 0); return 0; } - case 0xE: + case UM_RESIZE: if (argument1 == 7) { const int height = (std::min)((std::max)(static_cast(argument3), 0x152), 0x152); this->m_saved->height = height; diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index c56666003..8056e1714 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -1,4 +1,5 @@ #include "Render/DeviceContext/DCSurface.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UINewMakeCharWnd.h" @@ -233,7 +234,7 @@ void UINewMakeCharWnd::OnProcess() { // FUNCTION: fn_09624 int UIHairStyleButton::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 13: { + case UM_SETSTATE: { bool previous = this->m_selected; this->m_selected = argument1 != 0; if (previous != (argument1 != 0)) { @@ -250,7 +251,7 @@ int UIHairStyleButton::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; } - case 40: { + case UM_SETCURITEM: { char name[128]; memset(name, 0, sizeof(name)); if (this->m_race == 0) { @@ -516,16 +517,16 @@ void UINewMakeCharWnd::OnCreate(int width, int height) { // FUNCTION: fn_09625 int UINewMakeCharWnd::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: { 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); return 0; } - case 6: + case UM_COMMAND: break; - case 13: + case UM_SETSTATE: this->m_race = static_cast(argument1); [[fallthrough]]; default: @@ -533,7 +534,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } switch (argument1) { - case 0xB8: { + case ID_OK: { for (int index = 0; index < 2; ++index) { if ((g_doramCreationEnabled || index != 1) && sender == this->m_raceViews[index]) { return 0; @@ -611,12 +612,12 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum return 0; } - case 0xB9: + case ID_CANCEL: g_windowMgr.Schedule(this); g_modeMgr.gameMode->SendMsg(0, 0x2714, 0, 0, 0); return 0; - case 0xCC: + case ID_SLOT: if (g_doramCreationEnabled || sender != this->m_raceViews[1]) { for (int index = 0; index < 2; ++index) { if (sender == this->m_raceViews[index]) { @@ -646,7 +647,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } return 0; - case 0xD7: + case ID_RADIOBTN: if (argument2 == 0x1EF) { for (int index = 0; index < 9; ++index) { if (sender == this->m_hairColorButtons[index]) { @@ -663,7 +664,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } return 0; - case 0xE2: + case ID_RIGHT: if (argument2 == 0) { --this->m_action; if (this->m_action < this->unknown_01FC) { @@ -673,7 +674,7 @@ int UINewMakeCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum } return 0; - case 0xE3: + case ID_LEFT: if (argument2 == 0) { ++this->m_action; if (this->m_action >= this->unknown_01FC + 8) { diff --git a/Source/UI/Window/UINewSelectCharWnd.cpp b/Source/UI/Window/UINewSelectCharWnd.cpp index 1125233b6..19e38f384 100644 --- a/Source/UI/Window/UINewSelectCharWnd.cpp +++ b/Source/UI/Window/UINewSelectCharWnd.cpp @@ -1,4 +1,5 @@ #include "Contents/MessageTable.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CMode.h" #include "Client/Input/Mouse.h" #include "UI/Window/UINewSelectCharWnd.h" @@ -582,9 +583,9 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 0xB8: { + case ID_OK: { if (this->m_unknown13C) { break; } @@ -626,7 +627,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; } - case 0xB9: + case ID_CANCEL: g_accountLinkedUserDataMgr->Save(); if (g_session.m_loginModeFlag == 1) { if (g_windowMgr.Confirm(LookupMessage(0xD68), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { @@ -637,7 +638,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg g_windowMgr.Schedule(this); } break; - case 0xCB: + case ID_MAKE: if (this->m_pageSlot != argument2) { this->m_pageSlot = argument2; this->SendMsg(this->m_slotButtons2[argument2], 6, 0xCC, 0, 0, 0); @@ -647,7 +648,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg g_windowMgr.CloseWindow(0x115); } break; - case 0xCC: { + case ID_SLOT: { if (this->m_unknown13C || g_windowMgr.HasModalWindow() == 1) { break; } @@ -697,7 +698,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); break; } - case 0xD3: { + case ID_DELETE: { if (this->m_slotStatus[static_cast(g_selectedSlotIndex)] == 1) { break; } @@ -725,15 +726,15 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; } - case 0x11C: - case 0x11E: { + case ID_CHARGE: + case ID_NOTICE: { char text[260]; std::memset(text, 0, sizeof(text)); g_modeMgr.gameMode->SendMsg(0x2724, reinterpret_cast(text), 0, 0, 0); g_windowMgr.Confirm(text, 0, true, false, 0, "Message", 0x118, 0x78, 0); break; } - case 0x13C: { + case ID_PREV_PAGE: { if (this->m_page <= 0) { break; } @@ -799,7 +800,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->UpdateCharacterInfo(); break; } - case 0x13D: { + case ID_NEXT_PAGE: { if (this->m_page >= this->m_pageCount - 1) { break; } @@ -865,7 +866,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->UpdateCharacterInfo(); break; } - case 0x15F: { + case ID_CHANGE_NAME: { if (g_windowMgr.window_03DC != nullptr) { g_windowMgr.CloseWindow(0x80); } @@ -876,7 +877,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; } - case 0x160: { + case ID_CHANGE_NAME_SUCCESS: { CharacterInfo* info = reinterpret_cast(g_modeMgr.gameMode->SendMsg(8, static_cast(g_selectedSlotIndex), 0, 0, 0)); if (info->gid != g_renameGid) { @@ -961,12 +962,12 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } break; - case 13: + case UM_SETSTATE: if (!this->m_unknown13C) { this->m_pageSlot = argument1; } break; - case 0x12: + case UM_UPPUSH: if (this->m_unknown13C) { break; } @@ -992,7 +993,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->SaveCurrentSlot(); } break; - case 0x13: + case UM_DOWNPUSH: if (this->m_unknown13C) { break; } @@ -1020,7 +1021,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->SaveCurrentSlot(); } break; - case 0x14: + case UM_LEFTPUSH: if (this->m_unknown13C) { break; } @@ -1044,7 +1045,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->SaveCurrentSlot(); } break; - case 0x15: + case UM_RIGHTPUSH: if (this->m_unknown13C) { break; } @@ -1072,7 +1073,7 @@ int UINewSelectCharWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->SaveCurrentSlot(); } break; - case 0x21: + case UM_DELETE: this->SendMsg(nullptr, 6, 0xD3, 0, 0, 0); break; default: diff --git a/Source/UI/Window/UINewSkillListWnd.cpp b/Source/UI/Window/UINewSkillListWnd.cpp index add3a990a..9cc93033e 100644 --- a/Source/UI/Window/UINewSkillListWnd.cpp +++ b/Source/UI/Window/UINewSkillListWnd.cpp @@ -1,4 +1,5 @@ #include "Contents/Jobs/JobId.h" +#include "UI/Window/UIEnums.h" #include "Render/DeviceContext/DCSurface.h" #include "UI/Window/UINewSkillListWnd.h" #include "Client/Mode/CGameMode.h" @@ -1300,7 +1301,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s CMode* gameMode = g_modeMgr.gameMode; switch (message) { - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(a); if (this->m_saved->IsValid() == 0) { this->m_saved->Reset(); @@ -1311,7 +1312,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->SendMsg(nullptr, 14, 3, 560, 400, 0); } return 0; - case 14: + case UM_RESIZE: if (a == 3) { if (gate != 0) { const int minimum = this->m_tabs->geometry.height + 12; @@ -1335,12 +1336,12 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } break; - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(37); return 0; - case 271: + 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); @@ -1354,7 +1355,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->ResetLists(); this->SendMsg(nullptr, 23, 0, 0, 0, 0); return 0; - case 202: + case ID_MINI: this->StoreInfo(); this->m_needsRedraw = 1; gate = gate == 0; @@ -1364,18 +1365,18 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->SendMsg(nullptr, 14, 3, 560, 400, 0); } return 0; - case 213: { + case ID_CHECK: { int& flag = g_session.m_showSkillDescription; flag = flag == 0; return 0; } - case 239: - case 240: - case 241: - case 242: - case 243: - case 244: - case 245: + case ID_LVLUP1: + case ID_LVLUP2: + case ID_LVLUP3: + case ID_LVLUP4: + case ID_LVLUP5: + case ID_LVLUP6: + case ID_LVLUP7: case 246: case 247: case 248: @@ -1421,7 +1422,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } } break; - case 22: { + case UM_TAB: { std::list& list = this->SkillList(a, false); if (!this->IsExtraTab(a) && list.size() == 0) { this->m_tabs->unknown_007C = this->m_tab; @@ -1441,19 +1442,19 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s this->Invalidate(); return 0; } - case 23: + case UM_REFRESHITEM: this->ResetLists(); g_session.m_skillBundle.NumberExtra(); this->UpdateScrollBar(); this->LayoutButtons(); this->Invalidate(); return 0; - case 60: + case UM_REFRESH: this->InitTabs(); return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; int next; if (message == 9) { @@ -1473,7 +1474,7 @@ int UINewSkillListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } return next - previous; } - case 58: { + case UM_USESKILL: { const CSkillInfo* skill = reinterpret_cast(a); if (skill->level != 0) { gameMode->SendMsg(113, a, g_session.UseLevel(skill->id), 0, 0); diff --git a/Source/UI/Window/UINormalMB.cpp b/Source/UI/Window/UINormalMB.cpp index 49ec1fb0a..5bf523513 100644 --- a/Source/UI/Window/UINormalMB.cpp +++ b/Source/UI/Window/UINormalMB.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UINormalMB.h" +#include "UI/Window/UIEnums.h" #include "Contents/MessageTable.h" #include "Render/Renderer.h" #include "Resource/ResourceMgr.h" @@ -26,7 +27,7 @@ void UINormalMB::Paint() { // FUNCTION: fn_12943 int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: { + case UM_COMMAND: { const int id = static_cast(a); const auto action = this->m_actions.find(id); @@ -47,7 +48,7 @@ int UINormalMB::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int return 0; } - case 57: + case UM_CHANGEMSG: this->m_viewer->Clear(); this->m_viewer->SendMsg(nullptr, 29, a, 38, 0, 0); return 0; diff --git a/Source/UI/Window/UIPetEvolutionWnd.cpp b/Source/UI/Window/UIPetEvolutionWnd.cpp index 72d8870eb..174b60113 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/UIEnums.h" #include "Client/Session.h" #include "Contents/Items/ItemInfo.h" @@ -133,7 +134,7 @@ namespace { // FUNCTION: fn_13765 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 6: + case UM_COMMAND: if (argument1 == 184) { std::vector materials; for (auto it = this->m_materials.begin(); it != this->m_materials.end(); ++it) { @@ -166,7 +167,7 @@ int UIPetEvolutionWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; - case 98: { + case UM_TEXT_LBTN_UP: { ITEM_INFO item; item.SetItemId(argument1); item.identified = 1; diff --git a/Source/UI/Window/UIRebirthWnd.cpp b/Source/UI/Window/UIRebirthWnd.cpp index 2a7d62b59..22d92e437 100644 --- a/Source/UI/Window/UIRebirthWnd.cpp +++ b/Source/UI/Window/UIRebirthWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIRebirthWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "UI/Buttons/UIBitmapButton.h" @@ -45,23 +46,23 @@ int UIRebirthWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1 } switch (argument1) { - case 185: + case ID_CANCEL: g_windowMgr.CloseWindow(129); break; - case 220: + case ID_RESTART: mode->SendMsg(25, 0, 0, 0, 0); g_windowMgr.CloseWindow(129); break; - case 251: + case ID_QUIT: g_windowMgr.CloseWindow(129); mode->SendMsg(88, 0, 0, 0, 0); break; - case 252: + case ID_TO_CHARACTER_SELECT: mode->SendMsg(25, 1, 0, 0, 0); g_windowMgr.CloseWindow(129); g_windowMgr.CloseWindow(269); break; - case 353: + case ID_REBIRTH: mode->SendMsg(250, 0, 0, 0, 0); g_windowMgr.CloseWindow(129); break; diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index 188f43258..745d3b3da 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIRoMapWnd.h" +#include "UI/Window/UIEnums.h" #include "Script/LuaScript.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -725,9 +726,9 @@ void CFlyingShipRouteInfo::BuildRoute(const std::vector& mapNames) // FUNCTION: fn_12754 int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(140); return 0; case 192: @@ -743,7 +744,7 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } this->UpdateNavigationButtons(); return 0; - case 321: + case ID_SEARCH: if (this->m_searchEdit->Length()) { std::string name(this->m_searchEdit->Text()); if (g_navigationManager.SearchNavigation(name, 0, true) == true) { @@ -754,7 +755,7 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } return 0; - case 39: + case UM_COMBOBOX_SELECTED: if (this->m_worldCombo == sender) { g_worldViewMgr.currentWorld = argument1; this->Invalidate(); @@ -779,13 +780,13 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, } return 0; - case 60: + case UM_REFRESH: this->ClearRecords(); this->RefreshPartyRecords(); this->Invalidate(); return 0; - case 0: + case UM_DEFPUSH: if (sender == this->m_searchEdit) { if (this->m_searchEdit->Length() > 0) { this->SendMsg(this->m_searchEdit, 6, 321, 0, 0, 0); diff --git a/Source/UI/Window/UIRodexContentsWnd.cpp b/Source/UI/Window/UIRodexContentsWnd.cpp index f19e6c656..ae27088dd 100644 --- a/Source/UI/Window/UIRodexContentsWnd.cpp +++ b/Source/UI/Window/UIRodexContentsWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Text/FontCache.h" +#include "UI/Window/UIEnums.h" #include "Render/Text/TextContext.h" #include "UI/Window/UIRodexContentsWnd.h" #include "Client/Mode/CMode.h" @@ -274,14 +275,14 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->Invalidate(); } break; - case 0xC9: + case ID_CLOSE: g_windowMgr.CloseWindow(265); g_rodexMailStore->currentMailId = 0; if (g_windowMgr.unknown_0454) { reinterpret_cast(g_windowMgr.unknown_0454)->SendMsg(nullptr, 60, 0, 0, 0, 0); } break; - case 0xD3: { + case ID_DELETE: { RodexMailStore* store = g_rodexMailStore; std::map* mails; if (store->unknown_0010 == 0) { @@ -310,7 +311,7 @@ int UIRodexContentsWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; } - case 0x131: + case ID_SEND_MAIL: if (this->unknown_010C != 1) { g_modeMgr.GetGameMode()->SendMsg(0x10C, reinterpret_cast(this->m_title.c_str()), 0, 0, 0); } diff --git a/Source/UI/Window/UIRoulletteWnd.cpp b/Source/UI/Window/UIRoulletteWnd.cpp index 68c175b22..2dc125ff8 100644 --- a/Source/UI/Window/UIRoulletteWnd.cpp +++ b/Source/UI/Window/UIRoulletteWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UIRoulletteWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Input/InputCharset.h" #include "Client/Mode/CMode.h" #include "Client/Mode/ModeMgr.h" @@ -358,7 +359,7 @@ void UIRoulletteWnd::OnRBtnDown(int x, int y) { 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) { switch (argument1) { - case 201: + case ID_CLOSE: if (g_rouletteMgr->m_spinning == 0) { if (g_windowMgr.unknown_0464 != nullptr) { g_windowMgr.CloseWindow(269); diff --git a/Source/UI/Window/UISecondCostumeWnd.cpp b/Source/UI/Window/UISecondCostumeWnd.cpp index 74ce32b7a..0c9de16b6 100644 --- a/Source/UI/Window/UISecondCostumeWnd.cpp +++ b/Source/UI/Window/UISecondCostumeWnd.cpp @@ -1,3 +1,4 @@ +#include "UI/Window/UIEnums.h" #include "Resource/Bitmap/BitmapResource.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Window/UISecondCostumeWnd.h" @@ -224,13 +225,13 @@ void UISecondCostumeWnd::Paint() { // FUNCTION: fn_12948 int UISecondCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 201: + case ID_CLOSE: g_windowMgr.CloseWindow(259); break; - case 226: + case ID_RIGHT: if (this->m_page < 1) { this->m_page = 7; } else { @@ -240,12 +241,12 @@ int UISecondCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, this->Invalidate(); return 0; - case 227: + case ID_LEFT: this->m_page = this->m_page < 7 ? this->m_page + 1 : 0; this->Invalidate(); return 0; - case 336: + case ID_SELECT_ITEM: if (this->m_list->selected != -1) { this->m_selected[this->m_tab] = this->m_list->selected; this->Invalidate(); @@ -256,7 +257,7 @@ int UISecondCostumeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; - case 39: + case UM_COMBOBOX_SELECTED: this->m_tab = static_cast(a); this->RefreshList(static_cast(a)); return 0; diff --git a/Source/UI/Window/UISeekPartyListWnd.cpp b/Source/UI/Window/UISeekPartyListWnd.cpp index 9f5eab8f5..9b9f9bf68 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/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" #include "Contents/Party/PartyBookingMgr.h" @@ -234,7 +235,7 @@ void UISeekPartyListWnd::OnCreate(int width, int height) { int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(argument1); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); @@ -244,9 +245,9 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); this->SendMsg(nullptr, 23, 0, 0, 0, 0); return 0; - case 6: + case UM_COMMAND: switch (argument1) { - case 202: + case ID_MINI: if (this->m_minimized) { this->Resize(this->geometry.width, this->m_restoreHeight); } else { @@ -259,7 +260,7 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg case 284: this->Invalidate(); return 0; - case 343: + case ID_HELP: g_windowMgr.EnsureWindow(0xAD); return 0; case 365: @@ -366,22 +367,22 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } return 0; } - case 201: + case ID_CLOSE: g_session.m_partyBooking.m_alarm = this->m_alarmCheck->geometry.unknown_0030 != 0; g_windowMgr.CloseWindow(0xA9); return 0; default: return 0; } - case 98: + case UM_TEXT_LBTN_UP: if (argument1 != 378 || g_windowMgr.CloseWindow(0xA8)) { return 0; } g_windowMgr.EnsureWindow(0xA8); return 0; - case 7: - case 9: - case 10: { + case UM_SCROLLVERT: + case UM_SCROLLVERTPAGEUP: + case UM_SCROLLVERTPAGEDOWN: { const int previous = this->m_firstRow; int next; if (message == 9) { @@ -400,7 +401,7 @@ int UISeekPartyListWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } return next - previous; } - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->m_regionCombo) { this->SelectRegion(static_cast(argument1) + 1); this->m_region = static_cast(argument1); diff --git a/Source/UI/Window/UISeekPartyMBWnd.cpp b/Source/UI/Window/UISeekPartyMBWnd.cpp index 2566fa733..4e7aee2df 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/UIEnums.h" #include "Client/Session.h" #include "Contents/MessageTable.h" #include "Contents/UserData/NormalItemSlots.h" @@ -34,9 +35,9 @@ struct PACKET_CZ_PARTY_BOOKING_REQ_REGISTER { int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { switch (message) { - case 6: + case UM_COMMAND: switch (a) { - case 184: { + case ID_OK: { for (int i = 0; i < 6; ++i) { this->m_registration.detail.job[i] = -1; } @@ -94,12 +95,12 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st } break; } - case 185: - case 201: + case ID_CANCEL: + case ID_CLOSE: g_windowMgr.CloseWindow(168); g_windowMgr.CloseWindow(170); break; - case 202: + case ID_MINI: if (this->m_minimized) { this->Resize(this->geometry.width, this->m_restoreHeight); } else { @@ -112,7 +113,7 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st break; } break; - case 34: + case UM_SETINFO: this->m_saved = reinterpret_cast(a); if (!this->m_saved->IsValid()) { this->m_saved->Reset(); @@ -122,7 +123,7 @@ int UISeekPartyMBWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st this->SendMsg(nullptr, 14, 3, this->m_saved->width, this->m_saved->height, 0); this->SendMsg(nullptr, 23, 0, 0, 0, 0); break; - case 39: + case UM_COMBOBOX_SELECTED: if (sender == this->m_typeCombo) { const int key = a + 2; this->m_subTypeCombo->Clear(); diff --git a/Source/UI/Window/UISelCharForUServerWnd.cpp b/Source/UI/Window/UISelCharForUServerWnd.cpp index 06aa8fdbb..63334bc52 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.cpp +++ b/Source/UI/Window/UISelCharForUServerWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UISelCharForUServerWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/CLoginMode.h" #include "Client/Mode/CMode.h" #include "Client/Session.h" @@ -138,7 +139,7 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t } switch (argument1) { - case 0xB8: { + case ID_OK: { if (g_windowMgr.Confirm(LookupMessage(0x4BB), 2, false, false, 0, "Message", 280, 120, 0) != 0xBB) { return 0; } @@ -171,7 +172,7 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_windowMgr.Confirm(LookupMessage(0x4C1), 0, true, true, 0, "Message", 280, 120, 0); break; } - case 0xD5: + case ID_CHECK: this->m_checkedCount += sender->geometry.unknown_0030 != 0 ? 1 : -1; if (this->m_checkedCount > 9) { g_windowMgr.Confirm(LookupMessage(0x4BC), 0, true, true, 0, "Message", 280, 120, 0); diff --git a/Source/UI/Window/UISerachStoreInfoWnd.cpp b/Source/UI/Window/UISerachStoreInfoWnd.cpp index 2a3b36db0..f9ac23fb4 100644 --- a/Source/UI/Window/UISerachStoreInfoWnd.cpp +++ b/Source/UI/Window/UISerachStoreInfoWnd.cpp @@ -1,4 +1,5 @@ #include "UI/Window/UISerachStoreInfoWnd.h" +#include "UI/Window/UIEnums.h" #include "Client/Mode/ModeMgr.h" #include "Client/Session.h" @@ -201,9 +202,9 @@ void UISerachStoreInfoWnd::OnRBtnDown(int x, int y) { // FUNCTION: fn_12759 int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 6: + case UM_COMMAND: switch (argument1) { - case 201: { + case ID_CLOSE: { SearchStoreRequestHeader packet; packet.packetType = 0x83B; GetRagConnection().Send(reinterpret_cast(GetRagConnection()).FixedLength(packet.packetType), &packet); @@ -214,10 +215,10 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a g_windowMgr.CloseWindow(181); break; } - case 213: + case ID_CHECK: this->unknown_00ED = argument2 != 0; break; - case 215: + case ID_RADIOBTN: for (int index = 0; index < 2; ++index) { this->m_radios[index]->Invalidate(); int checked; @@ -322,7 +323,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a } return UIFrameWnd::SendMsg(sender, message, argument1, argument2, argument3, argument4); - case 60: + case UM_REFRESH: if (argument1 != 0) { this->unknown_00F0 = ""; if (argument2 == 387) { @@ -367,7 +368,7 @@ int UISerachStoreInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a this->Invalidate(); return 0; - case 98: + case UM_TEXT_LBTN_UP: if (argument1 == 316) { if (this->unknown_00DC > 1) { this->unknown_00E0 = -1; diff --git a/Source/UI/Window/UIShowWarpWnd.cpp b/Source/UI/Window/UIShowWarpWnd.cpp index decf93a80..45f98ba09 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/UIEnums.h" #include "UI/Buttons/UIBitmapButton.h" #include "Client/Replay.h" #include "Client/Session.h" @@ -53,15 +54,15 @@ void UIShowWarpWnd::Paint() { // FUNCTION: fn_12949 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 0x13: + case UM_DOWNPUSH: this->m_list->SendMsg(nullptr, 0x13, 0, 0, 0, 0); return 0; - case 0x12: + case UM_UPPUSH: this->m_list->SendMsg(nullptr, 0x12, 0, 0, 0, 0); return 0; - case 0x22: { + case UM_SETINFO: { const char* name = reinterpret_cast(argument1); if (std::string(name) == "Random") { this->m_list->AddLine(LookupMessage(0xD4)); @@ -73,7 +74,7 @@ int UIShowWarpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument return 0; } - case 6: + case UM_COMMAND: this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); if (argument1 == 201) { g_windowMgr.CloseWindow(0x134); diff --git a/Source/UI/Window/UIVideoWnd.cpp b/Source/UI/Window/UIVideoWnd.cpp index 4b5cdea86..2859effa7 100644 --- a/Source/UI/Window/UIVideoWnd.cpp +++ b/Source/UI/Window/UIVideoWnd.cpp @@ -1,4 +1,5 @@ #include "Render/Renderer.h" +#include "UI/Window/UIEnums.h" #include "UI/Window/UIVideoWnd.h" #include "Contents/MessageTable.h" @@ -101,17 +102,17 @@ int UIVideoWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 521) { g_windowMgr.CloseWindow(304); } break; - case 0: + case UM_DEFPUSH: if (argument1 == 27) { this->SendMsg(nullptr, 5, 0, 0, 0, 0); } break; - case 5: + case UM_CLOSE: if (g_windowMgr.Confirm(LookupMessage(3142), 2, true, false, 0, "Message", 280, 120, 0) == 187) { g_windowMgr.CloseWindow(304); } diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index cf315c62b..b181262dc 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -1,4 +1,5 @@ #include "Client/Input/Mouse.h" +#include "UI/Window/UIEnums.h" #include "UI/Chat/UINewChatWnd.h" #include "Client/Application/Launcher.h" #include "Client/Input/InputCharset.h" @@ -388,12 +389,12 @@ void UIWindow::RefreshSnap() { // FUNCTION: fn_17005 int UIWindow::SendMsg(UIWindow*, int message, std::intptr_t, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 0: + case UM_DEFPUSH: if (this->parent) { this->Parent()->SendMsg(this, 0, 0, 0, 0, 0); } break; - case 1: + case UM_CANCELPUSH: if (this->parent) { this->Parent()->SendMsg(this, 1, 0, 0, 0, 0); } @@ -2604,14 +2605,14 @@ void UINavigationroadiconWnd::Paint() { // FUNCTION: fn_03626 int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) { switch (message) { - case 0x22: + case UM_SETINFO: this->info = reinterpret_cast(argument1); this->info->Clamp(); this->Move(this->info->x, this->info->y); this->Invalidate(); break; - case 6: + case UM_COMMAND: if (argument1 != 0x150 && argument1 != 0x1B9) { this->RecordResponse(static_cast(argument1), argument2, argument3, argument4); if (argument1 > 499) { @@ -2685,7 +2686,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; } - case 0x141: + case ID_SEARCH: if (static_cast(this->unknown_00E0)->Length() != 0 && !g_navigationManager.unknown_1254) { g_navigationManager.unknown_1264 = static_cast(this->unknown_00E0)->Text(); g_navigationManager.UpdateSearchResults(); @@ -2702,12 +2703,12 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu g_serverLanguage->ResetInput(); } break; - case 0xD5: + case ID_CHECK: g_navigationManager.unknown_127D = false; g_navigationManager.unknown_127C = argument2 != 0; g_navigationManager.unknown_127E = g_navigationManager.unknown_127C; break; - case 0xCA: + case ID_MINI: g_navigationManager.unknown_1254 = true; this->geometry.targetAlpha = 0xAA; this->geometry.alphaStart = timeGetTime(); @@ -2753,7 +2754,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; } - case 0x157: + case ID_HELP: if (!g_windowMgr.CloseWindow(0xE5)) { g_windowMgr.EnsureWindow(0xE5); } @@ -2763,7 +2764,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu g_windowMgr.EnsureWindow(0x13A); } break; - case 0x150: + case ID_SELECT_ITEM: if (g_replayAnimationScaling == 0) { argument2 = this->unknown_00EC->selected; } @@ -2839,7 +2840,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } } break; - case 0xC9: + case ID_CLOSE: if (g_navigationManager.unknown_1258 == 2) { if (g_windowMgr.Confirm(LookupMessage(0x8BF), 2, true, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_navigationManager.SetViewMode(1); @@ -2866,7 +2867,7 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; - case 0x27: + case UM_COMBOBOX_SELECTED: if (sender == this->unknown_00DC) { g_navigationManager.unknown_1260 = static_cast(argument1); g_navigationManager.BuildNodePaths(); @@ -2880,11 +2881,11 @@ int UINavigationV4Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu } break; - case 0x28: + case UM_SETCURITEM: this->SetRoadIcon(static_cast(argument1)); break; - case 0: + 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); } @@ -2994,12 +2995,12 @@ int UIListBox_NaviSearch::SendMsg( // FUNCTION: fn_03625 int UINavigationRuideWnd::SendMsg(UIWindow*, int message, std::intptr_t a, std::intptr_t, std::intptr_t, std::intptr_t) { switch (message) { - case 6: + case UM_COMMAND: if (a == 201) { g_windowMgr.CloseWindow(314); } [[fallthrough]]; - case 60: + case UM_REFRESH: this->RefreshRoute(); this->Invalidate(); break; @@ -3573,7 +3574,7 @@ int UIPrivateAirplaneWnd::SendMsg( UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4 ) { switch (message) { - case 6: + case UM_COMMAND: if (argument1 == 201) { if (!g_windowMgr.modalWindows.empty() && g_windowMgr.modalWindows.back()) { g_windowMgr.unknown_0474 = 0xBC; @@ -3583,7 +3584,7 @@ int UIPrivateAirplaneWnd::SendMsg( g_navigationManager.RequestPrivateAirship(mapName, static_cast(argument2)); } break; - case 35: + case UM_REFRESHBUTTON: for (UIBasicButton* button : this->m_buttons) { button->SetDisabled(1); button->Invalidate(); diff --git a/Source/UI/Window/UIWindowFactory.cpp b/Source/UI/Window/UIWindowFactory.cpp index b2ac91c00..536e70fdf 100644 --- a/Source/UI/Window/UIWindowFactory.cpp +++ b/Source/UI/Window/UIWindowFactory.cpp @@ -51,7 +51,7 @@ UIWindow* UIWindowMgr::CreateLayoutWindow(int id) { window = new UISerachStoreInfoWnd(); g_searchStoreInfoCreated = true; break; - case 0xD1: + case WID_ENTRYQUEUESTANDBYWND: window = new UIEntryQueueStandByWnd(); break; } diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 914b987b5..12b603c25 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -1,3 +1,5 @@ +#include "UI/Window/UIEnums.h" +#include "Contents/Hotkeys/InterfaceHotkey.h" #include "UI/Window/WindowId.h" #include "UI/Window/WindowPolicy.h" #include "Render/Renderer.h" @@ -556,7 +558,7 @@ UIWindow* UIWindowMgr::LookupWindow(int id) { return this->window_01CC; case WID_LOGINOTPWND: return this->window_01D0; - case WID_NEWCHATWND: + case WID_CHATWND: return this->window_01C8; case WID_CHATROOMMAKEWND: return this->window_0274; @@ -566,7 +568,7 @@ UIWindow* UIWindowMgr::LookupWindow(int id) { return this->window_027C; case WID_MESSENGERGROUPWND: return this->window_02C8; - case WID_NEWSKILLLISTWND: + case WID_SKILLLISTWND: return this->window_02C4; case WID_GUILDMEMBERMANAGEWND: return this->window_0324; @@ -1594,25 +1596,25 @@ bool UIWindowMgr::ProcessKeyDown(int key, int keyData, int pressed) { if (hoverOnButton) { if (this->modifierKey == 0) { switch (this->keyCode) { - case 0x09: - case 0x0D: - case 0x10: - case 0x11: - case 0x12: - case 0x14: - case 0x2D: - case 0x70: - case 0x71: - case 0x72: - case 0x73: - case 0x74: - case 0x75: - case 0x76: - case 0x77: - case 0x78: - case 0x79: - case 0x7A: - case 0x7B: + case VK_TAB: + case VK_RETURN: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_CAPITAL: + case VK_INSERT: + case VK_F1: + case VK_F2: + case VK_F3: + case VK_F4: + case VK_F5: + case VK_F6: + case VK_F7: + case VK_F8: + case VK_F9: + case VK_F10: + case VK_F11: + case VK_F12: break; default: return this->ProcessHotkeyAction(key, pressed); @@ -1842,7 +1844,7 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: it->second->SendMsg(nullptr, 154, a, 0, 0, 0); } break; - case 14: { + case UIM_MAKE_WHISPER_WINDOW: { std::string name(text); if (this->namedWindows.find(name) == this->namedWindows.end()) { UIWhisperWnd* window = new UIWhisperWnd(); @@ -1879,23 +1881,23 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: } break; } - case 7: + case UIM_SAVE_CHAT_TO_FILE_FROM_CHATROOM: if (this->window_027C != nullptr) { static_cast(this->window_027C)->SaveChatLog(); } break; - case 6: + case UIM_SAVE_CHAT_TO_FILE: if (this->window_01C8 != nullptr) { static_cast(this->window_01C8)->SaveChatLogs(); } break; - case 5: + case UIM_PUSH_INTO_CHATROOM: if (this->window_027C != nullptr) { this->window_027C->SendMsg(nullptr, 37, a, b, 0, 0); } break; - case 1: - case 19: { + case UIM_PUSHINTOCHATHISTORY: + case UIM_PUSHINTOCHATHISTORY2: { if (g_replayAnimationScaling != 0 && !Replay::Instance().header.options.recordRestricted) { break; } @@ -1921,27 +1923,27 @@ int UIWindowMgr::SendNotice(int selector, std::intptr_t a, std::intptr_t b, std: } break; } - case 4: + case UIM_LOADINGPERCENT: if (this->unknown_01BC != nullptr) { this->unknown_01BC->SendMsg(nullptr, 17, a, 0, 0, 0); } break; - case 3: + case UIM_OPENCHATWND: this->ShowWindowById(1, 1); if (this->window_01C8 != nullptr) { this->window_01C8->SendMsg(nullptr, 16, 0, 0, 0, 0); } break; - case 2: + case UIM_CHANGECHATWNDSTATUS: if (this->window_01C8 != nullptr) { this->window_01C8->SendMsg(nullptr, 15, a, 0, 0, 0); } break; - case 8: - case 9: + case UIM_IME_OPENCANDIDATE: + case UIM_IME_CHANGECANDIDATE: this->EnsureWindow(51)->SendMsg(nullptr, 65, a, b, 0, 0); break; - case 10: + case UIM_IME_CLOSECANDIDATE: this->CloseWindow(51); break; } @@ -2465,7 +2467,7 @@ void UIWindowMgr::DrawLoginOverlay() { // FUNCTION: fn_17220 bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { switch (action) { - case 18: + case VK_MENU: if (this->modifierKey == 0) { if (UIWindow* window = this->LookupWindow(140)) { window->SendMsg(nullptr, 6, 219, 0, 0, 0); @@ -2474,7 +2476,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { } break; - case 27: { + case VK_ESCAPE: { if (!pressed) { break; } @@ -2533,8 +2535,8 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { case WID_ITEMPURCHASEWND: case WID_ITEMSELLWND: case WID_CHOOSESELLBUYWND: - case WID_MERCHANTSHOPMAKEWND_MODE_0: - case WID_MERCHANTITEMPURCHASEWND_MODE_0: + case WID_MERCHANTSHOPMAKEWND: + case WID_MERCHANTITEMPURCHASEWND: case WID_ITEMSELLWND2: case WID_MERCHANTSHOPMAKEWND_MODE_1: case WID_MERCHANTITEMPURCHASEWND_MODE_1: @@ -2610,7 +2612,7 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { return false; } - case 9: + case VK_TAB: if (HIBYTE(GetAsyncKeyState(VK_CONTROL))) { break; } @@ -2645,44 +2647,44 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { this->RestoreInput(); return false; - case 13: + case VK_RETURN: if (pressed) { this->ProcessEnterKey(); } break; - case 33: + case VK_PRIOR: if (this->window_4F1D4) { this->window_4F1D4->BroadcastMsg3(); return false; } break; - case 34: + case VK_NEXT: if (this->window_4F1D4) { this->window_4F1D4->BroadcastMsg4(); return false; } break; - case 38: + case VK_UP: this->ConfirmActiveDialog(); return false; - case 40: + case VK_DOWN: this->SubmitActiveDialog(); return false; - case 37: + case VK_LEFT: this->CancelActiveDialog(); return false; - case 39: + case VK_RIGHT: this->BroadcastMessage21(); return false; - case 44: - case 145: + case VK_SNAPSHOT: + case VK_SCROLL: if (pressed) { g_modeMgr.gameMode->SendMsg(68, 0, 0, 0, 0); return false; @@ -2696,14 +2698,14 @@ bool UIWindowMgr::ProcessHotkeyAction(int action, int pressed) { } break; - case 36: + case VK_HOME: if (this->window_4F1D4) { this->window_4F1D4->SendMsg(nullptr, 179, 0, 0, 0, 0); return false; } break; - case 35: + case VK_END: if (this->window_4F1D4) { this->window_4F1D4->SendMsg(nullptr, 114, 0, 0, 0, 0); } @@ -2755,7 +2757,7 @@ bool UIWindowMgr::CloseWindow(int id) { } switch (id) { - case WID_NEWCHATWND: + case WID_CHATWND: this->CloseWindow(26); if (this->window_01C8) { this->Schedule(this->window_01C8); @@ -2794,7 +2796,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_EQUIPWND_VIEWOTHER_0: + case WID_EQUIPWND: if (this->unknown_01E0) { this->Schedule(this->unknown_01E0); this->unknown_01E0 = nullptr; @@ -2834,7 +2836,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_SAYDIALOGWND_DIALOG: + case WID_SAYDIALOGWND: if (this->unknown_01F0) { this->Schedule(this->unknown_01F0); this->unknown_01F0 = nullptr; @@ -2855,7 +2857,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_CHOOSE3WND: + case WID_CHOOSEWND: if (this->unknown_01F8) { this->Schedule(this->unknown_01F8); this->unknown_01F8 = nullptr; @@ -2934,7 +2936,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_MERCHANTITEMPURCHASEWND_MODE_0: + case WID_MERCHANTITEMPURCHASEWND: if (this->unknown_0308) { this->Schedule(this->unknown_0308); this->unknown_0308 = nullptr; @@ -2949,14 +2951,14 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_MERCHANTITEMMYSHOPWND_MODE_0: + case WID_MERCHANTITEMMYSHOPWND: if (this->unknown_0304) { this->Schedule(this->unknown_0304); this->unknown_0304 = nullptr; closed = true; } break; - case WID_MERCHANTITEMSHOPWND_MODE_0: + case WID_MERCHANTITEMSHOPWND: if (this->unknown_0300) { this->Schedule(this->unknown_0300); this->unknown_0300 = nullptr; @@ -3152,7 +3154,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_NEWSKILLLISTWND: + case WID_SKILLLISTWND: if (g_windowMgr.LookupWindow(10030)) { this->CloseWindow(10030); } @@ -3171,7 +3173,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case 69: + case WID_MESSENGERWND: if (this->window_02C8) { this->window_02C8->StoreInfo(); } @@ -3189,7 +3191,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_MERCHANTSHOPMAKEWND_MODE_0: + case WID_MERCHANTSHOPMAKEWND: this->CloseWindow(42); if (this->unknown_02FC) { this->Schedule(this->unknown_02FC); @@ -3197,7 +3199,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case WID_MERCHANTMIRRORITEMWND_MODE_0: + case WID_MERCHANTMIRRORITEMWND: if (this->unknown_02F8) { this->Schedule(reinterpret_cast(this->unknown_02F8)); this->unknown_02F8 = 0; @@ -3283,7 +3285,7 @@ bool UIWindowMgr::CloseWindow(int id) { closed = true; } break; - case 59: + case WID_GUILDWND: { const bool closed60 = g_windowMgr.CloseWindow(60); const bool closed61 = g_windowMgr.CloseWindow(61); @@ -4251,27 +4253,27 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } switch (hotkey) { - case 0x64: + case HK_BASICINFOWND_MINI + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xCA, 0, 0, 0); } break; - case 0x65: + case HK_EQUIPWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xC3, 0, 0, 0); } break; - case 0x66: + case HK_SKILLWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xC4, 0, 0, 0); } break; - case 0x67: + case HK_QUESTWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0x169, 0, 0, 0); } break; - case 0x68: + case HK_FRIENDWND_ONOFF + 100: if (this->unknown_01DC) { int previous; std::memcpy(&previous, this->unknown_0740, sizeof(previous)); @@ -4284,7 +4286,7 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x69: + case HK_PARTYWND_ONOFF + 100: if (this->unknown_01DC) { int previous; std::memcpy(&previous, this->unknown_0740, sizeof(previous)); @@ -4297,27 +4299,27 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x6A: + case HK_CHATWND_MAKE + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xD6, 0, 0, 0); } break; - case 0x6B: + case HK_CARTWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xF7, 0, 0, 0); } break; - case 0x6C: + case HK_MAPWND_ONOFF + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x8C)) { g_windowMgr.EnsureWindow(0x8C); } break; - case 0x6D: + case HK_ITEMWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xC2, 0, 0, 0); } break; - case 0x6E: + case HK_GUILDWND_ONOFF + 100: if (this->unknown_01DC) { if (g_guildInfo.m_guildId != 0) { if (!g_windowMgr.CloseWindow(0x3B)) { @@ -4328,22 +4330,22 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x90: + case HK_CLANWND_ONOFF + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0xED)) { g_windowMgr.EnsureWindow(0xED); } break; - case 0x6F: + case HK_EMOTIONWND_ONOFF + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x57)) { g_windowMgr.EnsureWindow(0x57); } break; - case 0x70: + case HK_SITORSTAND + 100: if (g_modeMgr.gameMode) { g_modeMgr.gameMode->SendMsg(0x2A, 0x16, 0, 0, 0); } break; - case 0x71: + case HK_MINIMAP_ONOFF + 100: if (g_windowMgr.modal == nullptr && static_cast(g_modeMgr.GetGameMode())->unknown_0254 != 0) { if (this->unknown_005C == 0xFFFFFFFF) { this->unknown_005C = 0xAAFFFFFF; @@ -4355,30 +4357,30 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x72: + case HK_MACROWND_ONOFF + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x56)) { g_windowMgr.EnsureWindow(0x56); } break; - case 0x73: + case HK_EXEWND_ONOFF + 100: if (this->unknown_01DC) { ToggleGameSettingsTab4(); } break; - case 0x74: + case HK_ALLWND_OFF + 100: this->CycleWindowVisibility(4); break; - case 0x75: + case HK_SKILLBAR_ONOFF + 100: if (UIWindow* window = this->LookupWindow(0x24)) { window->SendMsg(nullptr, 6, 0xD8, 0, 0, 0); } break; - case 0x76: + case HK_CHATWND_ONOFF + 100: if (this->unknown_01DC) { this->ShowWindowById(1, 1 - this->unknown_003C); } break; - case 0x77: + case HK_CHATWND_ZOOM + 100: if (UIWindow* window = this->window_01C8) { if (window->geometry.visible != 0) { window->SendMsg(nullptr, 2, 0, 0, 0, 0); @@ -4391,37 +4393,37 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x78: + case HK_GAGE_ONOFF + 100: if (g_modeMgr.gameMode) { g_modeMgr.gameMode->SendMsg(0x29, 0, 0, 0, 0); } break; - case 0x79: + case HK_SNAPSHOT + 100: g_modeMgr.gameMode->SendMsg(0x44, 0, 0, 0, 0); break; - case 0x7A: + case HK_MEMORIALWND_ONOFF + 100: if (UIWindow* window = this->unknown_03F8) { window->Show(window->geometry.visible == 0); } else { g_windowMgr.EnsureWindow(0x89); } break; - case 0x7B: + case HK_PETWND_ONOFF + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x58)) { g_windowMgr.EnsureWindow(0x58); } break; - case 0x7C: + case HK_HOMUNWND_ONOFF + 100: if (this->unknown_01DC && g_session.unknown_5614 != 0 && !g_windowMgr.CloseWindow(0x71)) { g_windowMgr.EnsureWindow(0x71); } break; - case 0x7D: + case HK_MERWND_ONOFF + 100: if (this->unknown_01DC && g_session.unknown_56B0 != 0 && !g_windowMgr.CloseWindow(0x7D)) { g_windowMgr.EnsureWindow(0x7D); } break; - case 0x7E: + case HK_HOMUN_FOLLOW + 100: if (g_session.unknown_5614 != 0) { g_session.ClearHomunStatus(); if (CMode* mode = g_modeMgr.GetGameMode()) { @@ -4438,7 +4440,7 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x7F: + case HK_MER_FOLLOW + 100: if (g_session.unknown_56B0 != 0) { g_session.ResetMercenaryStats(); if (CMode* mode = g_modeMgr.GetGameMode()) { @@ -4453,24 +4455,24 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x80: + case HK_FRIEND_OPTIONWND + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x44)) { g_windowMgr.EnsureWindow(0x44); } break; - case 0x81: + case HK_PARTY_OPTIONWND + 100: if (this->unknown_01DC && !g_windowMgr.CloseWindow(0x35) && g_session.PartyCount()) { g_windowMgr.EnsureWindow(0x35); } break; - case 0x87: { + case HK_GROUND_CURSOR_ONOFF + 100: { int flag; std::memcpy(&flag, g_session.unknown_546C, sizeof(flag)); flag = 1 - flag; std::memcpy(g_session.unknown_546C, &flag, sizeof(flag)); break; } - case 0x83: + case HK_CHATMODE_ONOFF + 100: if (this->unknown_01DC && this->chatModeChanged && this->window_01C8 && (this->IsHoverOnWindow01C8Button() || this->hoverWindow == nullptr)) { static_cast(this->window_01C8)->ToggleInput(); if (this->hoverWindow) { @@ -4478,12 +4480,12 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x84: + case HK_BASICINFOWND_BTN_ONOFF + 100: if (UIWindow* window = this->LookupWindow(0x133)) { window->SendMsg(nullptr, 60, 0, 0, 0, 0); } break; - case 0x89: + case HK_CASHSHOPWND + 100: if (this->unknown_01DC) { if (g_windowMgr.LookupWindow(0x13E) == nullptr) { g_modeMgr.GetGameMode()->SendMsg(0x143, 0, 0, 0, 0); @@ -4492,29 +4494,29 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x8A: + case HK_REPLAY_ONOFF + 100: if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { window->SendMsg(nullptr, 6, 0x18F, 0, 0, 0); } break; - case 0x8B: + 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); } break; - case 0x8C: + case HK_REPLAY_SPEEDP + 100: if (g_replayAnimationScaling != 0 && this->window_4F168) { this->window_4F168->SendMsg(nullptr, 6, 0x195, 0, 0, 0); } break; - case 0x8D: + case HK_REPLAY_SPEEDN + 100: if (g_replayAnimationScaling != 0 && this->window_4F168) { this->window_4F168->SendMsg(nullptr, 6, 0x196, 0, 0, 0); } break; - case 0x8E: + case HK_NAVIGATION_ONOFF + 100: if (g_windowMgr.window_4F174) { g_windowMgr.window_4F174->SendMsg(nullptr, 6, 0xC9, 0, 0, 0); } else if (g_windowMgr.modal) { @@ -4524,7 +4526,7 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } break; - case 0x92: + case HK_BANK + 100: if (g_windowMgr.window_0448) { g_windowMgr.CloseWindow(0x113); } else { @@ -4536,12 +4538,12 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { connection.Send(g_packetLengths.FixedLength(packet.id), &packet); } break; - case 0x93: + case HK_STATUSWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0xC0, 0, 0, 0); } break; - case 0x94: { + case HK_SHORTCUTWND_ROTATE + 100: { if (UIWindow* window = this->window_01E8) { window->SendMsg(nullptr, 143, 1, g_session.GetOption(10), 0, 0); } @@ -4558,12 +4560,12 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { connection.Send(g_packetLengths.FixedLength(packet.id), &packet); break; } - case 0x95: + case HK_ACHIEVEMENT + 100: if (!g_windowMgr.CloseWindow(0x10E)) { g_windowMgr.EnsureWindow(0x10E); } break; - case 0x96: + 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); @@ -4572,30 +4574,30 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { } } break; - case 0x97: + case HK_MAIL_ONOFF + 100: if (UIWindow* window = g_windowMgr.LookupWindow(0x133)) { window->SendMsg(nullptr, 6, 0x1DC, 0, 0, 0); } break; - case 0x98: + case HK_SWAP_EQUIPMENT + 100: g_modeMgr.GetGameMode()->SendMsg(0x130, 0, 0, 0, 0); break; - case 0x9A: + case HK_TIPBOXWND_ONOFF + 100: if (!g_windowMgr.CloseWindow(0x13B)) { g_windowMgr.EnsureWindow(0x13B); } break; - case 0x9B: + case HK_CHANGE_SKILLBAR + 100: if (UIWindow* window = g_windowMgr.LookupWindow(0x24)) { window->SendMsg(nullptr, 6, 0x225, 0, 0, 0); } break; - case 0x9C: + case HK_COSEQUIPWND_ONOFF + 100: if (this->unknown_01DC) { this->unknown_01DC->SendMsg(nullptr, 6, 0x242, 0, 0, 0); } break; - case 0x9D: + case HK_PARTYBOARDWND_ONOFF + 100: if (!g_windowMgr.CloseWindow(0x144)) { g_windowMgr.EnsureWindow(0x144); } @@ -4616,30 +4618,30 @@ bool UIWindowMgr::ProcessShortcutKey(int action) { case 0xA3: Singleton::GetInstance()->ToggleOption(0x10A); break; - case 0xC8: - case 0xC9: - case 0xCA: - case 0xCB: - case 0xCC: - case 0xCD: - case 0xCE: - case 0xCF: - case 0xD0: - case 0xD1: + case HK_MACRO_1 + 200: + case HK_MACRO_2 + 200: + case HK_MACRO_3 + 200: + case HK_MACRO_4 + 200: + case HK_MACRO_5 + 200: + case HK_MACRO_6 + 200: + case HK_MACRO_7 + 200: + case HK_MACRO_8 + 200: + case HK_MACRO_9 + 200: + case HK_MACRO_10 + 200: if (g_modeMgr.gameMode) { this->SendEmotionHotkey(hotkey - 200); } break; - case 0xD2: - case 0xD3: - case 0xD4: - case 0xD5: - case 0xD6: - case 0xD7: - case 0xD8: - case 0xD9: - case 0xDA: - case 0xDB: + case HK_FLAG_1 + 200: + case HK_FLAG_2 + 200: + case HK_FLAG_3 + 200: + case HK_FLAG_4 + 200: + case HK_FLAG_5 + 200: + case HK_FLAG_6 + 200: + case HK_FLAG_7 + 200: + case HK_FLAG_8 + 200: + case HK_FLAG_9 + 200: + case HK_FLAG_10 + 200: this->SendFlagEffect(hotkey); break; default: @@ -4665,7 +4667,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { if (this->window_4F288) { switch (id) { case WID_ITEMWND: - case WID_EQUIPWND_VIEWOTHER_0: + case WID_EQUIPWND: case WID_MENUWND: case WID_MERCHANTITEMWND: case WID_ESCOPTIONWND: @@ -4758,7 +4760,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->ShowWindowById(36, this->m_normalItemSlotWindow.show); this->ShowWindowById(15, 0); break; - case WID_NEWCHATWND: + case WID_CHATWND: window = this->window_01C8; if (window == nullptr) { window = new UINewChatWnd(); @@ -4911,7 +4913,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { g_snapMgr.Add(window); } break; - case WID_EQUIPWND_VIEWOTHER_0: + case WID_EQUIPWND: window = this->unknown_01E0; if (window == nullptr) { window = new UIEquipWnd(); @@ -4957,7 +4959,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { basicInfo->SendMsg(nullptr, 6, 0x11E, 0xC0, 0, 0); } break; - case WID_NEWSKILLLISTWND: + case WID_SKILLLISTWND: window = this->window_02C4; if (window == nullptr) { window = new UINewSkillListWnd(); @@ -5110,7 +5112,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { g_windowMgr.CloseWindow(169); } break; - case 69: + case WID_MESSENGERWND: if (*reinterpret_cast(this->unknown_0740)) { this->EnsureWindow(34)->SendMsg(nullptr, 6, 0xD7, 2, 0, 0); } else { @@ -5134,7 +5136,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); this->unknown_073C = 1; break; - case WID_MERCHANTSHOPMAKEWND_MODE_0: + case WID_MERCHANTSHOPMAKEWND: window = this->unknown_02FC; if (window == nullptr) { window = new UIMerchantShopMakeWnd(0); @@ -5147,7 +5149,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); this->EnsureWindow(42); break; - case WID_MERCHANTMIRRORITEMWND_MODE_0: + case WID_MERCHANTMIRRORITEMWND: window = reinterpret_cast(this->unknown_02F8); if (window == nullptr) { window = new UIMerchantMirrorItemWnd(0); @@ -5265,7 +5267,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } window->Show(1); break; - case 59: { + case WID_GUILDWND: { GuildWndInfo* guildInfo = reinterpret_cast(base + 0x834); if (!guildInfo->IsValid()) { guildInfo->Reset(); @@ -5650,7 +5652,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { this->AddRendered(window); } break; - case WID_SAYDIALOGWND_DIALOG: + case WID_SAYDIALOGWND: window = this->unknown_01F0; if (window == nullptr) { window = new UISayDialogWnd(); @@ -5698,7 +5700,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } window->Show(1); break; - case WID_CHOOSE3WND: + case WID_CHOOSEWND: window = this->unknown_01F8; if (window == nullptr) { window = new UIChoose3Wnd(); @@ -5835,7 +5837,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } window->Show(1); break; - case WID_MERCHANTITEMPURCHASEWND_MODE_0: + case WID_MERCHANTITEMPURCHASEWND: window = this->unknown_0308; if (window == nullptr) { window = new UIMerchantItemPurchaseWnd(0); @@ -5860,7 +5862,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { window->Show(1); this->EnsureWindow(50); break; - case WID_MERCHANTITEMMYSHOPWND_MODE_0: + case WID_MERCHANTITEMMYSHOPWND: window = this->unknown_0304; if (window == nullptr) { window = new UIMerchantItemMyShopWnd(0); @@ -5872,7 +5874,7 @@ UIWindow* UIWindowMgr::EnsureWindow(int id) { } window->Show(1); break; - case WID_MERCHANTITEMSHOPWND_MODE_0: + case WID_MERCHANTITEMSHOPWND: window = this->unknown_0300; if (window == nullptr) { window = new UIMerchantItemShopWnd(0); diff --git a/Source/UI/Window/WindowId.h b/Source/UI/Window/WindowId.h index 1a0ffe277..f8b0e10f4 100644 --- a/Source/UI/Window/WindowId.h +++ b/Source/UI/Window/WindowId.h @@ -3,7 +3,7 @@ enum WindowId : int { WID_BASICINFOWND = 0, - WID_NEWCHATWND = 1, + WID_CHATWND = 1, WID_SELECTSERVERWND = 2, WID_LOGINWND = 3, WID_MAKECHARWND = 4, @@ -11,13 +11,13 @@ enum WindowId : int { WID_LOADINGWND = 7, WID_ITEMWND = 8, WID_TOOLTIPWND = 9, - WID_EQUIPWND_VIEWOTHER_0 = 10, + WID_EQUIPWND = 10, WID_STATUSWND = 11, WID_ITEMCOLLECTIONWND = 12, WID_MINIMAPZOOMWND = 14, WID_ITEMDROPCNTWND = 15, - WID_SAYDIALOGWND_DIALOG = 16, - WID_CHOOSE3WND = 17, + WID_SAYDIALOGWND = 16, + WID_CHOOSEWND = 17, WID_MENUWND = 18, WID_RESTARTWND = 19, WID_NOTICECONFIRMWND = 20, @@ -36,15 +36,15 @@ enum WindowId : int { WID_MESSENGERGROUPWND = 34, WID_JOINPARTYACCEPTWND = 35, WID_SHORTCUTWND = 36, - WID_NEWSKILLLISTWND = 37, + WID_SKILLLISTWND = 37, WID_TIPOFTHEDAYWND = 38, WID_CHOOSEWARPWND = 39, WID_MERCHANTITEMWND = 40, - WID_MERCHANTSHOPMAKEWND_MODE_0 = 41, - WID_MERCHANTMIRRORITEMWND_MODE_0 = 42, - WID_MERCHANTITEMSHOPWND_MODE_0 = 43, - WID_MERCHANTITEMPURCHASEWND_MODE_0 = 44, - WID_MERCHANTITEMMYSHOPWND_MODE_0 = 45, + WID_MERCHANTSHOPMAKEWND = 41, + WID_MERCHANTMIRRORITEMWND = 42, + WID_MERCHANTITEMSHOPWND = 43, + WID_MERCHANTITEMPURCHASEWND = 44, + WID_MERCHANTITEMMYSHOPWND = 45, WID_SKILLDESCRIBEWND = 46, WID_CARDITEMILLUSTWND = 47, WID_QUITWND = 48, @@ -258,6 +258,8 @@ enum WindowId : int { WID_RUNESYSTEM_DECOMRESULTWND = 362, WID_WAITDBSAVEWND = 10024, WID_DEBUFFREMOVEWND = 10032, + WID_GUILDWND = 59, + WID_MESSENGERWND = 69, }; #endif