from retail

This commit is contained in:
NoM0Re
2025-01-17 17:37:35 +01:00
parent f970df8eab
commit 89a247addb
21 changed files with 81 additions and 45 deletions
+2 -2
View File
@@ -93,10 +93,10 @@ if not WeakAuras.IsLibsOK() then
end end
-- These function stubs are defined here to reduce the number of errors that occur if WeakAuras.lua fails to compile -- 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 end
function WeakAuras.RegisterRegionOptions(_, _ , _ ,_) function Private.RegisterRegionOptions(_, _ , _ ,_)
end end
function Private.StartProfileSystem(_) function Private.StartProfileSystem(_)
+1 -1
View File
@@ -1372,4 +1372,4 @@ local function validate(data)
end end
-- Register new region type with WeakAuras -- Register new region type with WeakAuras
WeakAuras.RegisterRegionType("aurabar", create, modify, default, GetProperties, validate); Private.RegisterRegionType("aurabar", create, modify, default, GetProperties, validate);
+1 -1
View File
@@ -1566,4 +1566,4 @@ local function modify(parent, region, data)
Private.regionPrototype.modifyFinish(parent, region, data) Private.regionPrototype.modifyFinish(parent, region, data)
end end
WeakAuras.RegisterRegionType("dynamicgroup", create, modify, default) Private.RegisterRegionType("dynamicgroup", create, modify, default)
+1 -1
View File
@@ -183,4 +183,4 @@ local function modify(parent, region, data)
end end
-- Register new region type with WeakAuras -- Register new region type with WeakAuras
WeakAuras.RegisterRegionType("group", create, modify, default); Private.RegisterRegionType("group", create, modify, default);
+1 -1
View File
@@ -687,4 +687,4 @@ local function validate(data)
Private.EnforceSubregionExists(data, "subbackground") Private.EnforceSubregionExists(data, "subbackground")
end end
WeakAuras.RegisterRegionType("icon", create, modify, default, GetProperties, validate) Private.RegisterRegionType("icon", create, modify, default, GetProperties, validate)
+1 -1
View File
@@ -301,4 +301,4 @@ local function validate(data)
end end
-- Register new region type with WeakAuras -- Register new region type with WeakAuras
WeakAuras.RegisterRegionType("model", create, modify, default, GetProperties, validate); Private.RegisterRegionType("model", create, modify, default, GetProperties, validate);
+1 -1
View File
@@ -1036,4 +1036,4 @@ local function validate(data)
Private.EnforceSubregionExists(data, "subbackground") Private.EnforceSubregionExists(data, "subbackground")
end end
WeakAuras.RegisterRegionType("progresstexture", create, modify, default, GetProperties, validate); Private.RegisterRegionType("progresstexture", create, modify, default, GetProperties, validate);
+1 -1
View File
@@ -488,4 +488,4 @@ local function validate(data)
Private.EnforceSubregionExists(data, "subbackground") Private.EnforceSubregionExists(data, "subbackground")
end end
WeakAuras.RegisterRegionType("stopmotion", create, modify, default, properties, validate); Private.RegisterRegionType("stopmotion", create, modify, default, properties, validate);
+2 -2
View File
@@ -341,7 +341,7 @@ local function validate(data)
Private.EnforceSubregionExists(data, "subbackground") Private.EnforceSubregionExists(data, "subbackground")
end end
WeakAuras.RegisterRegionType("text", create, modify, default, GetProperties, validate); Private.RegisterRegionType("text", create, modify, default, GetProperties, validate);
-- Fallback region type -- Fallback region type
@@ -366,4 +366,4 @@ local function fallbackmodify(parent, region, data)
Private.regionPrototype.modifyFinish(parent, region, data); Private.regionPrototype.modifyFinish(parent, region, data);
end end
WeakAuras.RegisterRegionType("fallback", create, fallbackmodify, default); Private.RegisterRegionType("fallback", create, fallbackmodify, default);
+1 -1
View File
@@ -237,4 +237,4 @@ local function validate(data)
Private.EnforceSubregionExists(data, "subbackground") Private.EnforceSubregionExists(data, "subbackground")
end end
WeakAuras.RegisterRegionType("texture", create, modify, default, properties, validate); Private.RegisterRegionType("texture", create, modify, default, properties, validate);
+22 -22
View File
@@ -349,27 +349,27 @@ function Private.validate(input, default)
end end
end end
function WeakAuras.RegisterRegionType(name, createFunction, modifyFunction, default, properties, validate) function Private.RegisterRegionType(name, createFunction, modifyFunction, default, properties, validate)
if not(name) then 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 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 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 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 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 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 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 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 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 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 else
regionTypes[name] = { regionTypes[name] = {
create = createFunction, create = createFunction,
@@ -443,27 +443,27 @@ function WeakAuras.RegisterSubRegionType(name, displayName, supportFunction, cre
end end
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 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 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 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 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 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 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 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 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 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 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 else
local templateIcon local templateIcon
if (type(icon) == "function") then if (type(icon) == "function") then
+4 -1
View File
@@ -794,4 +794,7 @@ local function GetAnchors(data)
end end
-- Register new region type options with WeakAuras -- 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 return thumbnail
end 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)
+5 -2
View File
@@ -704,5 +704,8 @@ local function createIcon()
end end
-- Register new region type options with WeakAuras -- Register new region type options with WeakAuras
WeakAuras.RegisterRegionOptions("group", createOptions, createIcon, L["Group"], createThumbnail, modifyThumbnail, OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
L["Controls the positioning and configuration of multiple displays at the same time"]) 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)
+7 -1
View File
@@ -488,4 +488,10 @@ local function GetAnchors(data)
return anchorPoints; return anchorPoints;
end 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)
+5 -2
View File
@@ -297,5 +297,8 @@ local templates = {
}, },
} }
WeakAuras.RegisterRegionOptions("model", createOptions, createIcon, L["Model"], createThumbnail, modifyThumbnail, OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {}
L["Shows a 3D model from the game files"], templates) 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; return thumbnail;
end 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)
+4 -1
View File
@@ -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)
+5 -1
View File
@@ -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)
+4
View File
@@ -574,6 +574,10 @@ function WeakAuras.ToggleOptions(msg, Private)
if not OptionsPrivate.Private then if not OptionsPrivate.Private then
OptionsPrivate.Private = Private OptionsPrivate.Private = Private
Private.OptionsFrame = OptionsFrame Private.OptionsFrame = OptionsFrame
for _, fn in ipairs(OptionsPrivate.registerRegions) do
fn()
end
OptionsPrivate.Private.callbacks:RegisterCallback("AuraWarningsUpdated", function(event, uid) OptionsPrivate.Private.callbacks:RegisterCallback("AuraWarningsUpdated", function(event, uid)
local id = OptionsPrivate.Private.UIDtoID(uid) local id = OptionsPrivate.Private.UIDtoID(uid)
if displayButtons[id] then if displayButtons[id] then