diff --git a/GolemHelper/Automation/AutomationLogic.cpp b/GolemHelper/Automation/AutomationLogic.cpp index 93be3ca..69cfbec 100644 --- a/GolemHelper/Automation/AutomationLogic.cpp +++ b/GolemHelper/Automation/AutomationLogic.cpp @@ -61,20 +61,17 @@ void AutomationLogic::ApplyHealerBoons() { try { g_api->GameBinds.InvokeAsync(EGameBinds_MiscInteract, 50); - int initialDelay = g_state.useCustomDelays ? g_state.initialDelay : 390; - Sleep(initialDelay); - - int delay = g_state.useCustomDelays ? g_state.stepDelay : 290; + Sleep(g_state.initialDelay); if (g_state.isQuickDps) { for (int i = 0; i < 10; i++) { - CoordinateUtils::ClickAtScaled(g_coords.healerStepX[i], g_coords.healerStepY[i], delay); + CoordinateUtils::ClickAtScaled(g_coords.healerStepX[i], g_coords.healerStepY[i], g_state.stepDelay); } } else if (g_state.isAlacDps) { int alacStepY[9] = { 262, 352, 352, 305, 500, 450, 450, 305, 262 }; for (int i = 0; i < 9; i++) { - CoordinateUtils::ClickAtScaled(830, alacStepY[i], delay); + CoordinateUtils::ClickAtScaled(830, alacStepY[i], g_state.stepDelay); } } @@ -128,8 +125,7 @@ void AutomationLogic::ApplyAllBoons() { try { g_api->GameBinds.InvokeAsync(EGameBinds_MiscInteract, 50); - int initialDelay = g_state.useCustomDelays ? g_state.initialDelay : 390; - Sleep(initialDelay); + Sleep(g_state.initialDelay); for (int i = 0; i < 20; i++) { if (g_coords.boonStepX[i] == 0 && g_coords.boonStepY[i] == 0) { @@ -140,7 +136,7 @@ void AutomationLogic::ApplyAllBoons() { continue; } - int delay = (i == 19) ? 50 : (g_state.useCustomDelays ? g_state.stepDelay : 290); + int delay = (i == 19) ? 50 : g_state.stepDelay; CoordinateUtils::ClickAtScaled(g_coords.boonStepX[i], g_coords.boonStepY[i], delay); } @@ -182,8 +178,7 @@ void AutomationLogic::ApplyGolemSettings() { try { g_api->GameBinds.InvokeAsync(EGameBinds_MiscInteract, 50); - int initialDelay = g_state.useCustomDelays ? g_state.initialDelay : 390; - Sleep(initialDelay); + Sleep(g_state.initialDelay); for (int i = 0; i < 25; i++) { if (g_coords.golemStepX[i] == 0 && g_coords.golemStepY[i] == 0) { @@ -211,7 +206,7 @@ void AutomationLogic::ApplyGolemSettings() { } } - int delay = (i == 24) ? 50 : (g_state.useCustomDelays ? g_state.stepDelay : 290); + int delay = (i == 24) ? 50 : g_state.stepDelay; CoordinateUtils::ClickAtScaled(currentX, currentY, delay); @@ -219,8 +214,7 @@ void AutomationLogic::ApplyGolemSettings() { g_api->Log(ELogLevel_INFO, "GolemHelper", "5 Bleeding Stacks - repeating 7th step 4 more times"); for (int repeat = 0; repeat < 4; repeat++) { - int repeatDelay = g_state.useCustomDelays ? g_state.stepDelay : 290; - CoordinateUtils::ClickAtScaled(currentX, currentY, repeatDelay); + CoordinateUtils::ClickAtScaled(currentX, currentY, g_state.stepDelay); } } } diff --git a/GolemHelper/Common/Types.h b/GolemHelper/Common/Types.h index ed400c4..d9f7422 100644 --- a/GolemHelper/Common/Types.h +++ b/GolemHelper/Common/Types.h @@ -26,13 +26,12 @@ struct GolemHelperState { HitboxType hitboxType = HITBOX_SMALL; bool debugMode = false; bool showUI = false; - bool useCustomDelays = false; bool showAdvanced = false; bool showTimingSettings = false; int debugCounter = 0; int initialDelay = 390; - int stepDelay = 290; + int stepDelay = 290; }; struct MenuCoordinates { @@ -41,6 +40,7 @@ struct MenuCoordinates { 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830 }; + int golemStepY[25] = { 260, 260, 306, 257, 257, 306, 257, 306, 352, 400, 454, 508, 352, 257, 306, 454, 400, 306, 352, 400, @@ -51,6 +51,7 @@ struct MenuCoordinates { 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830 }; + int boonStepY[20] = { 262, 354, 262, 262, 400, 305, 354, 305, 262, 305, 450, 500, 354, 262, 305, 354, 400, 450, 262, 550 @@ -59,6 +60,7 @@ struct MenuCoordinates { int healerStepX[10] = { 830, 830, 830, 830, 830, 830, 830, 830, 830, 830 }; + int healerStepY[10] = { 262, 352, 352, 262, 262, 500, 450, 450, 305, 262 }; diff --git a/GolemHelper/Config/ConfigManager.cpp b/GolemHelper/Config/ConfigManager.cpp index faaabd4..49e74f7 100644 --- a/GolemHelper/Config/ConfigManager.cpp +++ b/GolemHelper/Config/ConfigManager.cpp @@ -19,15 +19,14 @@ void ConfigManager::SaveCustomDelaySettings() { } configFile << "[GolemHelper]" << std::endl; - configFile << "useCustomDelays=" << (g_state.useCustomDelays ? "1" : "0") << std::endl; - configFile << "stepDelay=" << g_state.stepDelay << std::endl; configFile << "initialDelay=" << g_state.initialDelay << std::endl; + configFile << "stepDelay=" << g_state.stepDelay << std::endl; configFile.close(); char logBuffer[250]; - sprintf_s(logBuffer, "Custom delay settings saved: enabled=%s, stepDelay=%dms, initialDelay=%dms", - g_state.useCustomDelays ? "true" : "false", g_state.stepDelay, g_state.initialDelay); + sprintf_s(logBuffer, "Delay settings saved: initialDelay=%dms, stepDelay=%dms", + g_state.initialDelay, g_state.stepDelay); g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer); } @@ -58,8 +57,11 @@ void ConfigManager::LoadCustomDelaySettings() { std::string key = line.substr(0, equalPos); std::string value = line.substr(equalPos + 1); - if (key == "useCustomDelays") { - g_state.useCustomDelays = (value == "1"); + if (key == "initialDelay") { + int delay = std::stoi(value); + if (delay >= 100 && delay <= 1000) { + g_state.initialDelay = delay; + } } else if (key == "stepDelay") { int delay = std::stoi(value); @@ -67,19 +69,13 @@ void ConfigManager::LoadCustomDelaySettings() { g_state.stepDelay = delay; } } - else if (key == "initialDelay") { - int delay = std::stoi(value); - if (delay >= 100 && delay <= 1000) { - g_state.initialDelay = delay; - } - } } configFile.close(); char logBuffer[250]; - sprintf_s(logBuffer, "Custom delay settings loaded: enabled=%s, stepDelay=%dms, initialDelay=%dms", - g_state.useCustomDelays ? "true" : "false", g_state.stepDelay, g_state.initialDelay); + sprintf_s(logBuffer, "Delay settings loaded: initialDelay=%dms, stepDelay=%dms", + g_state.initialDelay, g_state.stepDelay); g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer); } diff --git a/GolemHelper/GolemHelper.cpp b/GolemHelper/GolemHelper.cpp index 4086636..ae26cb3 100644 --- a/GolemHelper/GolemHelper.cpp +++ b/GolemHelper/GolemHelper.cpp @@ -33,10 +33,10 @@ void Load(AddonAPI* aApi) { "GOLEM_HELPER_ICON", "GOLEM_HELPER_ICON_HOVER", "GolemHelper.ToggleUI", - "Toggle GolemHelper UI" + "GolemHelper UI" ); - g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.2.5.0 Loaded ==="); + g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.2.6.0 Loaded ==="); g_api->Log(ELogLevel_INFO, "GolemHelper", "GolemHelper addon loaded successfully!"); } @@ -59,7 +59,7 @@ extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() { def.Signature = -424248; def.APIVersion = NEXUS_API_VERSION; def.Name = "GolemHelper"; - def.Version = { 1, 2, 5, 0 }; + def.Version = { 1, 2, 6, 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/UI/UIManager.cpp b/GolemHelper/UI/UIManager.cpp index a078ed4..0c58e1f 100644 --- a/GolemHelper/UI/UIManager.cpp +++ b/GolemHelper/UI/UIManager.cpp @@ -13,7 +13,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.2.5.0"); + ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.2.6.0"); ImGui::Separator(); ImGui::Text("Status:"); @@ -144,16 +144,13 @@ void UIManager::RenderUI() { ImGui::Spacing(); ImGui::Separator(); + ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); + ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.3f, 0.5f, 0.7f, 0.8f)); if (ImGui::CollapsingHeader("Set Custom Delays")) { - bool oldUseCustomDelays = g_state.useCustomDelays; int oldStepDelay = g_state.stepDelay; int oldInitialDelay = g_state.initialDelay; - ImGui::Checkbox("Use Custom Delays", &g_state.useCustomDelays); - - ImGui::Spacing(); - ImGui::Text("Initial Delay (after F key):"); ImGui::SetNextItemWidth(205); ImGui::SliderInt("##initial", &g_state.initialDelay, 100, 1000, "%d ms"); @@ -179,12 +176,11 @@ void UIManager::RenderUI() { ImGui::Spacing(); ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.2f, 1.0f), "Increase delays if clicks fail"); - if (oldUseCustomDelays != g_state.useCustomDelays || - oldStepDelay != g_state.stepDelay || - oldInitialDelay != g_state.initialDelay) { + if (oldStepDelay != g_state.stepDelay || oldInitialDelay != g_state.initialDelay) { ConfigManager::SaveCustomDelaySettings(); } } + ImGui::PopStyleColor(2); } ImGui::End(); @@ -206,7 +202,6 @@ void UIManager::RenderOptions() { g_state.skipBurning = false; g_state.fiveBleedingStacks = false; g_state.hitboxType = HITBOX_SMALL; - g_state.useCustomDelays = false; g_state.showAdvanced = false; g_state.showTimingSettings = false; g_state.stepDelay = 290; @@ -253,10 +248,6 @@ void UIManager::RenderOptions() { g_state.hitboxType == HITBOX_MEDIUM ? "Medium" : "Large"; ImGui::Text("- Hitbox: %s", hitboxName); - ImGui::Text("- Timing: %s", g_state.useCustomDelays ? "Custom" : "Default"); - - if (g_state.useCustomDelays) { - ImGui::Text("- Step Delay: %d ms", g_state.stepDelay); - ImGui::Text("- Initial Delay: %d ms", g_state.initialDelay); - } + ImGui::Text("- Step Delay: %d ms", g_state.stepDelay); + ImGui::Text("- Initial Delay: %d ms", g_state.initialDelay); } \ No newline at end of file