from retail
This commit is contained in:
@@ -38,8 +38,8 @@ local default = {
|
||||
zoom = 0
|
||||
};
|
||||
|
||||
WeakAuras.regionPrototype.AddAdjustedDurationToDefault(default);
|
||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
||||
Private.regionPrototype.AddAdjustedDurationToDefault(default);
|
||||
Private.regionPrototype.AddAlphaToDefault(default);
|
||||
|
||||
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 overlayInfo = Private.GetOverlayInfo(data);
|
||||
@@ -1051,7 +1051,7 @@ local function create(parent)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
for k, f in pairs(funcs) do
|
||||
region[k] = f
|
||||
@@ -1075,7 +1075,7 @@ local function modify(parent, region, data)
|
||||
region.text = nil
|
||||
region.stacks = nil
|
||||
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
-- Localize
|
||||
local bar, iconFrame, icon = region.bar, region.iconFrame, region.icon;
|
||||
|
||||
@@ -1355,7 +1355,7 @@ local function modify(parent, region, data)
|
||||
--- Update internal bar alignment
|
||||
region.bar:Update();
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
local function validate(data)
|
||||
|
||||
@@ -119,7 +119,7 @@ local function create(parent)
|
||||
region.selfPoint = "TOPLEFT"
|
||||
region.controlPoints = CreateObjectPool(createControlPoint, releaseControlPoint)
|
||||
region.controlPoints.parent = region
|
||||
WeakAuras.regionPrototype.create(region)
|
||||
Private.regionPrototype.create(region)
|
||||
region.suspended = 0
|
||||
|
||||
local oldSetFrameLevel = region.SetFrameLevel
|
||||
@@ -1041,7 +1041,7 @@ end
|
||||
local function modify(parent, region, data)
|
||||
Private.FixGroupChildrenOrderForGroup(data)
|
||||
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
|
||||
local background = region.background
|
||||
@@ -1560,7 +1560,7 @@ local function modify(parent, region, data)
|
||||
|
||||
region:ReloadControlledChildren()
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data)
|
||||
Private.regionPrototype.modifyFinish(parent, region, data)
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("dynamicgroup", create, modify, default)
|
||||
|
||||
@@ -35,7 +35,7 @@ local function create(parent)
|
||||
local border = CreateFrame("Frame", nil, region);
|
||||
region.border = border;
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
local oldSetFrameLevel = region.SetFrameLevel
|
||||
region.SetFrameLevel = function(self, level)
|
||||
@@ -90,7 +90,7 @@ local function modify(parent, region, data)
|
||||
else
|
||||
data.selfPoint = "CENTER";
|
||||
end
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
-- Localize
|
||||
local border = region.border;
|
||||
|
||||
@@ -179,7 +179,7 @@ local function modify(parent, region, data)
|
||||
region.border:Hide()
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
-- Register new region type with WeakAuras
|
||||
|
||||
@@ -35,7 +35,7 @@ local default = {
|
||||
cooldownEdge = false
|
||||
};
|
||||
|
||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
||||
Private.regionPrototype.AddAlphaToDefault(default);
|
||||
|
||||
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 result = CopyTable(properties)
|
||||
@@ -140,7 +140,7 @@ end
|
||||
|
||||
local function AnchorSubRegion(self, subRegion, anchorType, selfPoint, anchorPoint, anchorXOffset, anchorYOffset)
|
||||
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
|
||||
subRegion:ClearAllPoints()
|
||||
anchorPoint = anchorPoint or "CENTER"
|
||||
@@ -335,7 +335,7 @@ local function create(parent, data)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
region.AnchorSubRegion = AnchorSubRegion
|
||||
|
||||
@@ -347,7 +347,7 @@ local function modify(parent, region, data)
|
||||
region.stacks = 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;
|
||||
|
||||
@@ -674,7 +674,7 @@ local function modify(parent, region, data)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
|
||||
--- WORKAROUND
|
||||
-- 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)
|
||||
return properties;
|
||||
@@ -79,13 +79,13 @@ local function create(parent)
|
||||
local border = CreateFrame("Frame", nil, region);
|
||||
region.border = border;
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
for k, v in pairs (regionFunctions) do
|
||||
region[k] = v
|
||||
end
|
||||
|
||||
region.AnchorSubRegion = WeakAuras.regionPrototype.AnchorSubRegion
|
||||
region.AnchorSubRegion = Private.regionPrototype.AnchorSubRegion
|
||||
|
||||
-- Return complete region
|
||||
return region;
|
||||
@@ -175,7 +175,7 @@ end
|
||||
|
||||
-- Modify a given region/display
|
||||
local function modify(parent, region, data)
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
-- Localize
|
||||
local border = region.border;
|
||||
|
||||
@@ -273,7 +273,7 @@ local function modify(parent, region, data)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
-- Work around for movies and world map hiding all models
|
||||
|
||||
@@ -113,9 +113,9 @@ local default = {
|
||||
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;
|
||||
|
||||
@@ -176,7 +176,7 @@ local properties = {
|
||||
}
|
||||
}
|
||||
|
||||
WeakAuras.regionPrototype.AddProperties(properties, default);
|
||||
Private.regionPrototype.AddProperties(properties, default);
|
||||
|
||||
local function GetProperties(data)
|
||||
local overlayInfo = Private.GetOverlayInfo(data);
|
||||
@@ -462,7 +462,7 @@ local function create(parent)
|
||||
region.duration = 0;
|
||||
region.expirationTime = math.huge;
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
return region;
|
||||
end
|
||||
@@ -474,7 +474,7 @@ local function TimerTick(self)
|
||||
end
|
||||
|
||||
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 foregroundSpinner, backgroundSpinner = region.foregroundSpinner, region.backgroundSpinner;
|
||||
@@ -1029,7 +1029,7 @@ local function modify(parent, region, data)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
local function validate(data)
|
||||
|
||||
@@ -4,21 +4,21 @@ local AddonName, Private = ...
|
||||
local WeakAuras = WeakAuras;
|
||||
local L = WeakAuras.L;
|
||||
|
||||
WeakAuras.regionPrototype = {};
|
||||
Private.regionPrototype = {};
|
||||
|
||||
-- Alpha
|
||||
function WeakAuras.regionPrototype.AddAlphaToDefault(default)
|
||||
function Private.regionPrototype.AddAlphaToDefault(default)
|
||||
default.alpha = 1.0;
|
||||
end
|
||||
|
||||
-- Adjusted Duration
|
||||
|
||||
function WeakAuras.regionPrototype.AddAdjustedDurationToDefault(default)
|
||||
function Private.regionPrototype.AddAdjustedDurationToDefault(default)
|
||||
default.useAdjustededMax = false;
|
||||
default.useAdjustededMin = false;
|
||||
end
|
||||
|
||||
function WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, order)
|
||||
function Private.regionPrototype.AddAdjustedDurationOptions(options, data, order)
|
||||
options.useAdjustededMin = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
@@ -100,7 +100,7 @@ function Private.GetAnchorsForData(parentData, type)
|
||||
end
|
||||
|
||||
-- Sound / Chat Message / Custom Code
|
||||
function WeakAuras.regionPrototype.AddProperties(properties, defaultsForRegion)
|
||||
function Private.regionPrototype.AddProperties(properties, defaultsForRegion)
|
||||
properties["sound"] = {
|
||||
display = L["Sound"],
|
||||
action = "SoundPlay",
|
||||
@@ -452,9 +452,9 @@ local function AnchorSubRegion(self, subRegion, anchorType, selfPoint, anchorPoi
|
||||
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;
|
||||
region.SoundPlay = SoundPlay;
|
||||
region.SoundRepeatStop = SoundRepeatStop;
|
||||
@@ -500,7 +500,7 @@ end
|
||||
|
||||
-- SetDurationInfo
|
||||
|
||||
function WeakAuras.regionPrototype.modify(parent, region, data)
|
||||
function Private.regionPrototype.modify(parent, region, data)
|
||||
region.state = nil
|
||||
region.states = nil
|
||||
region.subRegionEvents:ClearSubscribers()
|
||||
@@ -587,7 +587,7 @@ function WeakAuras.regionPrototype.modify(parent, region, data)
|
||||
end, true)
|
||||
end
|
||||
|
||||
function WeakAuras.regionPrototype.modifyFinish(parent, region, data)
|
||||
function Private.regionPrototype.modifyFinish(parent, region, data)
|
||||
-- Sync subRegions
|
||||
if region.subRegions then
|
||||
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);
|
||||
end
|
||||
|
||||
function WeakAuras.regionPrototype.AddSetDurationInfo(region)
|
||||
function Private.regionPrototype.AddSetDurationInfo(region)
|
||||
if (region.SetValue and region.SetTime) then
|
||||
region.generatedSetDurationInfo = true;
|
||||
|
||||
@@ -704,7 +704,7 @@ function WeakAuras.regionPrototype.AddSetDurationInfo(region)
|
||||
end
|
||||
|
||||
-- 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 id = data.id
|
||||
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 frame = CreateFrame("Frame", nil, UIParent);
|
||||
@@ -102,7 +102,7 @@ local function create(parent)
|
||||
frame.foreground = foreground;
|
||||
foreground:SetAllPoints(frame);
|
||||
|
||||
WeakAuras.regionPrototype.create(frame);
|
||||
Private.regionPrototype.create(frame);
|
||||
|
||||
return frame;
|
||||
end
|
||||
@@ -151,7 +151,7 @@ local function SetFrameViaFrames(self, texture, frame)
|
||||
end
|
||||
|
||||
local function modify(parent, region, data)
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
region.foreground = region.foreground or {}
|
||||
region.background = region.background or {}
|
||||
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)
|
||||
return properties;
|
||||
@@ -71,13 +71,13 @@ local function create(parent)
|
||||
region.duration = 0;
|
||||
region.expirationTime = math.huge;
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
return region;
|
||||
end
|
||||
|
||||
local function modify(parent, region, data)
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
local text = region.text;
|
||||
|
||||
local fontPath = SharedMedia:Fetch("font", data.font);
|
||||
@@ -334,7 +334,7 @@ local function modify(parent, region, data)
|
||||
region:ConfigureTextUpdate()
|
||||
region:ConfigureSubscribers()
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
local function validate(data)
|
||||
@@ -346,7 +346,7 @@ WeakAuras.RegisterRegionType("text", create, modify, default, GetProperties, val
|
||||
-- Fallback region type
|
||||
|
||||
local function fallbackmodify(parent, region, data)
|
||||
WeakAuras.regionPrototype.modify(parent, region, data);
|
||||
Private.regionPrototype.modify(parent, region, data);
|
||||
local text = region.text;
|
||||
|
||||
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
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("fallback", create, fallbackmodify, default);
|
||||
|
||||
@@ -22,7 +22,7 @@ local default = {
|
||||
frameStrata = 1
|
||||
};
|
||||
|
||||
WeakAuras.regionPrototype.AddAlphaToDefault(default);
|
||||
Private.regionPrototype.AddAlphaToDefault(default);
|
||||
|
||||
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 region = CreateFrame("Frame", nil, UIParent);
|
||||
@@ -75,13 +75,13 @@ local function create(parent)
|
||||
region.texture = texture;
|
||||
texture:SetAllPoints(region);
|
||||
|
||||
WeakAuras.regionPrototype.create(region);
|
||||
Private.regionPrototype.create(region);
|
||||
|
||||
return region;
|
||||
end
|
||||
|
||||
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:SetDesaturated(data.desaturate)
|
||||
region:SetWidth(data.width);
|
||||
@@ -230,7 +230,7 @@ local function modify(parent, region, data)
|
||||
region.GetRotation = nil;
|
||||
end
|
||||
|
||||
WeakAuras.regionPrototype.modifyFinish(parent, region, data);
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
local function validate(data)
|
||||
|
||||
Reference in New Issue
Block a user