Skip to content

Commit

Permalink
Disabled nameplates visibility control in cinematic mode for ThreatPl…
Browse files Browse the repository at this point in the history
…ates to avoid side effects
  • Loading branch information
LenweSaralonde committed Aug 24, 2024
1 parent 9b7755a commit 4ca00b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 9 additions & 7 deletions modules/MusicianNamePlates/MusicianNamePlates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ function Musician.NamePlates.UpdateNamePlateCinematicMode(namePlate)

local UIParentIsVisible = UIParent:IsVisible()
local isCinematicModeEnabled = Musician.NamePlates.AreNamePlatesEnabled() and Musician_Settings.cinematicMode
local cinematicModeNamePlates = Musician.NamePlates.CanShowNamesCinematicMode() and Musician_Settings.cinematicModeNamePlates
local isCinematicModeNamePlatesEnabled = Musician_Settings.cinematicModeNamePlates

-- Attach animated notes frame to WorldFrame if hiding nameplates in cinematic mode
if not cinematicModeNamePlates and isCinematicModeEnabled then
if namePlate.musicianAnimatedNotesFrame and isCinematicModeEnabled then
local parent, scale
if not UIParentIsVisible then
parent = WorldFrame
Expand All @@ -480,11 +480,13 @@ function Musician.NamePlates.UpdateNamePlateCinematicMode(namePlate)
end

-- Set nameplate visibility
if not cinematicModeNamePlates and isCinematicModeEnabled or not isCinematicModeEnabled then
if UIParentIsVisible then
namePlate:Show()
else
namePlate:Hide()
if Musician.NamePlates.CanShowNamesCinematicMode() then
if isCinematicModeEnabled and not isCinematicModeNamePlatesEnabled or not isCinematicModeEnabled then
if UIParentIsVisible then
namePlate:Show()
else
namePlate:Hide()
end
end
end
end
Expand Down
8 changes: 1 addition & 7 deletions modules/TidyPlates_ThreatPlates/TidyPlates_ThreatPlates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ function Musician.TidyPlates_ThreatPlates:OnEnable()

-- Disable incompatible features
Musician.NamePlates.ForbidHideHealthBars()
Musician.NamePlates.ForbidShowNamesCinematicMode()

hooksecurefunc(Musician.NamePlates, "UpdateNoteIcon", function(namePlate)
if namePlate.TPFrame and namePlate.TPFrame.visual and namePlate.TPFrame.visual.name then
Musician.NamePlates.AddNoteIcon(namePlate, namePlate.TPFrame.visual.name)
end
end)

-- Handle cinematic mode
hooksecurefunc(Musician.NamePlates, "UpdateNamePlateCinematicMode", function(namePlate)
if namePlate.TPFrame then
Musician.NamePlates.UpdateNamePlateCinematicMode(namePlate.TPFrame)
end
end)
end
end

0 comments on commit 4ca00b0

Please sign in to comment.