From 4b82e66e0cd7acd638e265f2f1d8b89f2b3f5df4 Mon Sep 17 00:00:00 2001 From: Justice Date: Tue, 24 Jan 2023 02:12:16 +0300 Subject: [PATCH 1/4] fix script id collisions when two or more scripts have the same name --- ImGTA/scripts_mod.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ImGTA/scripts_mod.cpp b/ImGTA/scripts_mod.cpp index 6d9e8c4..8b0dbee 100644 --- a/ImGTA/scripts_mod.cpp +++ b/ImGTA/scripts_mod.cpp @@ -287,22 +287,21 @@ bool ScriptsMod::Draw() ImGui::Separator(); } - if (m_scripts.size() > 0) + for (auto& s : m_scripts) { - for (auto &s : m_scripts) + ImGui::PushID(s.m_handle); //prevent id conflicts (scripts with the same name) + if (ImGui::Selectable(s.m_scriptName.c_str(), false, ImGuiSelectableFlags_SpanAllColumns)) { - if (ImGui::Selectable(s.m_scriptName.c_str(), false, ImGuiSelectableFlags_SpanAllColumns)) - { - m_selected = &s; - ImGui::OpenPopup("ScriptPropertiesPopup"); - } - ImGui::NextColumn(); - - ImGui::Text("%d (0x%x)", s.m_handle, s.m_handle); ImGui::NextColumn(); + m_selected = &s; + ImGui::OpenPopup("ScriptPropertiesPopup"); } - ImGui::Columns(1); - ImGui::Separator(); + ImGui::NextColumn(); + + ImGui::Text("%d (0x%x)", s.m_handle, s.m_handle); ImGui::NextColumn(); + ImGui::PopID(); } + ImGui::Columns(1); + ImGui::Separator(); ShowSelectedPopup(); From c49893262391042dfd77ed33d0f500ee2bb859db Mon Sep 17 00:00:00 2001 From: Justice Date: Wed, 25 Jan 2023 16:38:12 +0300 Subject: [PATCH 2/4] another way to fix script name collisions --- ImGTA/scripts_mod.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ImGTA/scripts_mod.cpp b/ImGTA/scripts_mod.cpp index 8b0dbee..bbda217 100644 --- a/ImGTA/scripts_mod.cpp +++ b/ImGTA/scripts_mod.cpp @@ -295,10 +295,10 @@ bool ScriptsMod::Draw() m_selected = &s; ImGui::OpenPopup("ScriptPropertiesPopup"); } + ImGui::PopID(); ImGui::NextColumn(); ImGui::Text("%d (0x%x)", s.m_handle, s.m_handle); ImGui::NextColumn(); - ImGui::PopID(); } ImGui::Columns(1); ImGui::Separator(); From 4cdf8953b3fc8f870ffd9791c8090f98bab52a1a Mon Sep 17 00:00:00 2001 From: Justice Date: Wed, 25 Jan 2023 16:38:40 +0300 Subject: [PATCH 3/4] another way to fix script name collisions --- ImGTA/scripts_mod.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ImGTA/scripts_mod.cpp b/ImGTA/scripts_mod.cpp index bbda217..04be5eb 100644 --- a/ImGTA/scripts_mod.cpp +++ b/ImGTA/scripts_mod.cpp @@ -289,13 +289,12 @@ bool ScriptsMod::Draw() for (auto& s : m_scripts) { - ImGui::PushID(s.m_handle); //prevent id conflicts (scripts with the same name) - if (ImGui::Selectable(s.m_scriptName.c_str(), false, ImGuiSelectableFlags_SpanAllColumns)) + //##s.m_handle prevents id conflicts (scripts with the same name) + if (ImGui::Selectable((s.m_scriptName + "##" + std::to_string(s.m_handle)).c_str(), false, ImGuiSelectableFlags_SpanAllColumns)) { m_selected = &s; ImGui::OpenPopup("ScriptPropertiesPopup"); } - ImGui::PopID(); ImGui::NextColumn(); ImGui::Text("%d (0x%x)", s.m_handle, s.m_handle); ImGui::NextColumn(); From decb6e73bbd467bef45e1e4fd966298b1c38a3ce Mon Sep 17 00:00:00 2001 From: Justice Date: Tue, 31 Jan 2023 22:04:09 +0300 Subject: [PATCH 4/4] few fixes backported to v --- ImGTA/mem_watcher_mod.cpp | 4 ++-- ImGTA/script.cpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ImGTA/mem_watcher_mod.cpp b/ImGTA/mem_watcher_mod.cpp index 988c78e..f569f86 100644 --- a/ImGTA/mem_watcher_mod.cpp +++ b/ImGTA/mem_watcher_mod.cpp @@ -121,7 +121,7 @@ void MemWatcherMod::ShowAddAddress(bool isGlobal) { if (ImGui::InputInt("Hex Index##AddAddress", &m_inputAddressIndex, 1, 100, ImGuiInputTextFlags_CharsHexadecimal)) { - ClipInt(m_inputAddressIndex, 0, 999999); + ClipInt(m_inputAddressIndex, 0, INT32_MAX); m_indexRange = 1; m_inputsUpdated = true; } @@ -130,7 +130,7 @@ void MemWatcherMod::ShowAddAddress(bool isGlobal) { if (ImGui::InputInt("Decimal Index##AddAddress", &m_inputAddressIndex, 1, 100)) { - ClipInt(m_inputAddressIndex, 0, 999999); + ClipInt(m_inputAddressIndex, 0, INT32_MAX); m_indexRange = 1; m_inputsUpdated = true; } diff --git a/ImGTA/script.cpp b/ImGTA/script.cpp index 91f82f0..84e2d2e 100644 --- a/ImGTA/script.cpp +++ b/ImGTA/script.cpp @@ -76,9 +76,7 @@ void DLLObject::Update() ResetTextDrawCount(); if (m_isOpen) { - if (m_floatingMenu) - PAD::ENABLE_ALL_CONTROL_ACTIONS(0); - else + if (!m_floatingMenu) PAD::DISABLE_ALL_CONTROL_ACTIONS(0); }