Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39ca3d919b | ||
|
|
d035d14587 | ||
|
|
a334cadd83 |
12 changed files with 478 additions and 69 deletions
|
|
@ -386,3 +386,42 @@ void AutomationLogic::RespawnGolem() {
|
||||||
|
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "Golem respawn sequence completed!");
|
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!");
|
||||||
|
}
|
||||||
|
|
@ -8,4 +8,5 @@ public:
|
||||||
static void ApplyHealerBoons();
|
static void ApplyHealerBoons();
|
||||||
static void SpawnGolem();
|
static void SpawnGolem();
|
||||||
static void RespawnGolem();
|
static void RespawnGolem();
|
||||||
|
static void RemoveAndRespawnGolem();
|
||||||
};
|
};
|
||||||
|
|
@ -2,10 +2,17 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "CoordinateUtils.h"
|
#include "CoordinateUtils.h"
|
||||||
#include "../Common/Globals.h"
|
#include "../Common/Globals.h"
|
||||||
|
#include "../Config/ConfigManager.h"
|
||||||
|
|
||||||
void CoordinateUtils::GetScaledCoordinates(int baseX, int baseY, int* scaledX, int* scaledY) {
|
void CoordinateUtils::GetScaledCoordinates(int baseX, int baseY, int* scaledX, int* scaledY) {
|
||||||
if (!g_api) return;
|
if (!g_api) return;
|
||||||
|
|
||||||
|
if (g_state.hasCalibration) {
|
||||||
|
*scaledX = (int)(baseX * g_state.calibratedScaleX);
|
||||||
|
*scaledY = (int)(baseY * g_state.calibratedScaleY);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_nexusLink && g_nexusLink->Width > 0 && g_nexusLink->Height > 0) {
|
if (g_nexusLink && g_nexusLink->Width > 0 && g_nexusLink->Height > 0) {
|
||||||
float uiScale = g_nexusLink->Scaling;
|
float uiScale = g_nexusLink->Scaling;
|
||||||
float dpiScaleX, dpiScaleY;
|
float dpiScaleX, dpiScaleY;
|
||||||
|
|
@ -174,3 +181,73 @@ void CoordinateUtils::ClickAtScaled(int baseX, int baseY, int delay) {
|
||||||
SendMessage(gameWindow, WM_LBUTTONUP, 0, lParam);
|
SendMessage(gameWindow, WM_LBUTTONUP, 0, lParam);
|
||||||
Sleep(delay);
|
Sleep(delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CoordinateUtils::StartCalibration() {
|
||||||
|
g_state.calibrationMode = true;
|
||||||
|
g_state.showUI = false;
|
||||||
|
|
||||||
|
if (g_api) {
|
||||||
|
g_api->Log(ELogLevel_INFO, "GolemHelper",
|
||||||
|
"Calibration started - interact with the Boon Console and click 'Adjust Self'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinateUtils::CaptureCalibrationPoint() {
|
||||||
|
POINT mousePos;
|
||||||
|
GetCursorPos(&mousePos);
|
||||||
|
|
||||||
|
const float REF_BASE_X = 830.0f;
|
||||||
|
const float REF_BASE_Y = 262.0f;
|
||||||
|
|
||||||
|
g_state.calibratedScaleX = mousePos.x / REF_BASE_X;
|
||||||
|
g_state.calibratedScaleY = mousePos.y / REF_BASE_Y;
|
||||||
|
g_state.hasCalibration = true;
|
||||||
|
g_state.calibrationMode = false;
|
||||||
|
|
||||||
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
|
|
||||||
|
if (g_api) {
|
||||||
|
char buffer[256];
|
||||||
|
sprintf_s(buffer,
|
||||||
|
"Calibration saved: click=(%ld, %ld) scaleX=%.4f scaleY=%.4f",
|
||||||
|
mousePos.x, mousePos.y,
|
||||||
|
g_state.calibratedScaleX, g_state.calibratedScaleY);
|
||||||
|
g_api->Log(ELogLevel_INFO, "GolemHelper", buffer);
|
||||||
|
g_api->UI.SendAlert("Calibration saved!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinateUtils::ResetCalibration() {
|
||||||
|
g_state.hasCalibration = false;
|
||||||
|
g_state.calibrationMode = false;
|
||||||
|
g_state.calibratedScaleX = 1.0f;
|
||||||
|
g_state.calibratedScaleY = 1.0f;
|
||||||
|
|
||||||
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
|
|
||||||
|
if (g_api) {
|
||||||
|
g_api->Log(ELogLevel_INFO, "GolemHelper", "Calibration reset - back to auto-scaling");
|
||||||
|
g_api->UI.SendAlert("Calibration reset to default");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinateUtils::UpdateCalibrationCapture() {
|
||||||
|
if (!g_state.calibrationMode) return;
|
||||||
|
|
||||||
|
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000) {
|
||||||
|
g_state.calibrationMode = false;
|
||||||
|
if (g_api) g_api->UI.SendAlert("Calibration cancelled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool s_wasPressed = false;
|
||||||
|
bool isPressed = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0;
|
||||||
|
|
||||||
|
if (isPressed && !s_wasPressed) {
|
||||||
|
if (g_mumbleData && g_mumbleData->Context.IsGameFocused) {
|
||||||
|
CaptureCalibrationPoint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
s_wasPressed = isPressed;
|
||||||
|
}
|
||||||
|
|
@ -5,4 +5,9 @@ public:
|
||||||
static void GetScaledCoordinates(int baseX, int baseY, int* scaledX, int* scaledY);
|
static void GetScaledCoordinates(int baseX, int baseY, int* scaledX, int* scaledY);
|
||||||
static void DebugMousePosition();
|
static void DebugMousePosition();
|
||||||
static void ClickAtScaled(int baseX, int baseY, int delay = 25);
|
static void ClickAtScaled(int baseX, int baseY, int delay = 25);
|
||||||
|
|
||||||
|
static void StartCalibration();
|
||||||
|
static void CaptureCalibrationPoint();
|
||||||
|
static void ResetCalibration();
|
||||||
|
static void UpdateCalibrationCapture();
|
||||||
};
|
};
|
||||||
|
|
@ -72,8 +72,15 @@ public:
|
||||||
GOLEM_EXIT
|
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 BOON_LENGTH = 20;
|
||||||
static constexpr int HEALER_QUICK_LENGTH = 10;
|
static constexpr int HEALER_QUICK_LENGTH = 10;
|
||||||
static constexpr int GOLEM_LENGTH = 25;
|
static constexpr int GOLEM_LENGTH = 25;
|
||||||
static constexpr int GOLEM_RESPAWN_LENGTH = 2;
|
static constexpr int GOLEM_RESPAWN_LENGTH = 2;
|
||||||
|
static constexpr int GOLEM_REMOVE_AND_RESPAWN_LENGTH = 3;
|
||||||
};
|
};
|
||||||
|
|
@ -52,6 +52,7 @@ enum MenuOption {
|
||||||
|
|
||||||
// === GOLEM MENU ===
|
// === GOLEM MENU ===
|
||||||
GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION,
|
GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION,
|
||||||
|
GOLEM_REMOVEGOLEM,
|
||||||
GOLEM_SPAWNAGOLEM,
|
GOLEM_SPAWNAGOLEM,
|
||||||
GOLEM_HITBOX_SMALL,
|
GOLEM_HITBOX_SMALL,
|
||||||
GOLEM_HITBOX_MEDIUM,
|
GOLEM_HITBOX_MEDIUM,
|
||||||
|
|
@ -145,6 +146,7 @@ struct GolemHelperState {
|
||||||
bool skipAegis = false;
|
bool skipAegis = false;
|
||||||
bool alwaysHideIcon = false;
|
bool alwaysHideIcon = false;
|
||||||
bool autoShowHideUI = false;
|
bool autoShowHideUI = false;
|
||||||
|
bool alwaysLoadLastSettings = false;
|
||||||
int debugCounter = 0;
|
int debugCounter = 0;
|
||||||
|
|
||||||
int initialDelay = 390;
|
int initialDelay = 390;
|
||||||
|
|
@ -153,6 +155,12 @@ struct GolemHelperState {
|
||||||
bool quickAccessVisible = false;
|
bool quickAccessVisible = false;
|
||||||
unsigned int lastMapID = 0;
|
unsigned int lastMapID = 0;
|
||||||
|
|
||||||
|
// Calibration
|
||||||
|
bool calibrationMode = false;
|
||||||
|
bool hasCalibration = false;
|
||||||
|
float calibratedScaleX = 1.0f;
|
||||||
|
float calibratedScaleY = 1.0f;
|
||||||
|
|
||||||
std::vector<GolemTemplate> templates;
|
std::vector<GolemTemplate> templates;
|
||||||
int selectedTemplateIndex = -1;
|
int selectedTemplateIndex = -1;
|
||||||
int lastUserTemplateIndex = -1;
|
int lastUserTemplateIndex = -1;
|
||||||
|
|
@ -196,6 +204,7 @@ struct MenuCoordinates {
|
||||||
|
|
||||||
// === GOLEM MENU ===
|
// === GOLEM MENU ===
|
||||||
{GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, {830, 352}},
|
{GOLEM_RESPAWNMYPREVIOUSGOLEMINCARNATION, {830, 352}},
|
||||||
|
{GOLEM_REMOVEGOLEM, {830, 306}},
|
||||||
{GOLEM_SPAWNAGOLEM, {830, 260}},
|
{GOLEM_SPAWNAGOLEM, {830, 260}},
|
||||||
{GOLEM_HITBOX_SMALL, {830, 260}},
|
{GOLEM_HITBOX_SMALL, {830, 260}},
|
||||||
{GOLEM_HITBOX_MEDIUM, {830, 305}},
|
{GOLEM_HITBOX_MEDIUM, {830, 305}},
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,19 @@ void ConfigManager::SaveCustomDelaySettings() {
|
||||||
configFile << "stepDelay=" << g_state.stepDelay << std::endl;
|
configFile << "stepDelay=" << g_state.stepDelay << std::endl;
|
||||||
configFile << "alwaysHideIcon=" << (g_state.alwaysHideIcon ? "1" : "0") << std::endl;
|
configFile << "alwaysHideIcon=" << (g_state.alwaysHideIcon ? "1" : "0") << std::endl;
|
||||||
configFile << "autoShowHideUI=" << (g_state.autoShowHideUI ? "1" : "0") << std::endl;
|
configFile << "autoShowHideUI=" << (g_state.autoShowHideUI ? "1" : "0") << std::endl;
|
||||||
|
configFile << "alwaysLoadLastSettings=" << (g_state.alwaysLoadLastSettings ? "1" : "0") << std::endl;
|
||||||
|
configFile << "hasCalibration=" << (g_state.hasCalibration ? "1" : "0") << std::endl;
|
||||||
|
configFile << "calibratedScaleX=" << g_state.calibratedScaleX << std::endl;
|
||||||
|
configFile << "calibratedScaleY=" << g_state.calibratedScaleY << std::endl;
|
||||||
|
|
||||||
configFile.close();
|
configFile.close();
|
||||||
|
|
||||||
char logBuffer[350];
|
char logBuffer[512];
|
||||||
sprintf_s(logBuffer, "Settings saved: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s",
|
sprintf_s(logBuffer, "Settings saved: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s, alwaysLoadLastSettings=%s",
|
||||||
g_state.initialDelay, g_state.stepDelay,
|
g_state.initialDelay, g_state.stepDelay,
|
||||||
g_state.alwaysHideIcon ? "true" : "false",
|
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);
|
g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -79,15 +84,36 @@ void ConfigManager::LoadCustomDelaySettings() {
|
||||||
else if (key == "autoShowHideUI") {
|
else if (key == "autoShowHideUI") {
|
||||||
g_state.autoShowHideUI = (value == "1");
|
g_state.autoShowHideUI = (value == "1");
|
||||||
}
|
}
|
||||||
|
else if (key == "alwaysLoadLastSettings") {
|
||||||
|
g_state.alwaysLoadLastSettings = (value == "1");
|
||||||
|
}
|
||||||
|
else if (key == "hasCalibration") {
|
||||||
|
g_state.hasCalibration = (value == "1");
|
||||||
|
}
|
||||||
|
else if (key == "calibratedScaleX") {
|
||||||
|
try {
|
||||||
|
float v = std::stof(value);
|
||||||
|
if (v > 0.1f && v < 10.0f) g_state.calibratedScaleX = v;
|
||||||
|
}
|
||||||
|
catch (...) {}
|
||||||
|
}
|
||||||
|
else if (key == "calibratedScaleY") {
|
||||||
|
try {
|
||||||
|
float v = std::stof(value);
|
||||||
|
if (v > 0.1f && v < 10.0f) g_state.calibratedScaleY = v;
|
||||||
|
}
|
||||||
|
catch (...) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configFile.close();
|
configFile.close();
|
||||||
|
|
||||||
char logBuffer[350];
|
char logBuffer[512];
|
||||||
sprintf_s(logBuffer, "Settings loaded: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s",
|
sprintf_s(logBuffer, "Settings loaded: initialDelay=%dms, stepDelay=%dms, alwaysHideIcon=%s, autoShowHideUI=%s, alwaysLoadLastSettings=%s",
|
||||||
g_state.initialDelay, g_state.stepDelay,
|
g_state.initialDelay, g_state.stepDelay,
|
||||||
g_state.alwaysHideIcon ? "true" : "false",
|
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);
|
g_api->Log(ELogLevel_INFO, "GolemHelper", logBuffer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -95,3 +121,93 @@ void ConfigManager::LoadCustomDelaySettings() {
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "Could not load config file, using defaults");
|
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<int>(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<int>(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<EnvironmentDamageLevel>(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<HitboxType>(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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,4 +4,6 @@ class ConfigManager {
|
||||||
public:
|
public:
|
||||||
static void SaveCustomDelaySettings();
|
static void SaveCustomDelaySettings();
|
||||||
static void LoadCustomDelaySettings();
|
static void LoadCustomDelaySettings();
|
||||||
|
static void SaveLastUsedSettings();
|
||||||
|
static void LoadLastUsedSettings();
|
||||||
};
|
};
|
||||||
|
|
@ -23,6 +23,11 @@ void Load(AddonAPI* aApi) {
|
||||||
|
|
||||||
ConfigManager::LoadCustomDelaySettings();
|
ConfigManager::LoadCustomDelaySettings();
|
||||||
TemplateManager::LoadTemplates();
|
TemplateManager::LoadTemplates();
|
||||||
|
|
||||||
|
if (g_state.alwaysLoadLastSettings) {
|
||||||
|
ConfigManager::LoadLastUsedSettings();
|
||||||
|
}
|
||||||
|
|
||||||
FileUtils::CopyResourceIcons();
|
FileUtils::CopyResourceIcons();
|
||||||
|
|
||||||
g_api->Renderer.Register(ERenderType_Render, UIManager::RenderUI);
|
g_api->Renderer.Register(ERenderType_Render, UIManager::RenderUI);
|
||||||
|
|
@ -35,7 +40,7 @@ void Load(AddonAPI* aApi) {
|
||||||
|
|
||||||
MapUtils::UpdateQuickAccessVisibility();
|
MapUtils::UpdateQuickAccessVisibility();
|
||||||
|
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.5.3.0 Loaded ===");
|
g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.7.1.0 Loaded ===");
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "<c=#00ff00>GolemHelper addon</c> loaded successfully!");
|
g_api->Log(ELogLevel_INFO, "GolemHelper", "<c=#00ff00>GolemHelper addon</c> loaded successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,13 +67,13 @@ extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() {
|
||||||
def.Signature = -424248;
|
def.Signature = -424248;
|
||||||
def.APIVersion = NEXUS_API_VERSION;
|
def.APIVersion = NEXUS_API_VERSION;
|
||||||
def.Name = "GolemHelper";
|
def.Name = "GolemHelper";
|
||||||
def.Version = { 1, 5, 3, 0 };
|
def.Version = { 1, 7, 1, 0 };
|
||||||
def.Author = "Azrub";
|
def.Author = "Azrub";
|
||||||
def.Description = "Automates the process of setting optimal boon and golem configurations in the training area";
|
def.Description = "Automates the process of setting optimal boon and golem configurations in the training area";
|
||||||
def.Load = Load;
|
def.Load = Load;
|
||||||
def.Unload = Unload;
|
def.Unload = Unload;
|
||||||
def.Flags = EAddonFlags_None;
|
def.Flags = EAddonFlags_None;
|
||||||
def.Provider = EUpdateProvider_GitHub;
|
def.Provider = EUpdateProvider_Direct;
|
||||||
def.UpdateLink = "https://github.com/Azrub/GolemHelper";
|
def.UpdateLink = "https://git.azrub.dev/Azrub/GolemHelper/releases/download/latest/GolemHelper.dll";
|
||||||
return &def;
|
return &def;
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ void KeybindManager::RegisterKeybinds() {
|
||||||
g_api->InputBinds.RegisterWithStruct("GolemHelper.ApplyBoons", HandleBoonKeybind, kb_empty);
|
g_api->InputBinds.RegisterWithStruct("GolemHelper.ApplyBoons", HandleBoonKeybind, kb_empty);
|
||||||
g_api->InputBinds.RegisterWithStruct("GolemHelper.SpawnGolem", HandleGolemKeybind, 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.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.QuickDPS", HandleQuickDpsKeybind, kb_empty);
|
||||||
g_api->InputBinds.RegisterWithStruct("GolemHelper.AlacDPS", HandleAlacDpsKeybind, kb_empty);
|
g_api->InputBinds.RegisterWithStruct("GolemHelper.AlacDPS", HandleAlacDpsKeybind, kb_empty);
|
||||||
g_api->InputBinds.RegisterWithStruct("GolemHelper.Toggle", HandleToggleKeybind, 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.ApplyBoons");
|
||||||
g_api->InputBinds.Deregister("GolemHelper.SpawnGolem");
|
g_api->InputBinds.Deregister("GolemHelper.SpawnGolem");
|
||||||
g_api->InputBinds.Deregister("GolemHelper.RespawnGolem");
|
g_api->InputBinds.Deregister("GolemHelper.RespawnGolem");
|
||||||
|
g_api->InputBinds.Deregister("GolemHelper.RemoveAndRespawnGolem");
|
||||||
g_api->InputBinds.Deregister("GolemHelper.QuickDPS");
|
g_api->InputBinds.Deregister("GolemHelper.QuickDPS");
|
||||||
g_api->InputBinds.Deregister("GolemHelper.AlacDPS");
|
g_api->InputBinds.Deregister("GolemHelper.AlacDPS");
|
||||||
g_api->InputBinds.Deregister("GolemHelper.Toggle");
|
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) {
|
void KeybindManager::HandleToggleKeybind(const char* id, bool release) {
|
||||||
if (!release) {
|
if (!release) {
|
||||||
g_state.enabled = !g_state.enabled;
|
g_state.enabled = !g_state.enabled;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ public:
|
||||||
static void HandleBoonKeybind(const char* id, bool release);
|
static void HandleBoonKeybind(const char* id, bool release);
|
||||||
static void HandleGolemKeybind(const char* id, bool release);
|
static void HandleGolemKeybind(const char* id, bool release);
|
||||||
static void HandleRespawnGolemKeybind(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 HandleQuickDpsKeybind(const char* id, bool release);
|
||||||
static void HandleAlacDpsKeybind(const char* id, bool release);
|
static void HandleAlacDpsKeybind(const char* id, bool release);
|
||||||
static void HandleToggleKeybind(const char* id, bool release);
|
static void HandleToggleKeybind(const char* id, bool release);
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,14 @@
|
||||||
#include "../Config/ConfigManager.h"
|
#include "../Config/ConfigManager.h"
|
||||||
#include "../Utils/MapUtils.h"
|
#include "../Utils/MapUtils.h"
|
||||||
#include "../Config/TemplateManager.h"
|
#include "../Config/TemplateManager.h"
|
||||||
|
#include "../Automation/CoordinateUtils.h"
|
||||||
#include "../Dependencies/imgui/imgui.h"
|
#include "../Dependencies/imgui/imgui.h"
|
||||||
|
|
||||||
void UIManager::RenderUI() {
|
void UIManager::RenderUI() {
|
||||||
MapUtils::UpdateQuickAccessVisibility();
|
MapUtils::UpdateQuickAccessVisibility();
|
||||||
|
|
||||||
|
CoordinateUtils::UpdateCalibrationCapture();
|
||||||
|
|
||||||
if (!g_state.showUI) return;
|
if (!g_state.showUI) return;
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(ImVec2(450, 600), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(450, 600), ImGuiCond_FirstUseEver);
|
||||||
|
|
@ -17,7 +20,7 @@ void UIManager::RenderUI() {
|
||||||
|
|
||||||
if (ImGui::Begin("GolemHelper", &g_state.showUI, ImGuiWindowFlags_AlwaysAutoResize)) {
|
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.7.1.0");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
if (ImGui::BeginTabBar("GolemHelperTabs", ImGuiTabBarFlags_None)) {
|
if (ImGui::BeginTabBar("GolemHelperTabs", ImGuiTabBarFlags_None)) {
|
||||||
|
|
@ -28,46 +31,6 @@ void UIManager::RenderUI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::BeginTabItem("Templates")) {
|
if (ImGui::BeginTabItem("Templates")) {
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 130);
|
|
||||||
|
|
||||||
std::string currentTemplateName = "None";
|
|
||||||
bool foundMatchingTemplate = false;
|
|
||||||
|
|
||||||
for (const auto& temp : g_state.templates) {
|
|
||||||
if (temp.isQuickDps == g_state.isQuickDps &&
|
|
||||||
temp.isAlacDps == g_state.isAlacDps &&
|
|
||||||
temp.environmentDamage == g_state.environmentDamage &&
|
|
||||||
temp.envDamageLevel == g_state.envDamageLevel &&
|
|
||||||
temp.skipBurning == g_state.skipBurning &&
|
|
||||||
temp.skipConfusion == g_state.skipConfusion &&
|
|
||||||
temp.skipSlow == g_state.skipSlow &&
|
|
||||||
temp.addImmobilize == g_state.addImmobilize &&
|
|
||||||
temp.addBlind == g_state.addBlind &&
|
|
||||||
temp.fiveBleedingStacks == g_state.fiveBleedingStacks &&
|
|
||||||
temp.hitboxType == g_state.hitboxType &&
|
|
||||||
temp.addResistance == g_state.addResistance &&
|
|
||||||
temp.addStability == g_state.addStability &&
|
|
||||||
temp.skipAegis == g_state.skipAegis) {
|
|
||||||
currentTemplateName = temp.name;
|
|
||||||
foundMatchingTemplate = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::Text("Current: ");
|
|
||||||
ImGui::SameLine();
|
|
||||||
if (foundMatchingTemplate) {
|
|
||||||
std::string truncatedName = currentTemplateName;
|
|
||||||
if (truncatedName.length() > 8) {
|
|
||||||
truncatedName = truncatedName.substr(0, 6) + "..";
|
|
||||||
}
|
|
||||||
ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "%s", truncatedName.c_str());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "None");
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderTemplatesTab();
|
RenderTemplatesTab();
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +45,7 @@ void UIManager::RenderUI() {
|
||||||
void UIManager::RenderSettingsTab() {
|
void UIManager::RenderSettingsTab() {
|
||||||
ImGui::Text("Boon Configuration");
|
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()) {
|
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
||||||
g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false);
|
g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false);
|
||||||
}
|
}
|
||||||
|
|
@ -162,18 +125,26 @@ void UIManager::RenderSettingsTab() {
|
||||||
|
|
||||||
ImGui::Text("Golem Configuration");
|
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()) {
|
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
||||||
g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false);
|
g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
if (ImGui::Button("Respawn", ImVec2(80, 0))) {
|
if (ImGui::Button("Respawn", ImVec2(80, 0))) {
|
||||||
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
||||||
g_api->InputBinds.Invoke("GolemHelper.RespawnGolem", false);
|
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:");
|
ImGui::Text("Golem Hitbox:");
|
||||||
|
|
||||||
if (ImGui::RadioButton("Small (Benchmark Default)", g_state.hitboxType == HITBOX_SMALL)) {
|
if (ImGui::RadioButton("Small (Benchmark Default)", g_state.hitboxType == HITBOX_SMALL)) {
|
||||||
|
|
@ -233,22 +204,22 @@ void UIManager::RenderSettingsTab() {
|
||||||
int oldInitialDelay = g_state.initialDelay;
|
int oldInitialDelay = g_state.initialDelay;
|
||||||
|
|
||||||
ImGui::Text("Initial Delay (after F key):");
|
ImGui::Text("Initial Delay (after F key):");
|
||||||
ImGui::SetNextItemWidth(205);
|
ImGui::SetNextItemWidth(200);
|
||||||
ImGui::SliderInt("##initial", &g_state.initialDelay, 100, 1000, "%d ms");
|
ImGui::SliderInt("##initial", &g_state.initialDelay, 100, 1000, "%d ms");
|
||||||
|
|
||||||
ImGui::Text("Step Delay (between clicks):");
|
ImGui::Text("Step Delay (between clicks):");
|
||||||
ImGui::SetNextItemWidth(205);
|
ImGui::SetNextItemWidth(200);
|
||||||
ImGui::SliderInt("##step", &g_state.stepDelay, 100, 1000, "%d ms");
|
ImGui::SliderInt("##step", &g_state.stepDelay, 100, 1000, "%d ms");
|
||||||
|
|
||||||
ImGui::Spacing();
|
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.stepDelay = 290;
|
||||||
g_state.initialDelay = 390;
|
g_state.initialDelay = 390;
|
||||||
ConfigManager::SaveCustomDelaySettings();
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
if (ImGui::Button("Slow Mode", ImVec2(80, 0))) {
|
if (ImGui::Button("Slow Mode", ImVec2(78, 0))) {
|
||||||
g_state.stepDelay = 1000;
|
g_state.stepDelay = 1000;
|
||||||
g_state.initialDelay = 600;
|
g_state.initialDelay = 600;
|
||||||
ConfigManager::SaveCustomDelaySettings();
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
|
|
@ -256,30 +227,139 @@ void UIManager::RenderSettingsTab() {
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.2f, 1.0f), "Increase delays if clicks fail");
|
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.2f, 1.0f), "Increase delays if clicks fail");
|
||||||
|
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.2f, 1.0f), "or calibrate in Options");
|
||||||
|
|
||||||
if (oldStepDelay != g_state.stepDelay || oldInitialDelay != g_state.initialDelay) {
|
if (oldStepDelay != g_state.stepDelay || oldInitialDelay != g_state.initialDelay) {
|
||||||
ConfigManager::SaveCustomDelaySettings();
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::PopStyleColor(2);
|
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() {
|
void UIManager::RenderTemplatesTab() {
|
||||||
if (ImGui::Button("Apply Boons", ImVec2(120, 30))) {
|
|
||||||
|
std::string currentTemplateName = "None";
|
||||||
|
bool foundMatchingTemplate = false;
|
||||||
|
|
||||||
|
for (const auto& temp : g_state.templates) {
|
||||||
|
if (temp.isQuickDps == g_state.isQuickDps &&
|
||||||
|
temp.isAlacDps == g_state.isAlacDps &&
|
||||||
|
temp.environmentDamage == g_state.environmentDamage &&
|
||||||
|
temp.envDamageLevel == g_state.envDamageLevel &&
|
||||||
|
temp.skipBurning == g_state.skipBurning &&
|
||||||
|
temp.skipConfusion == g_state.skipConfusion &&
|
||||||
|
temp.skipSlow == g_state.skipSlow &&
|
||||||
|
temp.addImmobilize == g_state.addImmobilize &&
|
||||||
|
temp.addBlind == g_state.addBlind &&
|
||||||
|
temp.fiveBleedingStacks == g_state.fiveBleedingStacks &&
|
||||||
|
temp.hitboxType == g_state.hitboxType &&
|
||||||
|
temp.addResistance == g_state.addResistance &&
|
||||||
|
temp.addStability == g_state.addStability &&
|
||||||
|
temp.skipAegis == g_state.skipAegis) {
|
||||||
|
currentTemplateName = temp.name;
|
||||||
|
foundMatchingTemplate = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::Text("Current: ");
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (foundMatchingTemplate) {
|
||||||
|
ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "%s", currentTemplateName.c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "None");
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
if (ImGui::Button("Apply Boons", ImVec2(110, 0))) {
|
||||||
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
||||||
g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false);
|
g_api->InputBinds.Invoke("GolemHelper.ApplyBoons", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
|
if (ImGui::Button("Spawn Golem", ImVec2(110, 0))) {
|
||||||
if (ImGui::Button("Spawn Golem", ImVec2(120, 30))) {
|
|
||||||
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
if (g_state.enabled && MapUtils::IsInTrainingArea()) {
|
||||||
g_api->InputBinds.Invoke("GolemHelper.SpawnGolem", false);
|
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::Spacing();
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
ImGui::Text("Template Management");
|
ImGui::Text("Template Management");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
@ -287,7 +367,7 @@ void UIManager::RenderTemplatesTab() {
|
||||||
ImGui::Text("Save Current Settings:");
|
ImGui::Text("Save Current Settings:");
|
||||||
ImGui::SetNextItemWidth(170);
|
ImGui::SetNextItemWidth(170);
|
||||||
ImGui::InputText("##templateName", g_state.newTemplateName, sizeof(g_state.newTemplateName));
|
ImGui::InputText("##templateName", g_state.newTemplateName, sizeof(g_state.newTemplateName));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
|
|
||||||
if (ImGui::Button("Save", ImVec2(50, 0))) {
|
if (ImGui::Button("Save", ImVec2(50, 0))) {
|
||||||
if (strlen(g_state.newTemplateName) > 0) {
|
if (strlen(g_state.newTemplateName) > 0) {
|
||||||
|
|
@ -326,19 +406,19 @@ void UIManager::RenderTemplatesTab() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SetNextItemWidth(170);
|
ImGui::SetNextItemWidth(170);
|
||||||
if (ImGui::Combo("##templateList", ¤tUserIndex, userTemplateNames.data(), userTemplateNames.size())) {
|
if (ImGui::Combo("##templateList", ¤tUserIndex, userTemplateNames.data(), (int)userTemplateNames.size())) {
|
||||||
g_state.selectedTemplateIndex = userTemplateIndices[currentUserIndex];
|
g_state.selectedTemplateIndex = userTemplateIndices[currentUserIndex];
|
||||||
g_state.lastUserTemplateIndex = userTemplateIndices[currentUserIndex];
|
g_state.lastUserTemplateIndex = userTemplateIndices[currentUserIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
if (ImGui::Button("Load", ImVec2(50, 0))) {
|
if (ImGui::Button("Load", ImVec2(50, 0))) {
|
||||||
if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) {
|
if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) {
|
||||||
TemplateManager::LoadTemplate(userTemplateIndices[currentUserIndex]);
|
TemplateManager::LoadTemplate(userTemplateIndices[currentUserIndex]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0, 5);
|
||||||
if (ImGui::Button("Del", ImVec2(50, 0))) {
|
if (ImGui::Button("Del", ImVec2(50, 0))) {
|
||||||
if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) {
|
if (currentUserIndex >= 0 && currentUserIndex < userTemplateIndices.size()) {
|
||||||
TemplateManager::DeleteTemplate(userTemplateIndices[currentUserIndex]);
|
TemplateManager::DeleteTemplate(userTemplateIndices[currentUserIndex]);
|
||||||
|
|
@ -454,10 +534,12 @@ void UIManager::RenderTemplatesTab() {
|
||||||
TemplateManager::LoadTemplate(templateIndex);
|
TemplateManager::LoadTemplate(templateIndex);
|
||||||
g_state.selectedTemplateIndex = -1;
|
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++) {
|
for (int i = 3; i < 5; i++) {
|
||||||
const std::string& name = defaultNames[i];
|
const std::string& name = defaultNames[i];
|
||||||
int templateIndex = -1;
|
int templateIndex = -1;
|
||||||
|
|
@ -473,7 +555,7 @@ void UIManager::RenderTemplatesTab() {
|
||||||
TemplateManager::LoadTemplate(templateIndex);
|
TemplateManager::LoadTemplate(templateIndex);
|
||||||
g_state.selectedTemplateIndex = -1;
|
g_state.selectedTemplateIndex = -1;
|
||||||
}
|
}
|
||||||
if (i == 3) ImGui::SameLine();
|
if (i == 3) ImGui::SameLine(0, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -497,5 +579,62 @@ void UIManager::RenderOptions() {
|
||||||
ConfigManager::SaveCustomDelaySettings();
|
ConfigManager::SaveCustomDelaySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Checkbox("Enable debug mode", &g_state.debugMode);
|
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);
|
||||||
|
|
||||||
|
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("Coordinate Calibration")) {
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
if (g_state.calibrationMode) {
|
||||||
|
ImGui::TextColored(ImVec4(1.0f, 0.85f, 0.0f, 1.0f), "! Calibration active !");
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::TextWrapped("1. Interact with the Boon Console (press F)");
|
||||||
|
ImGui::TextWrapped("2. Hover your mouse over the middle of \"Adjust Self\" and click.");
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "The addon window is hidden.");
|
||||||
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Press ESC to cancel.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (g_state.hasCalibration) {
|
||||||
|
ImGui::TextColored(ImVec4(0.2f, 1.0f, 0.4f, 1.0f), "Status: Calibrated");
|
||||||
|
ImGui::Text("scaleX: %.4f scaleY: %.4f",
|
||||||
|
g_state.calibratedScaleX, g_state.calibratedScaleY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ImGui::TextColored(ImVec4(0.75f, 0.75f, 0.75f, 1.0f), "Status: Auto-scaling (default)");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
|
||||||
|
if (ImGui::Button("Calibrate", ImVec2(120, 0))) {
|
||||||
|
CoordinateUtils::StartCalibration();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_state.hasCalibration) {
|
||||||
|
ImGui::SameLine(0, 6);
|
||||||
|
if (ImGui::Button("Reset to Default", ImVec2(120, 0))) {
|
||||||
|
CoordinateUtils::ResetCalibration();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::TextDisabled("Interact with the Boon Console, then hover over");
|
||||||
|
ImGui::TextDisabled("the middle of \"Adjust Self\" and click.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
}
|
||||||
|
ImGui::PopStyleColor(2);
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue