From d14b3c4a5777b3a8e014788b0ebb35e7cb44f82d Mon Sep 17 00:00:00 2001 From: RBGDEV <149433862+rbgdevx@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:33:03 -0500 Subject: [PATCH] adjusting hide code to be consistent --- .vscode/settings.json | 2 +- CHANGELOG.md | 5 +++++ HealerInRange.lua | 4 ++-- HealerInRange.toc | 2 +- helpers.lua | 25 +------------------------ interface.lua | 4 ++-- options.lua | 4 ++-- 7 files changed, 14 insertions(+), 32 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0566be7..3e7e716 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -44,5 +44,5 @@ "table": "disable", "utf8": "disable" }, - "Lua.workspace.library": ["~\\.vscode\\extensions\\ketho.wow-api-0.18.1\\Annotations"] + "Lua.workspace.library": ["~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations"] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2dd3b..34cbb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Healer In Range +## [v1.1.5](https://github.com/rbgdevx/healer-in-range/releases/tag/v1.1.5) (2024-01-15) + +- Fixing hiding text after un-checking test mode, and unifying this approach everywhere it needs to be hidden +- Minor Cleanup + ## [v1.1.4](https://github.com/rbgdevx/healer-in-range/releases/tag/v1.1.4) (2024-12-20) - Fixing show outside logic diff --git a/HealerInRange.lua b/HealerInRange.lua index 4a71d7c..353eebf 100644 --- a/HealerInRange.lua +++ b/HealerInRange.lua @@ -70,7 +70,7 @@ do Interface.textFrame:Show() Interface.textFrame:SetAlpha(1) else - Interface.textFrame:Hide() + Interface.textFrame:SetAlpha(0) end end else @@ -108,7 +108,7 @@ do Interface.textFrame:Show() Interface.textFrame:SetAlpha(1) else - Interface.textFrame:Hide() + Interface.textFrame:SetAlpha(0) end end end diff --git a/HealerInRange.toc b/HealerInRange.toc index a0b9be1..4fd25b4 100644 --- a/HealerInRange.toc +++ b/HealerInRange.toc @@ -1,6 +1,6 @@ ## Interface: 110007 ## Title: HealerInRange -## Version: 1.1.4 +## Version: 1.1.5 ## Author: RBGDEV ## Notes: Shows text if you're in or out of range of a healer ## OptionalDeps: AceConfig-3.0, AceGUI-3.0, AceGUI-3.0-SharedMediaWidgets, CallbackHandler-1.0, LibSharedMedia-3.0, LibStub diff --git a/helpers.lua b/helpers.lua index 0111eb6..e77ebe1 100644 --- a/helpers.lua +++ b/helpers.lua @@ -16,7 +16,7 @@ local getmetatable = getmetatable local print = print local IsInInstance = IsInInstance -local wipe = table.wipe +-- local wipe = table.wipe local sformat = string.format local SharedMedia = LibStub("LibSharedMedia-3.0") @@ -190,26 +190,3 @@ NS.CleanupDB = function(src, dst) end return dst end - --- Pool for reusing tables. (Garbage collector isn't ran in combat unless max garbage is reached, which causes fps drops) -do - local pool = {} - - NS.NewTable = function() - local t = next(pool) or {} - pool[t] = nil -- remove from pool - return t - end - - NS.RemoveTable = function(tbl) - if tbl then - pool[wipe(tbl)] = true -- add to pool, wipe returns pointer to tbl here - end - end - - NS.ReleaseTables = function() - if next(pool) then - pool = {} - end - end -end diff --git a/interface.lua b/interface.lua index ec90bcb..15e6ba9 100644 --- a/interface.lua +++ b/interface.lua @@ -196,14 +196,14 @@ function Interface:ShowText(value) end end else - Interface.textFrame:Hide() + Interface.textFrame:SetAlpha(0) end else if NS.db.global.test then Interface.textFrame:Show() Interface.textFrame:SetAlpha(1) else - Interface.textFrame:Hide() + Interface.textFrame:SetAlpha(0) end end end diff --git a/options.lua b/options.lua index 0870e3e..61ab150 100644 --- a/options.lua +++ b/options.lua @@ -50,7 +50,7 @@ NS.AceConfig = { NS.Interface.textFrame:Show() NS.Interface.textFrame:SetAlpha(1) else - NS.Interface.textFrame:Hide() + NS.Interface.textFrame:SetAlpha(0) end end end, @@ -198,7 +198,7 @@ function Options:Setup() AceConfig:RegisterOptionsTable(AddonName, NS.AceConfig) AceConfigDialog:AddToBlizOptions(AddonName, AddonName) - SLASH_HIR1 = AddonName + SLASH_HIR1 = "/healerinrange" SLASH_HIR2 = "/hir" function SlashCmdList.HIR(message)