From cd34a8587439872ce819bc5199fa4283904a5deb Mon Sep 17 00:00:00 2001 From: Crum Date: Sat, 13 Jan 2018 23:28:23 -0600 Subject: [PATCH] load CaptureBar module --- .../5/6/7/ElvUI/Modules/Blizzard/Blizzard.lua | 2 +- .../6/7/ElvUI/Modules/Blizzard/CaptureBar.lua | 66 +++++++++++++++++++ .../7/ElvUI/Modules/Blizzard/ColorPicker.lua | 4 +- .../ElvUI/Modules/Blizzard/Load_Blizzard.xml | 1 + 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 2/3/4/5/6/7/ElvUI/Modules/Blizzard/CaptureBar.lua diff --git a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Blizzard.lua b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Blizzard.lua index aac5dc9..e9fd2cb 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Blizzard.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Blizzard.lua @@ -16,7 +16,7 @@ function B:Initialize() -- self:AlertMovers() self:EnhanceColorPicker() -- self:KillBlizzard() - -- self:PositionCaptureBar() + self:PositionCaptureBar() -- self:PositionDurabilityFrame() -- self:PositionGMFrames() self:MoveWatchFrame() diff --git a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/CaptureBar.lua b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/CaptureBar.lua new file mode 100644 index 0000000..3c39bee --- /dev/null +++ b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/CaptureBar.lua @@ -0,0 +1,66 @@ +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 +--WoW API / Variables + +local pvpHolder = CreateFrame("Frame", "PvPHolder", E.UIParent) + +function B:WorldStateAlwaysUpFrame_Update() + local captureBar + for i = 1, NUM_EXTENDED_UI_FRAMES do + captureBar = _G["WorldStateCaptureBar" .. i] + if captureBar and captureBar:IsShown() then + captureBar:ClearAllPoints() + captureBar:SetPoint("TOP", WorldStateAlwaysUpFrame, "BOTTOM", 0, -80) + end + end + + WorldStateAlwaysUpFrame:ClearAllPoints() + WorldStateAlwaysUpFrame:SetPoint("CENTER", pvpHolder, "CENTER", 0, 10) + + if AlwaysUpFrame1 then + AlwaysUpFrame1:ClearAllPoints() + AlwaysUpFrame1:SetPoint("CENTER", WorldStateAlwaysUpFrame, "CENTER", 0, 0) + end + + if AlwaysUpFrame2 then + AlwaysUpFrame2:SetPoint("TOP", AlwaysUpFrame1, "BOTTOM", 0, -5) + end + + local offset = 0 + + for i = 1, NUM_ALWAYS_UP_UI_FRAMES do + local frameText = _G["AlwaysUpFrame"..i.."Text"] + local frameIcon = _G["AlwaysUpFrame"..i.."Icon"] + local frameIcon2 = _G["AlwaysUpFrame"..i.."DynamicIconButton"] + + frameText:ClearAllPoints() + frameText:SetPoint("CENTER", WorldStateAlwaysUpFrame, "CENTER", 0, offset) + frameText:SetJustifyH("CENTER") + + frameIcon:ClearAllPoints() + frameIcon:SetPoint("CENTER", frameText, "LEFT", -7, -9) + frameIcon:SetWidth(38) + frameIcon:SetHeight(38) + + frameIcon2:ClearAllPoints() + frameIcon2:SetPoint("LEFT", frameText, "RIGHT", 5, 0) + frameIcon2:SetWidth(38) + frameIcon2:SetHeight(38) + + offset = offset - 25 + end +end + +function B:PositionCaptureBar() + self:SecureHook("WorldStateAlwaysUpFrame_Update") + + pvpHolder:SetWidth(30) + pvpHolder:SetHeight(70) + pvpHolder:SetPoint("TOP", E.UIParent, "TOP", 0, -4) + + E:CreateMover(pvpHolder, "PvPMover", L["PvP"], nil, nil, nil, "ALL") +end \ No newline at end of file diff --git a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/ColorPicker.lua b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/ColorPicker.lua index 2b0a2e8..2fccdf1 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/ColorPicker.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/ColorPicker.lua @@ -5,10 +5,12 @@ local E, L, DF = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, local B = E:GetModule("Blizzard"); local S = E:GetModule("Skins"); +--Cache global variables +--Lua functions local tonumber, collectgarbage = tonumber, collectgarbage local floor = math.floor local format = string.format - +--WoW API / Variables local CreateFrame = CreateFrame local RAID_CLASS_COLORS = RAID_CLASS_COLORS local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS diff --git a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Load_Blizzard.xml b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Load_Blizzard.xml index bd9d425..6482cab 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Load_Blizzard.xml +++ b/2/3/4/5/6/7/ElvUI/Modules/Blizzard/Load_Blizzard.xml @@ -2,4 +2,5 @@