Skip to content

Commit

Permalink
fixing placeholder text setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgdevx committed Nov 5, 2024
1 parent fa4096d commit 233b2ef
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 7 deletions.
35 changes: 33 additions & 2 deletions AutoBodyRes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ do
function AutoBodyRes:RESURRECT_REQUEST()
if NS.db.global.resurrect then
AcceptResurrect()

After(0, function()
if NS.isDead() then
AcceptResurrect()
Expand All @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion AutoBodyRes.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ AutoBodyResFrame:SetScript("OnEvent", function(_, event, ...)
end)
NS.AutoBodyRes.frame = AutoBodyResFrame

NS.PLACEHOLDER_TEXT = "PLACEHOLDER TEXT"

NS.DefaultDatabase = {
global = {
lock = false,
Expand Down
22 changes: 18 additions & 4 deletions options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 233b2ef

Please sign in to comment.