diff --git a/Source/Client/Application/ApplicationWindow.cpp b/Source/Client/Application/ApplicationWindow.cpp index 866eef87..e9f29e17 100644 --- a/Source/Client/Application/ApplicationWindow.cpp +++ b/Source/Client/Application/ApplicationWindow.cpp @@ -195,7 +195,7 @@ LRESULT CALLBACK sub_E5C430(HWND window, UINT message, WPARAM wParam, LPARAM lPa if (!g_windowMgr.GetHoverWindow() || g_windowMgr.GetHoverWindow()->SendMsg(nullptr, WM_KEYDOWN, wParam, lParam, 0, 0) != 3) { g_serverLanguage->KeyDown(wParam, lParam); } - if (g_dialogKeyboardEnabled && !g_dialogKeyboardBlocked) { + if (g_session.unknown_5480 && !g_session.unknown_5488) { g_windowMgr.RefreshWindow01C8Edits(); } return 0; diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index 234322c6..f9b741b9 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -1028,7 +1028,6 @@ extern char g_pendingWhisperCount; extern int g_whisperRecord; extern int g_timeAttackStart; void sub_CCFF10(); -extern int g_localMapMove; extern unsigned char g_gameModePacketBuffer[0x10000]; extern int g_unknown173A5BC; extern int g_unknown_01738268; diff --git a/Source/Client/Mode/CLoginMode.h b/Source/Client/Mode/CLoginMode.h index 572c4ec0..a67d3aaa 100644 --- a/Source/Client/Mode/CLoginMode.h +++ b/Source/Client/Mode/CLoginMode.h @@ -178,7 +178,6 @@ extern std::list g_pingLogTicks; extern char g_zoneServerIp[16]; extern int g_zoneServerPort; extern char g_zoneServerHost[129]; -extern int g_hangameLogin; extern CharacterInfo g_charInfo; extern bool g_replayMode; extern int g_restoreSurfaces; diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 785c9e2f..7af366a2 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -3283,7 +3283,7 @@ void CGameMode::InitializeState() { g_windowMgr.EnsureWindow(190); } - if (g_closeWindow137State) { + if (g_session.unknown_593C) { g_windowMgr.EnsureWindow(137); } diff --git a/Source/Client/Mode/GameModeHandlers.cpp b/Source/Client/Mode/GameModeHandlers.cpp index 9b715a6c..3d58e230 100644 --- a/Source/Client/Mode/GameModeHandlers.cpp +++ b/Source/Client/Mode/GameModeHandlers.cpp @@ -2194,10 +2194,10 @@ void CGameMode::ReceiveAchievementUpdate( } } - g_unknown_01738784 = unknown01738784; - g_unknown_01738788 = unknown01738788; - g_achievementCompleted = completed; - g_achievementTotal = total; + g_session.unknown_614C = unknown01738784; + g_session.unknown_6150 = unknown01738788; + g_session.unknown_6154 = completed; + g_session.unknown_6158 = total; AchievementRecordPacket record; record.id = id; @@ -2902,7 +2902,7 @@ void CGameMode::ReceivePendingItem1718List(const unsigned char* packet) { } g_session.ClearTradeItems(); - if (g_hangameLogin == 1) { + if (g_session.m_channelCopId == 1) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast("한게임 유저는 12월 3일부로 유료아이템 구매가 불가능합니다."), 0xFF, 0, 0, 0); return; diff --git a/Source/Client/Mode/GameModeItemLists.cpp b/Source/Client/Mode/GameModeItemLists.cpp index 190df8b5..a2f2f67e 100644 --- a/Source/Client/Mode/GameModeItemLists.cpp +++ b/Source/Client/Mode/GameModeItemLists.cpp @@ -86,8 +86,6 @@ namespace { } } -// GLOBAL: gl_24395 -int g_activePetEggIndex; // OFFSET: 0x00D42FB0 // FUNCTION: fn_21831 @@ -118,7 +116,7 @@ void CGameMode::ReceiveEquipListPart(unsigned char listType, int count, const un FillEquipListItem(item, record, options); if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - g_activePetEggIndex = item.unknown_0000[1]; + g_session.unknown_1050 = item.unknown_0000[1]; } if (item.unknown_0000[3] == 0) { @@ -134,7 +132,7 @@ void CGameMode::ReceiveEquipListPart(unsigned char listType, int count, const un } if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); + const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).itemId.c_str()); if (!g_petEvolutionMgr->IsAutoFeeding(petEgg) && g_petAutoFeed == true) { g_session.SendPetAutoFeedOption(0); } diff --git a/Source/Client/Mode/GameModeMiniMap.cpp b/Source/Client/Mode/GameModeMiniMap.cpp index 908575f2..b135e098 100644 --- a/Source/Client/Mode/GameModeMiniMap.cpp +++ b/Source/Client/Mode/GameModeMiniMap.cpp @@ -26,10 +26,6 @@ #include #include -// GLOBAL: gl_24934 -int g_searchStoreX; -// GLOBAL: gl_24935 -int g_searchStoreY; // GLOBAL: gl_25107 CFile g_whisperFile; @@ -160,10 +156,10 @@ void CGameMode::DrawMiniMapMembers(const TextureRegion& view) { } } - if (g_searchStoreX > -1) { - const int y = g_searchStoreY; + if (g_session.unknown_5BE8 > -1) { + const int y = g_session.unknown_5BEC; if (y > -1) { - this->DrawMiniMapMarker(view, g_searchStoreX, y, 4, "유저인터페이스\\basic_interface\\search_store.bmp", 0, 0, true); + this->DrawMiniMapMarker(view, g_session.unknown_5BE8, y, 4, "유저인터페이스\\basic_interface\\search_store.bmp", 0, 0, true); } } } diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index bc5f2e51..a9d60c28 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -85,8 +85,6 @@ #include #include -// GLOBAL: gl_25253 -int g_localMapMove; // GLOBAL: gl_25441 static const std::string g_whisperItemLinkTag = ""; @@ -1772,17 +1770,8 @@ int g_unknown_0173826C; // GLOBAL: gl_25113 int g_unknown_01738270; -// GLOBAL: gl_25114 -int g_unknown_01738784; -// GLOBAL: gl_25115 -short g_unknown_01738788; -// GLOBAL: gl_24957 -int g_achievementCompleted; - -// GLOBAL: gl_24958 -int g_achievementTotal; // OFFSET: 0x00D1C050 // FUNCTION: fn_21624 @@ -1812,10 +1801,10 @@ void CGameMode::sub_D1C050(const AchievementStatePacket* packet) { // OFFSET: 0x00D6C460 // FUNCTION: fn_22081 void CGameMode::sub_D6C460(int count, int unknown01738784, short unknown01738788, int completed, int total, const AchievementRecordPacket* packets) { - g_unknown_01738784 = unknown01738784; - g_unknown_01738788 = unknown01738788; - g_achievementCompleted = completed; - g_achievementTotal = total; + g_session.unknown_614C = unknown01738784; + g_session.unknown_6150 = unknown01738788; + g_session.unknown_6154 = completed; + g_session.unknown_6158 = total; for (int i = 0; i < count; ++i) { g_session.UpdateRecord6144(packets[i]); @@ -5137,7 +5126,7 @@ void CGameMode::RequestLocalMapMove(const char* mapName, std::uint16_t x, std::u /* 0014 */ std::uint16_t y; } packet; - g_localMapMove = 1; + g_session.m_localMapMove = 1; packet.id = 0x91; strcpy_s(packet.mapName, sizeof(packet.mapName), mapName); packet.x = x; @@ -6084,7 +6073,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { break; case 260: if (packet->aid == g_session.m_aid) { - g_seasonalMonsterSprites = 1; + g_session.unknown_5450 = 1; } std::sprintf(message, ""); break; @@ -6725,7 +6714,7 @@ void CGameMode::ReceiveStatusChangeNotice(const unsigned char* data) { break; case 260: if (packet->aid == g_session.m_aid) { - g_seasonalMonsterSprites = 0; + g_session.unknown_5450 = 0; } std::sprintf(message, ""); break; diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index e4af6ec7..38d5cf74 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -1526,7 +1526,7 @@ void CGameMode::ReceiveZoneServerChange(const unsigned char* packet) { // OFFSET: 0x00D79F00 // FUNCTION: fn_22184 void CGameMode::ReceiveZoneServerChange(const char* mapName, std::int16_t x, std::int16_t y, int ip, std::int16_t port) { - g_localMapMove = 1; + g_session.m_localMapMove = 1; this->ChangeZoneServer(mapName, x, y, ip, port, std::string()); } @@ -5495,7 +5495,7 @@ void CGameMode::ApplyStatusChange( break; case 260: if (aid == g_session.m_aid) { - g_seasonalMonsterSprites = 1; + g_session.unknown_5450 = 1; } std::sprintf(message, ""); break; @@ -6225,7 +6225,7 @@ void CGameMode::ApplyStatusChange( break; case 260: if (aid == g_session.m_aid) { - g_seasonalMonsterSprites = 0; + g_session.unknown_5450 = 0; } std::sprintf(message, ""); break; @@ -7862,7 +7862,7 @@ namespace { // INLINED __forceinline void EquipWindowItem(const ITEM_INFO& item) { if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - g_activePetEggIndex = item.unknown_0000[1]; + g_session.unknown_1050 = item.unknown_0000[1]; } if (item.unknown_0000[3] != 0) { @@ -7874,7 +7874,7 @@ namespace { } if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); + const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).itemId.c_str()); if (!g_petEvolutionMgr->IsAutoFeeding(petEgg) && g_petAutoFeed == true) { g_session.SendPetAutoFeedOption(0); } @@ -7998,7 +7998,7 @@ namespace { // INLINED __forceinline void AddInventoryEquipItem(const ITEM_INFO& item) { if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - g_activePetEggIndex = item.unknown_0000[1]; + g_session.unknown_1050 = item.unknown_0000[1]; } if (item.unknown_0000[3] == 0) { @@ -8014,7 +8014,7 @@ namespace { } if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); + const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).itemId.c_str()); if (!g_petEvolutionMgr->IsAutoFeeding(petEgg) && g_petAutoFeed == true) { g_session.SendPetAutoFeedOption(0); } @@ -9034,7 +9034,7 @@ void CGameMode::ReceivePetChangeState(const unsigned char* data) { if (found == 1) { item.unknown_005D = 1; g_session.UpdateInventoryItem(item, 1); - g_activePetEggIndex = item.unknown_0000[1]; + g_session.unknown_1050 = item.unknown_0000[1]; if (UIWindow* inventory = g_windowMgr.LookupWindow(8)) { inventory->Invalidate(); } diff --git a/Source/Client/Mode/LoginMode.cpp b/Source/Client/Mode/LoginMode.cpp index e59531e0..2548dd8a 100644 --- a/Source/Client/Mode/LoginMode.cpp +++ b/Source/Client/Mode/LoginMode.cpp @@ -1965,8 +1965,6 @@ void CLoginMode::Zc_Accept_Enter2(const AcceptEnterPositionPacket* packet) { // GLOBAL: gl_25155 char g_loginFailCount; -// GLOBAL: gl_25156 -int g_hangameLogin; // OFFSET: 0x00D91790 // FUNCTION: fn_22289 @@ -2053,7 +2051,7 @@ void CLoginMode::ShowLoginError(int code, int argument) { 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) { - if (g_hangameLogin == 1) { + if (g_session.m_channelCopId == 1) { const std::uint8_t urlSource[] = {0x17, 0x67, 0xAB, 0xA1, 0xBF, 0x48, 0x56, 0x9A, 0x08, 0x64, 0xF1, 0xB9, 0xE4, 0x09, 0x1E, 0x8C, 0x12, 0x76, 0xF1, 0xB2, 0xEA, 0x0A, 0x79}; thread_local EncryptedName url(urlSource); @@ -2637,7 +2635,7 @@ void CLoginMode::PollNetworkStatus() { const unsigned int dataLength = packet->length - offsetof(AcceptEnterNeoUnionPacket, characters); this->characterCount = dataLength / sizeof(CharacterInfo); - g_charViewCount = this->characterCount; + g_session.unknown_0E94 = this->characterCount; const unsigned char* characters = reinterpret_cast(packet->characters) + dataLength % sizeof(CharacterInfo); memcpy_s(this->characters, sizeof(this->characters), characters, this->characterCount * sizeof(CharacterInfo)); this->pendingCursorType = 19; @@ -2951,7 +2949,7 @@ void CLoginMode::PollNetworkStatus() { case 0xB18: { const std::int16_t slots = reinterpret_cast(g_gameModePacketBuffer)->result; if (slots <= 100) { - g_extraInventorySlots = slots; + g_session.unknown_7FBC = slots; } break; } diff --git a/Source/Contents/AchievementMgr.h b/Source/Contents/AchievementMgr.h index 09f4038c..2558cf3e 100644 --- a/Source/Contents/AchievementMgr.h +++ b/Source/Contents/AchievementMgr.h @@ -79,9 +79,5 @@ public: static_assert(sizeof(CAchievementMgr) == 0x1C); extern CAchievementMgr* g_achievementMgr; -extern int g_achievementCompleted; -extern int g_achievementTotal; -extern int g_unknown_01738784; -extern short g_unknown_01738788; #endif diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index 74890e9f..79162e28 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -231,8 +231,6 @@ void CRenderObject::Render(int argument) { } } -// GLOBAL: gl_24732 -int g_seasonalMonsterSprites; // OFFSET: 0x00CB20F0 // FUNCTION: fn_21103 @@ -241,7 +239,7 @@ void CRenderObject::DrawSprite(int argument, bool seasonal, float offset) { CSprRes* sprite = this->render.sprite; CActRes* action = this->render.action; - if (g_seasonalMonsterSprites == 1 && seasonal == true) { + if (g_session.unknown_5450 == 1 && seasonal == true) { SYSTEMTIME time; GetLocalTime(&time); int job; diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 95a9325f..193f87a5 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -4834,7 +4834,7 @@ void CGameActor::SpawnDamageDigits(int, int damage, std::uint32_t color, int typ effect->SendMsg(nullptr, 22, 0, this->render.accountId, 0, type, type >> 31, 0, 0, 0, 0, 0, 0, 0, 0); const std::intptr_t position = reinterpret_cast(&this->render.position); const int count = static_cast(digits.size()); - if (value >= 100000000 && g_damageMillionUnit == 2) { + if (value >= 100000000 && g_session.m_damageMillionUnit == 2) { if (index == 0) { effect->SendMsg(nullptr, 64, 0, position, position >> 31, *it, *it >> 31, (count - 1) * 3 + 4, 0, 0, 0, 0, 0, 0, 0); } else { diff --git a/Source/Contents/Actors/RenderObject.h b/Source/Contents/Actors/RenderObject.h index 19cf2241..95690959 100644 --- a/Source/Contents/Actors/RenderObject.h +++ b/Source/Contents/Actors/RenderObject.h @@ -104,7 +104,6 @@ public: /* 0010 */ RenderObjectState render; }; -extern int g_seasonalMonsterSprites; extern int g_pickInvert; extern int g_pickModifierKey; diff --git a/Source/Contents/ClientItemLists.cpp b/Source/Contents/ClientItemLists.cpp index 37b31f6f..fd43c14e 100644 --- a/Source/Contents/ClientItemLists.cpp +++ b/Source/Contents/ClientItemLists.cpp @@ -618,7 +618,7 @@ void CGameMode::ReceiveEquipItemList(const unsigned char* packet) { FillEquipItemListItem(item, record, options); if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - g_activePetEggIndex = item.unknown_0000[1]; + g_session.unknown_1050 = item.unknown_0000[1]; } if (item.unknown_0000[3] == 0) { @@ -634,7 +634,7 @@ void CGameMode::ReceiveEquipItemList(const unsigned char* packet) { } if (g_session.IsPetEgg(std::atoi(item.itemId.c_str())) && item.unknown_005D) { - const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); + const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).itemId.c_str()); if (!g_petEvolutionMgr->IsAutoFeeding(petEgg) && g_petAutoFeed == true) { g_session.SendPetAutoFeedOption(0); } diff --git a/Source/Contents/ClientState.cpp b/Source/Contents/ClientState.cpp index 75528f89..b762b743 100644 --- a/Source/Contents/ClientState.cpp +++ b/Source/Contents/ClientState.cpp @@ -44,8 +44,6 @@ namespace { }; } -// GLOBAL: gl_24492 -bool g_homunculusAutoFeed; // GLOBAL: gl_24493 bool g_petAutoFeed; @@ -972,7 +970,7 @@ void CSession::SetHomunculusAutoFeed(bool enabled) { this->m_homunculusAutoFeed = true; message = 3282; } else { - g_homunculusAutoFeed = false; + g_session.m_homunculusAutoFeed = false; message = 3283; } diff --git a/Source/Contents/ClientState.h b/Source/Contents/ClientState.h index d74a24e9..e1ad82fa 100644 --- a/Source/Contents/ClientState.h +++ b/Source/Contents/ClientState.h @@ -3,9 +3,7 @@ #include -extern bool g_homunculusAutoFeed; extern bool g_petAutoFeed; -extern int g_activePetEggIndex; void RequestBasicInfoRefresh(); void __stdcall sub_E489C0(bool enabled); diff --git a/Source/Contents/Effects/EffectLists.cpp b/Source/Contents/Effects/EffectLists.cpp index b5e51d0d..0d5d73ae 100644 --- a/Source/Contents/Effects/EffectLists.cpp +++ b/Source/Contents/Effects/EffectLists.cpp @@ -81,11 +81,7 @@ #include #include -// GLOBAL: gl_24787 -int g_levelEffectId1; -// GLOBAL: gl_24788 -int g_levelEffectId2; void CRenderObject::ClearLevelEffects() { reinterpret_cast(this)[0x2B8] = 0; @@ -108,8 +104,8 @@ void CRenderObject::ClearLevelEffects() { this->SendMsg(nullptr, 0x6D, 0, 0xC9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->SendMsg(nullptr, 0x6D, 0, 0xCA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); this->SendMsg(nullptr, 0x6D, 0, 0xCA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 0x6D, 0, g_levelEffectId1, g_levelEffectId1 >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - this->SendMsg(this, 0x6D, 0, g_levelEffectId2, g_levelEffectId2 >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, 0x6D, 0, g_session.m_maxLevelEffect4th, g_session.m_maxLevelEffect4th >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + this->SendMsg(this, 0x6D, 0, g_session.m_maxLevelEffect4thSub, g_session.m_maxLevelEffect4thSub >> 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } // OFFSET: 0x00B25750 diff --git a/Source/Contents/Effects/MsgEffect.cpp b/Source/Contents/Effects/MsgEffect.cpp index 4631e619..8f2af133 100644 --- a/Source/Contents/Effects/MsgEffect.cpp +++ b/Source/Contents/Effects/MsgEffect.cpp @@ -27,11 +27,6 @@ #include #include -// GLOBAL: gl_25145 -int g_damageMillionUnit; - -// GLOBAL: gl_24976 -std::string g_damageResourceName; // GLOBAL: gl_24975 bool g_msgEffectShowSpecial = true; @@ -1699,8 +1694,8 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, case 14: case 16: case 21: - this->SetSpriteName(ResourceMgr::Instance(), FormatOwnedString("%s.spr", g_damageResourceName.c_str()).c_str()); - this->SetActionName(ResourceMgr::Instance(), FormatOwnedString("%s.act", g_damageResourceName.c_str()).c_str()); + 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; this->render.previousAnimation = 0; this->render.position = *position; @@ -1720,8 +1715,8 @@ void CMsgEffect::SendMsg(CGameObject* sender, int message, int a, int b, int c, return; } - this->SetSpriteName(ResourceMgr::Instance(), FormatOwnedString("%s.spr", g_damageResourceName.c_str()).c_str()); - this->SetActionName(ResourceMgr::Instance(), FormatOwnedString("%s.act", g_damageResourceName.c_str()).c_str()); + 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; this->render.previousAnimation = 0; this->render.position = *position; diff --git a/Source/Contents/Effects/MsgEffect.h b/Source/Contents/Effects/MsgEffect.h index eaeea01e..0f7be445 100644 --- a/Source/Contents/Effects/MsgEffect.h +++ b/Source/Contents/Effects/MsgEffect.h @@ -6,8 +6,6 @@ #include #include -extern int g_damageMillionUnit; -extern std::string g_damageResourceName; extern bool g_msgEffectShowSpecial; class CMsgEffect : public EffectActor { diff --git a/Source/Contents/MapSkyMgr.cpp b/Source/Contents/MapSkyMgr.cpp index ef8972c0..65e95269 100644 --- a/Source/Contents/MapSkyMgr.cpp +++ b/Source/Contents/MapSkyMgr.cpp @@ -1,6 +1,7 @@ #include "Contents/MapSkyMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeMgr.h" +#include "Client/Session.h" #include "Contents/Configuration/ServiceOptions.h" #include "Contents/Effects/EffectActor.h" #include "Contents/Effects/EffectLists.h" @@ -42,8 +43,6 @@ CWeatherEffect g_weatherEffect; // GLOBAL: gl_24633 float g_depthAverageHalf = 0.5f; -// GLOBAL: gl_25254 -std::vector g_registeredLowercaseNames; static_assert(sizeof(std::vector) == 12); @@ -488,11 +487,11 @@ void RegisterLowercaseName(const char* name) { character = static_cast(std::tolower(static_cast(character))); } - for (const std::string& entry : g_registeredLowercaseNames) { + for (const std::string& entry : g_session.unknown_80A8) { if (entry == lowered) { return; } } - g_registeredLowercaseNames.push_back(lowered.c_str()); + g_session.unknown_80A8.push_back(lowered.c_str()); } diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index 77542710..e1bdaa1c 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -169,12 +169,6 @@ public: /* 028C */ int mode; }; -// GLOBAL: gl_24961 -bool g_messengerGroupCollapsed; -// GLOBAL: gl_25219 -int g_messengerDropColumnWidth; -// GLOBAL: gl_25220 -int g_messengerDropRowHeight; // GLOBAL: gl_25250 std::string g_messengerNamelessTag = ""; @@ -708,8 +702,8 @@ __declspec(noinline) void UIMessengerGroupWnd::DropMember(int x, int y, int inde } int cell; - if (x < g_messengerDropColumnWidth + 23 && y > top) { - int row = (y - top) / (g_messengerDropRowHeight + 3); + if (x < g_windowMgr.unknown_4F238 + 23 && y > top) { + int row = (y - top) / (g_windowMgr.unknown_4F23C + 3); if (g_windowMgr.FindSnapExcludedWindow(row)) { cell = g_windowMgr.FindMiniPartyCell(); } else { @@ -1115,7 +1109,7 @@ void UIMessengerGroupWnd::Paint() { // OFFSET: 0x0073CD30 // FUNCTION: fn_07708 void UIMessengerGroupWnd::Slot26(int, int) { - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { this->SendMsg(nullptr, 6, 232, 0, 0, 0); } } @@ -1123,7 +1117,7 @@ void UIMessengerGroupWnd::Slot26(int, int) { // OFFSET: 0x0073D460 // FUNCTION: fn_07713 void UIMessengerGroupWnd::Slot25(int x, int y) { - if (g_messengerGroupCollapsed) { + if (g_session.m_lockMouse) { return; } @@ -1178,7 +1172,7 @@ void UIMessengerGroupWnd::Slot33(int x, int y) { gameMode->TargetActorByAid(member.accountId); MessengerMember selectedMember = this->MemberAtIndex(this->selected); - if (this->mode == 1 && !g_messengerGroupCollapsed && !g_windowMgr.HasMiniPartyMember(selectedMember.accountId)) { + if (this->mode == 1 && !g_session.m_lockMouse && !g_windowMgr.HasMiniPartyMember(selectedMember.accountId)) { gameMode->SetDragIds(29, this->selected); if (!g_windowMgr.window_4F250) { UIDragMiniPartyWnd* window = new (std::nothrow) UIDragMiniPartyWnd(selectedMember); @@ -1371,7 +1365,7 @@ void UIMessengerGroupWnd::LayoutButtons() { x = 135; } - if (g_messengerGroupCollapsed) { + if (g_session.m_lockMouse) { this->buttons[5]->Move(x, this->geometry.height - 40); this->buttons[6]->Move(-100, -100); } else { @@ -1498,12 +1492,12 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, return 0; } case 0xE7: - if (!g_messengerGroupCollapsed && this->selected != -1) { + if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); } return 0; case 0xE8: - if (!g_messengerGroupCollapsed && this->selected != -1) { + if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid && !(member.name == g_session.DecodePlayerName())) { const char* tag; @@ -1520,7 +1514,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0xE9: - if (!g_messengerGroupCollapsed && this->selected != -1) { + if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { g_windowMgr.Confirm(LookupMessage(0xBF), 0, true, false, 0, "Message", 0x118, 0x78, 0); @@ -1528,7 +1522,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0xEA: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { g_windowMgr.CloseWindow(0xD0); } @@ -1557,7 +1551,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0xEB: - if (!g_messengerGroupCollapsed && this->selected != -1) { + if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid) { if (this->mode == 0) { @@ -1573,7 +1567,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0xEC: - if (!g_messengerGroupCollapsed && this->selected != -1) { + if (!g_session.m_lockMouse && this->selected != -1) { MessengerMember member = this->MemberAtIndex(this->selected); if (member.valid && member.name == g_session.DecodePlayerName()) { if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { @@ -1583,16 +1577,16 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0x16C: - if (g_messengerGroupCollapsed != true) { + if (g_session.m_lockMouse != true) { g_windowMgr.RearrangeMiniPartyWindows(); } return 0; case 0x179: if (sender == this->buttons[5]) { - g_messengerGroupCollapsed = false; + g_session.m_lockMouse = false; this->buttons[6]->Move(sender->geometry.x, sender->geometry.y); } else if (sender == this->buttons[6]) { - g_messengerGroupCollapsed = true; + g_session.m_lockMouse = true; this->buttons[5]->Move(sender->geometry.x, sender->geometry.y); } else { return 0; @@ -1600,7 +1594,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, sender->Move(-100, -100); return 0; case 0x1BD: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_033C) { g_windowMgr.CloseWindow(0x44); } @@ -1621,7 +1615,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0x1BE: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (g_windowMgr.Confirm(LookupMessage(0x165), 2, false, false, 0, "Message", 0x118, 0x78, 0) == 0xBB) { g_modeMgr.gameMode->SendMsg(0x3D, 0, 0, 0, 0); if (g_windowMgr.unknown_042C) { @@ -1631,7 +1625,7 @@ int UIMessengerGroupWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, } return 0; case 0x1BF: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_033C) { g_windowMgr.CloseWindow(0x44); } diff --git a/Source/Contents/Messenger/MessengerMember.h b/Source/Contents/Messenger/MessengerMember.h index a9a5a410..bbb24bf3 100644 --- a/Source/Contents/Messenger/MessengerMember.h +++ b/Source/Contents/Messenger/MessengerMember.h @@ -30,7 +30,6 @@ struct MessengerMember { int ReadMessengerMembers(std::list& members, int offset, int size, const std::vector& data); -extern bool g_messengerGroupCollapsed; #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(MessengerMember) == 80); diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 4c55a2c6..c93bdd7b 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -9750,7 +9750,7 @@ void UILoadingWnd::Slot15(int, int) { const int count = static_cast(g_loadingScreens.size()); char name[256]; - if (g_localMapMove == 1) { + if (g_session.m_localMapMove == 1) { std::strcpy(name, "유저인터페이스\\loading_airplane.jpg"); } else if (!g_randomLoadingScreen) { if (s_loadingScreenIndex < count) { @@ -12321,13 +12321,13 @@ void UIExchangeWnd::Paint() { } char grouped[32]; char amount[128]; - int length = std::sprintf(amount, "%s", FormatGroupedInteger(g_exchangeMyZeny, grouped, sizeof(grouped))); - PriceColors colors = PriceColor(g_exchangeMyZeny); + int length = std::sprintf(amount, "%s", FormatGroupedInteger(g_session.unknown_5210, grouped, sizeof(grouped))); + PriceColors colors = PriceColor(g_session.unknown_5210); this->DrawRightAlignedText(219, 331, amount, length, 1, 16, colors.primary & 0xFFFFFF, 0); this->DrawRightAlignedText(220, 331, amount, length, 1, 16, colors.primary & 0xFFFFFF, 0); this->DrawRightAlignedText(220, 332, amount, length, 1, 16, 0x323232, 0); - length = std::sprintf(amount, "%s", FormatGroupedInteger(g_exchangeOtherZeny, grouped, sizeof(grouped))); - colors = PriceColor(g_exchangeOtherZeny); + length = std::sprintf(amount, "%s", FormatGroupedInteger(g_session.unknown_5214, grouped, sizeof(grouped))); + colors = PriceColor(g_session.unknown_5214); this->DrawRightAlignedText(499, 331, amount, length, 1, 16, colors.primary & 0xFFFFFF, 0); this->DrawRightAlignedText(500, 331, amount, length, 1, 16, colors.primary & 0xFFFFFF, 0); this->DrawRightAlignedText(500, 332, amount, length, 1, 16, 0x323232, 0); diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index ab9e6256..a4cdffc4 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -3563,8 +3563,6 @@ int UISlotBmpButton::SendMsg(UIWindow* sender, int message, std::intptr_t argume #include "Client/Mode/CMode.h" #include "Client/Mode/CLoginMode.h" -// GLOBAL: gl_25382 -int g_slotButtonInfo; // OFFSET: 0x0088EBC0 // FUNCTION: fn_11385 @@ -3594,7 +3592,7 @@ void UISlotBmpButton::Paint() { } } - if (this->m_index == 0 && g_slotButtonInfo == 0) { + if (this->m_index == 0 && g_session.unknown_59BC == 0) { CBitmapRes* balloon = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\select_character_ver3\\balloon.bmp"))); this->DrawBitmap(this->geometry.width / 2 - 0x2e, 0x1a, balloon ? &balloon->image : nullptr, false); diff --git a/Source/UI/Dialogs/UIMemorialDunWnd.h b/Source/UI/Dialogs/UIMemorialDunWnd.h index 123088a9..dc854cbe 100644 --- a/Source/UI/Dialogs/UIMemorialDunWnd.h +++ b/Source/UI/Dialogs/UIMemorialDunWnd.h @@ -6,8 +6,6 @@ class UIBitmapButton; class UIBasicButton; -extern int g_memorialDunWndX; -extern int g_memorialDunWndY; class UIMemorialDunWnd : public UIFrameWnd { public: diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index e46ac9e9..be3b7072 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -1471,7 +1471,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } else if (g_serviceType == 6) { format = "Total : %d Koin"; } else if (g_serviceType == 0) { - format = g_hangameLogin == 1 ? "Total : %d 한코인" : "Total : %d Cash"; + format = g_session.m_channelCopId == 1 ? "Total : %d 한코인" : "Total : %d Cash"; } else { format = "Total : %d Point"; } @@ -1697,7 +1697,7 @@ int UIItemPurchaseWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, s } else if (g_serviceType == 6) { format = "Total : %s Koin"; } else if (g_serviceType == 0) { - format = g_hangameLogin == 1 ? "Total : %s 한코인" : "Total : %s 캐시"; + format = g_session.m_channelCopId == 1 ? "Total : %s 한코인" : "Total : %s 캐시"; } else { format = "Total : %s Point"; } @@ -7326,7 +7326,7 @@ void UIItemShopWnd::Slot28(int x, int y) { if (g_serviceType == 6) { sprintf(currency, "Koin"); } else if (g_serviceType == 0) { - if (g_hangameLogin == 1) { + if (g_session.m_channelCopId == 1) { sprintf(currency, "한코인"); } else { sprintf(currency, LookupMessage(1307)); @@ -10501,10 +10501,10 @@ void UIItemWnd::Paint() { } const int count = g_session.GetList0Size() + g_session.CountItems17F0() + g_session.CountItems2B50(); - const std::uint32_t color = count >= g_extraInventorySlots + 100 ? 0xFF : 0x232323; + const std::uint32_t color = count >= g_session.unknown_7FBC + 100 ? 0xFF : 0x232323; this->DrawTextAt(35, this->geometry.height - 15, FormatOwnedString("%d", count).c_str(), 0, 0, 11, color, 0, 0); const int width = this->TextWidth(FormatOwnedString("%d", count).c_str(), 0, 0, 11, 0, 0); - this->DrawTextAt(width + 36, this->geometry.height - 15, FormatOwnedString("/%d", g_extraInventorySlots + 100).c_str(), 0, 0, 11, 0, 0, 0 + this->DrawTextAt(width + 36, this->geometry.height - 15, FormatOwnedString("/%d", g_session.unknown_7FBC + 100).c_str(), 0, 0, 11, 0, 0, 0 ); } diff --git a/Source/UI/Exchange/UIExchangeUI.cpp b/Source/UI/Exchange/UIExchangeUI.cpp index de4a9d39..001c7b42 100644 --- a/Source/UI/Exchange/UIExchangeUI.cpp +++ b/Source/UI/Exchange/UIExchangeUI.cpp @@ -47,11 +47,7 @@ void CUIListBoxEx::AddNewItem(); template <> void CUIListBoxEx::Slot53(int resolveSkin); -// GLOBAL: gl_25004 -int g_exchangeMyZeny; -// GLOBAL: gl_25005 -int g_exchangeOtherZeny; // OFFSET: 0x00A0F790 // FUNCTION: fn_15176 @@ -553,12 +549,12 @@ void CUIExchangeUI::UpdateZeny(bool mine) { first = this->unknown_00E8; second = this->unknown_00EC; third = this->unknown_00F0; - zeny = g_exchangeMyZeny; + zeny = g_session.unknown_5210; } else { first = this->unknown_00FC; second = this->unknown_0100; third = this->unknown_0104; - zeny = g_exchangeOtherZeny; + zeny = g_session.unknown_5214; } char text[24]; diff --git a/Source/UI/Exchange/UIExchangeUI.h b/Source/UI/Exchange/UIExchangeUI.h index e370186f..3cba32a0 100644 --- a/Source/UI/Exchange/UIExchangeUI.h +++ b/Source/UI/Exchange/UIExchangeUI.h @@ -87,8 +87,6 @@ public: void OnSelectSecondListItem(ExchangeUI::CUIItem* item, const ExchangeUI::CItemData& data); }; -extern int g_exchangeMyZeny; -extern int g_exchangeOtherZeny; #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(ExchangeUI::CItemData) == 0x100); diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index a15d3698..480c97f9 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -67,8 +67,6 @@ struct GuildTotalInfoEntry { // GLOBAL: gl_24994 std::string g_guildNamelessTag = ""; -// GLOBAL: gl_25131 -bool g_guildOnlineFirst; // OFFSET: 0x00957D30 // FUNCTION: fn_13044 @@ -1786,7 +1784,7 @@ void UIGuildMemberManageWnd::Slot15(int, int) { this->m_onlineCheck->SetImages("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp", LookupMessage(2864)); this->m_onlineCheck->FitToText(); this->m_onlineCheck->Move(12, this->geometry.height - 18); - this->m_onlineCheck->SetChecked(g_guildOnlineFirst); + this->m_onlineCheck->SetChecked(g_session.m_guildMemberListSort); this->AddChild(this->m_onlineCheck); this->UpdateScroll(); } @@ -2509,7 +2507,7 @@ void UIGuildMemberManageWnd::Paint() { } } - if (g_guildOnlineFirst) { + if (g_session.m_guildMemberListSort) { this->m_members.sort([](const GuildInfo::Member& left, const GuildInfo::Member& right) { return left.online > right.online; }); @@ -2593,7 +2591,7 @@ int UIGuildMemberManageWnd::SendMsg(UIWindow* sender, int message, std::intptr_t g_windowMgr.CloseWindow(59); return 0; case 213: - g_guildOnlineFirst = !g_guildOnlineFirst; + g_session.m_guildMemberListSort = !g_session.m_guildMemberListSort; this->Invalidate(); return 0; case 273: diff --git a/Source/UI/Item/UIParaItemShopWnd.cpp b/Source/UI/Item/UIParaItemShopWnd.cpp index 5ea71698..ef02e962 100644 --- a/Source/UI/Item/UIParaItemShopWnd.cpp +++ b/Source/UI/Item/UIParaItemShopWnd.cpp @@ -741,7 +741,7 @@ void UIParaItemShopWnd::Paint() { if (g_serviceType == 6) { currency = "K"; } else if (g_serviceType == 0) { - if (g_hangameLogin == 1) { + if (g_session.m_channelCopId == 1) { currency = "H"; } else { currency = "C"; @@ -768,7 +768,7 @@ void UIParaItemShopWnd::Paint() { if (this->unknown_010C == 1) { std::string text; - if (g_serviceType == 0 && g_hangameLogin == 1) { + if (g_serviceType == 0 && g_session.m_channelCopId == 1) { text = FormatOwnedString(LookupMessage(1290), this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0), g_pendingAid); } else { text = FormatOwnedString(LookupMessage(1210), this->ClipTextToWidth(g_session.DecodePlayerName(), 100, 0, 12, 0), g_pendingAid); diff --git a/Source/UI/Menu/UIMenuIconWnd.cpp b/Source/UI/Menu/UIMenuIconWnd.cpp index 1b54ff8a..4b4dde23 100644 --- a/Source/UI/Menu/UIMenuIconWnd.cpp +++ b/Source/UI/Menu/UIMenuIconWnd.cpp @@ -38,8 +38,6 @@ struct MenuIconOpenUiPacket { }; #pragma pack(pop) -// GLOBAL: gl_24966 -static bool s_menuIconExpanded; // OFFSET: 0x0084A1E0 // FUNCTION: fn_10606 @@ -68,7 +66,7 @@ UIWindow* UIMenuIconWnd::HitTest(int x, int y) { return nullptr; } - if (!s_menuIconExpanded) { + if (!g_session.m_showMenuIcon) { if (x >= this->geometry.x + this->geometry.width || y < this->geometry.y || y >= this->geometry.y + this->unknown_00D0->geometry.height) { return nullptr; } @@ -188,7 +186,7 @@ void UIMenuIconWnd::Slot15(int width, int height) { this->unknown_00D4->SetId(201); this->unknown_00D4->Enable(0); this->AddChild(this->unknown_00D4); - this->SendMsg(this, 6, s_menuIconExpanded == true ? 510 : 201, 0, 0, 0); + this->SendMsg(this, 6, g_session.m_showMenuIcon == true ? 510 : 201, 0, 0, 0); if (this->unknown_00B4.size() > 20) { this->Resize(220, 238); } @@ -203,7 +201,7 @@ void UIMenuIconWnd::Paint() { this->unknown_00D4->Enable(0); UIButton* toggle; - if (s_menuIconExpanded) { + if (g_session.m_showMenuIcon) { toggle = this->unknown_00D4; } else if (this->unknown_00C4.size() == 0) { toggle = this->unknown_00CC; @@ -213,7 +211,7 @@ void UIMenuIconWnd::Paint() { toggle->Enable(1); for (auto it = this->unknown_00B4.begin(); it != this->unknown_00B4.end(); ++it) { - if (!s_menuIconExpanded) { + if (!g_session.m_showMenuIcon) { it->second->Enable(0); if (this->unknown_00BC.find(it->first) != this->unknown_00BC.end()) { this->unknown_00BC[it->first]->Enable(0); @@ -366,7 +364,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument if (!Replay::Instance().AllowsEvent(argument1)) { switch (argument1) { case 201: - s_menuIconExpanded = false; + g_session.m_showMenuIcon = false; this->Invalidate(); break; case 286: { @@ -434,7 +432,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument break; } case 510: - s_menuIconExpanded = true; + g_session.m_showMenuIcon = true; this->Invalidate(); break; case 476: @@ -484,7 +482,7 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument } } } else if (message == 60) { - this->SendMsg(nullptr, 6, s_menuIconExpanded == true ? 201 : 510, 0, 0, 0); + this->SendMsg(nullptr, 6, g_session.m_showMenuIcon == true ? 201 : 510, 0, 0, 0); } if (message == 6 && argument1 == 376 && !Replay::Instance().AllowsEvent(argument1) && g_entryQueueMgr) { diff --git a/Source/UI/Party/UIMiniPartyWnd.cpp b/Source/UI/Party/UIMiniPartyWnd.cpp index 20d62d4a..9afef004 100644 --- a/Source/UI/Party/UIMiniPartyWnd.cpp +++ b/Source/UI/Party/UIMiniPartyWnd.cpp @@ -87,7 +87,7 @@ void UIMiniPartyWnd::Slot25(int x, int y) { // OFFSET: 0x00740B80 // FUNCTION: fn_07731 void UIMiniPartyInfoWnd::Slot25(int x, int y) { - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { this->m_owner->Slot25(x, y); } @@ -102,7 +102,7 @@ void UIMiniPartyInfoWnd::Slot25(int x, int y) { // OFFSET: 0x00740D10 // FUNCTION: fn_07732 void UIMiniPartyInfoWnd::Slot31(int x, int y) { - if (g_messengerGroupCollapsed != true && this == g_windowMgr.Capture()) { + if (g_session.m_lockMouse != true && this == g_windowMgr.Capture()) { this->m_owner->Slot31(x, y); } } @@ -142,7 +142,7 @@ void UIMiniPartyInfoWnd::Slot28(int, int) { // OFFSET: 0x00741280 // FUNCTION: fn_07734 void UIMiniPartyInfoWnd::Slot33(int, int) { - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { this->SendMsg(nullptr, 0x31, 0, 0, 0, 0); } } @@ -172,13 +172,13 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg break; } case 231: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { this->m_owner->GetMember(); return 0; } break; case 232: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (this->m_owner->GetMember().valid && !(this->m_owner->GetMember().name == g_session.DecodePlayerName())) { const char* group; if (g_windowMgr.IsFriend(this->m_owner->GetMember().name.c_str())) { @@ -195,13 +195,13 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; case 233: - if (!g_messengerGroupCollapsed && this->m_owner->GetMember().valid) { + 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: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (g_windowMgr.unknown_042C) { g_windowMgr.CloseWindow(208); } @@ -220,7 +220,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; case 235: - if (!g_messengerGroupCollapsed && this->m_owner->GetMember().valid) { + if (!g_session.m_lockMouse && this->m_owner->GetMember().valid) { if (!(this->m_owner->GetMember().name == g_session.DecodePlayerName())) { if (g_windowMgr.Confirm(LookupMessage(363), 2, false, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(62, reinterpret_cast(this->m_owner->GetMember().name.c_str()), 0, 0, 0); @@ -230,7 +230,7 @@ int UIMiniPartyInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t arg } break; case 236: - if (!g_messengerGroupCollapsed) { + if (!g_session.m_lockMouse) { if (this->m_owner->GetMember().valid && this->m_owner->GetMember().name == g_session.DecodePlayerName()) { if (g_windowMgr.Confirm(LookupMessage(357), 2, false, false, 0, "Message", 280, 120, 0) == 187) { g_modeMgr.gameMode->SendMsg(61, 0, 0, 0, 0); diff --git a/Source/UI/Shortcuts/ShortcutCooldowns.cpp b/Source/UI/Shortcuts/ShortcutCooldowns.cpp index 8f49ea67..5afafe4f 100644 --- a/Source/UI/Shortcuts/ShortcutCooldowns.cpp +++ b/Source/UI/Shortcuts/ShortcutCooldowns.cpp @@ -647,10 +647,10 @@ int g_charViewOffsetY; // FUNCTION: fn_12678 void UISelCharForUServerWnd::Paint() { const char* background = - g_charViewCount > 12 ? "유저인터페이스\\login_interface\\selCharForIntergration2.bmp" : "유저인터페이스\\login_interface\\selCharForIntergration.bmp"; + g_session.unknown_0E94 > 12 ? "유저인터페이스\\login_interface\\selCharForIntergration2.bmp" : "유저인터페이스\\login_interface\\selCharForIntergration.bmp"; this->DrawBitmap(0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve(background)))->image, false); - for (int index = 0; index < g_charViewCount; ++index) { + for (int index = 0; index < g_session.unknown_0E94; ++index) { if (this->m_slotEnabled[index] != 0) { continue; } diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 58a75d67..3c176a55 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -76,11 +76,7 @@ struct MemorialDungeonCommandPacket { // GLOBAL: gl_24660 std::uint8_t g_chatInputFlag; -// GLOBAL: gl_24737 -int g_memorialDunWndX; -// GLOBAL: gl_24738 -int g_memorialDunWndY; // GLOBAL: gl_24888 static bool g_subChatMiniFirstCollapsed; @@ -696,11 +692,11 @@ void UIMemorialDunWnd::Move(int x, int y) { const int top = y <= g_renderer->viewport.height - this->geometry.height ? y : 310; this->UIFrameWnd::Move(left, top); - if (g_memorialDunWndX != left) { - g_memorialDunWndX = left; + if (g_session.unknown_5940 != left) { + g_session.unknown_5940 = left; } - if (g_memorialDunWndY != top) { - g_memorialDunWndY = top; + if (g_session.unknown_5944 != top) { + g_session.unknown_5944 = top; } } diff --git a/Source/UI/Text/UIAchWnd.cpp b/Source/UI/Text/UIAchWnd.cpp index 2fabd312..68f108fd 100644 --- a/Source/UI/Text/UIAchWnd.cpp +++ b/Source/UI/Text/UIAchWnd.cpp @@ -1287,10 +1287,10 @@ int UIAchievementWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argum upper->unknown_00A8->Invalidate(); upper = this->upper; - upper->unknown_0094 = g_achievementCompleted; - upper->unknown_00A4->value = g_achievementCompleted; - upper->unknown_0098 = g_achievementTotal; - upper->unknown_00A4->maximum = g_achievementTotal; + upper->unknown_0094 = g_session.unknown_6154; + upper->unknown_00A4->value = g_session.unknown_6154; + upper->unknown_0098 = g_session.unknown_6158; + upper->unknown_00A4->maximum = g_session.unknown_6158; upper->unknown_00A4->Invalidate(); this->upper->Invalidate(); diff --git a/Source/UI/UIBartermarketWnd.cpp b/Source/UI/UIBartermarketWnd.cpp index aa7ea434..5465be29 100644 --- a/Source/UI/UIBartermarketWnd.cpp +++ b/Source/UI/UIBartermarketWnd.cpp @@ -1134,8 +1134,6 @@ void UIExpandedBarterPurchaseButton::Slot28(int x, int y) { } } -// GLOBAL: gl_25056 -int g_extraInventorySlots; // OFFSET: 0x00840530 // FUNCTION: fn_10544 @@ -1162,7 +1160,7 @@ bool UIBarterItemPurchaseWnd::Purchase() { } } - if (count > g_extraInventorySlots + 100) { + if (count > g_session.unknown_7FBC + 100) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); this->SendMsg(nullptr, 6, 185, 0, 0, 0); @@ -1575,7 +1573,7 @@ bool UIExpandedBarterItemPurchaseWnd::Purchase() { } } - if (count > g_extraInventorySlots + 100) { + if (count > g_session.unknown_7FBC + 100) { g_windowMgr.SendNotice(3, 0, 0, 0, 0, 0); g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(3568)), 255, 0, 0, 0); this->SendMsg(nullptr, 6, 185, 0, 0, 0); diff --git a/Source/UI/UIBartermarketWnd.h b/Source/UI/UIBartermarketWnd.h index 758f634f..1c311481 100644 --- a/Source/UI/UIBartermarketWnd.h +++ b/Source/UI/UIBartermarketWnd.h @@ -117,6 +117,5 @@ public: std::string FormatChunkText(int refine, std::string name, int amount); }; -extern int g_extraInventorySlots; #endif diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 24cfbcd9..f63dcf61 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -3291,7 +3291,7 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int } case 267: if (g_serviceType == 0) { - if (g_hangameLogin == 1) { + if (g_session.m_channelCopId == 1) { g_modeMgr.Quit(); const char* url = HangameJoinUrl()().Text(); const std::uint8_t verbSource[] = {0xDC, 0x17, 0x3C, 0xE1, 0xDF}; @@ -3307,11 +3307,11 @@ int UILoginWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int this->OpenWebPage(); break; case 359: - g_hangameLogin = 0; + g_session.m_channelCopId = 0; this->Invalidate(); break; case 360: - g_hangameLogin = 2; + g_session.m_channelCopId = 2; this->Invalidate(); break; } @@ -3469,7 +3469,7 @@ void UIHomunInfoWnd::Slot15(int, int) { this->unknown_00D4->SetSize(12, 12); this->unknown_00D4->Move(210, 142); this->unknown_00D4->SetBitmaps("유저인터페이스\\checkbox_1.bmp", "유저인터페이스\\checkbox_0.bmp"); - this->unknown_00D4->SetChecked(g_homunculusAutoFeed); + this->unknown_00D4->SetChecked(g_session.m_homunculusAutoFeed); this->AddChild(this->unknown_00D4); } @@ -3696,7 +3696,7 @@ void UIPetInfoWnd::Slot15(int, int) { this->UpdateFriendlyGauge(); this->m_message0 = 201; - const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).itemId.c_str()); + const int petEgg = std::atoi(LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).itemId.c_str()); this->unknown_00E4 = g_petEvolutionMgr->IsAutoFeeding(petEgg); if (this->unknown_00E4 == true) { this->unknown_00E8 = new UICheckBox(); @@ -3747,7 +3747,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i if (g_session.m_petFriendly > 900) { g_windowMgr.CloseWindow(260); UIWindow* window = g_windowMgr.EnsureWindow(261); - const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).GetItemId(); + const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).GetItemId(); window->SendMsg(nullptr, 142, petEgg, b, 0, 0); this->SendMsg(nullptr, 6, 201, 0, 0, 0); g_windowMgr.CloseWindow(260); @@ -3815,7 +3815,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i menu->SendMsg(nullptr, 31, reinterpret_cast(performance.c_str()), 468, 0, 0); menu->SendMsg(nullptr, 31, reinterpret_cast(unequip.c_str()), 469, 0, 0); menu->SendMsg(nullptr, 31, reinterpret_cast(returnToEgg.c_str()), 470, 0, 0); - const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_activePetEggIndex).GetItemId(); + const int petEgg = LookupClientItemByIdentity(g_session.m_inventoryItems, g_session.unknown_1050).GetItemId(); const std::pair> targets = g_petEvolutionMgr->GetEvolutionTargets(petEgg); if (targets.first == true) { for (auto it = targets.second.begin(); it != targets.second.end(); ++it) { diff --git a/Source/UI/Window/UISelCharForUServerWnd.cpp b/Source/UI/Window/UISelCharForUServerWnd.cpp index a249849d..85412bff 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.cpp +++ b/Source/UI/Window/UISelCharForUServerWnd.cpp @@ -22,8 +22,6 @@ extern const char* LookupMessage(int id); -// GLOBAL: gl_24772 -int g_charViewCount; #pragma pack(push, 1) struct PACKET_CZ_SELECT_CHARACTERS { @@ -38,7 +36,7 @@ struct PACKET_CZ_SELECT_CHARACTERS { // FUNCTION: fn_12526 UISelCharForUServerWnd::UISelCharForUServerWnd() : UIFrameWnd(0), m_columns(6) { - if (g_charViewCount > 12) { + if (g_session.unknown_0E94 > 12) { this->m_columns = 9; } @@ -46,7 +44,7 @@ UISelCharForUServerWnd::UISelCharForUServerWnd() this->m_checkedCount = 0; this->geometry.unknown_0034 = 0; this->unknown_19E4 = 0; - for (int index = 0; index < g_charViewCount; ++index) { + for (int index = 0; index < g_session.unknown_0E94; ++index) { this->m_slotEnabled[index] = 1; } @@ -70,7 +68,7 @@ void UISelCharForUServerWnd::Slot15(int, int) { this->m_message0 = 184; - for (int index = 0; index < g_charViewCount; ++index) { + for (int index = 0; index < g_session.unknown_0E94; ++index) { UICheckBox* checkBox = new UICheckBox(); this->m_checkBoxes[index] = checkBox; checkBox->SetSize(10, 10); @@ -79,7 +77,7 @@ void UISelCharForUServerWnd::Slot15(int, int) { this->AddChild(this->m_checkBoxes[index]); } - for (int index = 0; index < g_charViewCount; ++index) { + for (int index = 0; index < g_session.unknown_0E94; ++index) { CharacterInfo* info = reinterpret_cast(static_cast(g_charViewMode)->SendMsg(8, index, 0, 0, 0)); if (!info) { continue; @@ -147,7 +145,7 @@ int UISelCharForUServerWnd::SendMsg(UIWindow* sender, int message, std::intptr_t int characterIds[9] = {}; int count = 0; - const int viewCount = g_charViewCount; + const int viewCount = g_session.unknown_0E94; for (int index = 0; index < viewCount; ++index) { if (this->m_checkBoxes[index]->geometry.unknown_0030 != 0) { CMode* mode = g_modeMgr.gameMode; diff --git a/Source/UI/Window/UISelCharForUServerWnd.h b/Source/UI/Window/UISelCharForUServerWnd.h index 1683e6b6..5453e8c8 100644 --- a/Source/UI/Window/UISelCharForUServerWnd.h +++ b/Source/UI/Window/UISelCharForUServerWnd.h @@ -11,7 +11,6 @@ class UIBitmapButton; class UICharInfoBalloonText; -extern int g_charViewCount; class UISelCharForUServerWnd : public UIFrameWnd { public: diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index 0071cdf3..cc60355d 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -118,8 +118,6 @@ UIWindowMgr g_windowMgr; // GLOBAL: gl_25159 bool g_windowToggleFlag; -// GLOBAL: gl_24686 -int g_closeWindow137State; // GLOBAL: gl_24687 int g_closeWindow164State; @@ -842,9 +840,9 @@ void UIWindowMgr::sub_AA6B80() { continue; } - if (window == reinterpret_cast(this->unknown_03F8) && g_closeWindow137State != 0) { - g_memorialDunWndX = window->geometry.x; - g_memorialDunWndY = window->geometry.y; + if (window == reinterpret_cast(this->unknown_03F8) && g_session.unknown_593C != 0) { + g_session.unknown_5940 = window->geometry.x; + g_session.unknown_5944 = window->geometry.y; } if (!this->modalWindows.empty() && this->modalWindows.back()) { @@ -3523,7 +3521,7 @@ bool UIWindowMgr::CloseWindow(int id) { this->Schedule(this->unknown_03F8); this->unknown_03F8 = nullptr; closed = true; - g_closeWindow137State = 0; + g_session.unknown_593C = 0; } break; case 139: diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index 758ece57..24dd7f93 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -610,10 +610,7 @@ extern bool g_windowToggleFlag; extern bool g_randomLoadingScreen; extern int g_windowCloseValue; extern int g_savedWindowCloseValue; -extern int g_closeWindow137State; extern int g_closeWindow164State; -extern int g_dialogKeyboardEnabled; -extern int g_dialogKeyboardBlocked; void __fastcall RefreshItemWindows(UIWindowMgr* mgr); diff --git a/Source/UI/Window/WindowDialogs.cpp b/Source/UI/Window/WindowDialogs.cpp index 3f68b14e..de395907 100644 --- a/Source/UI/Window/WindowDialogs.cpp +++ b/Source/UI/Window/WindowDialogs.cpp @@ -7,16 +7,12 @@ #include "UI/Window/UINewSelectCharWnd.h" #include "UI/Window/UIWindowMgr.h" -// GLOBAL: gl_24604 -int g_dialogKeyboardEnabled; -// GLOBAL: gl_24605 -int g_dialogKeyboardBlocked; // OFFSET: 0x00A90950 // FUNCTION: fn_17154 bool UIWindowMgr::ProcessDialogKey(int, int key) { - if (g_dialogKeyboardEnabled == 0 || g_dialogKeyboardBlocked != 0) { + if (g_session.unknown_5480 == 0 || g_session.unknown_5488 != 0) { return false; } diff --git a/Source/UI/Window/WindowMgrState.cpp b/Source/UI/Window/WindowMgrState.cpp index 0ba6111b..64e8ca31 100644 --- a/Source/UI/Window/WindowMgrState.cpp +++ b/Source/UI/Window/WindowMgrState.cpp @@ -458,8 +458,8 @@ void UIWindowMgr::LoadUIRectInfo() { RegQueryValueExA(key, "CHATWNDSTICKON", nullptr, &type, reinterpret_cast(&this->unknown_03F4), &size); RegQueryValueExA(key, "ONSTSUBCHAT", nullptr, &type, base + 0x3F5, &size); RegQueryValueExA(key, "ONBTSUBCHAT", nullptr, &type, reinterpret_cast(&this->unknown_03F6), &size); - RegQueryValueExA(key, "MEMORIALDUNWND.X", nullptr, &type, reinterpret_cast(&g_memorialDunWndX), &size); - RegQueryValueExA(key, "MEMORIALDUNWND.Y", nullptr, &type, reinterpret_cast(&g_memorialDunWndY), &size); + RegQueryValueExA(key, "MEMORIALDUNWND.X", nullptr, &type, reinterpret_cast(&g_session.unknown_5940), &size); + RegQueryValueExA(key, "MEMORIALDUNWND.Y", nullptr, &type, reinterpret_cast(&g_session.unknown_5944), &size); RegQueryValueExA(key, "QUICKSLOTWNDINFO.X", nullptr, &type, base + 0x934, &size); RegQueryValueExA(key, "QUICKSLOTWNDINFO.Y", nullptr, &type, base + 0x938, &size); RegQueryValueExA(key, "QUICKSLOTWNDINFO.W", nullptr, &type, base + 0x93C, &size); @@ -912,8 +912,8 @@ void UIWindowMgr::SaveUIRectInfo() { RegSetValueExA(key, "CHATWNDSTICKON", 0, REG_DWORD, reinterpret_cast(&this->unknown_03F4), 4); RegSetValueExA(key, "ONSTSUBCHAT", 0, REG_DWORD, base + 0x3F5, 4); RegSetValueExA(key, "ONBTSUBCHAT", 0, REG_DWORD, reinterpret_cast(&this->unknown_03F6), 4); - RegSetValueExA(key, "MEMORIALDUNWND.X", 0, REG_DWORD, reinterpret_cast(&g_memorialDunWndX), 4); - RegSetValueExA(key, "MEMORIALDUNWND.Y", 0, REG_DWORD, reinterpret_cast(&g_memorialDunWndY), 4); + RegSetValueExA(key, "MEMORIALDUNWND.X", 0, REG_DWORD, reinterpret_cast(&g_session.unknown_5940), 4); + RegSetValueExA(key, "MEMORIALDUNWND.Y", 0, REG_DWORD, reinterpret_cast(&g_session.unknown_5944), 4); RegSetValueExA(key, "QUICKSLOTWNDINFO.X", 0, REG_DWORD, base + 0x934, 4); RegSetValueExA(key, "QUICKSLOTWNDINFO.Y", 0, REG_DWORD, base + 0x938, 4); RegSetValueExA(key, "QUICKSLOTWNDINFO.W", 0, REG_DWORD, base + 0x93C, 4);