from retail
This commit is contained in:
@@ -435,7 +435,6 @@ local FakeWeakAurasMixin = {
|
|||||||
},
|
},
|
||||||
blockedTables = {
|
blockedTables = {
|
||||||
ModelPaths = true,
|
ModelPaths = true,
|
||||||
regionPrototype = true,
|
|
||||||
RealTimeProfilingWindow = true,
|
RealTimeProfilingWindow = true,
|
||||||
-- Note these shouldn't exist in the WeakAuras namespace, but moving them takes a bit of effort,
|
-- Note these shouldn't exist in the WeakAuras namespace, but moving them takes a bit of effort,
|
||||||
-- so for now just block them and clean them up later
|
-- so for now just block them and clean them up later
|
||||||
|
|||||||
@@ -1383,6 +1383,9 @@ Private.event_prototypes = {
|
|||||||
AddUnitEventForEvents(result, unit, "UNIT_NAME_UPDATE")
|
AddUnitEventForEvents(result, unit, "UNIT_NAME_UPDATE")
|
||||||
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
|
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
|
||||||
AddUnitEventForEvents(result, unit, "PLAYER_FLAGS_CHANGED")
|
AddUnitEventForEvents(result, unit, "PLAYER_FLAGS_CHANGED")
|
||||||
|
if trigger.use_inRange then
|
||||||
|
AddUnitEventForEvents(result, unit, "UNIT_IN_RANGE_UPDATE")
|
||||||
|
end
|
||||||
return result;
|
return result;
|
||||||
end,
|
end,
|
||||||
internal_events = function(trigger)
|
internal_events = function(trigger)
|
||||||
@@ -1548,6 +1551,16 @@ Private.event_prototypes = {
|
|||||||
end,
|
end,
|
||||||
init = "UnitIsConnected(unit)"
|
init = "UnitIsConnected(unit)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "inRange",
|
||||||
|
display = L["In Range"],
|
||||||
|
type = "toggle",
|
||||||
|
width = WeakAuras.doubleWidth,
|
||||||
|
enable = function(trigger)
|
||||||
|
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
|
||||||
|
end,
|
||||||
|
init = "UnitInRange(unit)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "hostility",
|
name = "hostility",
|
||||||
display = L["Hostility"],
|
display = L["Hostility"],
|
||||||
@@ -1790,6 +1803,9 @@ Private.event_prototypes = {
|
|||||||
if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then
|
if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then
|
||||||
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
|
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
|
||||||
end
|
end
|
||||||
|
if trigger.use_inRange then
|
||||||
|
AddUnitEventForEvents(result, unit, "UNIT_IN_RANGE_UPDATE")
|
||||||
|
end
|
||||||
return result
|
return result
|
||||||
end,
|
end,
|
||||||
internal_events = function(trigger)
|
internal_events = function(trigger)
|
||||||
@@ -2049,6 +2065,16 @@ Private.event_prototypes = {
|
|||||||
end,
|
end,
|
||||||
init = "UnitIsConnected(unit)"
|
init = "UnitIsConnected(unit)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "inRange",
|
||||||
|
display = L["In Range"],
|
||||||
|
type = "toggle",
|
||||||
|
width = WeakAuras.doubleWidth,
|
||||||
|
enable = function(trigger)
|
||||||
|
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
|
||||||
|
end,
|
||||||
|
init = "UnitInRange(unit)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "nameplateType",
|
name = "nameplateType",
|
||||||
display = L["Nameplate Type"],
|
display = L["Nameplate Type"],
|
||||||
@@ -2099,6 +2125,9 @@ Private.event_prototypes = {
|
|||||||
end
|
end
|
||||||
tinsert(result.events, "FRAME_UPDATE")
|
tinsert(result.events, "FRAME_UPDATE")
|
||||||
end
|
end
|
||||||
|
if trigger.use_inRange then
|
||||||
|
AddUnitEventForEvents(result, unit, "UNIT_IN_RANGE_UPDATE")
|
||||||
|
end
|
||||||
return result;
|
return result;
|
||||||
end,
|
end,
|
||||||
internal_events = function(trigger)
|
internal_events = function(trigger)
|
||||||
@@ -2389,6 +2418,16 @@ Private.event_prototypes = {
|
|||||||
end,
|
end,
|
||||||
init = "UnitIsConnected(unit)"
|
init = "UnitIsConnected(unit)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name = "inRange",
|
||||||
|
display = L["In Range"],
|
||||||
|
type = "toggle",
|
||||||
|
width = WeakAuras.doubleWidth,
|
||||||
|
enable = function(trigger)
|
||||||
|
return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party"
|
||||||
|
end,
|
||||||
|
init = "UnitInRange(unit)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name = "nameplateType",
|
name = "nameplateType",
|
||||||
display = L["Nameplate Type"],
|
display = L["Nameplate Type"],
|
||||||
@@ -6558,6 +6597,7 @@ Private.event_prototypes = {
|
|||||||
|
|
||||||
if trigger.use_instance_difficulty ~= nil
|
if trigger.use_instance_difficulty ~= nil
|
||||||
or trigger.use_instance_size ~= nil
|
or trigger.use_instance_size ~= nil
|
||||||
|
or trigger.use_pvpflagged ~= nil
|
||||||
then
|
then
|
||||||
tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD")
|
tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ local default = {
|
|||||||
zoom = 0
|
zoom = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddAdjustedDurationToDefault(default);
|
Private.regionPrototype.AddAdjustedDurationToDefault(default);
|
||||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
Private.regionPrototype.AddAlphaToDefault(default);
|
||||||
|
|
||||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ local properties = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function GetProperties(data)
|
local function GetProperties(data)
|
||||||
local overlayInfo = Private.GetOverlayInfo(data);
|
local overlayInfo = Private.GetOverlayInfo(data);
|
||||||
@@ -1051,7 +1051,7 @@ local function create(parent)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
for k, f in pairs(funcs) do
|
for k, f in pairs(funcs) do
|
||||||
region[k] = f
|
region[k] = f
|
||||||
@@ -1075,7 +1075,7 @@ local function modify(parent, region, data)
|
|||||||
region.text = nil
|
region.text = nil
|
||||||
region.stacks = nil
|
region.stacks = nil
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
-- Localize
|
-- Localize
|
||||||
local bar, iconFrame, icon = region.bar, region.iconFrame, region.icon;
|
local bar, iconFrame, icon = region.bar, region.iconFrame, region.icon;
|
||||||
|
|
||||||
@@ -1355,7 +1355,7 @@ local function modify(parent, region, data)
|
|||||||
--- Update internal bar alignment
|
--- Update internal bar alignment
|
||||||
region.bar:Update();
|
region.bar:Update();
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function validate(data)
|
local function validate(data)
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ local function create(parent)
|
|||||||
region.selfPoint = "TOPLEFT"
|
region.selfPoint = "TOPLEFT"
|
||||||
region.controlPoints = CreateObjectPool(createControlPoint, releaseControlPoint)
|
region.controlPoints = CreateObjectPool(createControlPoint, releaseControlPoint)
|
||||||
region.controlPoints.parent = region
|
region.controlPoints.parent = region
|
||||||
WeakAuras.regionPrototype.create(region)
|
Private.regionPrototype.create(region)
|
||||||
region.suspended = 0
|
region.suspended = 0
|
||||||
|
|
||||||
local oldSetFrameLevel = region.SetFrameLevel
|
local oldSetFrameLevel = region.SetFrameLevel
|
||||||
@@ -1041,7 +1041,7 @@ end
|
|||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
Private.FixGroupChildrenOrderForGroup(data)
|
Private.FixGroupChildrenOrderForGroup(data)
|
||||||
region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1)
|
region:SetScale(data.scale and data.scale > 0 and data.scale <= 10 and data.scale or 1)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data)
|
Private.regionPrototype.modify(parent, region, data)
|
||||||
|
|
||||||
if data.border and not data.useAnchorPerUnit then
|
if data.border and not data.useAnchorPerUnit then
|
||||||
local background = region.background
|
local background = region.background
|
||||||
@@ -1560,7 +1560,7 @@ local function modify(parent, region, data)
|
|||||||
|
|
||||||
region:ReloadControlledChildren()
|
region:ReloadControlledChildren()
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data)
|
Private.regionPrototype.modifyFinish(parent, region, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.RegisterRegionType("dynamicgroup", create, modify, default)
|
WeakAuras.RegisterRegionType("dynamicgroup", create, modify, default)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ local function create(parent)
|
|||||||
local border = CreateFrame("Frame", nil, region);
|
local border = CreateFrame("Frame", nil, region);
|
||||||
region.border = border;
|
region.border = border;
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
local oldSetFrameLevel = region.SetFrameLevel
|
local oldSetFrameLevel = region.SetFrameLevel
|
||||||
region.SetFrameLevel = function(self, level)
|
region.SetFrameLevel = function(self, level)
|
||||||
@@ -90,7 +90,7 @@ local function modify(parent, region, data)
|
|||||||
else
|
else
|
||||||
data.selfPoint = "CENTER";
|
data.selfPoint = "CENTER";
|
||||||
end
|
end
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
-- Localize
|
-- Localize
|
||||||
local border = region.border;
|
local border = region.border;
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ local function modify(parent, region, data)
|
|||||||
region.border:Hide()
|
region.border:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register new region type with WeakAuras
|
-- Register new region type with WeakAuras
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ local default = {
|
|||||||
cooldownEdge = false
|
cooldownEdge = false
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
Private.regionPrototype.AddAlphaToDefault(default);
|
||||||
|
|
||||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ local properties = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function GetProperties(data)
|
local function GetProperties(data)
|
||||||
local result = CopyTable(properties)
|
local result = CopyTable(properties)
|
||||||
@@ -140,7 +140,7 @@ end
|
|||||||
|
|
||||||
local function AnchorSubRegion(self, subRegion, anchorType, selfPoint, anchorPoint, anchorXOffset, anchorYOffset)
|
local function AnchorSubRegion(self, subRegion, anchorType, selfPoint, anchorPoint, anchorXOffset, anchorYOffset)
|
||||||
if anchorType == "area" then
|
if anchorType == "area" then
|
||||||
WeakAuras.regionPrototype.AnchorSubRegion(selfPoint == "region" and self or self.icon, subRegion, anchorType, selfPoint, anchorPoint, anchorXOffset, anchorYOffset)
|
Private.regionPrototype.AnchorSubRegion(selfPoint == "region" and self or self.icon, subRegion, anchorType, selfPoint, anchorPoint, anchorXOffset, anchorYOffset)
|
||||||
else
|
else
|
||||||
subRegion:ClearAllPoints()
|
subRegion:ClearAllPoints()
|
||||||
anchorPoint = anchorPoint or "CENTER"
|
anchorPoint = anchorPoint or "CENTER"
|
||||||
@@ -335,7 +335,7 @@ local function create(parent, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
region.AnchorSubRegion = AnchorSubRegion
|
region.AnchorSubRegion = AnchorSubRegion
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ local function modify(parent, region, data)
|
|||||||
region.stacks = nil
|
region.stacks = nil
|
||||||
region.text2 = nil
|
region.text2 = nil
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
|
|
||||||
local button, icon, cooldown = region.button, region.icon, region.cooldown;
|
local button, icon, cooldown = region.button, region.icon, region.cooldown;
|
||||||
|
|
||||||
@@ -674,7 +674,7 @@ local function modify(parent, region, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
|
|
||||||
--- WORKAROUND
|
--- WORKAROUND
|
||||||
-- This fixes a issue with barmodels not appearing on icons if the
|
-- This fixes a issue with barmodels not appearing on icons if the
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ local properties = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function GetProperties(data)
|
local function GetProperties(data)
|
||||||
return properties;
|
return properties;
|
||||||
@@ -79,13 +79,13 @@ local function create(parent)
|
|||||||
local border = CreateFrame("Frame", nil, region);
|
local border = CreateFrame("Frame", nil, region);
|
||||||
region.border = border;
|
region.border = border;
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
for k, v in pairs (regionFunctions) do
|
for k, v in pairs (regionFunctions) do
|
||||||
region[k] = v
|
region[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
region.AnchorSubRegion = WeakAuras.regionPrototype.AnchorSubRegion
|
region.AnchorSubRegion = Private.regionPrototype.AnchorSubRegion
|
||||||
|
|
||||||
-- Return complete region
|
-- Return complete region
|
||||||
return region;
|
return region;
|
||||||
@@ -175,7 +175,7 @@ end
|
|||||||
|
|
||||||
-- Modify a given region/display
|
-- Modify a given region/display
|
||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
-- Localize
|
-- Localize
|
||||||
local border = region.border;
|
local border = region.border;
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ local function modify(parent, region, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Work around for movies and world map hiding all models
|
-- Work around for movies and world map hiding all models
|
||||||
|
|||||||
@@ -113,9 +113,9 @@ local default = {
|
|||||||
slantMode = "INSIDE"
|
slantMode = "INSIDE"
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
Private.regionPrototype.AddAlphaToDefault(default);
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddAdjustedDurationToDefault(default);
|
Private.regionPrototype.AddAdjustedDurationToDefault(default);
|
||||||
|
|
||||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ local properties = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function GetProperties(data)
|
local function GetProperties(data)
|
||||||
local overlayInfo = Private.GetOverlayInfo(data);
|
local overlayInfo = Private.GetOverlayInfo(data);
|
||||||
@@ -462,7 +462,7 @@ local function create(parent)
|
|||||||
region.duration = 0;
|
region.duration = 0;
|
||||||
region.expirationTime = math.huge;
|
region.expirationTime = math.huge;
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
end
|
end
|
||||||
@@ -474,7 +474,7 @@ local function TimerTick(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
|
|
||||||
local background, foreground = region.background, region.foreground;
|
local background, foreground = region.background, region.foreground;
|
||||||
local foregroundSpinner, backgroundSpinner = region.foregroundSpinner, region.backgroundSpinner;
|
local foregroundSpinner, backgroundSpinner = region.foregroundSpinner, region.backgroundSpinner;
|
||||||
@@ -1029,7 +1029,7 @@ local function modify(parent, region, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function validate(data)
|
local function validate(data)
|
||||||
|
|||||||
@@ -4,21 +4,21 @@ local AddonName, Private = ...
|
|||||||
local WeakAuras = WeakAuras;
|
local WeakAuras = WeakAuras;
|
||||||
local L = WeakAuras.L;
|
local L = WeakAuras.L;
|
||||||
|
|
||||||
WeakAuras.regionPrototype = {};
|
Private.regionPrototype = {};
|
||||||
|
|
||||||
-- Alpha
|
-- Alpha
|
||||||
function WeakAuras.regionPrototype.AddAlphaToDefault(default)
|
function Private.regionPrototype.AddAlphaToDefault(default)
|
||||||
default.alpha = 1.0;
|
default.alpha = 1.0;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adjusted Duration
|
-- Adjusted Duration
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.AddAdjustedDurationToDefault(default)
|
function Private.regionPrototype.AddAdjustedDurationToDefault(default)
|
||||||
default.useAdjustededMax = false;
|
default.useAdjustededMax = false;
|
||||||
default.useAdjustededMin = false;
|
default.useAdjustededMin = false;
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, order)
|
function Private.regionPrototype.AddAdjustedDurationOptions(options, data, order)
|
||||||
options.useAdjustededMin = {
|
options.useAdjustededMin = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
width = WeakAuras.normalWidth,
|
width = WeakAuras.normalWidth,
|
||||||
@@ -100,7 +100,7 @@ function Private.GetAnchorsForData(parentData, type)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Sound / Chat Message / Custom Code
|
-- Sound / Chat Message / Custom Code
|
||||||
function WeakAuras.regionPrototype.AddProperties(properties, defaultsForRegion)
|
function Private.regionPrototype.AddProperties(properties, defaultsForRegion)
|
||||||
properties["sound"] = {
|
properties["sound"] = {
|
||||||
display = L["Sound"],
|
display = L["Sound"],
|
||||||
action = "SoundPlay",
|
action = "SoundPlay",
|
||||||
@@ -452,9 +452,9 @@ local function AnchorSubRegion(self, subRegion, anchorType, selfPoint, anchorPoi
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AnchorSubRegion = AnchorSubRegion
|
Private.regionPrototype.AnchorSubRegion = AnchorSubRegion
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.create(region)
|
function Private.regionPrototype.create(region)
|
||||||
local defaultsForRegion = Private.regionTypes[region.regionType] and Private.regionTypes[region.regionType].default;
|
local defaultsForRegion = Private.regionTypes[region.regionType] and Private.regionTypes[region.regionType].default;
|
||||||
region.SoundPlay = SoundPlay;
|
region.SoundPlay = SoundPlay;
|
||||||
region.SoundRepeatStop = SoundRepeatStop;
|
region.SoundRepeatStop = SoundRepeatStop;
|
||||||
@@ -500,7 +500,7 @@ end
|
|||||||
|
|
||||||
-- SetDurationInfo
|
-- SetDurationInfo
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.modify(parent, region, data)
|
function Private.regionPrototype.modify(parent, region, data)
|
||||||
region.state = nil
|
region.state = nil
|
||||||
region.states = nil
|
region.states = nil
|
||||||
region.subRegionEvents:ClearSubscribers()
|
region.subRegionEvents:ClearSubscribers()
|
||||||
@@ -587,7 +587,7 @@ function WeakAuras.regionPrototype.modify(parent, region, data)
|
|||||||
end, true)
|
end, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.modifyFinish(parent, region, data)
|
function Private.regionPrototype.modifyFinish(parent, region, data)
|
||||||
-- Sync subRegions
|
-- Sync subRegions
|
||||||
if region.subRegions then
|
if region.subRegions then
|
||||||
for index, subRegion in pairs(region.subRegions) do
|
for index, subRegion in pairs(region.subRegions) do
|
||||||
@@ -674,7 +674,7 @@ local function TimerTickForSetDuration(self)
|
|||||||
self:SetTime(max - adjustMin, self.expirationTime - adjustMin, self.inverse);
|
self:SetTime(max - adjustMin, self.expirationTime - adjustMin, self.inverse);
|
||||||
end
|
end
|
||||||
|
|
||||||
function WeakAuras.regionPrototype.AddSetDurationInfo(region)
|
function Private.regionPrototype.AddSetDurationInfo(region)
|
||||||
if (region.SetValue and region.SetTime) then
|
if (region.SetValue and region.SetTime) then
|
||||||
region.generatedSetDurationInfo = true;
|
region.generatedSetDurationInfo = true;
|
||||||
|
|
||||||
@@ -704,7 +704,7 @@ function WeakAuras.regionPrototype.AddSetDurationInfo(region)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Expand/Collapse function
|
-- Expand/Collapse function
|
||||||
function WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, parent, parentRegionType)
|
function Private.regionPrototype.AddExpandFunction(data, region, cloneId, parent, parentRegionType)
|
||||||
local uid = data.uid
|
local uid = data.uid
|
||||||
local id = data.id
|
local id = data.id
|
||||||
local inDynamicGroup = parentRegionType == "dynamicgroup";
|
local inDynamicGroup = parentRegionType == "dynamicgroup";
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ local properties = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function create(parent)
|
local function create(parent)
|
||||||
local frame = CreateFrame("Frame", nil, UIParent);
|
local frame = CreateFrame("Frame", nil, UIParent);
|
||||||
@@ -102,7 +102,7 @@ local function create(parent)
|
|||||||
frame.foreground = foreground;
|
frame.foreground = foreground;
|
||||||
foreground:SetAllPoints(frame);
|
foreground:SetAllPoints(frame);
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(frame);
|
Private.regionPrototype.create(frame);
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
end
|
end
|
||||||
@@ -151,7 +151,7 @@ local function SetFrameViaFrames(self, texture, frame)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
region.foreground = region.foreground or {}
|
region.foreground = region.foreground or {}
|
||||||
region.background = region.background or {}
|
region.background = region.background or {}
|
||||||
local pattern = "%.x(%d+)y(%d+)f(%d+)%.[tb][gl][ap]"
|
local pattern = "%.x(%d+)y(%d+)f(%d+)%.[tb][gl][ap]"
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ local properties = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function GetProperties(data)
|
local function GetProperties(data)
|
||||||
return properties;
|
return properties;
|
||||||
@@ -71,13 +71,13 @@ local function create(parent)
|
|||||||
region.duration = 0;
|
region.duration = 0;
|
||||||
region.expirationTime = math.huge;
|
region.expirationTime = math.huge;
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
end
|
end
|
||||||
|
|
||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
local text = region.text;
|
local text = region.text;
|
||||||
|
|
||||||
local fontPath = SharedMedia:Fetch("font", data.font);
|
local fontPath = SharedMedia:Fetch("font", data.font);
|
||||||
@@ -334,7 +334,7 @@ local function modify(parent, region, data)
|
|||||||
region:ConfigureTextUpdate()
|
region:ConfigureTextUpdate()
|
||||||
region:ConfigureSubscribers()
|
region:ConfigureSubscribers()
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function validate(data)
|
local function validate(data)
|
||||||
@@ -346,7 +346,7 @@ WeakAuras.RegisterRegionType("text", create, modify, default, GetProperties, val
|
|||||||
-- Fallback region type
|
-- Fallback region type
|
||||||
|
|
||||||
local function fallbackmodify(parent, region, data)
|
local function fallbackmodify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
local text = region.text;
|
local text = region.text;
|
||||||
|
|
||||||
text:SetFont(STANDARD_TEXT_FONT, data.fontSize < 33 and data.fontSize or 33, data.outline and "OUTLINE" or nil);
|
text:SetFont(STANDARD_TEXT_FONT, data.fontSize < 33 and data.fontSize or 33, data.outline and "OUTLINE" or nil);
|
||||||
@@ -363,7 +363,7 @@ local function fallbackmodify(parent, region, data)
|
|||||||
|
|
||||||
region.Update = function() end
|
region.Update = function() end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.RegisterRegionType("fallback", create, fallbackmodify, default);
|
WeakAuras.RegisterRegionType("fallback", create, fallbackmodify, default);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ local default = {
|
|||||||
frameStrata = 1
|
frameStrata = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
Private.regionPrototype.AddAlphaToDefault(default);
|
||||||
|
|
||||||
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ceil(GetScreenHeight() / 20) * 20;
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ local properties = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
Private.regionPrototype.AddProperties(properties, default);
|
||||||
|
|
||||||
local function create(parent)
|
local function create(parent)
|
||||||
local region = CreateFrame("Frame", nil, UIParent);
|
local region = CreateFrame("Frame", nil, UIParent);
|
||||||
@@ -75,13 +75,13 @@ local function create(parent)
|
|||||||
region.texture = texture;
|
region.texture = texture;
|
||||||
texture:SetAllPoints(region);
|
texture:SetAllPoints(region);
|
||||||
|
|
||||||
WeakAuras.regionPrototype.create(region);
|
Private.regionPrototype.create(region);
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
end
|
end
|
||||||
|
|
||||||
local function modify(parent, region, data)
|
local function modify(parent, region, data)
|
||||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
Private.regionPrototype.modify(parent, region, data);
|
||||||
region.texture:SetTexture(data.texture);
|
region.texture:SetTexture(data.texture);
|
||||||
region.texture:SetDesaturated(data.desaturate)
|
region.texture:SetDesaturated(data.desaturate)
|
||||||
region:SetWidth(data.width);
|
region:SetWidth(data.width);
|
||||||
@@ -230,7 +230,7 @@ local function modify(parent, region, data)
|
|||||||
region.GetRotation = nil;
|
region.GetRotation = nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||||
end
|
end
|
||||||
|
|
||||||
local function validate(data)
|
local function validate(data)
|
||||||
|
|||||||
@@ -2873,8 +2873,8 @@ function Private.SetRegion(data, cloneId)
|
|||||||
local anim_cancelled = loginFinished and Private.CancelAnimation(region, true, true, true, true, true, true);
|
local anim_cancelled = loginFinished and Private.CancelAnimation(region, true, true, true, true, true, true);
|
||||||
|
|
||||||
regionTypes[regionType].modify(parent, region, data);
|
regionTypes[regionType].modify(parent, region, data);
|
||||||
WeakAuras.regionPrototype.AddSetDurationInfo(region);
|
Private.regionPrototype.AddSetDurationInfo(region);
|
||||||
WeakAuras.regionPrototype.AddExpandFunction(data, region, cloneId, parent, parent.regionType)
|
Private.regionPrototype.AddExpandFunction(data, region, cloneId, parent, parent.regionType)
|
||||||
|
|
||||||
data.animation = data.animation or {};
|
data.animation = data.animation or {};
|
||||||
data.animation.start = data.animation.start or {type = "none"};
|
data.animation.start = data.animation.start or {type = "none"};
|
||||||
|
|||||||
@@ -374,8 +374,17 @@ end
|
|||||||
|
|
||||||
local function CreateHiddenAll(subOption)
|
local function CreateHiddenAll(subOption)
|
||||||
return function(data, info)
|
return function(data, info)
|
||||||
|
local mainOptions = OptionsPrivate.EnsureOptions(data, subOption)
|
||||||
|
for i=1,#info do
|
||||||
|
mainOptions = mainOptions.args[info[i]];
|
||||||
|
end
|
||||||
|
|
||||||
if(#data.controlledChildren == 0) then
|
if(#data.controlledChildren == 0) then
|
||||||
return true;
|
if mainOptions.hiddenAllIfAnyHidden then
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for child in OptionsPrivate.Private.TraverseLeafs(data) do
|
for child in OptionsPrivate.Private.TraverseLeafs(data) do
|
||||||
@@ -387,13 +396,24 @@ local function CreateHiddenAll(subOption)
|
|||||||
childOptionTable[i] = childOption;
|
childOptionTable[i] = childOption;
|
||||||
end
|
end
|
||||||
if (childOption) then
|
if (childOption) then
|
||||||
if (not hiddenChild(childOptionTable, info)) then
|
local childHidden = hiddenChild(childOptionTable, info)
|
||||||
return false;
|
if mainOptions.hiddenAllIfAnyHidden then
|
||||||
|
if childHidden then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not childHidden then
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true;
|
if mainOptions.hiddenAllIfAnyHidden then
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ local function createOptions(id, data)
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
options = WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, 36.5);
|
options = OptionsPrivate.Private.regionPrototype.AddAdjustedDurationOptions(options, data, 36.5);
|
||||||
|
|
||||||
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
||||||
if (overlayInfo and next(overlayInfo)) then
|
if (overlayInfo and next(overlayInfo)) then
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ local function createOptions(id, data)
|
|||||||
name = "",
|
name = "",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
options = WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, 57);
|
options = OptionsPrivate.Private.regionPrototype.AddAdjustedDurationOptions(options, data, 57);
|
||||||
|
|
||||||
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
|
||||||
if (overlayInfo and next(overlayInfo)) then
|
if (overlayInfo and next(overlayInfo)) then
|
||||||
|
|||||||
Reference in New Issue
Block a user