From f6055f946cb17a58bb029987fbddca844b7c1565 Mon Sep 17 00:00:00 2001 From: Azrub Date: Tue, 12 Aug 2025 12:13:11 +0200 Subject: [PATCH] Release v1.5.2.0 Added Respawn Golem button --- GolemHelper/Automation/AutomationLogic.cpp | 38 ++++++++++++++++++++++ GolemHelper/Automation/AutomationLogic.h | 1 + GolemHelper/Common/MenuSequences.h | 6 ++++ GolemHelper/Common/Types.h | 8 +++-- GolemHelper/GolemHelper.cpp | 4 +-- GolemHelper/Input/KeybindManager.cpp | 8 +++++ GolemHelper/Input/KeybindManager.h | 1 + GolemHelper/UI/UIManager.cpp | 10 ++++-- 8 files changed, 70 insertions(+), 6 deletions(-) diff --git a/GolemHelper/Automation/AutomationLogic.cpp b/GolemHelper/Automation/AutomationLogic.cpp index 4c4d49d..66c6f19 100644 --- a/GolemHelper/Automation/AutomationLogic.cpp +++ b/GolemHelper/Automation/AutomationLogic.cpp @@ -347,4 +347,42 @@ void AutomationLogic::SpawnGolem() { } g_api->Log(ELogLevel_INFO, "GolemHelper", "Golem settings sequence completed (25 steps)!"); +} + +void AutomationLogic::RespawnGolem() { + if (!g_api || !g_state.enabled) return; + + bool uiWasVisible = g_state.showUI; + if (uiWasVisible) { + g_state.showUI = false; + } + + g_api->Log(ELogLevel_INFO, "GolemHelper", "Starting golem respawn sequence (2 steps)"); + + try { + g_api->GameBinds.InvokeAsync(EGameBinds_MiscInteract, 50); + Sleep(g_state.initialDelay); + + for (int i = 0; i < MenuSequences::GOLEM_RESPAWN_LENGTH; i++) { + MenuOption step = MenuSequences::GOLEM_RESPAWN[i]; + auto coordIt = g_coords.coords.find(step); + + if (coordIt == g_coords.coords.end() || + (coordIt->second.first == 0 && coordIt->second.second == 0)) { + continue; + } + + int delay = (i == MenuSequences::GOLEM_RESPAWN_LENGTH - 1) ? 50 : g_state.stepDelay; + CoordinateUtils::ClickAtScaled(coordIt->second.first, coordIt->second.second, delay); + } + } + catch (...) { + g_api->Log(ELogLevel_WARNING, "GolemHelper", "Exception during golem respawn sequence"); + } + + if (uiWasVisible) { + g_state.showUI = true; + } + + g_api->Log(ELogLevel_INFO, "GolemHelper", "Golem respawn sequence completed!"); } \ No newline at end of file diff --git a/GolemHelper/Automation/AutomationLogic.h b/GolemHelper/Automation/AutomationLogic.h index 33e0e03..fb73bc8 100644 --- a/GolemHelper/Automation/AutomationLogic.h +++ b/GolemHelper/Automation/AutomationLogic.h @@ -7,4 +7,5 @@ public: static void ApplyBoons(); static void ApplyHealerBoons(); static void SpawnGolem(); + static void RespawnGolem(); }; \ No newline at end of file diff --git a/GolemHelper/Common/MenuSequences.h b/GolemHelper/Common/MenuSequences.h index 04066db..f361e66 100644 --- a/GolemHelper/Common/MenuSequences.h +++ b/GolemHelper/Common/MenuSequences.h @@ -67,7 +67,13 @@ public: GOLEM_PLEASESPAWNMYGOLEM }; + static constexpr MenuOption GOLEM_RESPAWN[2] = { + GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, + GOLEM_EXIT + }; + static constexpr int BOON_LENGTH = 20; static constexpr int HEALER_QUICK_LENGTH = 10; static constexpr int GOLEM_LENGTH = 25; + static constexpr int GOLEM_RESPAWN_LENGTH = 2; }; \ No newline at end of file diff --git a/GolemHelper/Common/Types.h b/GolemHelper/Common/Types.h index 17619f6..4605641 100644 --- a/GolemHelper/Common/Types.h +++ b/GolemHelper/Common/Types.h @@ -51,6 +51,7 @@ enum MenuOption { BOON_ENV_EXTREME, // === GOLEM MENU === + GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, GOLEM_SPAWNAGOLEM, GOLEM_HITBOX_SMALL, GOLEM_HITBOX_MEDIUM, @@ -79,7 +80,8 @@ enum MenuOption { GOLEM_WEAKNESS, GOLEM_GOBACK4, GOLEM_GOBACK5, - GOLEM_PLEASESPAWNMYGOLEM + GOLEM_PLEASESPAWNMYGOLEM, + GOLEM_EXIT }; struct GolemTemplate { @@ -193,6 +195,7 @@ struct MenuCoordinates { {BOON_ENV_EXTREME, {830, 262}}, // === GOLEM MENU === + {GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, {830, 352}}, {GOLEM_SPAWNAGOLEM, {830, 260}}, {GOLEM_HITBOX_SMALL, {830, 260}}, {GOLEM_HITBOX_MEDIUM, {830, 305}}, @@ -221,6 +224,7 @@ struct MenuCoordinates { {GOLEM_WEAKNESS, {830, 400}}, {GOLEM_GOBACK4, {830, 454}}, {GOLEM_GOBACK5, {830, 454}}, - {GOLEM_PLEASESPAWNMYGOLEM, {830, 548}} + {GOLEM_PLEASESPAWNMYGOLEM, {830, 548}}, + {GOLEM_EXIT, {830, 400}}, }; }; \ No newline at end of file diff --git a/GolemHelper/GolemHelper.cpp b/GolemHelper/GolemHelper.cpp index 2332611..1a461d9 100644 --- a/GolemHelper/GolemHelper.cpp +++ b/GolemHelper/GolemHelper.cpp @@ -35,7 +35,7 @@ void Load(AddonAPI* aApi) { MapUtils::UpdateQuickAccessVisibility(); - g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.5.1.0 Loaded ==="); + g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.5.2.0 Loaded ==="); g_api->Log(ELogLevel_INFO, "GolemHelper", "GolemHelper addon loaded successfully!"); } @@ -62,7 +62,7 @@ extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() { def.Signature = -424248; def.APIVersion = NEXUS_API_VERSION; def.Name = "GolemHelper"; - def.Version = { 1, 5, 1, 0 }; + def.Version = { 1, 5, 2, 0 }; def.Author = "Azrub"; def.Description = "Automates the process of setting optimal boon and golem configurations in the training area"; def.Load = Load; diff --git a/GolemHelper/Input/KeybindManager.cpp b/GolemHelper/Input/KeybindManager.cpp index b37393a..c2e5216 100644 --- a/GolemHelper/Input/KeybindManager.cpp +++ b/GolemHelper/Input/KeybindManager.cpp @@ -11,6 +11,7 @@ void KeybindManager::RegisterKeybinds() { Keybind kb_empty = { 0, false, false, false }; g_api->InputBinds.RegisterWithStruct("GolemHelper.ApplyBoons", HandleBoonKeybind, kb_empty); g_api->InputBinds.RegisterWithStruct("GolemHelper.SpawnGolem", HandleGolemKeybind, kb_empty); + g_api->InputBinds.RegisterWithStruct("GolemHelper.RespawnGolem", HandleRespawnGolemKeybind, kb_empty); g_api->InputBinds.RegisterWithStruct("GolemHelper.QuickDPS", HandleQuickDpsKeybind, kb_empty); g_api->InputBinds.RegisterWithStruct("GolemHelper.AlacDPS", HandleAlacDpsKeybind, kb_empty); g_api->InputBinds.RegisterWithStruct("GolemHelper.Toggle", HandleToggleKeybind, kb_empty); @@ -23,6 +24,7 @@ void KeybindManager::UnregisterKeybinds() { g_api->InputBinds.Deregister("GolemHelper.ApplyBoons"); g_api->InputBinds.Deregister("GolemHelper.SpawnGolem"); + g_api->InputBinds.Deregister("GolemHelper.RespawnGolem"); g_api->InputBinds.Deregister("GolemHelper.QuickDPS"); g_api->InputBinds.Deregister("GolemHelper.AlacDPS"); g_api->InputBinds.Deregister("GolemHelper.Toggle"); @@ -42,6 +44,12 @@ void KeybindManager::HandleGolemKeybind(const char* id, bool release) { } } +void KeybindManager::HandleRespawnGolemKeybind(const char* id, bool release) { + if (!release && g_state.enabled) { + AutomationLogic::RespawnGolem(); + } +} + void KeybindManager::HandleToggleKeybind(const char* id, bool release) { if (!release) { g_state.enabled = !g_state.enabled; diff --git a/GolemHelper/Input/KeybindManager.h b/GolemHelper/Input/KeybindManager.h index f705823..000a8da 100644 --- a/GolemHelper/Input/KeybindManager.h +++ b/GolemHelper/Input/KeybindManager.h @@ -7,6 +7,7 @@ public: static void HandleBoonKeybind(const char* id, bool release); static void HandleGolemKeybind(const char* id, bool release); + static void HandleRespawnGolemKeybind(const char* id, bool release); static void HandleQuickDpsKeybind(const char* id, bool release); static void HandleAlacDpsKeybind(const char* id, bool release); static void HandleToggleKeybind(const char* id, bool release); diff --git a/GolemHelper/UI/UIManager.cpp b/GolemHelper/UI/UIManager.cpp index 26bec2d..0f21545 100644 --- a/GolemHelper/UI/UIManager.cpp +++ b/GolemHelper/UI/UIManager.cpp @@ -17,7 +17,7 @@ void UIManager::RenderUI() { if (ImGui::Begin("GolemHelper", &g_state.showUI, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.5.1.0"); + ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.5.2.0"); ImGui::Separator(); if (ImGui::BeginTabBar("GolemHelperTabs", ImGuiTabBarFlags_None)) { @@ -162,11 +162,17 @@ void UIManager::RenderSettingsTab() { ImGui::Text("Golem Configuration"); - if (ImGui::Button("Spawn Golem", ImVec2(150, 0))) { + if (ImGui::Button("Spawn Golem", ImVec2(120, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false); } } + ImGui::SameLine(); + if (ImGui::Button("Respawn", ImVec2(80, 0))) { + if (g_state.enabled && MapUtils::IsInTrainingArea()) { + g_api->InputBinds.Invoke("GolemHelper.RespawnGolem", false); + } + } ImGui::Text("Golem Hitbox:");