Release v1.3.0.0
- GolemHelper icon now appears only in Training Area and automatically hides in all other maps.
This commit is contained in:
parent
80c2157f24
commit
47839c1915
9 changed files with 101 additions and 11 deletions
|
|
@ -5,5 +5,6 @@
|
||||||
|
|
||||||
AddonAPI* g_api = nullptr;
|
AddonAPI* g_api = nullptr;
|
||||||
NexusLinkData* g_nexusLink = nullptr;
|
NexusLinkData* g_nexusLink = nullptr;
|
||||||
|
Mumble::Data* g_mumbleData = nullptr;
|
||||||
GolemHelperState g_state;
|
GolemHelperState g_state;
|
||||||
MenuCoordinates g_coords;
|
MenuCoordinates g_coords;
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "../Dependencies/nexus/Nexus.h"
|
#include "../Dependencies/nexus/Nexus.h"
|
||||||
|
#include "../Dependencies/mumble/mumble.h"
|
||||||
|
|
||||||
extern AddonAPI* g_api;
|
extern AddonAPI* g_api;
|
||||||
extern NexusLinkData* g_nexusLink;
|
extern NexusLinkData* g_nexusLink;
|
||||||
|
extern Mumble::Data* g_mumbleData;
|
||||||
extern GolemHelperState g_state;
|
extern GolemHelperState g_state;
|
||||||
extern MenuCoordinates g_coords;
|
extern MenuCoordinates g_coords;
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "../Dependencies/mumble/mumble.h"
|
||||||
|
|
||||||
enum HitboxType {
|
enum HitboxType {
|
||||||
HITBOX_SMALL = 0,
|
HITBOX_SMALL = 0,
|
||||||
|
|
@ -32,6 +33,9 @@ struct GolemHelperState {
|
||||||
|
|
||||||
int initialDelay = 390;
|
int initialDelay = 390;
|
||||||
int stepDelay = 290;
|
int stepDelay = 290;
|
||||||
|
|
||||||
|
bool quickAccessVisible = false;
|
||||||
|
unsigned int lastMapID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MenuCoordinates {
|
struct MenuCoordinates {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Common/Globals.h"
|
#include "Common/Globals.h"
|
||||||
#include "Utils/FileUtils.h"
|
#include "Utils/FileUtils.h"
|
||||||
|
#include "Utils/MapUtils.h"
|
||||||
#include "Config/ConfigManager.h"
|
#include "Config/ConfigManager.h"
|
||||||
#include "UI/UIManager.h"
|
#include "UI/UIManager.h"
|
||||||
#include "Input/KeybindManager.h"
|
#include "Input/KeybindManager.h"
|
||||||
|
|
@ -15,6 +16,8 @@ void Load(AddonAPI* aApi) {
|
||||||
|
|
||||||
g_nexusLink = (NexusLinkData*)g_api->DataLink.Get("DL_NEXUS_LINK");
|
g_nexusLink = (NexusLinkData*)g_api->DataLink.Get("DL_NEXUS_LINK");
|
||||||
|
|
||||||
|
g_mumbleData = (Mumble::Data*)g_api->DataLink.Get("DL_MUMBLE_LINK");
|
||||||
|
|
||||||
g_state.enabled = true;
|
g_state.enabled = true;
|
||||||
|
|
||||||
ConfigManager::LoadCustomDelaySettings();
|
ConfigManager::LoadCustomDelaySettings();
|
||||||
|
|
@ -28,21 +31,17 @@ void Load(AddonAPI* aApi) {
|
||||||
g_api->Textures.GetOrCreateFromFile("GOLEM_HELPER_ICON", "addons/GolemHelper/icons/GOLEM_HELPER_ICON.png");
|
g_api->Textures.GetOrCreateFromFile("GOLEM_HELPER_ICON", "addons/GolemHelper/icons/GOLEM_HELPER_ICON.png");
|
||||||
g_api->Textures.GetOrCreateFromFile("GOLEM_HELPER_ICON_HOVER", "addons/GolemHelper/icons/GOLEM_HELPER_ICON_HOVER.png");
|
g_api->Textures.GetOrCreateFromFile("GOLEM_HELPER_ICON_HOVER", "addons/GolemHelper/icons/GOLEM_HELPER_ICON_HOVER.png");
|
||||||
|
|
||||||
g_api->QuickAccess.Add(
|
MapUtils::UpdateQuickAccessVisibility();
|
||||||
"GolemHelper.ToggleUI",
|
|
||||||
"GOLEM_HELPER_ICON",
|
|
||||||
"GOLEM_HELPER_ICON_HOVER",
|
|
||||||
"GolemHelper.ToggleUI",
|
|
||||||
"GolemHelper UI"
|
|
||||||
);
|
|
||||||
|
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.2.6.0 Loaded ===");
|
g_api->Log(ELogLevel_INFO, "GolemHelper", "=== GolemHelper v1.3.0.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!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unload() {
|
void Unload() {
|
||||||
if (g_api) {
|
if (g_api) {
|
||||||
g_api->QuickAccess.Remove("GolemHelper.ToggleUI");
|
if (g_state.quickAccessVisible) {
|
||||||
|
g_api->QuickAccess.Remove("GolemHelper.ToggleUI");
|
||||||
|
}
|
||||||
g_api->Renderer.Deregister(UIManager::RenderUI);
|
g_api->Renderer.Deregister(UIManager::RenderUI);
|
||||||
g_api->Renderer.Deregister(UIManager::RenderOptions);
|
g_api->Renderer.Deregister(UIManager::RenderOptions);
|
||||||
KeybindManager::UnregisterKeybinds();
|
KeybindManager::UnregisterKeybinds();
|
||||||
|
|
@ -50,8 +49,10 @@ void Unload() {
|
||||||
|
|
||||||
g_api->Log(ELogLevel_INFO, "GolemHelper", "<c=#ff0000>GolemHelper signing off</c>, it was an honor commander.");
|
g_api->Log(ELogLevel_INFO, "GolemHelper", "<c=#ff0000>GolemHelper signing off</c>, it was an honor commander.");
|
||||||
g_api = nullptr;
|
g_api = nullptr;
|
||||||
|
g_mumbleData = nullptr;
|
||||||
g_state.enabled = false;
|
g_state.enabled = false;
|
||||||
g_state.showUI = false;
|
g_state.showUI = false;
|
||||||
|
g_state.quickAccessVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() {
|
extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() {
|
||||||
|
|
@ -59,7 +60,7 @@ 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, 2, 6, 0 };
|
def.Version = { 1, 3, 0, 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;
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="UI\UIManager.h" />
|
<ClInclude Include="UI\UIManager.h" />
|
||||||
<ClInclude Include="Utils\FileUtils.h" />
|
<ClInclude Include="Utils\FileUtils.h" />
|
||||||
|
<ClInclude Include="Utils\MapUtils.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Automation\AutomationLogic.cpp" />
|
<ClCompile Include="Automation\AutomationLogic.cpp" />
|
||||||
|
|
@ -213,6 +214,7 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="UI\UIManager.cpp" />
|
<ClCompile Include="UI\UIManager.cpp" />
|
||||||
<ClCompile Include="Utils\FileUtils.cpp" />
|
<ClCompile Include="Utils\FileUtils.cpp" />
|
||||||
|
<ClCompile Include="Utils\MapUtils.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="GolemHelper.rc" />
|
<ResourceCompile Include="GolemHelper.rc" />
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,9 @@
|
||||||
<ClInclude Include="GolemHelper.h">
|
<ClInclude Include="GolemHelper.h">
|
||||||
<Filter>File di origine</Filter>
|
<Filter>File di origine</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Utils\MapUtils.h">
|
||||||
|
<Filter>Utils</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="dllmain.cpp">
|
<ClCompile Include="dllmain.cpp">
|
||||||
|
|
@ -155,6 +158,9 @@
|
||||||
<ClCompile Include="GolemHelper.cpp">
|
<ClCompile Include="GolemHelper.cpp">
|
||||||
<Filter>File di origine</Filter>
|
<Filter>File di origine</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Utils\MapUtils.cpp">
|
||||||
|
<Filter>Utils</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="GolemHelper.rc">
|
<ResourceCompile Include="GolemHelper.rc">
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,12 @@
|
||||||
#include "UIManager.h"
|
#include "UIManager.h"
|
||||||
#include "../Common/Globals.h"
|
#include "../Common/Globals.h"
|
||||||
#include "../Config/ConfigManager.h"
|
#include "../Config/ConfigManager.h"
|
||||||
|
#include "../Utils/MapUtils.h"
|
||||||
#include "../Dependencies/imgui/imgui.h"
|
#include "../Dependencies/imgui/imgui.h"
|
||||||
|
|
||||||
void UIManager::RenderUI() {
|
void UIManager::RenderUI() {
|
||||||
|
MapUtils::UpdateQuickAccessVisibility();
|
||||||
|
|
||||||
if (!g_state.showUI) return;
|
if (!g_state.showUI) return;
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(ImVec2(400, 500), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(400, 500), ImGuiCond_FirstUseEver);
|
||||||
|
|
@ -13,7 +16,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.2.6.0");
|
ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.3.0.0");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
ImGui::Text("Status:");
|
ImGui::Text("Status:");
|
||||||
|
|
@ -139,6 +142,13 @@ void UIManager::RenderUI() {
|
||||||
ImGui::Text("DPI Scale: %.3f", dpiScale);
|
ImGui::Text("DPI Scale: %.3f", dpiScale);
|
||||||
ImGui::Text("Debug samples: %d", g_state.debugCounter);
|
ImGui::Text("Debug samples: %d", g_state.debugCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
ImGui::Text("Map Info:");
|
||||||
|
unsigned int currentMapID = MapUtils::GetCurrentMapID();
|
||||||
|
ImGui::Text("Current MapID: %u", currentMapID);
|
||||||
|
ImGui::Text("Is Training Area: %s", MapUtils::IsInTrainingArea() ? "YES" : "NO");
|
||||||
|
ImGui::Text("QuickAccess Visible: %s", g_state.quickAccessVisible ? "YES" : "NO");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
|
||||||
56
GolemHelper/Utils/MapUtils.cpp
Normal file
56
GolemHelper/Utils/MapUtils.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include "MapUtils.h"
|
||||||
|
#include "../Common/Globals.h"
|
||||||
|
|
||||||
|
bool MapUtils::IsInTrainingArea() {
|
||||||
|
return GetCurrentMapID() == 1154;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int MapUtils::GetCurrentMapID() {
|
||||||
|
if (g_mumbleData && g_mumbleData->Context.MapID != 0) {
|
||||||
|
return g_mumbleData->Context.MapID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapUtils::UpdateQuickAccessVisibility() {
|
||||||
|
if (!g_api) return;
|
||||||
|
|
||||||
|
bool shouldBeVisible = IsInTrainingArea();
|
||||||
|
unsigned int currentMapID = GetCurrentMapID();
|
||||||
|
|
||||||
|
if (currentMapID != g_state.lastMapID) {
|
||||||
|
g_state.lastMapID = currentMapID;
|
||||||
|
|
||||||
|
if (shouldBeVisible && !g_state.quickAccessVisible) {
|
||||||
|
g_api->QuickAccess.Add(
|
||||||
|
"GolemHelper.ToggleUI",
|
||||||
|
"GOLEM_HELPER_ICON",
|
||||||
|
"GOLEM_HELPER_ICON_HOVER",
|
||||||
|
"GolemHelper.ToggleUI",
|
||||||
|
"GolemHelper UI"
|
||||||
|
);
|
||||||
|
g_state.quickAccessVisible = true;
|
||||||
|
|
||||||
|
if (g_state.debugMode) {
|
||||||
|
char buffer[150];
|
||||||
|
sprintf_s(buffer, sizeof(buffer), "QuickAccess icon ADDED - MapID: %u (Training Area)", currentMapID);
|
||||||
|
g_api->Log(ELogLevel_INFO, "GolemHelper", buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!shouldBeVisible && g_state.quickAccessVisible) {
|
||||||
|
g_api->QuickAccess.Remove("GolemHelper.ToggleUI");
|
||||||
|
g_state.quickAccessVisible = false;
|
||||||
|
|
||||||
|
if (g_state.debugMode) {
|
||||||
|
char buffer[150];
|
||||||
|
sprintf_s(buffer, sizeof(buffer), "QuickAccess icon REMOVED - MapID: %u (Not Training Area)", currentMapID);
|
||||||
|
g_api->Log(ELogLevel_INFO, "GolemHelper", buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
GolemHelper/Utils/MapUtils.h
Normal file
8
GolemHelper/Utils/MapUtils.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class MapUtils {
|
||||||
|
public:
|
||||||
|
static bool IsInTrainingArea();
|
||||||
|
static void UpdateQuickAccessVisibility();
|
||||||
|
static unsigned int GetCurrentMapID();
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue