Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Mar 4, 2023
2 parents 071f97c + 69a2d0c commit a457b7d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Version 100005.04

- Fixed fading. Adding new stuff is never easy...

## Version 100005.03

### Unit Frames
Expand Down
9 changes: 1 addition & 8 deletions ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
### Unit Frames
- Added the "Health" option to fading. It's controlled by the player's health, and if it's below
<100% the frame will fade in.
- Added an option to disable status icons. These are the round role, class, etc icons at the bottom
of a frame.
- Removed fading options from pet, target of focus, and target of target frames. These are now
controlled by the fading options of player, focus, and target frames respectively.
- Fixed fading. Adding new stuff is never easy...
]]
22 changes: 8 additions & 14 deletions ls_UI/core/fading.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local function addTargetWidget(object, widget)
end

local function removeTargetWidget(object, widget)
widget.hasTarget = false
widget.hasTarget = nil
targetWidgets[object] = nil
end

Expand All @@ -46,7 +46,7 @@ local function addCombatWidget(object, widget)
end

local function removeCombatWidget(object, widget)
widget.inCombat = false
widget.inCombat = nil
combatWidgets[object] = nil
end

Expand All @@ -58,7 +58,7 @@ local function addHealthWidget(object, widget)
end

local function removeHealthWidget(object, widget)
widget.maxHealth = false
widget.maxHealth = nil
healthWidgets[object] = nil
end

Expand Down Expand Up @@ -142,9 +142,7 @@ updater:SetScript("OnEvent", function(self, event)
for object, widget in next, combatWidgets do
widget.inCombat = false

if not widget.hasTarget and widget.maxHealth then
object:EnableFading()
end
object:EnableFading()
end
elseif event == "PLAYER_TARGET_CHANGED" or event == "PLAYER_FOCUS_CHANGED" then
if UnitExists("target") or UnitExists("focus") then
Expand All @@ -161,9 +159,7 @@ updater:SetScript("OnEvent", function(self, event)
for object, widget in next, targetWidgets do
widget.hasTarget = false

if not widget.inCombat and widget.maxHealth then
object:EnableFading()
end
object:EnableFading()
end

self.hasTarget = false
Expand All @@ -174,9 +170,7 @@ updater:SetScript("OnEvent", function(self, event)
for object, widget in next, healthWidgets do
widget.maxHealth = true

if not (widget.inCombat or widget.hasTarget) then
object:EnableFading()
end
object:EnableFading()
end

self.maxHealth = true
Expand Down Expand Up @@ -245,7 +239,7 @@ function addHoverWidget(object, widget)
end

function removeHoverWidget(object, widget)
widget.canHover = false
widget.canHover = nil
hoverWidgets[object] = nil

if not next(hoverWidgets) then
Expand All @@ -271,7 +265,7 @@ end
function object_proto:EnableFading()
local widget = widgets[self]

if not (widget.hasTarget or widget.inCombat) then
if not (widget.inCombat or widget.hasTarget) and widget.maxHealth ~= false then
addHoverWidget(self, widget)
end
end
Expand Down
2 changes: 1 addition & 1 deletion ls_UI/ls_UI.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100005
## Author: lightspark
## Version: 100005.03
## Version: 100005.04
## Title: LS: |cff1a9fc0UI|r
## Notes: Yet another UI, but this one is a bit special...
## SavedVariables: LS_UI_GLOBAL_CONFIG, LS_UI_PRIVATE_CONFIG
Expand Down

0 comments on commit a457b7d

Please sign in to comment.