diff --git a/AutoBodyRes.lua b/AutoBodyRes.lua index 0a658cb..3d0dd4d 100644 --- a/AutoBodyRes.lua +++ b/AutoBodyRes.lua @@ -43,6 +43,7 @@ do function AutoBodyRes:RESURRECT_REQUEST() if NS.db.global.resurrect then AcceptResurrect() + After(0, function() if NS.isDead() then AcceptResurrect() @@ -55,6 +56,15 @@ do Interface:Stop(Interface, Interface.timerAnimationGroup) Interface:Stop(Interface, Interface.flashAnimationGroup) + + local isInInstance = IsInInstance() + if isInInstance == false then + if NS.db.global.test then + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end + end end end @@ -82,6 +92,15 @@ function AutoBodyRes:PLAYER_UNGHOST() Interface:Stop(Interface, Interface.timerAnimationGroup) Interface:Stop(Interface, Interface.flashAnimationGroup) + + local isInInstance = IsInInstance() + if isInInstance == false then + if NS.db.global.test then + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end + end end function AutoBodyRes:PLAYER_SKINNED() @@ -119,9 +138,9 @@ end function AutoBodyRes:PLAYER_ENTERING_WORLD() After(0, function() -- Some info isn't available until 1 frame after loading is done - local inInstance, instanceType = IsInInstance() + local isInInstance, instanceType = IsInInstance() - if inInstance then + if isInInstance then local isBattleground = instanceType == "pvp" or IsBattleground() if isBattleground then @@ -190,6 +209,12 @@ function AutoBodyRes:PLAYER_ENTERING_WORLD() ResTicker:Cancel() end + if NS.db.global.test then + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end + FrameUtil.UnregisterFrameForEvents(AutoBodyResFrame, DEAD_EVENTS) return end @@ -202,6 +227,12 @@ function AutoBodyRes:PLAYER_ENTERING_WORLD() Interface:Stop(Interface, Interface.flashAnimationGroup) end + if NS.db.global.test then + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end + AutoBodyRes:PlayerDeadEvents() end end) diff --git a/AutoBodyRes.toc b/AutoBodyRes.toc index 5304f1e..719677a 100644 --- a/AutoBodyRes.toc +++ b/AutoBodyRes.toc @@ -1,6 +1,6 @@ ## Interface: 110005 ## Title: AutoBodyRes -## Version: 1.1.5 +## Version: 1.1.6 ## Author: RBGDEV ## Notes: Shows text if someone took your body or not after you died in a battleground, preventing you from being able to body res. ## OptionalDeps: Ace3, LibStub, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets diff --git a/CHANGELOG.md b/CHANGELOG.md index 064af13..5785c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Auto Body Res +## [v1.1.6](https://github.com/rbgdevx/auto-body-res/releases/tag/v1.1.6) (2024-11-04) + +- Updating placeholder text to be clear its placeholder +- Ensuring when you have placeholder text enabled for placement that it always shows back up when out of instances and when not dead if enabled outside battlegrounds + ## [v1.1.5](https://github.com/rbgdevx/auto-body-res/releases/tag/v1.1.5) (2024-11-04) - Creating all new settings to control which battleground modes to disable in diff --git a/config.lua b/config.lua index 2698c17..4d6216b 100644 --- a/config.lua +++ b/config.lua @@ -57,6 +57,8 @@ AutoBodyResFrame:SetScript("OnEvent", function(_, event, ...) end) NS.AutoBodyRes.frame = AutoBodyResFrame +NS.PLACEHOLDER_TEXT = "PLACEHOLDER TEXT" + NS.DefaultDatabase = { global = { lock = false, diff --git a/options.lua b/options.lua index fd67f6f..323ad5b 100644 --- a/options.lua +++ b/options.lua @@ -64,11 +64,25 @@ NS.AceConfig = { local isInInstance = IsInInstance() if isInInstance == false then if val then - NS.Interface.text:SetText("CAN BODY RES NOW") - NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) - NS.Interface.textFrame:Show() + if NS.db.global.outside then + if not NS.isDead() then + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end + else + NS.Interface.text:SetText(NS.PLACEHOLDER_TEXT) + NS.UpdateSize(NS.Interface.textFrame, NS.Interface.text) + NS.Interface.textFrame:Show() + end else - NS.Interface.textFrame:Hide() + if NS.db.global.outside then + if not NS.isDead() then + NS.Interface.textFrame:Hide() + end + else + NS.Interface.textFrame:Hide() + end end end end,