Commit f22a3efc authored by Simpy's avatar Simpy 🐹

11.34

parents 7eb26b53 e3c2c860
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
------------------------------------------------------------------------ ------------------------------------------------------------------------
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB 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 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}} 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) ...@@ -18,6 +18,29 @@ function E:RandomAnimShake(index)
return random(s[1], s[2]), random(s[3], s[4]) return random(s[1], s[2]), random(s[3], s[4])
end 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, ...) function E:SetUpAnimGroup(obj, Type, ...)
if not Type then Type = 'Flash' end if not Type then Type = 'Flash' end
...@@ -59,6 +82,29 @@ function E:SetUpAnimGroup(obj, Type, ...) ...@@ -59,6 +82,29 @@ function E:SetUpAnimGroup(obj, Type, ...)
shake.path[i]:SetOffset(E.AnimShakeH[i], 0) shake.path[i]:SetOffset(E.AnimShakeH[i], 0)
end end
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 else
local x, y, duration, customName = ... local x, y, duration, customName = ...
if not customName then customName = 'anim' end if not customName then customName = 'anim' end
...@@ -88,6 +134,22 @@ function E:SetUpAnimGroup(obj, Type, ...) ...@@ -88,6 +134,22 @@ function E:SetUpAnimGroup(obj, Type, ...)
end end
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) function E:Shake(obj)
if not obj.shake then if not obj.shake then
E:SetUpAnimGroup(obj, 'Shake') E:SetUpAnimGroup(obj, 'Shake')
......
This diff is collapsed.
...@@ -51,6 +51,7 @@ local LSM = E.Libs.LSM ...@@ -51,6 +51,7 @@ local LSM = E.Libs.LSM
--Constants --Constants
E.noop = function() end E.noop = function() end
E.title = format('|cfffe7b2c%s |r', 'ElvUI') E.title = format('|cfffe7b2c%s |r', 'ElvUI')
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player') E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player')
E.mylevel = UnitLevel('player') E.mylevel = UnitLevel('player')
E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player') E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player')
...@@ -58,13 +59,12 @@ E.myLocalizedRace, E.myrace = UnitRace('player') ...@@ -58,13 +59,12 @@ E.myLocalizedRace, E.myrace = UnitRace('player')
E.myname = UnitName('player') E.myname = UnitName('player')
E.myrealm = GetRealmName() E.myrealm = GetRealmName()
E.myspec = GetSpecialization() E.myspec = GetSpecialization()
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.wowpatch, E.wowbuild = GetBuildInfo() E.wowpatch, E.wowbuild = GetBuildInfo()
E.wowbuild = tonumber(E.wowbuild) E.wowbuild = tonumber(E.wowbuild)
E.isMacClient = IsMacClient()
E.IsRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE E.IsRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
E.screenwidth, E.screenheight = GetPhysicalScreenSize() E.screenwidth, E.screenheight = GetPhysicalScreenSize()
E.resolution = format('%dx%d', E.screenwidth, E.screenheight) 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.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.TexturePath = 'Interface\\AddOns\\ElvUI\\Media\\Textures\\' -- for plugins?
E.InfoColor = '|cfffe7b2c' E.InfoColor = '|cfffe7b2c'
...@@ -925,7 +925,7 @@ function E:UpdateNamePlates(skipCallback) ...@@ -925,7 +925,7 @@ function E:UpdateNamePlates(skipCallback)
end end
function E:UpdateTooltip() function E:UpdateTooltip()
-- for plugins :3 Tooltip:SetTooltipFonts()
end end
function E:UpdateBags(skipCallback) function E:UpdateBags(skipCallback)
...@@ -1063,6 +1063,9 @@ do ...@@ -1063,6 +1063,9 @@ do
if E.private.chat.enable then if E.private.chat.enable then
tinsert(staggerTable, 'UpdateChat') tinsert(staggerTable, 'UpdateChat')
end end
if E.private.tooltip.enable then
tinsert(staggerTable, 'UpdateTooltip')
end
tinsert(staggerTable, 'UpdateDataBars') tinsert(staggerTable, 'UpdateDataBars')
tinsert(staggerTable, 'UpdateDataTexts') tinsert(staggerTable, 'UpdateDataTexts')
if E.private.general.minimap.enable then if E.private.general.minimap.enable then
...@@ -1278,12 +1281,11 @@ function E:InitializeModules() ...@@ -1278,12 +1281,11 @@ function E:InitializeModules()
end end
local function buffwatchConvert(spell) local function buffwatchConvert(spell)
if spell.sizeOverride then if spell.sizeOverride then spell.sizeOverride = nil end
local newSize = spell.sizeOverride if spell.size then spell.size = nil end
spell.size = (newSize > 8 and newSize) or 8
spell.sizeOverride = nil if not spell.sizeOffset then
elseif not spell.size or spell.size < 6 then spell.sizeOffset = 0
spell.size = 6
end end
if spell.styleOverride then if spell.styleOverride then
...@@ -1500,6 +1502,15 @@ function E:DBConversions() ...@@ -1500,6 +1502,15 @@ function E:DBConversions()
for _, spell in pairs(E.db.unitframe.filters.buffwatch) do for _, spell in pairs(E.db.unitframe.filters.buffwatch) do
buffwatchConvert(spell) buffwatchConvert(spell)
end 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 end
function E:RefreshModulesDB() function E:RefreshModulesDB()
...@@ -1514,6 +1525,9 @@ function E:Initialize() ...@@ -1514,6 +1525,9 @@ function E:Initialize()
twipe(self.global) twipe(self.global)
twipe(self.private) twipe(self.private)
LSM.DefaultMedia.font = 'PT Sans Narrow'
LSM.DefaultMedia.statusbar = 'ElvUI Norm'
self.myguid = UnitGUID('player') self.myguid = UnitGUID('player')
self.data = E.Libs.AceDB:New('ElvDB', self.DF) self.data = E.Libs.AceDB:New('ElvDB', self.DF)
self.data.RegisterCallback(self, 'OnProfileChanged', 'StaggeredUpdateAll') self.data.RegisterCallback(self, 'OnProfileChanged', 'StaggeredUpdateAll')
......
...@@ -7,6 +7,7 @@ local S = E:GetModule('Skins') ...@@ -7,6 +7,7 @@ local S = E:GetModule('Skins')
local _G = _G local _G = _G
local gsub = gsub local gsub = gsub
local format = format local format = format
local pairs = pairs
local ipairs = ipairs local ipairs = ipairs
local tinsert = tinsert local tinsert = tinsert
--WoW API / Variables --WoW API / Variables
...@@ -294,43 +295,13 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg) ...@@ -294,43 +295,13 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.general.totems.growthDirection = 'HORIZONTAL' E.db.general.totems.growthDirection = 'HORIZONTAL'
E.db.general.totems.size = 50 E.db.general.totems.size = 50
E.db.general.totems.spacing = 8 E.db.general.totems.spacing = 8
--Movers --Movers
E.db.movers.AlertFrameMover = 'TOP,ElvUIParent,TOP,-1,-18' for mover, position in pairs(E.LayoutMoverPositions["ALL"]) do
E.db.movers.AltPowerBarMover = 'TOP,ElvUIParent,TOP,-1,-36' E.db.movers[mover] = position
E.db.movers.AzeriteBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-245' E:SaveMoverDefaultPosition(mover)
E.db.movers.BelowMinimapContainerMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-4,-274' end
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'
--Tooltip --Tooltip
E.db.tooltip.fontSize = 10 E.db.tooltip.fontSize = 10
E.db.tooltip.healthBar.fontOutline = 'MONOCHROMEOUTLINE' E.db.tooltip.healthBar.fontOutline = 'MONOCHROMEOUTLINE'
...@@ -443,23 +414,21 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg) ...@@ -443,23 +414,21 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
Layout Tweaks will be handled below, Layout Tweaks will be handled below,
These are changes that deviate from the shared base layout. 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 if layout == 'healer' 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'
E.db.unitframe.units.party.enable = false E.db.unitframe.units.party.enable = false
E.db.unitframe.units.raid.visibility = '[nogroup] hide;show' E.db.unitframe.units.raid.visibility = '[nogroup] hide;show'
end end
end end
E:StaggeredUpdateAll(nil, true) E:StaggeredUpdateAll(nil, true)
E.db.layoutSetting = layout
if _G.InstallStepComplete and not noDisplayMsg then if _G.InstallStepComplete and not noDisplayMsg then
_G.InstallStepComplete.message = L["Layout Set"] _G.InstallStepComplete.message = L["Layout Set"]
...@@ -473,8 +442,7 @@ local function SetupAuras(style, noDisplayMsg) ...@@ -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.debuffs, P.unitframe.units.player.debuffs)
E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar) E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar)
if frame then if frame then
UF:Configure_Auras(frame, 'Buffs') UF:Configure_AllAuras(frame)
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AuraBars(frame) UF:Configure_AuraBars(frame)
end end
...@@ -483,8 +451,7 @@ local function SetupAuras(style, noDisplayMsg) ...@@ -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.debuffs, P.unitframe.units.target.debuffs)
E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar) E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar)
if frame then if frame then
UF:Configure_Auras(frame, 'Buffs') UF:Configure_AllAuras(frame)
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AuraBars(frame) UF:Configure_AuraBars(frame)
end end
...@@ -493,8 +460,7 @@ local function SetupAuras(style, noDisplayMsg) ...@@ -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.debuffs, P.unitframe.units.focus.debuffs)
E:CopyTable(E.db.unitframe.units.focus.aurabar, P.unitframe.units.focus.aurabar) E:CopyTable(E.db.unitframe.units.focus.aurabar, P.unitframe.units.focus.aurabar)
if frame then if frame then
UF:Configure_Auras(frame, 'Buffs') UF:Configure_AllAuras(frame)
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AuraBars(frame) UF:Configure_AuraBars(frame)
end end
......
<Ui xmlns="http://www.blizzard.com/wow/ui/"> <Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file='Patch.lua'/>
<Script file='Core.lua'/> <Script file='Core.lua'/>
<Script file='Math.lua'/> <Script file='Math.lua'/>
<Script file='API.lua'/> <Script file='API.lua'/>
......
...@@ -62,12 +62,15 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -62,12 +62,15 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local f = CreateFrame('Button', name, E.UIParent) local f = CreateFrame('Button', name, E.UIParent)
f:SetClampedToScreen(true) f:SetClampedToScreen(true)
f:RegisterForDrag('LeftButton', 'RightButton') f:RegisterForDrag('LeftButton', 'RightButton')
f:SetFrameLevel(parent:GetFrameLevel() + 1)
f:SetFrameStrata(overlay and 'DIALOG' or 'BACKGROUND')
f:EnableMouseWheel(true) f:EnableMouseWheel(true)
f:SetMovable(true) f:SetMovable(true)
f:Width(width)
f:Height(height)
f:SetTemplate('Transparent', nil, nil, true) f:SetTemplate('Transparent', nil, nil, true)
f:Height(height)
f:Width(width)
f:Hide() f:Hide()
f.parent = parent f.parent = parent
f.name = name f.name = name
f.textString = text f.textString = text
...@@ -77,13 +80,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -77,13 +80,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
f.shouldDisable = shouldDisable f.shouldDisable = shouldDisable
f.configString = configString 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.CreatedMovers[name].mover = f
E.snapBars[#E.snapBars+1] = f E.snapBars[#E.snapBars+1] = f
...@@ -122,6 +118,10 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -122,6 +118,10 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnDragStart(self) local function OnDragStart(self)
if InCombatLockdown() then E:Print(ERR_NOT_IN_COMBAT) return end 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 if E.db.general.stickyFrames then
Sticky:StartMoving(self, E.snapBars, f.snapOffset, f.snapOffset, f.snapOffset, f.snapOffset) Sticky:StartMoving(self, E.snapBars, f.snapOffset, f.snapOffset, f.snapOffset, f.snapOffset)
else else
...@@ -135,7 +135,13 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -135,7 +135,13 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnDragStop(self) local function OnDragStop(self)
if InCombatLockdown() then E:Print(ERR_NOT_IN_COMBAT) return end 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 isDragging = false
if E.db.general.stickyFrames then if E.db.general.stickyFrames then
Sticky:StopMoving(self) Sticky:StopMoving(self)
else else
...@@ -161,10 +167,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -161,10 +167,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
E:SaveMoverPosition(name) E:SaveMoverPosition(name)
if ElvUIMoverNudgeWindow then
E:UpdateNudgeFrame(self, x, y)
end
coordFrame.child = nil coordFrame.child = nil
coordFrame:Hide() coordFrame:Hide()
...@@ -177,27 +179,43 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -177,27 +179,43 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
local function OnEnter(self) local function OnEnter(self)
if isDragging then return end 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) self.text:SetTextColor(1, 1, 1)
E.AssignFrameToNudge(self) E.AssignFrameToNudge(self)
coordFrame.child = self coordFrame.child = self
coordFrame:GetScript('OnUpdate')(coordFrame) coordFrame:GetScript('OnUpdate')(coordFrame)
end 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 button == 'LeftButton' and not isDragging then
if ElvUIMoverNudgeWindow:IsShown() then if ElvUIMoverNudgeWindow:IsShown() then
ElvUIMoverNudgeWindow:Hide() ElvUIMoverNudgeWindow:Hide()
else else
ElvUIMoverNudgeWindow:Show() ElvUIMoverNudgeWindow:Show()
end end
elseif button == 'RightButton' then end
isDragging = false end
if E.db.general.stickyFrames then
Sticky:StopMoving(self)
else
self:StopMovingOrSizing()
end
local function OnMouseDown(self, button)
if button == 'RightButton' then
--Allow resetting of anchor by Ctrl+RightClick --Allow resetting of anchor by Ctrl+RightClick
if IsControlKeyDown() and self.textString then if IsControlKeyDown() and self.textString then
E:ResetMovers(self.textString) E:ResetMovers(self.textString)
...@@ -209,11 +227,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -209,11 +227,6 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
end end
end end
local function OnLeave(self)
if isDragging then return end
self.text:SetTextColor(unpack(E.media.rgbvaluecolor))
end
local function OnShow(self) local function OnShow(self)
self:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor)) self:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor))
end end
...@@ -230,16 +243,16 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh ...@@ -230,16 +243,16 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
f:SetScript('OnMouseUp', E.AssignFrameToNudge) f:SetScript('OnMouseUp', E.AssignFrameToNudge)
f:SetScript('OnDragStop', OnDragStop) f:SetScript('OnDragStop', OnDragStop)
f:SetScript('OnEnter', OnEnter) f:SetScript('OnEnter', OnEnter)
f:SetScript('OnMouseUp', OnMouseUp)
f:SetScript('OnMouseDown', OnMouseDown) f:SetScript('OnMouseDown', OnMouseDown)
f:SetScript('OnLeave', OnLeave) f:SetScript('OnLeave', OnLeave)
f:SetScript('OnShow', OnShow) f:SetScript('OnShow', OnShow)
f:SetScript('OnMouseWheel', OnMouseWheel) f:SetScript('OnMouseWheel', OnMouseWheel)
parent:SetScript('OnSizeChanged', SizeChanged) parent: