from retail
This commit is contained in:
+2
-2
@@ -93,10 +93,10 @@ if not WeakAuras.IsLibsOK() then
|
||||
end
|
||||
|
||||
-- These function stubs are defined here to reduce the number of errors that occur if WeakAuras.lua fails to compile
|
||||
function WeakAuras.RegisterRegionType(_, _, _ ,_)
|
||||
function Private.RegisterRegionType(_, _, _ ,_)
|
||||
end
|
||||
|
||||
function WeakAuras.RegisterRegionOptions(_, _ , _ ,_)
|
||||
function Private.RegisterRegionOptions(_, _ , _ ,_)
|
||||
end
|
||||
|
||||
function Private.StartProfileSystem(_)
|
||||
|
||||
@@ -1372,4 +1372,4 @@ local function validate(data)
|
||||
end
|
||||
|
||||
-- Register new region type with WeakAuras
|
||||
WeakAuras.RegisterRegionType("aurabar", create, modify, default, GetProperties, validate);
|
||||
Private.RegisterRegionType("aurabar", create, modify, default, GetProperties, validate);
|
||||
|
||||
@@ -1566,4 +1566,4 @@ local function modify(parent, region, data)
|
||||
Private.regionPrototype.modifyFinish(parent, region, data)
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("dynamicgroup", create, modify, default)
|
||||
Private.RegisterRegionType("dynamicgroup", create, modify, default)
|
||||
|
||||
@@ -183,4 +183,4 @@ local function modify(parent, region, data)
|
||||
end
|
||||
|
||||
-- Register new region type with WeakAuras
|
||||
WeakAuras.RegisterRegionType("group", create, modify, default);
|
||||
Private.RegisterRegionType("group", create, modify, default);
|
||||
|
||||
@@ -687,4 +687,4 @@ local function validate(data)
|
||||
Private.EnforceSubregionExists(data, "subbackground")
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("icon", create, modify, default, GetProperties, validate)
|
||||
Private.RegisterRegionType("icon", create, modify, default, GetProperties, validate)
|
||||
|
||||
@@ -301,4 +301,4 @@ local function validate(data)
|
||||
end
|
||||
|
||||
-- Register new region type with WeakAuras
|
||||
WeakAuras.RegisterRegionType("model", create, modify, default, GetProperties, validate);
|
||||
Private.RegisterRegionType("model", create, modify, default, GetProperties, validate);
|
||||
|
||||
@@ -1036,4 +1036,4 @@ local function validate(data)
|
||||
Private.EnforceSubregionExists(data, "subbackground")
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("progresstexture", create, modify, default, GetProperties, validate);
|
||||
Private.RegisterRegionType("progresstexture", create, modify, default, GetProperties, validate);
|
||||
|
||||
@@ -488,4 +488,4 @@ local function validate(data)
|
||||
Private.EnforceSubregionExists(data, "subbackground")
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("stopmotion", create, modify, default, properties, validate);
|
||||
Private.RegisterRegionType("stopmotion", create, modify, default, properties, validate);
|
||||
|
||||
@@ -341,7 +341,7 @@ local function validate(data)
|
||||
Private.EnforceSubregionExists(data, "subbackground")
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("text", create, modify, default, GetProperties, validate);
|
||||
Private.RegisterRegionType("text", create, modify, default, GetProperties, validate);
|
||||
|
||||
-- Fallback region type
|
||||
|
||||
@@ -366,4 +366,4 @@ local function fallbackmodify(parent, region, data)
|
||||
Private.regionPrototype.modifyFinish(parent, region, data);
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("fallback", create, fallbackmodify, default);
|
||||
Private.RegisterRegionType("fallback", create, fallbackmodify, default);
|
||||
|
||||
@@ -237,4 +237,4 @@ local function validate(data)
|
||||
Private.EnforceSubregionExists(data, "subbackground")
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionType("texture", create, modify, default, properties, validate);
|
||||
Private.RegisterRegionType("texture", create, modify, default, properties, validate);
|
||||
|
||||
+22
-22
@@ -349,27 +349,27 @@ function Private.validate(input, default)
|
||||
end
|
||||
end
|
||||
|
||||
function WeakAuras.RegisterRegionType(name, createFunction, modifyFunction, default, properties, validate)
|
||||
function Private.RegisterRegionType(name, createFunction, modifyFunction, default, properties, validate)
|
||||
if not(name) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - name is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - name is not defined", 2);
|
||||
elseif(type(name) ~= "string") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - name is not a string", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - name is not a string", 2);
|
||||
elseif not(createFunction) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - creation function is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - creation function is not defined", 2);
|
||||
elseif(type(createFunction) ~= "function") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - creation function is not a function", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - creation function is not a function", 2);
|
||||
elseif not(modifyFunction) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - modification function is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - modification function is not defined", 2);
|
||||
elseif(type(modifyFunction) ~= "function") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - modification function is not a function", 2)
|
||||
error("Improper arguments to Private.RegisterRegionType - modification function is not a function", 2)
|
||||
elseif not(default) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - default options are not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - default options are not defined", 2);
|
||||
elseif(type(default) ~= "table") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - default options are not a table", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - default options are not a table", 2);
|
||||
elseif(type(default) ~= "table" and type(default) ~= "nil") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - properties options are not a table", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - properties options are not a table", 2);
|
||||
elseif(regionTypes[name]) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionType - region type \""..name.."\" already defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionType - region type \""..name.."\" already defined", 2);
|
||||
else
|
||||
regionTypes[name] = {
|
||||
create = createFunction,
|
||||
@@ -443,27 +443,27 @@ function WeakAuras.RegisterSubRegionType(name, displayName, supportFunction, cre
|
||||
end
|
||||
end
|
||||
|
||||
function WeakAuras.RegisterRegionOptions(name, createFunction, icon, displayName, createThumbnail, modifyThumbnail, description, templates, getAnchors)
|
||||
function Private.RegisterRegionOptions(name, createFunction, icon, displayName, createThumbnail, modifyThumbnail, description, templates, getAnchors)
|
||||
if not(name) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - name is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - name is not defined", 2);
|
||||
elseif(type(name) ~= "string") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - name is not a string", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - name is not a string", 2);
|
||||
elseif not(createFunction) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - creation function is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - creation function is not defined", 2);
|
||||
elseif(type(createFunction) ~= "function") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - creation function is not a function", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - creation function is not a function", 2);
|
||||
elseif not(icon) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - icon is not defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - icon is not defined", 2);
|
||||
elseif not(type(icon) == "string" or type(icon) == "function") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - icon is not a string or a function", 2)
|
||||
error("Improper arguments to Private.RegisterRegionOptions - icon is not a string or a function", 2)
|
||||
elseif not(displayName) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - display name is not defined".." "..name, 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - display name is not defined".." "..name, 2);
|
||||
elseif(type(displayName) ~= "string") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - display name is not a string", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - display name is not a string", 2);
|
||||
elseif (getAnchors and type(getAnchors) ~= "function") then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - anchors is not a function", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - anchors is not a function", 2);
|
||||
elseif(regionOptions[name]) then
|
||||
error("Improper arguments to WeakAuras.RegisterRegionOptions - region type \""..name.."\" already defined", 2);
|
||||
error("Improper arguments to Private.RegisterRegionOptions - region type \""..name.."\" already defined", 2);
|
||||
else
|
||||
local templateIcon
|
||||
if (type(icon) == "function") then
|
||||
|
||||
@@ -794,4 +794,7 @@ local function GetAnchors(data)
|
||||
end
|
||||
|
||||
-- Register new region type options with WeakAuras
|
||||
WeakAuras.RegisterRegionOptions("aurabar", createOptions, createIcon, L["Progress Bar"], createThumbnail, modifyThumbnail, L["Shows a progress bar with name, timer, and icon"], templates, GetAnchors);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("aurabar", createOptions, createIcon, L["Progress Bar"], createThumbnail, modifyThumbnail, L["Shows a progress bar with name, timer, and icon"], templates, GetAnchors);
|
||||
end)
|
||||
@@ -639,4 +639,7 @@ local function createIcon()
|
||||
return thumbnail
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionOptions("dynamicgroup", createOptions, createIcon, L["Dynamic Group"], createThumbnail, modifyThumbnail, L["A group that dynamically controls the positioning of its children"]);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("dynamicgroup", createOptions, createIcon, L["Dynamic Group"], createThumbnail, modifyThumbnail, L["A group that dynamically controls the positioning of its children"]);
|
||||
end)
|
||||
|
||||
@@ -704,5 +704,8 @@ local function createIcon()
|
||||
end
|
||||
|
||||
-- Register new region type options with WeakAuras
|
||||
WeakAuras.RegisterRegionOptions("group", createOptions, createIcon, L["Group"], createThumbnail, modifyThumbnail,
|
||||
L["Controls the positioning and configuration of multiple displays at the same time"])
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("group", createOptions, createIcon, L["Group"], createThumbnail, modifyThumbnail,
|
||||
L["Controls the positioning and configuration of multiple displays at the same time"])
|
||||
end)
|
||||
|
||||
@@ -488,4 +488,10 @@ local function GetAnchors(data)
|
||||
return anchorPoints;
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionOptions("icon", createOptions, "interface\\icons\\spell_holy_sealofsalvation.blp", L["Icon"], createThumbnail, modifyThumbnail, L["Shows a spell icon with an optional cooldown overlay"], templates, GetAnchors);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("icon", createOptions, "interface\\icons\\spell_holy_sealofsalvation.blp", L["Icon"],
|
||||
createThumbnail, modifyThumbnail,
|
||||
L["Shows a spell icon with an optional cooldown overlay"],
|
||||
templates, GetAnchors);
|
||||
end)
|
||||
|
||||
@@ -297,5 +297,8 @@ local templates = {
|
||||
},
|
||||
}
|
||||
|
||||
WeakAuras.RegisterRegionOptions("model", createOptions, createIcon, L["Model"], createThumbnail, modifyThumbnail,
|
||||
L["Shows a 3D model from the game files"], templates)
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("model", createOptions, createIcon, L["Model"], createThumbnail, modifyThumbnail,
|
||||
L["Shows a 3D model from the game files"], templates);
|
||||
end)
|
||||
|
||||
@@ -797,4 +797,7 @@ local templates = {
|
||||
},
|
||||
}
|
||||
|
||||
WeakAuras.RegisterRegionOptions("progresstexture", createOptions, createIcon, L["Progress Texture"], createThumbnail, modifyThumbnail, L["Shows a texture that changes based on duration"], templates);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("progresstexture", createOptions, createIcon, L["Progress Texture"], createThumbnail, modifyThumbnail, L["Shows a texture that changes based on duration"], templates);
|
||||
end)
|
||||
|
||||
@@ -706,4 +706,8 @@ local function createIcon()
|
||||
return thumbnail;
|
||||
end
|
||||
|
||||
WeakAuras.RegisterRegionOptions("stopmotion", createOptions, createIcon, L["Stop Motion"], createThumbnail, modifyThumbnail, L["Shows a stop motion texture"]);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("stopmotion", createOptions, createIcon, L["Stop Motion"],
|
||||
createThumbnail, modifyThumbnail, L["Shows a stop motion texture"]);
|
||||
end)
|
||||
|
||||
@@ -473,4 +473,7 @@ local templates = {
|
||||
}
|
||||
}
|
||||
|
||||
WeakAuras.RegisterRegionOptions("text", createOptions, createIcon, L["Text"], createThumbnail, modifyThumbnail, L["Shows one or more lines of text, which can include dynamic information such as progress or stacks"], templates);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("text", createOptions, createIcon, L["Text"], createThumbnail, modifyThumbnail, L["Shows one or more lines of text, which can include dynamic information such as progress or stacks"], templates);
|
||||
end)
|
||||
|
||||
@@ -244,4 +244,8 @@ local templates = {
|
||||
},
|
||||
}
|
||||
|
||||
WeakAuras.RegisterRegionOptions("texture", createOptions, createIcon, L["Texture"], createThumbnail, modifyThumbnail, L["Shows a custom texture"], templates);
|
||||
OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
|
||||
table.insert(OptionsPrivate.registerRegions, function()
|
||||
OptionsPrivate.Private.RegisterRegionOptions("texture", createOptions, createIcon, L["Texture"], createThumbnail, modifyThumbnail,
|
||||
L["Shows a custom texture"], templates);
|
||||
end)
|
||||
|
||||
@@ -574,6 +574,10 @@ function WeakAuras.ToggleOptions(msg, Private)
|
||||
if not OptionsPrivate.Private then
|
||||
OptionsPrivate.Private = Private
|
||||
Private.OptionsFrame = OptionsFrame
|
||||
for _, fn in ipairs(OptionsPrivate.registerRegions) do
|
||||
fn()
|
||||
end
|
||||
|
||||
OptionsPrivate.Private.callbacks:RegisterCallback("AuraWarningsUpdated", function(event, uid)
|
||||
local id = OptionsPrivate.Private.UIDtoID(uid)
|
||||
if displayButtons[id] then
|
||||
|
||||
Reference in New Issue
Block a user