diff --git a/GolemHelper/Automation/AutomationLogic.cpp b/GolemHelper/Automation/AutomationLogic.cpp index 66c6f19..97d5f2a 100644 --- a/GolemHelper/Automation/AutomationLogic.cpp +++ b/GolemHelper/Automation/AutomationLogic.cpp @@ -385,4 +385,43 @@ void AutomationLogic::RespawnGolem() { } g_api->Log(ELogLevel_INFO, "GolemHelper", "Golem respawn sequence completed!"); +} + +void AutomationLogic::RemoveAndRespawnGolem() +{ + 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 remove and respawn sequence (3 steps)"); + + try { + g_api->GameBinds.InvokeAsync(EGameBinds_MiscInteract, 50); + Sleep(g_state.initialDelay); + + for (int i = 0; i < MenuSequences::GOLEM_REMOVE_AND_RESPAWN_LENGTH; i++) { + MenuOption step = MenuSequences::GOLEM_REMOVE_AND_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_REMOVE_AND_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 remove and respawn sequence"); + } + + if (uiWasVisible) { + g_state.showUI = true; + } + + g_api->Log(ELogLevel_INFO, "GolemHelper", "Golem remove and respawn sequence completed!"); } \ No newline at end of file diff --git a/GolemHelper/Automation/AutomationLogic.h b/GolemHelper/Automation/AutomationLogic.h index fb73bc8..027b07d 100644 --- a/GolemHelper/Automation/AutomationLogic.h +++ b/GolemHelper/Automation/AutomationLogic.h @@ -8,4 +8,5 @@ public: static void ApplyHealerBoons(); static void SpawnGolem(); static void RespawnGolem(); + static void RemoveAndRespawnGolem(); }; \ No newline at end of file diff --git a/GolemHelper/Common/MenuSequences.h b/GolemHelper/Common/MenuSequences.h index f361e66..c411255 100644 --- a/GolemHelper/Common/MenuSequences.h +++ b/GolemHelper/Common/MenuSequences.h @@ -72,8 +72,15 @@ public: GOLEM_EXIT }; + static constexpr MenuOption GOLEM_REMOVE_AND_RESPAWN[3] = { + GOLEM_REMOVEGOLEM, + 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; + static constexpr int GOLEM_REMOVE_AND_RESPAWN_LENGTH = 3; }; \ No newline at end of file diff --git a/GolemHelper/Common/Types.h b/GolemHelper/Common/Types.h index 4605641..8a2a9b1 100644 --- a/GolemHelper/Common/Types.h +++ b/GolemHelper/Common/Types.h @@ -52,6 +52,7 @@ enum MenuOption { // === GOLEM MENU === GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, + GOLEM_REMOVEGOLEM, GOLEM_SPAWNAGOLEM, GOLEM_HITBOX_SMALL, GOLEM_HITBOX_MEDIUM, @@ -145,6 +146,7 @@ struct GolemHelperState { bool skipAegis = false; bool alwaysHideIcon = false; bool autoShowHideUI = false; + bool alwaysLoadLastSettings = false; int debugCounter = 0; int initialDelay = 390; @@ -196,6 +198,7 @@ struct MenuCoordinates { // === GOLEM MENU === {GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, {830, 352}}, + {GOLEM_REMOVEGOLEM, {830, 306}}, {GOLEM_SPAWNAGOLEM, {830, 260}}, {GOLEM_HITBOX_SMALL, {830, 260}}, {GOLEM_HITBOX_MEDIUM, {830, 305}}, diff --git a/GolemHelper/Config/ConfigManager.cpp b/GolemHelper/Config/ConfigManager.cpp index 66f4092..dc6268b 100644 --- a/GolemHelper/Config/ConfigManager.cpp +++ b/GolemHelper/Config/ConfigManager.cpp @@ -23,14 +23,16 @@ void ConfigManager::SaveCustomDelaySettings() { configFile << "stepDelay=" << g_state.stepDelay << std::endl; configFile << "alwaysHideIcon=" << (g_state.alwaysHideIcon ? "1" : "0") << std::endl; configFile << "autoShowHideUI=" << (g_state.autoShowHideUI ? "1" : "0") << std::endl; + configFile << "alwaysLoadLastSettings=" << (g_state.alwaysLoadLastSettings ? "1" : "0") << std::endl; configFile.close(); - char logBuffer[350]; - sprintf_s(logBuffer, "Settings saved: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s", + char logBuffer[512]; + sprintf_s(logBuffer, "Settings saved: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s, alwaysLoadLastSettings=%s", g_state.initialDelay, g_state.stepDelay, g_state.alwaysHideIcon ? "true" : "false", - g_state.autoShowHideUI ? "true" : "false"); + g_state.autoShowHideUI ? "true" : "false", + g_state.alwaysLoadLastSettings ? "true" : "false"); g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer); } @@ -79,19 +81,113 @@ void ConfigManager::LoadCustomDelaySettings() { else if (key == "autoShowHideUI") { g_state.autoShowHideUI = (value == "1"); } + else if (key == "alwaysLoadLastSettings") { + g_state.alwaysLoadLastSettings = (value == "1"); + } } configFile.close(); - char logBuffer[350]; - sprintf_s(logBuffer, "Settings loaded: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s", + char logBuffer[512]; + sprintf_s(logBuffer, "Settings loaded: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s, alwaysLoadLastSettings=%s", g_state.initialDelay, g_state.stepDelay, g_state.alwaysHideIcon ? "true" : "false", - g_state.autoShowHideUI ? "true" : "false"); + g_state.autoShowHideUI ? "true" : "false", + g_state.alwaysLoadLastSettings ? "true" : "false"); g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer); } catch (...) { g_api->Log(ELogLevel_INFO, "GolemHelper", "Could not load config file, using defaults"); } +} + +void ConfigManager::SaveLastUsedSettings() { + if (!g_api) return; + + std::string addonPath = g_api->Paths.GetAddonDirectory("GolemHelper"); + std::string settingsPath = addonPath + "\\last_settings.ini"; + + try { + std::ofstream settingsFile(settingsPath); + if (!settingsFile.is_open()) { + g_api->Log(ELogLevel_WARNING, "GolemHelper", "Could not create last settings file"); + return; + } + + settingsFile << "[LastUsedSettings]" << std::endl; + settingsFile << "isQuickDps=" << (g_state.isQuickDps ? "1" : "0") << std::endl; + settingsFile << "isAlacDps=" << (g_state.isAlacDps ? "1" : "0") << std::endl; + settingsFile << "showBoonAdvanced=" << (g_state.showBoonAdvanced ? "1" : "0") << std::endl; + settingsFile << "environmentDamage=" << (g_state.environmentDamage ? "1" : "0") << std::endl; + settingsFile << "envDamageLevel=" << static_cast(g_state.envDamageLevel) << std::endl; + settingsFile << "skipBurning=" << (g_state.skipBurning ? "1" : "0") << std::endl; + settingsFile << "showAdvanced=" << (g_state.showAdvanced ? "1" : "0") << std::endl; + settingsFile << "skipConfusion=" << (g_state.skipConfusion ? "1" : "0") << std::endl; + settingsFile << "skipSlow=" << (g_state.skipSlow ? "1" : "0") << std::endl; + settingsFile << "addImmobilize=" << (g_state.addImmobilize ? "1" : "0") << std::endl; + settingsFile << "addBlind=" << (g_state.addBlind ? "1" : "0") << std::endl; + settingsFile << "fiveBleedingStacks=" << (g_state.fiveBleedingStacks ? "1" : "0") << std::endl; + settingsFile << "hitboxType=" << static_cast(g_state.hitboxType) << std::endl; + settingsFile << "addResistance=" << (g_state.addResistance ? "1" : "0") << std::endl; + settingsFile << "addStability=" << (g_state.addStability ? "1" : "0") << std::endl; + settingsFile << "skipAegis=" << (g_state.skipAegis ? "1" : "0") << std::endl; + + settingsFile.close(); + g_api->Log(ELogLevel_INFO, "GolemHelper", "Last used settings saved"); + + } + catch (...) { + g_api->Log(ELogLevel_WARNING, "GolemHelper", "Failed to save last settings file"); + } +} + +void ConfigManager::LoadLastUsedSettings() { + if (!g_api) return; + + std::string addonPath = g_api->Paths.GetAddonDirectory("GolemHelper"); + std::string settingsPath = addonPath + "\\last_settings.ini"; + + try { + std::ifstream settingsFile(settingsPath); + if (!settingsFile.is_open()) { + g_api->Log(ELogLevel_INFO, "GolemHelper", "No last settings file found"); + return; + } + + std::string line; + while (std::getline(settingsFile, line)) { + if (line.empty() || line[0] == '[') continue; + + size_t equalPos = line.find('='); + if (equalPos == std::string::npos) continue; + + std::string key = line.substr(0, equalPos); + std::string value = line.substr(equalPos + 1); + + if (key == "isQuickDps") g_state.isQuickDps = (value == "1"); + else if (key == "isAlacDps") g_state.isAlacDps = (value == "1"); + else if (key == "showBoonAdvanced") g_state.showBoonAdvanced = (value == "1"); + else if (key == "environmentDamage") g_state.environmentDamage = (value == "1"); + else if (key == "envDamageLevel") g_state.envDamageLevel = static_cast(std::stoi(value)); + else if (key == "showAdvanced") g_state.showAdvanced = (value == "1"); + else if (key == "skipBurning") g_state.skipBurning = (value == "1"); + else if (key == "skipConfusion") g_state.skipConfusion = (value == "1"); + else if (key == "skipSlow") g_state.skipSlow = (value == "1"); + else if (key == "addImmobilize") g_state.addImmobilize = (value == "1"); + else if (key == "addBlind") g_state.addBlind = (value == "1"); + else if (key == "fiveBleedingStacks") g_state.fiveBleedingStacks = (value == "1"); + else if (key == "hitboxType") g_state.hitboxType = static_cast(std::stoi(value)); + else if (key == "addResistance") g_state.addResistance = (value == "1"); + else if (key == "addStability") g_state.addStability = (value == "1"); + else if (key == "skipAegis") g_state.skipAegis = (value == "1"); + } + + settingsFile.close(); + g_api->Log(ELogLevel_INFO, "GolemHelper", "Last used settings loaded"); + + } + catch (...) { + g_api->Log(ELogLevel_INFO, "GolemHelper", "Could not load last settings file"); + } } \ No newline at end of file diff --git a/GolemHelper/Config/ConfigManager.h b/GolemHelper/Config/ConfigManager.h index 585e33a..e1eb57e 100644 --- a/GolemHelper/Config/ConfigManager.h +++ b/GolemHelper/Config/ConfigManager.h @@ -4,4 +4,6 @@ class ConfigManager { public: static void SaveCustomDelaySettings(); static void LoadCustomDelaySettings(); + static void SaveLastUsedSettings(); + static void LoadLastUsedSettings(); }; \ No newline at end of file diff --git a/GolemHelper/GolemHelper.cpp b/GolemHelper/GolemHelper.cpp index a75f73e..ba247d3 100644 --- a/GolemHelper/GolemHelper.cpp +++ b/GolemHelper/GolemHelper.cpp @@ -23,6 +23,11 @@ void Load(AddonAPI* aApi) { ConfigManager::LoadCustomDelaySettings(); TemplateManager::LoadTemplates(); + + if (g_state.alwaysLoadLastSettings) { + ConfigManager::LoadLastUsedSettings(); + } + FileUtils::CopyResourceIcons(); g_api->Renderer.Register(ERenderType_Render, UIManager::RenderUI); @@ -35,7 +40,7 @@ void Load(AddonAPI* aApi) { MapUtils::UpdateQuickAccessVisibility(); - g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.5.3.0 Loaded ==="); + g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.6.0.0 Loaded ==="); g_api->Log(ELogLevel_INFO, "GolemHelper", "GolemHelper addon loaded successfully!"); } @@ -62,7 +67,7 @@ extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() { def.Signature = -424248; def.APIVersion = NEXUS_API_VERSION; def.Name = "GolemHelper"; - def.Version = { 1, 5, 3, 0 }; + def.Version = { 1, 6, 0, 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 c2e5216..f9cf377 100644 --- a/GolemHelper/Input/KeybindManager.cpp +++ b/GolemHelper/Input/KeybindManager.cpp @@ -12,6 +12,7 @@ void KeybindManager::RegisterKeybinds() { 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.RemoveAndRespawnGolem", HandleRemoveAndRespawnGolemKeybind, 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); @@ -25,6 +26,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.RemoveAndRespawnGolem"); g_api->InputBinds.Deregister("GolemHelper.QuickDPS"); g_api->InputBinds.Deregister("GolemHelper.AlacDPS"); g_api->InputBinds.Deregister("GolemHelper.Toggle"); @@ -50,6 +52,12 @@ void KeybindManager::HandleRespawnGolemKeybind(const char* id, bool release) { } } +void KeybindManager::HandleRemoveAndRespawnGolemKeybind(const char* id, bool release) { + if (!release && g_state.enabled) { + AutomationLogic::RemoveAndRespawnGolem(); + } +} + 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 000a8da..25e26f3 100644 --- a/GolemHelper/Input/KeybindManager.h +++ b/GolemHelper/Input/KeybindManager.h @@ -8,6 +8,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 HandleRemoveAndRespawnGolemKeybind(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 034097b..93d9df1 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.3.0"); + ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.6.0.0"); ImGui::Separator(); if (ImGui::BeginTabBar("GolemHelperTabs", ImGuiTabBarFlags_None)) { @@ -82,7 +82,7 @@ void UIManager::RenderUI() { void UIManager::RenderSettingsTab() { ImGui::Text("Boon Configuration"); - if (ImGui::Button("Apply Boons", ImVec2(150, 0))) { + if (ImGui::Button("Apply Boons", ImVec2(130, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false); } @@ -162,18 +162,26 @@ void UIManager::RenderSettingsTab() { ImGui::Text("Golem Configuration"); - if (ImGui::Button("Spawn Golem", ImVec2(120, 0))) { + if (ImGui::Button("Spawn Golem", ImVec2(110, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false); } } - ImGui::SameLine(); + ImGui::SameLine(0, 5); if (ImGui::Button("Respawn", ImVec2(80, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.RespawnGolem", false); } } + ImGui::Spacing(); + + if (ImGui::Button("Remove and Respawn", ImVec2(150, 0))) { + if (g_state.enabled && MapUtils::IsInTrainingArea()) { + g_api->InputBinds.Invoke("GolemHelper.RemoveAndRespawnGolem", false); + } + } + ImGui::Text("Golem Hitbox:"); if (ImGui::RadioButton("Small (Benchmark Default)", g_state.hitboxType == HITBOX_SMALL)) { @@ -233,22 +241,22 @@ void UIManager::RenderSettingsTab() { int oldInitialDelay = g_state.initialDelay; ImGui::Text("Initial Delay (after F key):"); - ImGui::SetNextItemWidth(205); + ImGui::SetNextItemWidth(200); ImGui::SliderInt("##initial", &g_state.initialDelay, 100, 1000, "%d ms"); ImGui::Text("Step Delay (between clicks):"); - ImGui::SetNextItemWidth(205); + ImGui::SetNextItemWidth(200); ImGui::SliderInt("##step", &g_state.stepDelay, 100, 1000, "%d ms"); ImGui::Spacing(); - if (ImGui::Button("Reset to Default", ImVec2(120, 0))) { + if (ImGui::Button("Reset to Default", ImVec2(117, 0))) { g_state.stepDelay = 290; g_state.initialDelay = 390; ConfigManager::SaveCustomDelaySettings(); } - ImGui::SameLine(); - if (ImGui::Button("Slow Mode", ImVec2(80, 0))) { + ImGui::SameLine(0, 5); + if (ImGui::Button("Slow Mode", ImVec2(78, 0))) { g_state.stepDelay = 1000; g_state.initialDelay = 600; ConfigManager::SaveCustomDelaySettings(); @@ -262,24 +270,97 @@ void UIManager::RenderSettingsTab() { } } ImGui::PopStyleColor(2); + + if (g_state.alwaysLoadLastSettings) { + static bool lastIsQuickDps = g_state.isQuickDps; + static bool lastIsAlacDps = g_state.isAlacDps; + static bool lastEnvironmentDamage = g_state.environmentDamage; + static EnvironmentDamageLevel lastEnvDamageLevel = g_state.envDamageLevel; + static bool lastSkipBurning = g_state.skipBurning; + static bool lastSkipConfusion = g_state.skipConfusion; + static bool lastSkipSlow = g_state.skipSlow; + static bool lastAddImmobilize = g_state.addImmobilize; + static bool lastAddBlind = g_state.addBlind; + static bool lastFiveBleedingStacks = g_state.fiveBleedingStacks; + static HitboxType lastHitboxType = g_state.hitboxType; + static bool lastAddResistance = g_state.addResistance; + static bool lastAddStability = g_state.addStability; + static bool lastSkipAegis = g_state.skipAegis; + static bool lastShowBoonAdvanced = g_state.showBoonAdvanced; + static bool lastShowAdvanced = g_state.showAdvanced; + + if (lastIsQuickDps != g_state.isQuickDps || + lastIsAlacDps != g_state.isAlacDps || + lastEnvironmentDamage != g_state.environmentDamage || + lastEnvDamageLevel != g_state.envDamageLevel || + lastSkipBurning != g_state.skipBurning || + lastSkipConfusion != g_state.skipConfusion || + lastSkipSlow != g_state.skipSlow || + lastAddImmobilize != g_state.addImmobilize || + lastAddBlind != g_state.addBlind || + lastFiveBleedingStacks != g_state.fiveBleedingStacks || + lastHitboxType != g_state.hitboxType || + lastAddResistance != g_state.addResistance || + lastAddStability != g_state.addStability || + lastSkipAegis != g_state.skipAegis || + lastShowBoonAdvanced != g_state.showBoonAdvanced || + lastShowAdvanced != g_state.showAdvanced) { + + ConfigManager::SaveLastUsedSettings(); + + lastIsQuickDps = g_state.isQuickDps; + lastIsAlacDps = g_state.isAlacDps; + lastEnvironmentDamage = g_state.environmentDamage; + lastEnvDamageLevel = g_state.envDamageLevel; + lastSkipBurning = g_state.skipBurning; + lastSkipConfusion = g_state.skipConfusion; + lastSkipSlow = g_state.skipSlow; + lastAddImmobilize = g_state.addImmobilize; + lastAddBlind = g_state.addBlind; + lastFiveBleedingStacks = g_state.fiveBleedingStacks; + lastHitboxType = g_state.hitboxType; + lastAddResistance = g_state.addResistance; + lastAddStability = g_state.addStability; + lastSkipAegis = g_state.skipAegis; + lastShowBoonAdvanced = g_state.showBoonAdvanced; + lastShowAdvanced = g_state.showAdvanced; + } + } } void UIManager::RenderTemplatesTab() { - if (ImGui::Button("Apply Boons", ImVec2(120, 30))) { + ImGui::Spacing(); + + if (ImGui::Button("Apply Boons", ImVec2(110, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false); } } - ImGui::SameLine(); - - if (ImGui::Button("Spawn Golem", ImVec2(120, 30))) { + ImGui::SameLine(0, 5); + if (ImGui::Button("Spawn Golem", ImVec2(110, 0))) { if (g_state.enabled && MapUtils::IsInTrainingArea()) { g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false); } } + ImGui::Spacing(); + + if (ImGui::Button("Respawn", ImVec2(110, 0))) { + if (g_state.enabled && MapUtils::IsInTrainingArea()) { + g_api->InputBinds.Invoke("GolemHelper.RespawnGolem", false); + } + } + ImGui::SameLine(0, 5); + if (ImGui::Button("Remove and Respawn", ImVec2(150, 0))) { + if (g_state.enabled && MapUtils::IsInTrainingArea()) { + g_api->InputBinds.Invoke("GolemHelper.RemoveAndRespawnGolem", false); + } + } + + ImGui::Spacing(); ImGui::Spacing(); ImGui::Separator(); + ImGui::Spacing(); ImGui::Text("Template Management"); ImGui::Separator(); @@ -287,7 +368,7 @@ void UIManager::RenderTemplatesTab() { ImGui::Text("Save Current Settings:"); ImGui::SetNextItemWidth(170); ImGui::InputText("##templateName", g_state.newTemplateName, sizeof(g_state.newTemplateName)); - ImGui::SameLine(); + ImGui::SameLine(0, 5); if (ImGui::Button("Save", ImVec2(50, 0))) { if (strlen(g_state.newTemplateName) > 0) { @@ -331,14 +412,14 @@ void UIManager::RenderTemplatesTab() { g_state.lastUserTemplateIndex = userTemplateIndices[currentUserIndex]; } - ImGui::SameLine(); + ImGui::SameLine(0, 5); if (ImGui::Button("Load", ImVec2(50, 0))) { if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) { TemplateManager::LoadTemplate(userTemplateIndices[currentUserIndex]); } } - ImGui::SameLine(); + ImGui::SameLine(0, 5); if (ImGui::Button("Del", ImVec2(50, 0))) { if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) { TemplateManager::DeleteTemplate(userTemplateIndices[currentUserIndex]); @@ -454,10 +535,12 @@ void UIManager::RenderTemplatesTab() { TemplateManager::LoadTemplate(templateIndex); g_state.selectedTemplateIndex = -1; } - if (i < 2) ImGui::SameLine(); + if (i < 2) ImGui::SameLine(0, 5);; } } + ImGui::Spacing(); + for (int i = 3; i < 5; i++) { const std::string& name = defaultNames[i]; int templateIndex = -1; @@ -473,7 +556,7 @@ void UIManager::RenderTemplatesTab() { TemplateManager::LoadTemplate(templateIndex); g_state.selectedTemplateIndex = -1; } - if (i == 3) ImGui::SameLine(); + if (i == 3) ImGui::SameLine(0, 5);; } } } @@ -497,5 +580,12 @@ void UIManager::RenderOptions() { ConfigManager::SaveCustomDelaySettings(); } + bool oldAlwaysLoadLastSettings = g_state.alwaysLoadLastSettings; + ImGui::Checkbox("Always Load Last Settings", &g_state.alwaysLoadLastSettings); + + if (oldAlwaysLoadLastSettings != g_state.alwaysLoadLastSettings) { + ConfigManager::SaveCustomDelaySettings(); + } + ImGui::Checkbox("Enable debug mode", &g_state.debugMode); } \ No newline at end of file