mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
Merge branch 'auras-work' of https://github.com/ElvUI-Vanilla/ElvUI into auras-work
This commit is contained in:
@@ -11,9 +11,8 @@ local GetInventoryItemDurability = GetInventoryItemDurability
|
||||
local GetInventoryItemTexture = GetInventoryItemTexture
|
||||
local GetInventorySlotInfo = GetInventorySlotInfo
|
||||
local ToggleCharacter = ToggleCharacter
|
||||
local DURABILITY_TEMPLATE = string.gsub(DURABILITY_TEMPLATE, "%%d / %%d", "(%%d+) / (%%d+)")
|
||||
|
||||
local DURABILITY = "Durability" -- Neel ElvUI locale
|
||||
local DURABILITY = "Durability"
|
||||
|
||||
local displayString = ""
|
||||
local tooltipString = "%d%%"
|
||||
@@ -34,26 +33,6 @@ local slots = {
|
||||
"HeadSlot"
|
||||
}
|
||||
|
||||
local scan
|
||||
local function GetInventoryItemDurability(slot)
|
||||
if not GetInventoryItemTexture("player", slot) then return nil, nil end
|
||||
|
||||
if not scan then
|
||||
scan = CreateFrame("GameTooltip", "DurabilityScan", nil, "ShoppingTooltipTemplate")
|
||||
scan:SetOwner(UIParent, "ANCHOR_NONE")
|
||||
end
|
||||
|
||||
scan:ClearLines()
|
||||
scan:SetInventoryItem("player", slot)
|
||||
|
||||
for i = 4, scan:NumLines() do
|
||||
local text = _G[scan:GetName().."TextLeft"..i]:GetText()
|
||||
for durability, max in string.gfind(text, DURABILITY_TEMPLATE) do
|
||||
return tonumber(durability), tonumber(max)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function OnEvent(self, t)
|
||||
lastPanel = self
|
||||
totalDurability = 100
|
||||
|
||||
@@ -48,15 +48,15 @@ end
|
||||
|
||||
function M:GetLocTextColor()
|
||||
local pvpType = GetZonePVPInfo()
|
||||
if(pvpType == "sanctuary") then
|
||||
if pvpType == "sanctuary" then
|
||||
return 0.035, 0.58, 0.84
|
||||
elseif(pvpType == "arena") then
|
||||
elseif pvpType == "arena" then
|
||||
return 0.84, 0.03, 0.03
|
||||
elseif(pvpType == "friendly") then
|
||||
elseif pvpType == "friendly" then
|
||||
return 0.05, 0.85, 0.03
|
||||
elseif(pvpType == "hostile") then
|
||||
elseif pvpType == "hostile" then
|
||||
return 0.84, 0.03, 0.03
|
||||
elseif(pvpType == "contested") then
|
||||
elseif pvpType == "contested" then
|
||||
return 0.9, 0.85, 0.05
|
||||
else
|
||||
return 0.84, 0.03, 0.03
|
||||
@@ -104,7 +104,7 @@ local function ResetZoom()
|
||||
isResetting = false
|
||||
end
|
||||
local function SetupZoomReset()
|
||||
if(E.db.general.minimap.resetZoom.enable and not isResetting) then
|
||||
if E.db.general.minimap.resetZoom.enable and not isResetting then
|
||||
isResetting = true
|
||||
E:Delay(E.db.general.minimap.resetZoom.time, ResetZoom)
|
||||
end
|
||||
@@ -120,8 +120,8 @@ function M:UpdateSettings()
|
||||
Minimap:SetScale(E.MinimapSize / 140)
|
||||
end
|
||||
|
||||
if(LeftMiniPanel and RightMiniPanel) then
|
||||
if(E.db.datatexts.minimapPanels and E.private.general.minimap.enable) then
|
||||
if LeftMiniPanel and RightMiniPanel then
|
||||
if E.db.datatexts.minimapPanels and E.private.general.minimap.enable then
|
||||
LeftMiniPanel:Show()
|
||||
RightMiniPanel:Show()
|
||||
else
|
||||
@@ -130,48 +130,48 @@ function M:UpdateSettings()
|
||||
end
|
||||
end
|
||||
|
||||
if(BottomMiniPanel) then
|
||||
if(E.db.datatexts.minimapBottom and E.private.general.minimap.enable) then
|
||||
if BottomMiniPanel then
|
||||
if E.db.datatexts.minimapBottom and E.private.general.minimap.enable then
|
||||
BottomMiniPanel:Show()
|
||||
else
|
||||
BottomMiniPanel:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if(BottomLeftMiniPanel) then
|
||||
if(E.db.datatexts.minimapBottomLeft and E.private.general.minimap.enable) then
|
||||
if BottomLeftMiniPanel then
|
||||
if E.db.datatexts.minimapBottomLeft and E.private.general.minimap.enable then
|
||||
BottomLeftMiniPanel:Show()
|
||||
else
|
||||
BottomLeftMiniPanel:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if(BottomRightMiniPanel) then
|
||||
if(E.db.datatexts.minimapBottomRight and E.private.general.minimap.enable) then
|
||||
if BottomRightMiniPanel then
|
||||
if E.db.datatexts.minimapBottomRight and E.private.general.minimap.enable then
|
||||
BottomRightMiniPanel:Show()
|
||||
else
|
||||
BottomRightMiniPanel:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if(TopMiniPanel) then
|
||||
if(E.db.datatexts.minimapTop and E.private.general.minimap.enable) then
|
||||
if TopMiniPanel then
|
||||
if E.db.datatexts.minimapTop and E.private.general.minimap.enable then
|
||||
TopMiniPanel:Show()
|
||||
else
|
||||
TopMiniPanel:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if(TopLeftMiniPanel) then
|
||||
if(E.db.datatexts.minimapTopLeft and E.private.general.minimap.enable) then
|
||||
if TopLeftMiniPanel then
|
||||
if E.db.datatexts.minimapTopLeft and E.private.general.minimap.enable then
|
||||
TopLeftMiniPanel:Show()
|
||||
else
|
||||
TopLeftMiniPanel:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
if(TopRightMiniPanel) then
|
||||
if(E.db.datatexts.minimapTopRight and E.private.general.minimap.enable) then
|
||||
if TopRightMiniPanel then
|
||||
if E.db.datatexts.minimapTopRight and E.private.general.minimap.enable then
|
||||
TopRightMiniPanel:Show()
|
||||
else
|
||||
TopRightMiniPanel:Hide()
|
||||
@@ -179,19 +179,19 @@ function M:UpdateSettings()
|
||||
end
|
||||
|
||||
if MMHolder then
|
||||
MMHolder:SetWidth(E.MinimapWidth + E.Border + E.Spacing*3)
|
||||
E:Width(MMHolder, E.MinimapWidth + E.Border + E.Spacing*3)
|
||||
|
||||
if E.db.datatexts.minimapPanels then
|
||||
MMHolder:SetHeight(E.MinimapHeight + (LeftMiniPanel and (LeftMiniPanel:GetHeight() + E.Border) or 24) + E.Spacing*3)
|
||||
E:Height(MMHolder, E.MinimapHeight + (LeftMiniPanel and (LeftMiniPanel:GetHeight() + E.Border) or 24) + E.Spacing*3)
|
||||
else
|
||||
MMHolder:SetHeight(E.MinimapHeight + E.Border + E.Spacing*3)
|
||||
E:Height(MMHolder, E.MinimapHeight + E.Border + E.Spacing*3)
|
||||
end
|
||||
end
|
||||
|
||||
if Minimap.location then
|
||||
Minimap.location:SetWidth(E.MinimapSize)
|
||||
E:Width(Minimap.location, E.MinimapSize)
|
||||
|
||||
if(E.db.general.minimap.locationText ~= "SHOW" or not E.private.general.minimap.enable) then
|
||||
if E.db.general.minimap.locationText ~= "SHOW" or not E.private.general.minimap.enable then
|
||||
Minimap.location:Hide()
|
||||
else
|
||||
Minimap.location:Show()
|
||||
@@ -199,8 +199,7 @@ function M:UpdateSettings()
|
||||
end
|
||||
|
||||
if MinimapMover then
|
||||
MinimapMover:SetWidth(MMHolder:GetWidth())
|
||||
MinimapMover:SetHeight(MMHolder:GetHeight())
|
||||
E:Size(MinimapMover, MMHolder:GetWidth(), MMHolder:GetHeight())
|
||||
end
|
||||
|
||||
if GameTimeFrame then
|
||||
@@ -210,7 +209,7 @@ function M:UpdateSettings()
|
||||
local pos = E.db.general.minimap.icons.calendar.position or "TOPRIGHT"
|
||||
local scale = E.db.general.minimap.icons.calendar.scale or 1
|
||||
GameTimeFrame:ClearAllPoints()
|
||||
GameTimeFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.calendar.xOffset or 0, E.db.general.minimap.icons.calendar.yOffset or 0)
|
||||
E:Point(GameTimeFrame, pos, Minimap, pos, E.db.general.minimap.icons.calendar.xOffset or 0, E.db.general.minimap.icons.calendar.yOffset or 0)
|
||||
GameTimeFrame:SetScale(scale)
|
||||
GameTimeFrame:Show()
|
||||
end
|
||||
@@ -220,7 +219,7 @@ function M:UpdateSettings()
|
||||
local pos = E.db.general.minimap.icons.mail.position or "TOPRIGHT"
|
||||
local scale = E.db.general.minimap.icons.mail.scale or 1
|
||||
MiniMapMailFrame:ClearAllPoints()
|
||||
MiniMapMailFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.mail.xOffset or 3, E.db.general.minimap.icons.mail.yOffset or 4)
|
||||
E:Point(MiniMapMailFrame, pos, Minimap, pos, E.db.general.minimap.icons.mail.xOffset or 3, E.db.general.minimap.icons.mail.yOffset or 4)
|
||||
MiniMapMailFrame:SetScale(scale)
|
||||
end
|
||||
|
||||
@@ -228,7 +227,7 @@ function M:UpdateSettings()
|
||||
local pos = E.db.general.minimap.icons.battlefield.position or "BOTTOMRIGHT"
|
||||
local scale = E.db.general.minimap.icons.battlefield.scale or 1
|
||||
MiniMapBattlefieldFrame:ClearAllPoints()
|
||||
MiniMapBattlefieldFrame:SetPoint(pos, Minimap, pos, E.db.general.minimap.icons.battlefield.xOffset or 3, E.db.general.minimap.icons.battlefield.yOffset or 0)
|
||||
E:Point(MiniMapBattlefieldFrame, pos, Minimap, pos, E.db.general.minimap.icons.battlefield.xOffset or 3, E.db.general.minimap.icons.battlefield.yOffset or 0)
|
||||
MiniMapBattlefieldFrame:SetScale(scale)
|
||||
end
|
||||
|
||||
@@ -238,7 +237,7 @@ function M:UpdateSettings()
|
||||
local x = E.db.general.minimap.icons.difficulty.xOffset or 0
|
||||
local y = E.db.general.minimap.icons.difficulty.yOffset or 0
|
||||
MiniMapInstanceDifficulty:ClearAllPoints()
|
||||
MiniMapInstanceDifficulty:SetPoint(pos, Minimap, pos, x, y)
|
||||
E:Point(MiniMapInstanceDifficulty, pos, Minimap, pos, x, y)
|
||||
MiniMapInstanceDifficulty:SetScale(scale)
|
||||
end
|
||||
end
|
||||
@@ -261,11 +260,10 @@ function M:Initialize()
|
||||
end
|
||||
|
||||
local mmholder = CreateFrame("Frame", "MMHolder", UIParent)
|
||||
mmholder:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
|
||||
mmholder:SetWidth(E.MinimapWidth + 29)
|
||||
mmholder:SetHeight(E.MinimapHeight + 53)
|
||||
E:Point(mmholder, "TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
|
||||
E:Size(mmholder, E.MinimapWidth + 29, E.MinimapHeight + 53)
|
||||
Minimap:ClearAllPoints()
|
||||
Minimap:SetPoint("TOPRIGHT", mmholder, "TOPRIGHT", -E.Border, -E.Border)
|
||||
E:Point(Minimap, "TOPRIGHT", mmholder, "TOPRIGHT", -E.Border, -E.Border)
|
||||
|
||||
Minimap:SetMaskTexture("Interface\\ChatFrame\\ChatFrameBackground")
|
||||
Minimap.backdrop = CreateFrame("Frame", nil, UIParent)
|
||||
@@ -289,7 +287,7 @@ function M:Initialize()
|
||||
|
||||
Minimap.location = Minimap:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(Minimap.location, nil, nil, "OUTLINE")
|
||||
Minimap.location:SetPoint("TOP", Minimap, "TOP", 0, -2)
|
||||
E:Point(Minimap.location, "TOP", Minimap, "TOP", 0, -2)
|
||||
Minimap.location:SetJustifyH("CENTER")
|
||||
Minimap.location:SetJustifyV("MIDDLE")
|
||||
if E.db.general.minimap.locationText ~= "SHOW" or not E.private.general.minimap.enable then
|
||||
@@ -323,9 +321,8 @@ function M:Initialize()
|
||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "Update_ZoneText")
|
||||
|
||||
local fm = CreateFrame("Minimap", "FarmModeMap", E.UIParent)
|
||||
fm:SetWidth(E.db.farmSize)
|
||||
fm:SetHeight(E.db.farmSize)
|
||||
fm:SetPoint("TOP", E.UIParent, "TOP", 0, -120)
|
||||
E:Size(fm, E.db.farmSize)
|
||||
E:Point(fm, "TOP", E.UIParent, "TOP", 0, -120)
|
||||
fm:SetClampedToScreen(true)
|
||||
E:CreateBackdrop(fm, "Default")
|
||||
fm:EnableMouseWheel(true)
|
||||
@@ -338,14 +335,14 @@ function M:Initialize()
|
||||
fm:Hide()
|
||||
|
||||
FarmModeMap:SetScript("OnShow", function()
|
||||
if(BuffsMover and not E:HasMoverBeenMoved("BuffsMover")) then
|
||||
if BuffsMover and not E:HasMoverBeenMoved("BuffsMover") then
|
||||
BuffsMover:ClearAllPoints()
|
||||
BuffsMover:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
|
||||
E:Point(BuffsMover, "TOPRIGHT", E.UIParent, "TOPRIGHT", -3, -3)
|
||||
end
|
||||
|
||||
if(DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover")) then
|
||||
if DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover") then
|
||||
DebuffsMover:ClearAllPoints()
|
||||
DebuffsMover:SetPoint("TOPRIGHT", ElvUIPlayerBuffs, "BOTTOMRIGHT", 0, -3)
|
||||
E:Point(DebuffsMover, "TOPRIGHT", ElvUIPlayerBuffs, "BOTTOMRIGHT", 0, -3)
|
||||
end
|
||||
|
||||
MinimapCluster:ClearAllPoints()
|
||||
@@ -353,11 +350,11 @@ function M:Initialize()
|
||||
end)
|
||||
|
||||
FarmModeMap:SetScript("OnHide", function()
|
||||
if(BuffsMover and not E:HasMoverBeenMoved("BuffsMover")) then
|
||||
if BuffsMover and not E:HasMoverBeenMoved("BuffsMover") then
|
||||
E:ResetMovers(L["Player Buffs"])
|
||||
end
|
||||
|
||||
if(DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover")) then
|
||||
if DebuffsMover and not E:HasMoverBeenMoved("DebuffsMover") then
|
||||
E:ResetMovers(L["Player Debuffs"])
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ local AFK = E:NewModule("AFK", "AceEvent-3.0", "AceTimer-3.0");
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
local GetTime = GetTime
|
||||
local floor = math.floor
|
||||
--WoW API / Variables
|
||||
local CinematicFrame = CinematicFrame
|
||||
@@ -14,12 +13,12 @@ local GetBattlefieldStatus = GetBattlefieldStatus
|
||||
local GetGuildInfo = GetGuildInfo
|
||||
local GetScreenHeight = GetScreenHeight
|
||||
local GetScreenWidth = GetScreenWidth
|
||||
local GetTime = GetTime
|
||||
local UnitAffectingCombat = UnitAffectingCombat
|
||||
local IsInGuild = IsInGuild
|
||||
local IsShiftKeyDown = IsShiftKeyDown
|
||||
local Screenshot = Screenshot
|
||||
local SetCVar = SetCVar
|
||||
local UnitFactionGroup = UnitFactionGroup
|
||||
|
||||
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS
|
||||
local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES
|
||||
@@ -284,11 +283,9 @@ function AFK:Initialize()
|
||||
E:Size(self.AFKMode.bottom.logo, 320, 150)
|
||||
E:Point(self.AFKMode.bottom.logo, "CENTER", self.AFKMode.bottom, "CENTER", 0, 50)
|
||||
self.AFKMode.bottom.logo:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\logo")
|
||||
|
||||
local factionGroup = UnitFactionGroup("player")
|
||||
self.AFKMode.bottom.faction = self.AFKMode.bottom:CreateTexture(nil, "OVERLAY")
|
||||
E:Point(self.AFKMode.bottom.faction, "BOTTOMLEFT", self.AFKMode.bottom, "BOTTOMLEFT", -20, -16)
|
||||
self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..factionGroup.."-Logo")
|
||||
self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..E.myfaction.."-Logo")
|
||||
E:Size(self.AFKMode.bottom.faction, 140)
|
||||
|
||||
self.AFKMode.bottom.name = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
local E, L, V, P, G = unpack(ElvUI)
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local UF = E:GetModule("UnitFrames");
|
||||
local ns = oUF
|
||||
local ElvUF = ns.oUF
|
||||
local ns = oUF;
|
||||
local ElvUF = ns.oUF;
|
||||
|
||||
local _G = _G;
|
||||
local setmetatable, getfenv, setfenv = setmetatable, getfenv, setfenv;
|
||||
local type, unpack, select, pairs = type, unpack, select, pairs;
|
||||
local min, random = math.min, math.random;
|
||||
local format = string.format;
|
||||
|
||||
local UnitMana = UnitMana;
|
||||
local UnitManaMax = UnitManaMax;
|
||||
local UnitHealth = UnitHealth;
|
||||
local UnitHealthMax = UnitHealthMax;
|
||||
local UnitName = UnitName;
|
||||
local UnitClass = UnitClass;
|
||||
local InCombatLockdown = InCombatLockdown;
|
||||
local UnregisterUnitWatch = UnregisterUnitWatch;
|
||||
local RegisterUnitWatch = RegisterUnitWatch;
|
||||
local RegisterStateDriver = RegisterStateDriver;
|
||||
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE;
|
||||
local CLASS_SORT_ORDER = CLASS_SORT_ORDER;
|
||||
local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS;
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
local setmetatable, getfenv, setfenv = setmetatable, getfenv, setfenv
|
||||
local type, unpack, select, pairs = type, unpack, select, pairs
|
||||
local min, random = math.min, math.random
|
||||
local format = string.format
|
||||
--WoW API / Variables
|
||||
local UnitMana = UnitMana
|
||||
local UnitManaMax = UnitManaMax
|
||||
local UnitHealth = UnitHealth
|
||||
local UnitHealthMax = UnitHealthMax
|
||||
local UnitName = UnitName
|
||||
local UnitClass = UnitClass
|
||||
local UnitAffectingCombat = UnitAffectingCombat
|
||||
local UnregisterUnitWatch = UnregisterUnitWatch
|
||||
local RegisterUnitWatch = RegisterUnitWatch
|
||||
local RegisterStateDriver = RegisterStateDriver
|
||||
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
|
||||
local CLASS_SORT_ORDER = CLASS_SORT_ORDER
|
||||
local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS
|
||||
|
||||
local attributeBlacklist = {["showRaid"] = true, ["showParty"] = true, ["showSolo"] = true}
|
||||
local configEnv
|
||||
@@ -29,45 +31,45 @@ local originalEnvs = {}
|
||||
local overrideFuncs = {}
|
||||
|
||||
local function createConfigEnv()
|
||||
if( configEnv ) then return end
|
||||
if configEnv then return end
|
||||
configEnv = setmetatable({
|
||||
UnitMana = function (unit, displayType)
|
||||
if(unit:find("target") or unit:find("focus")) then
|
||||
return UnitMana(unit, displayType);
|
||||
if find(unit, "target") or find(unit, "focus") then
|
||||
return UnitMana(unit, displayType)
|
||||
end
|
||||
|
||||
return random(1, UnitManaMax(unit, displayType) or 1);
|
||||
return random(1, UnitManaMax(unit, displayType) or 1)
|
||||
end,
|
||||
UnitHealth = function(unit)
|
||||
if(unit:find("target") or unit:find("focus")) then
|
||||
return UnitHealth(unit);
|
||||
if find(unit, "target") or find(unit, "focus") then
|
||||
return UnitHealth(unit)
|
||||
end
|
||||
|
||||
return random(1, UnitHealthMax(unit));
|
||||
return random(1, UnitHealthMax(unit))
|
||||
end,
|
||||
UnitName = function(unit)
|
||||
if(unit:find("target") or unit:find("focus")) then
|
||||
return UnitName(unit);
|
||||
if find(unit, "target") or find(unit, "focus") then
|
||||
return UnitName(unit)
|
||||
end
|
||||
if(E.CreditsList) then
|
||||
local max = #E.CreditsList;
|
||||
return E.CreditsList[random(1, max)];
|
||||
if E.CreditsList then
|
||||
local max = getn(E.CreditsList)
|
||||
return E.CreditsList[random(1, max)]
|
||||
end
|
||||
return "Test Name";
|
||||
return "Test Name"
|
||||
end,
|
||||
UnitClass = function(unit)
|
||||
if(unit:find("target") or unit:find("focus")) then
|
||||
return UnitClass(unit);
|
||||
if find(unit, "target") or find(unit, "focus") then
|
||||
return UnitClass(unit)
|
||||
end
|
||||
|
||||
local classToken = CLASS_SORT_ORDER[random(1, #(CLASS_SORT_ORDER))];
|
||||
return LOCALIZED_CLASS_NAMES_MALE[classToken], classToken;
|
||||
local classToken = CLASS_SORT_ORDER[random(1, getn(CLASS_SORT_ORDER))]
|
||||
return LOCALIZED_CLASS_NAMES_MALE[classToken], classToken
|
||||
end,
|
||||
Hex = function(r, g, b)
|
||||
if(type(r) == "table") then
|
||||
if(r.r) then r, g, b = r.r, r.g, r.b; else r, g, b = unpack(r); end
|
||||
if type(r) == "table" then
|
||||
if r.r then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end
|
||||
end
|
||||
return format("|cff%02x%02x%02x", r*255, g*255, b*255);
|
||||
return format("|cff%02x%02x%02x", r*255, g*255, b*255)
|
||||
end,
|
||||
ColorGradient = ElvUF.ColorGradient,
|
||||
}, {
|
||||
@@ -101,11 +103,11 @@ local function createConfigEnv()
|
||||
end
|
||||
|
||||
function UF:ForceShow(frame)
|
||||
if InCombatLockdown() then return; end
|
||||
if UnitAffectingCombat("player") then return end
|
||||
if not frame.isForced then
|
||||
frame.oldUnit = frame.unit
|
||||
frame.unit = "player"
|
||||
frame.isForced = true;
|
||||
frame.isForced = true
|
||||
frame.oldOnUpdate = frame:GetScript("OnUpdate")
|
||||
end
|
||||
|
||||
@@ -119,17 +121,17 @@ function UF:ForceShow(frame)
|
||||
frame:Update()
|
||||
end
|
||||
|
||||
if(_G[frame:GetName().."Target"]) then
|
||||
self:ForceShow(_G[frame:GetName().."Target"]);
|
||||
if _G[frame:GetName().."Target"] then
|
||||
self:ForceShow(_G[frame:GetName().."Target"])
|
||||
end
|
||||
|
||||
if(_G[frame:GetName().."Pet"]) then
|
||||
self:ForceShow(_G[frame:GetName().."Pet"]);
|
||||
if _G[frame:GetName().."Pet"] then
|
||||
self:ForceShow(_G[frame:GetName().."Pet"])
|
||||
end
|
||||
end
|
||||
|
||||
function UF:UnforceShow(frame)
|
||||
if InCombatLockdown() then return; end
|
||||
if UnitAffectingCombat("player") then return end
|
||||
if not frame.isForced then
|
||||
return
|
||||
end
|
||||
@@ -152,11 +154,11 @@ function UF:UnforceShow(frame)
|
||||
frame:Update()
|
||||
end
|
||||
|
||||
if(_G[frame:GetName().."Target"]) then
|
||||
if _G[frame:GetName().."Target"] then
|
||||
self:UnforceShow(_G[frame:GetName().."Target"])
|
||||
end
|
||||
|
||||
if(_G[frame:GetName().."Pet"]) then
|
||||
if _G[frame:GetName().."Pet"] then
|
||||
self:UnforceShow(_G[frame:GetName().."Pet"])
|
||||
end
|
||||
end
|
||||
@@ -164,8 +166,8 @@ end
|
||||
function UF:ShowChildUnits(header, ...)
|
||||
header.isForced = true
|
||||
|
||||
for i=1, select("#", ...) do
|
||||
local frame = select(i, ...)
|
||||
for i = 1, getn(args) do
|
||||
local frame = select(i, unpack(args))
|
||||
frame:RegisterForClicks(nil)
|
||||
frame:SetID(i)
|
||||
frame.TargetGlow:SetAlpha(0)
|
||||
@@ -176,8 +178,8 @@ end
|
||||
function UF:UnshowChildUnits(header, ...)
|
||||
header.isForced = nil
|
||||
|
||||
for i=1, select("#", ...) do
|
||||
local frame = select(i, ...)
|
||||
for i = 1, getn(args) do
|
||||
local frame = select(i, unpack(args))
|
||||
frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
||||
frame.TargetGlow:SetAlpha(1)
|
||||
self:UnforceShow(frame)
|
||||
@@ -185,7 +187,7 @@ function UF:UnshowChildUnits(header, ...)
|
||||
end
|
||||
|
||||
local function OnAttributeChanged(self)
|
||||
if not self:GetParent().forceShow and not self.forceShow then return; end
|
||||
if not self:GetParent().forceShow and not self.forceShow then return end
|
||||
if not self:IsShown() then return end
|
||||
|
||||
local db = self.db or self:GetParent().db
|
||||
@@ -199,7 +201,7 @@ local function OnAttributeChanged(self)
|
||||
end
|
||||
|
||||
function UF:HeaderConfig(header, configMode)
|
||||
if InCombatLockdown() then return; end
|
||||
if UnitAffectingCombat("player") then return end
|
||||
|
||||
createConfigEnv()
|
||||
header.forceShow = configMode
|
||||
@@ -225,18 +227,18 @@ function UF:HeaderConfig(header, configMode)
|
||||
|
||||
RegisterStateDriver(header, "visibility", header.db.visibility)
|
||||
|
||||
if(header:GetScript("OnEvent")) then
|
||||
header:GetScript("OnEvent")(header, "PLAYER_ENTERING_WORLD");
|
||||
if header:GetScript("OnEvent") then
|
||||
header:GetScript("OnEvent")(header, "PLAYER_ENTERING_WORLD")
|
||||
end
|
||||
end
|
||||
|
||||
for i=1, #header.groups do
|
||||
for i = 1, getn(header.groups) do
|
||||
local group = header.groups[i]
|
||||
|
||||
if group:IsShown() then
|
||||
group.forceShow = header.forceShow
|
||||
group.forceShowAuras = header.forceShowAuras
|
||||
group:HookScript("OnAttributeChanged", OnAttributeChanged)
|
||||
HookScript(group, "OnAttributeChanged", OnAttributeChanged)
|
||||
if configMode then
|
||||
for key in pairs(attributeBlacklist) do
|
||||
group:SetAttribute(key, nil)
|
||||
@@ -258,7 +260,7 @@ function UF:HeaderConfig(header, configMode)
|
||||
end
|
||||
end
|
||||
|
||||
UF["headerFunctions"][header.groupName]:AdjustVisibility(header);
|
||||
UF["headerFunctions"][header.groupName]:AdjustVisibility(header)
|
||||
end
|
||||
|
||||
function UF:PLAYER_REGEN_DISABLED()
|
||||
@@ -275,19 +277,7 @@ function UF:PLAYER_REGEN_DISABLED()
|
||||
end
|
||||
end
|
||||
|
||||
for i=1, 5 do
|
||||
if self["arena"..i] and self["arena"..i].isForced then
|
||||
self:UnforceShow(self["arena"..i])
|
||||
end
|
||||
end
|
||||
|
||||
for i=1, 4 do
|
||||
if self["boss"..i] and self["boss"..i].isForced then
|
||||
self:UnforceShow(self["boss"..i])
|
||||
end
|
||||
end
|
||||
|
||||
for i=1, 4 do
|
||||
for i = 1, 4 do
|
||||
if self["party"..i] and self["party"..i].isForced then
|
||||
self:UnforceShow(self["party"..i])
|
||||
end
|
||||
|
||||
@@ -487,10 +487,10 @@ function UF:UpdateDebuffsHeaderPosition()
|
||||
|
||||
if numBuffs == 0 then
|
||||
debuffs:ClearAllPoints()
|
||||
E:Point(debuff, sbuffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset)
|
||||
E:Point(debuffs, buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset)
|
||||
else
|
||||
debuffs:ClearAllPoints()
|
||||
E:Point(debuff, sdebuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset)
|
||||
E:Point(debuffs, debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="UnitFrames.lua"/>
|
||||
<Script file="Config_Enviroment.lua"/>
|
||||
<Script file="Tags.lua"/>
|
||||
<Include file="Elements\Load_Elements.xml"/>
|
||||
<Include file="Units\Load_Units.xml"/>
|
||||
|
||||
@@ -679,7 +679,7 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
|
||||
if headerUpdate or not self[group].mover then
|
||||
UF["headerFunctions"][group]:Configure_Groups(self[group])
|
||||
if not self[group].isForced and not self[group].blockVisibilityChanges then
|
||||
-- RegisterStateDriver(self[group], "visibility", db.visibility)
|
||||
RegisterStateDriver(self[group], "visibility", db.visibility)
|
||||
end
|
||||
else
|
||||
UF["headerFunctions"][group]:Configure_Groups(self[group])
|
||||
@@ -693,7 +693,7 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
|
||||
E:EnableMover(self[group].mover:GetName())
|
||||
end
|
||||
else
|
||||
-- UnregisterStateDriver(self[group], "visibility")
|
||||
UnregisterStateDriver(self[group], "visibility")
|
||||
self[group]:Hide()
|
||||
if self[group].mover then
|
||||
E:DisableMover(self[group].mover:GetName())
|
||||
@@ -708,7 +708,7 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
|
||||
local db = UF.db["units"][group]
|
||||
if db.enable ~= true then
|
||||
UnregisterStateDriver(UF[group], "visibility")
|
||||
--UF[group]:Hide()
|
||||
UF[group]:Hide()
|
||||
if(UF[group].mover) then
|
||||
E:DisableMover(UF[group].mover:GetName())
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user