From ff66b6d84e40eaec8a5823818b6fcfa22183907e Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 1 Jan 2025 12:08:49 +0000 Subject: [PATCH] Fixed /age2 on /age not working Fixed /age on vanquish not working --- GWToolboxdll/Modules/GameSettings.cpp | 22 ++++++++-------------- GWToolboxdll/Modules/GameSettings.h | 1 - 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/GWToolboxdll/Modules/GameSettings.cpp b/GWToolboxdll/Modules/GameSettings.cpp index d476647d8..577d0bf21 100644 --- a/GWToolboxdll/Modules/GameSettings.cpp +++ b/GWToolboxdll/Modules/GameSettings.cpp @@ -1237,7 +1237,11 @@ namespace { if (status->blocked && !GW::Map::CancelEnterChallenge()) Log::Warning("Failed to cancel mission entry"); break; - } + } break; + case GW::UI::UIMessage::kVanquishComplete: { + if (auto_age_on_vanquish) + GW::Chat::SendChat('/', L"age"); + } break; } } @@ -1572,7 +1576,6 @@ void GameSettings::Initialize() GW::StoC::RegisterPacketCallback(&PartyPlayerAdd_Entry, bind_member(this, &GameSettings::OnPartyPlayerJoined)); GW::StoC::RegisterPacketCallback(&GameSrvTransfer_Entry, OnMapTravel); GW::StoC::RegisterPacketCallback(&CinematicPlay_Entry, OnCinematic); - GW::StoC::RegisterPacketCallback(&VanquishComplete_Entry, OnVanquishComplete); GW::StoC::RegisterPacketCallback(&VanquishComplete_Entry, bind_member(this, &GameSettings::OnDungeonReward)); GW::StoC::RegisterPacketCallback(&PlayerJoinInstance_Entry, OnMapLoaded); GW::StoC::RegisterPacketCallback(&PlayerJoinInstance_Entry, OnPlayerJoinInstance); @@ -1640,7 +1643,8 @@ void GameSettings::Initialize() GW::UI::UIMessage::kMapLoaded, GW::UI::UIMessage::kTradeSessionStart, GW::UI::UIMessage::kShowCancelEnterMissionBtn, - GW::UI::UIMessage::kPartyDefeated + GW::UI::UIMessage::kPartyDefeated, + GW::UI::UIMessage::kVanquishComplete }; for (const auto message_id : post_ui_messages) { RegisterUIMessageCallback(&OnPostUIMessage_HookEntry, message_id, OnPostUIMessage, 0x8000); @@ -2594,19 +2598,9 @@ void GameSettings::OnServerMessage(const GW::HookStatus*, GW::Packet::StoC::Mess // 0x8101 0x641F 0x86C3 0xE149 0x53E8 0x101 0x107 = You have been in this map for n minutes. // 0x8101 0x641E 0xE7AD 0xEF64 0x1676 0x101 0x107 0x102 0x107 = You have been in this map for n hours and n minutes. if (wmemcmp(msg, L"\x8101\x641F\x86C3\xE149\x53E8", 5) == 0 || wmemcmp(msg, L"\x8101\x641E\xE7AD\xEF64\x1676", 5) == 0) { - GW::Chat::SendChat(GW::Chat::Channel::CHANNEL_EMOTE, L"age2"); + GW::Chat::SendChat('/', L"age2"); } } - -// Automatic /age on vanquish -void GameSettings::OnVanquishComplete(const GW::HookStatus*, GW::Packet::StoC::VanquishComplete*) -{ - if (!auto_age_on_vanquish) { - return; - } - GW::Chat::SendChat(GW::Chat::Channel::CHANNEL_EMOTE, L"age"); -} - void GameSettings::OnDungeonReward(GW::HookStatus* status, GW::Packet::StoC::DungeonReward*) const { if (hide_dungeon_chest_popup) { diff --git a/GWToolboxdll/Modules/GameSettings.h b/GWToolboxdll/Modules/GameSettings.h index 594a9251c..69027b642 100644 --- a/GWToolboxdll/Modules/GameSettings.h +++ b/GWToolboxdll/Modules/GameSettings.h @@ -70,7 +70,6 @@ class GameSettings : public ToolboxModule { static void OnAgentEffect(GW::HookStatus*, const GW::Packet::StoC::GenericValue*); void OnFactionDonate(GW::HookStatus*, GW::UI::UIMessage, void*, void*) const; static void OnPartyDefeated(const GW::HookStatus*, GW::Packet::StoC::PartyDefeated*); - static void OnVanquishComplete(const GW::HookStatus*, GW::Packet::StoC::VanquishComplete*); void OnDungeonReward(GW::HookStatus*, GW::Packet::StoC::DungeonReward*) const; static void OnMapLoaded(GW::HookStatus*, GW::Packet::StoC::MapLoaded*); static void OnCinematic(const GW::HookStatus*, const GW::Packet::StoC::CinematicPlay*);