diff --git a/ls_UI/core/defaults.lua b/ls_UI/core/defaults.lua index e5b476e0..49eec439 100644 --- a/ls_UI/core/defaults.lua +++ b/ls_UI/core/defaults.lua @@ -771,6 +771,17 @@ D.profile = { width = 114, height = 28, point = {"BOTTOMRIGHT", "LSPlayerFrame", "BOTTOMLEFT", -12, 0}, + fade = { + enabled = false, + combat = false, + target = false, + health = false, + out_delay = 0.75, + out_duration = 0.15, + in_duration = 0.15, + min_alpha = 0.2, + max_alpha = 1, + }, insets = { t_size = 0.25, b_size = 0.25, @@ -1191,6 +1202,17 @@ D.profile = { width = 114, height = 28, point = {"BOTTOMLEFT", "LSTargetFrame", "BOTTOMRIGHT", 12, 0}, + fade = { + enabled = false, + combat = false, + target = false, + health = false, + out_delay = 0.75, + out_duration = 0.15, + in_duration = 0.15, + min_alpha = 0.2, + max_alpha = 1, + }, insets = { t_size = 0.25, b_size = 0.25, @@ -1524,6 +1546,17 @@ D.profile = { width = 114, height = 28, point = {"BOTTOMLEFT", "LSFocusFrame", "BOTTOMRIGHT", 12, 0}, + fade = { + enabled = false, + combat = false, + target = false, + health = false, + out_delay = 0.75, + out_duration = 0.15, + in_duration = 0.15, + min_alpha = 0.2, + max_alpha = 1, + }, insets = { t_size = 0.25, b_size = 0.25, diff --git a/ls_UI/core/modernize.lua b/ls_UI/core/modernize.lua index fb539ccf..5f9b3bb7 100644 --- a/ls_UI/core/modernize.lua +++ b/ls_UI/core/modernize.lua @@ -776,19 +776,6 @@ function P:Modernize(data, name, key) data.version = 10000501 end - --> 100005.03 - if data.version < 10000503 then - if data.units then - for _, unit in next, {"pet", "focustarget", "targettarget"} do - if data.units[unit] then - data.units[unit].fade = nil - end - end - end - - data.version = 10000503 - end - --> 100100.01 if data.version < 10010001 then if data.blizzard then diff --git a/ls_UI/modules/unitframes/core.lua b/ls_UI/modules/unitframes/core.lua index f9754a8f..403e2af9 100644 --- a/ls_UI/modules/unitframes/core.lua +++ b/ls_UI/modules/unitframes/core.lua @@ -35,21 +35,10 @@ local configIgnoredKeys = { threat = true, } -local parentUnits = { - ["pet"] = "player", - ["focustarget"] = "focus", - ["targettarget"] = "target", -} - local frame_proto = {} function frame_proto:UpdateConfig() self._config = E:CopyTable(C.db.profile.units[self.__unit], self._config, configIgnoredKeys) - - local parentUnit = parentUnits[self.__unit] - if parentUnit then - self._config.fade = E:CopyTable(C.db.profile.units[parentUnit].fade, self._config.fade) - end end function frame_proto:OnEnter() diff --git a/ls_UI_Options/unitframes/core.lua b/ls_UI_Options/unitframes/core.lua index bda6b149..c33f3677 100644 --- a/ls_UI_Options/unitframes/core.lua +++ b/ls_UI_Options/unitframes/core.lua @@ -261,12 +261,6 @@ local function getUnitFrameOptions(order, unit, name) if unit == "player" then temp.disabled = isPlayerFrameDisabled - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.player, C.db.profile.units.player) - UNITFRAMES:For("player", "Update") - UNITFRAMES:For("pet", "UpdateConfig") - UNITFRAMES:For("pet", "UpdateFading") - end temp.args.class_power = CONFIG:CreateUnitFrameClassPowerOptions(33, unit) temp.args.castbar = CONFIG:CreateUnitFrameCastbarOptions(34, unit) temp.args.custom_texts = CONFIG:CreateUnitFrameCustomTextsOptions(40, unit) @@ -279,15 +273,8 @@ local function getUnitFrameOptions(order, unit, name) temp.args.pvp = nil temp.args.status = nil temp.args.mirror_widgets = nil - temp.args.fading = nil elseif unit == "target" then temp.disabled = isTargetFrameDisabled - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.target, C.db.profile.units.target) - UNITFRAMES:For("target", "Update") - UNITFRAMES:For("targettarget", "UpdateConfig") - UNITFRAMES:For("targettarget", "UpdateFading") - end temp.args.castbar = CONFIG:CreateUnitFrameCastbarOptions(34, unit) temp.args.auras = CONFIG:CreateUnitFrameAurasOptions(35, unit) temp.args.custom_texts = CONFIG:CreateUnitFrameCustomTextsOptions(40, unit) @@ -296,15 +283,8 @@ local function getUnitFrameOptions(order, unit, name) temp.args.debuff = nil temp.args.pvp = nil temp.args.mirror_widgets = nil - temp.args.fading = nil elseif unit == "focus" then temp.disabled = isFocusFrameDisabled - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.focus, C.db.profile.units.focus) - UNITFRAMES:For("focus", "Update") - UNITFRAMES:For("focustarget", "UpdateConfig") - UNITFRAMES:For("focustarget", "UpdateFading") - end temp.args.castbar = CONFIG:CreateUnitFrameCastbarOptions(34, unit) temp.args.auras = CONFIG:CreateUnitFrameAurasOptions(35, unit) temp.args.custom_texts = CONFIG:CreateUnitFrameCustomTextsOptions(40, unit) @@ -313,7 +293,6 @@ local function getUnitFrameOptions(order, unit, name) temp.args.debuff = nil temp.args.pvp = nil temp.args.mirror_widgets = nil - temp.args.fading = nil elseif unit == "boss" then temp.disabled = isBossFrameDisabled temp.args.alt_power = CONFIG:CreateUnitFrameAltPowerOptions(33, unit) diff --git a/ls_UI_Options/unitframes/fading.lua b/ls_UI_Options/unitframes/fading.lua index 58745325..3ba3ec4c 100644 --- a/ls_UI_Options/unitframes/fading.lua +++ b/ls_UI_Options/unitframes/fading.lua @@ -25,7 +25,7 @@ local function isFadingDisabled(info) end function CONFIG:CreateUnitFrameFadingOptions(order, unit) - local temp = { + return { order = order, type = "group", name = L["FADING"], @@ -117,59 +117,4 @@ function CONFIG:CreateUnitFrameFadingOptions(order, unit) }, }, } - - if unit == "player" then - temp.set = function(info, value) - C.db.profile.units.player.fade[info[#info]] = value - - UNITFRAMES:For("player", "UpdateConfig") - UNITFRAMES:For("player", "UpdateFading") - UNITFRAMES:For("pet", "UpdateConfig") - UNITFRAMES:For("pet", "UpdateFading") - end - - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.player.fade, C.db.profile.units.player.fade, {enabled = true}) - UNITFRAMES:For("player", "UpdateConfig") - UNITFRAMES:For("player", "UpdateFading") - UNITFRAMES:For("pet", "UpdateConfig") - UNITFRAMES:For("pet", "UpdateFading") - end - elseif unit == "focus" then - temp.set = function(info, value) - C.db.profile.units.focus.fade[info[#info]] = value - - UNITFRAMES:For("focus", "UpdateConfig") - UNITFRAMES:For("focus", "UpdateFading") - UNITFRAMES:For("focustarget", "UpdateConfig") - UNITFRAMES:For("focustarget", "UpdateFading") - end - - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.focus.fade, C.db.profile.units.focus.fade, {enabled = true}) - UNITFRAMES:For("focus", "UpdateConfig") - UNITFRAMES:For("focus", "UpdateFading") - UNITFRAMES:For("focustarget", "UpdateConfig") - UNITFRAMES:For("focustarget", "UpdateFading") - end - elseif unit == "target" then - temp.set = function(info, value) - C.db.profile.units.target.fade[info[#info]] = value - - UNITFRAMES:For("target", "UpdateConfig") - UNITFRAMES:For("target", "UpdateFading") - UNITFRAMES:For("targettarget", "UpdateConfig") - UNITFRAMES:For("targettarget", "UpdateFading") - end - - temp.args.reset.func = function() - CONFIG:CopySettings(D.profile.units.target.fade, C.db.profile.units.target.fade, {enabled = true}) - UNITFRAMES:For("target", "UpdateConfig") - UNITFRAMES:For("target", "UpdateFading") - UNITFRAMES:For("targettarget", "UpdateConfig") - UNITFRAMES:For("targettarget", "UpdateFading") - end - end - - return temp end