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;
|
||||
NexusLinkData* g_nexusLink = nullptr;
|
||||
Mumble::Data* g_mumbleData = nullptr;
|
||||
GolemHelperState g_state;
|
||||
MenuCoordinates g_coords;
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
#pragma once
|
||||
#include "Types.h"
|
||||
#include "../Dependencies/nexus/Nexus.h"
|
||||
#include "../Dependencies/mumble/mumble.h"
|
||||
|
||||
extern AddonAPI* g_api;
|
||||
extern NexusLinkData* g_nexusLink;
|
||||
extern Mumble::Data* g_mumbleData;
|
||||
extern GolemHelperState g_state;
|
||||
extern MenuCoordinates g_coords;
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "../Dependencies/mumble/mumble.h"
|
||||
|
||||
enum HitboxType {
|
||||
HITBOX_SMALL = 0,
|
||||
|
|
@ -32,6 +33,9 @@ struct GolemHelperState {
|
|||
|
||||
int initialDelay = 390;
|
||||
int stepDelay = 290;
|
||||
|
||||
bool quickAccessVisible = false;
|
||||
unsigned int lastMapID = 0;
|
||||
};
|
||||
|
||||
struct MenuCoordinates {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include <string>
|
||||
#include "Common/Globals.h"
|
||||
#include "Utils/FileUtils.h"
|
||||
#include "Utils/MapUtils.h"
|
||||
#include "Config/ConfigManager.h"
|
||||
#include "UI/UIManager.h"
|
||||
#include "Input/KeybindManager.h"
|
||||
|
|
@ -15,6 +16,8 @@ void Load(AddonAPI* aApi) {
|
|||
|
||||
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;
|
||||
|
||||
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_HOVER", "addons/GolemHelper/icons/GOLEM_HELPER_ICON_HOVER.png");
|
||||
|
||||
g_api->QuickAccess.Add(
|
||||
"GolemHelper.ToggleUI",
|
||||
"GOLEM_HELPER_ICON",
|
||||
"GOLEM_HELPER_ICON_HOVER",
|
||||
"GolemHelper.ToggleUI",
|
||||
"GolemHelper UI"
|
||||
);
|
||||
MapUtils::UpdateQuickAccessVisibility();
|
||||
|
||||
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!");
|
||||
}
|
||||
|
||||
void Unload() {
|
||||
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::RenderOptions);
|
||||
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 = nullptr;
|
||||
g_mumbleData = nullptr;
|
||||
g_state.enabled = false;
|
||||
g_state.showUI = false;
|
||||
g_state.quickAccessVisible = false;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() {
|
||||
|
|
@ -59,7 +60,7 @@ extern "C" __declspec(dllexport) AddonDefinition* GetAddonDef() {
|
|||
def.Signature = -424248;
|
||||
def.APIVersion = NEXUS_API_VERSION;
|
||||
def.Name = "GolemHelper";
|
||||
def.Version = { 1, 2, 6, 0 };
|
||||
def.Version = { 1, 3, 0, 0 };
|
||||
def.Author = "Azrub";
|
||||
def.Description = "Automates the process of setting optimal boon and golem configurations in the training area";
|
||||
def.Load = Load;
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@
|
|||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="UI\UIManager.h" />
|
||||
<ClInclude Include="Utils\FileUtils.h" />
|
||||
<ClInclude Include="Utils\MapUtils.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Automation\AutomationLogic.cpp" />
|
||||
|
|
@ -213,6 +214,7 @@
|
|||
</ClCompile>
|
||||
<ClCompile Include="UI\UIManager.cpp" />
|
||||
<ClCompile Include="Utils\FileUtils.cpp" />
|
||||
<ClCompile Include="Utils\MapUtils.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="GolemHelper.rc" />
|
||||
|
|
|
|||
|
|
@ -108,6 +108,9 @@
|
|||
<ClInclude Include="GolemHelper.h">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Utils\MapUtils.h">
|
||||
<Filter>Utils</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
|
|
@ -155,6 +158,9 @@
|
|||
<ClCompile Include="GolemHelper.cpp">
|
||||
<Filter>File di origine</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Utils\MapUtils.cpp">
|
||||
<Filter>Utils</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="GolemHelper.rc">
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
#include "UIManager.h"
|
||||
#include "../Common/Globals.h"
|
||||
#include "../Config/ConfigManager.h"
|
||||
#include "../Utils/MapUtils.h"
|
||||
#include "../Dependencies/imgui/imgui.h"
|
||||
|
||||
void UIManager::RenderUI() {
|
||||
MapUtils::UpdateQuickAccessVisibility();
|
||||
|
||||
if (!g_state.showUI) return;
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(400, 500), ImGuiCond_FirstUseEver);
|
||||
|
|
@ -13,7 +16,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.6.0");
|
||||
ImGui::TextColored(ImVec4(0.2f, 0.8f, 1.0f, 1.0f), "GolemHelper v1.3.0.0");
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Text("Status:");
|
||||
|
|
@ -139,6 +142,13 @@ void UIManager::RenderUI() {
|
|||
ImGui::Text("DPI Scale: %.3f", dpiScale);
|
||||
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();
|
||||
|
|
|
|||
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