mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
load AlertFrame module
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
local E, L, DF = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local B = E:GetModule("Blizzard");
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
local pairs = pairs
|
||||
--WoW API / Variables
|
||||
local NUM_GROUP_LOOT_FRAMES = NUM_GROUP_LOOT_FRAMES
|
||||
|
||||
local AlertFrameHolder = CreateFrame("Frame", "AlertFrameHolder", E.UIParent)
|
||||
AlertFrameHolder:SetWidth(250)
|
||||
AlertFrameHolder:SetHeight(20)
|
||||
AlertFrameHolder:SetPoint("TOP", E.UIParent, "TOP", 0, -18)
|
||||
|
||||
function E:PostAlertMove()
|
||||
local position = "TOP"
|
||||
local _, y = AlertFrameMover:GetCenter()
|
||||
local screenHeight = E.UIParent:GetTop()
|
||||
if y > (screenHeight / 2) then
|
||||
position = "TOP"
|
||||
AlertFrameMover:SetText(AlertFrameMover.textString .. " [Grow Down]")
|
||||
else
|
||||
position = "BOTTOM"
|
||||
AlertFrameMover:SetText(AlertFrameMover.textString .. " [Grow Up]")
|
||||
end
|
||||
|
||||
local rollBars = E:GetModule("Misc").RollBars
|
||||
if E.private.general.lootRoll then
|
||||
local lastframe, lastShownFrame
|
||||
for i, frame in pairs(rollBars) do
|
||||
frame:ClearAllPoints()
|
||||
if i ~= 1 then
|
||||
if position == "TOP" then
|
||||
frame:SetPoint("TOP", lastframe, "BOTTOM", 0, -4)
|
||||
else
|
||||
frame:SetPoint("BOTTOM", lastframe, "TOP", 0, 4)
|
||||
end
|
||||
else
|
||||
if position == "TOP" then
|
||||
frame:SetPoint("TOP", AlertFrameHolder, "BOTTOM", 0, -4)
|
||||
else
|
||||
frame:SetPoint("BOTTOM", AlertFrameHolder, "TOP", 0, 4)
|
||||
end
|
||||
end
|
||||
lastframe = frame
|
||||
|
||||
if frame:IsShown() then
|
||||
lastShownFrame = frame
|
||||
end
|
||||
end
|
||||
elseif E.private.skins.blizzard.enable and E.private.skins.blizzard.lootRoll then
|
||||
local lastframe, lastShownFrame
|
||||
for i = 1, NUM_GROUP_LOOT_FRAMES do
|
||||
local frame = _G["GroupLootFrame" .. i]
|
||||
if frame then
|
||||
frame:ClearAllPoints()
|
||||
if i ~= 1 then
|
||||
if position == "TOP" then
|
||||
frame:SetPoint("TOP", lastframe, "BOTTOM", 0, -4)
|
||||
else
|
||||
frame:SetPoint("BOTTOM", lastframe, "TOP", 0, 4)
|
||||
end
|
||||
else
|
||||
if position == "TOP" then
|
||||
frame:SetPoint("TOP", AlertFrameHolder, "BOTTOM", 0, -4)
|
||||
else
|
||||
frame:SetPoint("BOTTOM", AlertFrameHolder, "TOP", 0, 4)
|
||||
end
|
||||
end
|
||||
lastframe = frame
|
||||
|
||||
if frame:IsShown() then
|
||||
lastShownFrame = frame
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function B:AlertMovers()
|
||||
E:CreateMover(AlertFrameHolder, "AlertFrameMover", L["Loot / Alert Frames"], nil, nil, E.PostAlertMove)
|
||||
end
|
||||
@@ -13,7 +13,7 @@ local GetRewardSpell = GetRewardSpell
|
||||
E.Blizzard = B
|
||||
|
||||
function B:Initialize()
|
||||
-- self:AlertMovers()
|
||||
self:AlertMovers()
|
||||
self:EnhanceColorPicker()
|
||||
-- self:KillBlizzard()
|
||||
self:PositionCaptureBar()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="Blizzard.lua"/>
|
||||
<Script file="AlertFrame.lua"/>
|
||||
<Script file="ColorPicker.lua"/>
|
||||
<Script file="WatchFrame.lua"/>
|
||||
<Script file="CaptureBar.lua"/>
|
||||
|
||||
Reference in New Issue
Block a user