Commit f22a3efc authored by Simpy's avatar Simpy 🐹

11.34

parents 7eb26b53 e3c2c860
......@@ -3,7 +3,7 @@
------------------------------------------------------------------------
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
--Lua functions
local _G = _G
local random, next, unpack, strsub = random, next, unpack, strsub
E.AnimShake = {{-9,7,-7,12}, {-5,9,-9,5}, {-5,7,-7,5}, {-9,9,-9,9}, {-5,7,-7,5}, {-9,7,-9,5}}
......@@ -18,6 +18,29 @@ function E:RandomAnimShake(index)
return random(s[1], s[2]), random(s[3], s[4])
end
--TEST
--[[local t = UIParent:CreateFontString("FontString","OVERLAY","GameTooltipText")
t:SetText(0)
t:SetPoint("CENTER")
t:FontTemplate(nil, 20)
E:SetUpAnimGroup(t, "Number", 10, 5)
local b = CreateFrame("BUTTON", nil, UIParent)
b:SetPoint("CENTER", 0, -100)
b:SetTemplate()
b:SetSize(40,30)
b:EnableMouse(true)
b:SetScript("OnClick", function()
if t:GetText() == 10 then
t.NumberAnim:SetChange(0)
t.NumberAnimGroup:Play()
else
t.NumberAnim:SetChange(10)
t.NumberAnimGroup:Play()
end
end)]]
function E:SetUpAnimGroup(obj, Type, ...)
if not Type then Type = 'Flash' end
......@@ -59,6 +82,29 @@ function E:SetUpAnimGroup(obj, Type, ...)
shake.path[i]:SetOffset(E.AnimShakeH[i], 0)
end
end
elseif Type == "Elastic" then
local width, height, duration, loop = ...
obj.elastic = _G.CreateAnimationGroup(obj)
for i = 1, 4 do
local anim = obj.elastic:CreateAnimation(i < 3 and 'width' or 'height')
anim:SetChange((i==1 and width*0.45) or (i==2 and width) or (i==3 and height*0.45) or height)
anim:SetEasing('inout-elastic')
anim:SetDuration(duration)
obj.elastic[i] = anim
end
obj.elastic[1]:SetScript('OnFinished', function(anim) anim:Stop() obj.elastic[2]:Play() end)
obj.elastic[3]:SetScript('OnFinished', function(anim) anim:Stop() obj.elastic[4]:Play() end)
obj.elastic[2]:SetScript('OnFinished', function(anim) anim:Stop() if loop then obj.elastic[1]:Play() end end)
obj.elastic[4]:SetScript('OnFinished', function(anim) anim:Stop() if loop then obj.elastic[3]:Play() end end)
elseif Type == "Number" then
local endingNumber, duration = ...
obj.NumberAnimGroup = _G.CreateAnimationGroup(obj)
obj.NumberAnim = obj.NumberAnimGroup:CreateAnimation('number')
obj.NumberAnim:SetChange(endingNumber)
obj.NumberAnim:SetEasing('in-circular')
obj.NumberAnim:SetDuration(duration)
else
local x, y, duration, customName = ...
if not customName then customName = 'anim' end
......@@ -88,6 +134,22 @@ function E:SetUpAnimGroup(obj, Type, ...)
end
end
function E:Elasticize(obj)
if not obj.elastic then
E:SetUpAnimGroup(obj, 'Elastic', 128, 64, 2, false)
end
obj.elastic[1]:Play()
obj.elastic[3]:Play()
end
function E:StopElasticize(obj)
if obj.elastic then
obj.elastic[1]:Stop(true)
obj.elastic[3]:Stop(true)
end
end
function E:Shake(obj)
if not obj.shake then
E:SetUpAnimGroup(obj, 'Shake')
......
This diff is collapsed.
......@@ -51,6 +51,7 @@ local LSM = E.Libs.LSM
--Constants
E.noop = function() end
E.title = format('|cfffe7b2c%s |r', 'ElvUI')
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player')
E.mylevel = UnitLevel('player')
E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player')
......@@ -58,13 +59,12 @@ E.myLocalizedRace, E.myrace = UnitRace('player')
E.myname = UnitName('player')
E.myrealm = GetRealmName()
E.myspec = GetSpecialization()
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.wowpatch, E.wowbuild = GetBuildInfo()
E.wowbuild = tonumber(E.wowbuild)
E.isMacClient = IsMacClient()
E.IsRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
E.screenwidth, E.screenheight = GetPhysicalScreenSize()
E.resolution = format('%dx%d', E.screenwidth, E.screenheight)
E.isMacClient = IsMacClient()
E.NewSign = '|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:14:14|t' -- not used by ElvUI yet, but plugins like BenikUI and MerathilisUI use it.
E.TexturePath = 'Interface\\AddOns\\ElvUI\\Media\\Textures\\' -- for plugins?
E.InfoColor = '|cfffe7b2c'
......@@ -925,7 +925,7 @@ function E:UpdateNamePlates(skipCallback)
end
function E:UpdateTooltip()
-- for plugins :3
Tooltip:SetTooltipFonts()
end
function E:UpdateBags(skipCallback)
......@@ -1063,6 +1063,9 @@ do
if E.private.chat.enable then
tinsert(staggerTable, 'UpdateChat')
end
if E.private.tooltip.enable then
tinsert(staggerTable, 'UpdateTooltip')
end
tinsert(staggerTable, 'UpdateDataBars')
tinsert(staggerTable, 'UpdateDataTexts')
if E.private.general.minimap.enable then
......@@ -1278,12 +1281,11 @@ function E:InitializeModules()
end
local function buffwatchConvert(spell)
if spell.sizeOverride then
local newSize = spell.sizeOverride
spell.size = (newSize > 8 and newSize) or 8
spell.sizeOverride = nil
elseif not spell.size or spell.size < 6 then
spell.size = 6
if spell.sizeOverride then spell.sizeOverride = nil end
if spell.size then spell.size = nil end
if not spell.sizeOffset then
spell.sizeOffset = 0
end
if spell.styleOverride then
......@@ -1500,6 +1502,15 @@ function E:DBConversions()
for _, spell in pairs(E.db.unitframe.filters.buffwatch) do
buffwatchConvert(spell)
end
-- fix aurabars colors
for spell, info in pairs(E.global.unitframe.AuraBarColors) do
if type(info) == 'boolean' then
E.global.unitframe.AuraBarColors[spell] = { enable = info, color = { r = 1, g = 1, b = 1, a = 1} }
elseif type(info) == 'table' and info.r then
E.global.unitframe.AuraBarColors[spell] = { enable = true, color = info }
end
end
end
function E:RefreshModulesDB()
......@@ -1514,6 +1525,9 @@ function E:Initialize()
twipe(self.global)
twipe(self.private)
LSM.DefaultMedia.font = 'PT Sans Narrow'
LSM.DefaultMedia.statusbar = 'ElvUI Norm'
self.myguid = UnitGUID('player')
self.data = E.Libs.AceDB:New('ElvDB', self.DF)
self.data.RegisterCallback(self, 'OnProfileChanged', 'StaggeredUpdateAll')
......
......@@ -7,6 +7,7 @@ local S = E:GetModule('Skins')
local _G = _G
local gsub = gsub
local format = format
local pairs = pairs
local ipairs = ipairs
local tinsert = tinsert
--WoW API / Variables
......@@ -294,43 +295,13 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.general.totems.growthDirection = 'HORIZONTAL'
E.db.general.totems.size = 50
E.db.general.totems.spacing = 8
--Movers
E.db.movers.AlertFrameMover = 'TOP,ElvUIParent,TOP,-1,-18'
E.db.movers.AltPowerBarMover = 'TOP,ElvUIParent,TOP,-1,-36'
E.db.movers.AzeriteBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-245'
E.db.movers.BelowMinimapContainerMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-4,-274'
E.db.movers.BNETMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-4,-274'
E.db.movers.BossButton = 'BOTTOM,ElvUIParent,BOTTOM,-1,293'
E.db.movers.ElvAB_1 = 'BOTTOM,ElvUIParent,BOTTOM,-1,191'
E.db.movers.ElvAB_2 = 'BOTTOM,ElvUIParent,BOTTOM,0,4'
E.db.movers.ElvAB_3 = 'BOTTOM,ElvUIParent,BOTTOM,-1,139'
E.db.movers.ElvAB_5 = 'BOTTOM,ElvUIParent,BOTTOM,-92,57'
E.db.movers.ElvUF_FocusMover = 'BOTTOM,ElvUIParent,BOTTOM,342,59'
E.db.movers.ElvUF_PartyMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,248'
E.db.movers.ElvUF_PetMover = 'BOTTOM,ElvUIParent,BOTTOM,-342,100'
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,95'
E.db.movers.ElvUF_PlayerMover = 'BOTTOM,ElvUIParent,BOTTOM,-342,139'
E.db.movers.ElvUF_Raid40Mover = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,482'
E.db.movers.ElvUF_RaidMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,248'
E.db.movers.ElvUF_RaidpetMover = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,737'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,243'
E.db.movers.ElvUF_TargetMover = 'BOTTOM,ElvUIParent,BOTTOM,342,139'
E.db.movers.ElvUF_TargetTargetMover = 'BOTTOM,ElvUIParent,BOTTOM,342,100'
E.db.movers.ExperienceBarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,43'
E.db.movers.HonorBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-255'
E.db.movers.LevelUpBossBannerMover = 'TOP,ElvUIParent,TOP,-1,-120'
E.db.movers.LootFrameMover = 'TOPLEFT,ElvUIParent,TOPLEFT,418,-186'
E.db.movers.LossControlMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,507'
E.db.movers.MirrorTimer1Mover = 'TOP,ElvUIParent,TOP,-1,-96'
E.db.movers.ObjectiveFrameMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-163,-325'
E.db.movers.ReputationBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-264'
E.db.movers.ShiftAB = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,769'
E.db.movers.SocialMenuMover = 'TOPLEFT,ElvUIParent,TOPLEFT,4,-187'
E.db.movers.TalkingHeadFrameMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,373'
E.db.movers.TotemBarMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,490,4'
E.db.movers.VehicleSeatMover = 'TOPLEFT,ElvUIParent,TOPLEFT,4,-4'
E.db.movers.VOICECHAT = 'TOPLEFT,ElvUIParent,TOPLEFT,368,-210'
E.db.movers.ZoneAbility = 'BOTTOM,ElvUIParent,BOTTOM,-1,293'
for mover, position in pairs(E.LayoutMoverPositions["ALL"]) do
E.db.movers[mover] = position
E:SaveMoverDefaultPosition(mover)
end
--Tooltip
E.db.tooltip.fontSize = 10
E.db.tooltip.healthBar.fontOutline = 'MONOCHROMEOUTLINE'
......@@ -443,23 +414,21 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
Layout Tweaks will be handled below,
These are changes that deviate from the shared base layout.
]]
if E.LayoutMoverPositions[layout] then
for mover, position in pairs(E.LayoutMoverPositions[layout]) do
E.db.movers[mover] = position
E:SaveMoverDefaultPosition(mover)
end
end
if layout == 'dpsCaster' then
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97'
elseif layout == 'healer' then
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97'
E.db.movers.ElvUF_RaidMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,202,373'
E.db.movers.LootFrameMover = 'TOPLEFT,ElvUIParent,TOPLEFT,250,-104'
E.db.movers.ShiftAB = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,273'
E.db.movers.VOICECHAT = 'TOPLEFT,ElvUIParent,TOPLEFT,250,-82'
if layout == 'healer' then
E.db.unitframe.units.party.enable = false
E.db.unitframe.units.raid.visibility = '[nogroup] hide;show'
end
end
E:StaggeredUpdateAll(nil, true)
E.db.layoutSetting = layout
if _G.InstallStepComplete and not noDisplayMsg then
_G.InstallStepComplete.message = L["Layout Set"]
......@@ -473,8 +442,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.player.debuffs, P.unitframe.units.player.debuffs)
E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......@@ -483,8 +451,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.target.debuffs, P.unitframe.units.target.debuffs)
E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......@@ -493,8 +460,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.focus.debuffs, P.unitframe.units.focus.debuffs)
E:CopyTable(E.db.unitframe.units.focus.aurabar, P.unitframe.units.focus.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file='Patch.lua'/>
<Script file='Core.lua'/>
<Script file='Math.lua'/>
<Script file='API.lua'/>
......
......@@ -62,12 +62,15 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local f = CreateFrame('Button', name, E.UIParent)
f:SetClampedToScreen(true)
f:RegisterForDrag('LeftButton', 'RightButton')
f:SetFrameLevel(parent:GetFrameLevel() + 1)
f:SetFrameStrata(overlay and 'DIALOG' or 'BACKGROUND')
f:EnableMouseWheel(true)
f:SetMovable(true)
f:Width(width)
f:Height(height)
f:SetTemplate('Transparent', nil, nil, true)
f:Height(height)
f:Width(width)
f:Hide()
f.parent = parent
f.name = name
f.textString = text
......@@ -77,13 +80,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
f.shouldDisable = shouldDisable
f.configString = configString
f:SetFrameLevel(parent:GetFrameLevel() + 1)
if overlay == true then
f:SetFrameStrata('DIALOG')
else
f:SetFrameStrata('BACKGROUND')
end
E.CreatedMovers[name].mover = f
E.snapBars[#E.snapBars+1] = f
......@@ -122,6 +118,10 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnDragStart(self)
if InCombatLockdown() then E:Print(ERR_NOT_IN_COMBAT) return end
if _G.ElvUIGrid then
E:UIFrameFadeIn(_G.ElvUIGrid, 0.75, _G.ElvUIGrid:GetAlpha(), 1)
end
if E.db.general.stickyFrames then
Sticky:StartMoving(self, E.snapBars, f.snapOffset, f.snapOffset, f.snapOffset, f.snapOffset)
else
......@@ -135,7 +135,13 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnDragStop(self)
if InCombatLockdown() then E:Print(ERR_NOT_IN_COMBAT) return end
if _G.ElvUIGrid and E.ConfigurationMode then
E:UIFrameFadeOut(_G.ElvUIGrid, 0.75, _G.ElvUIGrid:GetAlpha(), 0.4)
end
isDragging = false
if E.db.general.stickyFrames then
Sticky:StopMoving(self)
else
......@@ -161,10 +167,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
E:SaveMoverPosition(name)
if ElvUIMoverNudgeWindow then
E:UpdateNudgeFrame(self, x, y)
end
coordFrame.child = nil
coordFrame:Hide()
......@@ -177,27 +179,43 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnEnter(self)
if isDragging then return end
for key in pairs(E.CreatedMovers) do
local mover = _G[key]
if mover:IsShown() and mover ~= self then
E:UIFrameFadeOut(mover, 0.75, mover:GetAlpha(), 0.5)
end
end
self.text:SetTextColor(1, 1, 1)
E.AssignFrameToNudge(self)
coordFrame.child = self
coordFrame:GetScript('OnUpdate')(coordFrame)
end
local function OnMouseDown(self, button)
local function OnLeave(self)
if isDragging then return end
for key in pairs(E.CreatedMovers) do
local mover = _G[key]
if mover:IsShown() and mover ~= self then
E:UIFrameFadeIn(mover, 0.75, mover:GetAlpha(), 1)
end
end
self.text:SetTextColor(unpack(E.media.rgbvaluecolor))
end
local function OnMouseUp(_, button)
if button == 'LeftButton' and not isDragging then
if ElvUIMoverNudgeWindow:IsShown() then
ElvUIMoverNudgeWindow:Hide()
else
ElvUIMoverNudgeWindow:Show()
end
elseif button == 'RightButton' then
isDragging = false
if E.db.general.stickyFrames then
Sticky:StopMoving(self)
else
self:StopMovingOrSizing()
end
end
local function OnMouseDown(self, button)
if button == 'RightButton' then
--Allow resetting of anchor by Ctrl+RightClick
if IsControlKeyDown() and self.textString then
E:ResetMovers(self.textString)
......@@ -209,11 +227,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
end
end
local function OnLeave(self)
if isDragging then return end
self.text:SetTextColor(unpack(E.media.rgbvaluecolor))
end
local function OnShow(self)
self:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor))
end
......@@ -230,16 +243,16 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
f:SetScript('OnMouseUp', E.AssignFrameToNudge)
f:SetScript('OnDragStop', OnDragStop)
f:SetScript('OnEnter', OnEnter)
f:SetScript('OnMouseUp', OnMouseUp)
f:SetScript('OnMouseDown', OnMouseDown)
f:SetScript('OnLeave', OnLeave)
f:SetScript('OnShow', OnShow)
f:SetScript('OnMouseWheel', OnMouseWheel)
parent:SetScript('OnSizeChanged', SizeChanged)
parent.mover = f
parent:ClearAllPoints()
parent:Point(point, f, 0, 0)
parent.mover = f
if postdrag ~= nil and type(postdrag) == 'function' then
f:RegisterEvent('PLAYER_ENTERING_WORLD')
......@@ -316,18 +329,8 @@ function E:CalculateMoverPoints(mover, nudgeX, nudgeY)
return x, y, point, nudgePoint, nudgeInversePoint
end
function E:UpdatePositionOverride(name)
local frame = _G[name]
local OnDragStop = frame and frame.GetScript and frame:GetScript('OnDragStop')
if OnDragStop then OnDragStop(frame) end
end
function E:HasMoverBeenMoved(name)
if E.db.movers and E.db.movers[name] then
return true
else
return false
end
return E.db.movers and E.db.movers[name]
end
function E:SaveMoverPosition(name)
......@@ -342,38 +345,60 @@ function E:SaveMoverPosition(name)
end
function E:SetMoverSnapOffset(name, offset)
if not _G[name] or not E.CreatedMovers[name] then return end
E.CreatedMovers[name].mover.snapOffset = offset or -2
E.CreatedMovers[name].snapoffset = offset or -2
local mover = _G[name] and E.CreatedMovers[name]
if not mover then return end
mover.mover.snapOffset = offset or -2
mover.snapoffset = offset or -2
end
function E:SaveMoverDefaultPosition(name)
if not _G[name] then return end
local mover = _G[name] and E.CreatedMovers[name]
if not mover then return end
E.CreatedMovers[name].point = GetPoint(_G[name])
E.CreatedMovers[name].postdrag(_G[name], E:GetScreenQuadrant(_G[name]))
if E.LayoutMoverPositions[E.db.layoutSetting] and E.LayoutMoverPositions[E.db.layoutSetting][name] then
mover.point = E.LayoutMoverPositions[E.db.layoutSetting][name]
elseif E.LayoutMoverPositions.ALL[name] then
mover.point = E.LayoutMoverPositions.ALL[name]
else
mover.point = GetPoint(_G[name])
end
if mover.postdrag then
mover.postdrag(_G[name], E:GetScreenQuadrant(_G[name]))
end
end
function E:CreateMover(parent, name, text, overlay, snapoffset, postdrag, moverTypes, shouldDisable, configString)
if not moverTypes then moverTypes = 'ALL,GENERAL' end
if E.CreatedMovers[name] == nil then
E.CreatedMovers[name] = {}
E.CreatedMovers[name].parent = parent
E.CreatedMovers[name].text = text
E.CreatedMovers[name].overlay = overlay
E.CreatedMovers[name].postdrag = postdrag
E.CreatedMovers[name].snapoffset = snapoffset
E.CreatedMovers[name].point = GetPoint(parent)
E.CreatedMovers[name].shouldDisable = shouldDisable
E.CreatedMovers[name].configString = configString
E.CreatedMovers[name].type = {}
local mover = E.CreatedMovers[name]
if mover == nil then
mover = {}
mover.parent = parent
mover.text = text
mover.overlay = overlay
mover.postdrag = postdrag
mover.snapoffset = snapoffset
if E.LayoutMoverPositions[E.db.layoutSetting] and E.LayoutMoverPositions[E.db.layoutSetting][name] then
mover.point = E.LayoutMoverPositions[E.db.layoutSetting][name]
elseif E.LayoutMoverPositions.ALL[name] then
mover.point = E.LayoutMoverPositions.ALL[name]
else
mover.point = GetPoint(parent)
end
mover.shouldDisable = shouldDisable
mover.configString = configString
mover.type = {}
local types = {split(',', moverTypes)}
for i = 1, #types do
local moverType = types[i]
E.CreatedMovers[name].type[moverType] = true
mover.type[moverType] = true
end
E.CreatedMovers[name] = mover
end
CreateMover(parent, name, text, overlay, snapoffset, postdrag, shouldDisable, configString)
......@@ -383,21 +408,17 @@ function E:ToggleMovers(show, moverType)
self.configMode = show
for name in pairs(E.CreatedMovers) do
if not show then
_G[name]:Hide()
else
if E.CreatedMovers[name].type[moverType] then
if show and E.CreatedMovers[name].type[moverType] then
_G[name]:Show()
else
_G[name]:Hide()
end
end
end
end
function E:DisableMover(name)
if(self.DisabledMovers[name]) then return end
if(not self.CreatedMovers[name]) then
if self.DisabledMovers[name] then return end
if not self.CreatedMovers[name] then
error('mover doesn\'t exist')
end
......@@ -414,8 +435,8 @@ function E:DisableMover(name)
end
function E:EnableMover(name)
if(self.CreatedMovers[name]) then return end
if(not self.DisabledMovers[name]) then
if self.CreatedMovers[name] then return end
if not self.DisabledMovers[name] then
error('mover doesn\'t exist')
end
......@@ -424,12 +445,6 @@ function E:EnableMover(name)
self.CreatedMovers[name][x] = y
end
--Make sure we add anchor information from a potential profile switch
--Commented out, as it created an issue with trying to reset a mover after having used EnableMover on it. Not sure if this code is even needed anymore.
-- if E.db.movers and E.db.movers[name] and type(E.db.movers[name]) == 'string' then
-- self.CreatedMovers[name].point = E.db.movers[name]
-- end