This commit is contained in:
Bunny67
2020-09-14 10:12:22 +03:00
parent 6c3f9d925e
commit 0f4f16b6f0
71 changed files with 2302 additions and 2431 deletions
@@ -50,32 +50,25 @@ local function copyAuraPart(source, destination, part)
end
end
if (part == "trigger" or all) and not IsRegionAGroup(source) then
destination.triggers = {};
WeakAuras.DeepCopy(source.triggers, destination.triggers);
destination.triggers = CopyTable(source.triggers);
end
if (part == "condition" or all) and not IsRegionAGroup(source) then
destination.conditions = {};
WeakAuras.DeepCopy(source.conditions, destination.conditions);
destination.conditions = CopyTable(source.conditions);
end
if (part == "load" or all) and not IsRegionAGroup(source) then
destination.load = {};
WeakAuras.DeepCopy(source.load, destination.load);
destination.load = CopyTable(source.load);
end
if (part == "action" or all) and not IsRegionAGroup(source) then
destination.actions = {};
WeakAuras.DeepCopy(source.actions, destination.actions);
destination.actions = CopyTable(source.actions);
end
if (part == "animation" or all) and not IsRegionAGroup(source) then
destination.animation = {};
WeakAuras.DeepCopy(source.animation, destination.animation);
destination.animation = CopyTable(source.animation);
end
if (part == "authorOptions" or all) and not IsRegionAGroup(source) then
destination.authorOptions = {};
WeakAuras.DeepCopy(source.authorOptions, destination.authorOptions);
destination.authorOptions = CopyTable(source.authorOptions);
end
if (part == "config" or all) and not IsRegionAGroup(source) then
destination.config = {};
WeakAuras.DeepCopy(source.config, destination.config);
destination.config = CopyTable(source.config);
end
end
@@ -83,8 +76,7 @@ end
local function CopyToClipboard(part, description)
clipboard.part = part;
clipboard.pasteText = description;
clipboard.source = {};
WeakAuras.DeepCopy(clipboard.current, clipboard.source);
clipboard.source = CopyTable(clipboard.current);
end
clipboard.pasteMenuEntry = {
@@ -106,7 +98,7 @@ clipboard.pasteMenuEntry = {
end
WeakAuras.FillOptions()
WeakAuras.ScanForLoads({[clipboard.current.id] = true});
OptionsPrivate.Private.ScanForLoads({[clipboard.current.id] = true});
WeakAuras.SortDisplayButtons();
WeakAuras.PickDisplay(clipboard.current.id);
WeakAuras.UpdateDisplayButton(clipboard.current.id);
@@ -466,7 +458,7 @@ local function GetDropTarget()
end
local function Show_DropIndicator(id)
local indicator = WeakAuras.DropIndicator()
local indicator = OptionsPrivate.DropIndicator()
local source = WeakAuras.GetDisplayButton(id)
local target, pos
if source then
@@ -517,10 +509,10 @@ local methods = {
function self.callbacks.OnClickNormal(_, mouseButton)
if(IsControlKeyDown() and not data.controlledChildren) then
if (WeakAuras.IsDisplayPicked(data.id)) then
WeakAuras.ClearPick(data.id);
if (OptionsPrivate.IsDisplayPicked(data.id)) then
OptionsPrivate.ClearPick(data.id);
else
WeakAuras.PickDisplayMultiple(data.id);
OptionsPrivate.PickDisplayMultiple(data.id);
end
self:ReloadTooltip();
elseif(IsShiftKeyDown()) then
@@ -537,23 +529,23 @@ local methods = {
editbox:Insert("[WeakAuras: "..fullName.." - "..data.id.."]");
elseif not data.controlledChildren then
-- select all buttons between 1st select and current
WeakAuras.PickDisplayMultipleShift(data.id)
OptionsPrivate.PickDisplayMultipleShift(data.id)
end
else
if(mouseButton == "RightButton") then
Hide_Tooltip();
if(WeakAuras.IsDisplayPicked(data.id) and WeakAuras.IsPickedMultiple()) then
EasyMenu(WeakAuras.MultipleDisplayTooltipMenu(), WeakAuras_DropDownMenu, self.frame, 0, 0, "MENU");
if(OptionsPrivate.IsDisplayPicked(data.id) and OptionsPrivate.IsPickedMultiple()) then
EasyMenu(OptionsPrivate.MultipleDisplayTooltipMenu(), WeakAuras_DropDownMenu, self.frame, 0, 0, "MENU");
else
UpdateClipboardMenuEntry(data);
EasyMenu(self.menu, WeakAuras_DropDownMenu, self.frame, 0, 0, "MENU");
if not(WeakAuras.IsDisplayPicked(data.id)) then
if not(OptionsPrivate.IsDisplayPicked(data.id)) then
WeakAuras.PickDisplay(data.id);
end
end
else
if (WeakAuras.IsDisplayPicked(data.id)) then
WeakAuras.ClearPicks();
if (OptionsPrivate.IsDisplayPicked(data.id)) then
OptionsPrivate.ClearPicks();
else
WeakAuras.PickDisplay(data.id);
end
@@ -602,46 +594,46 @@ local methods = {
WeakAuras.Add(data);
WeakAuras.ClearAndUpdateOptions(data.id)
self.callbacks.UpdateExpandButton();
WeakAuras.SetGrouping();
OptionsPrivate.SetGrouping();
WeakAuras.UpdateDisplayButton(data);
WeakAuras.ClearAndUpdateOptions(data.id);
WeakAuras.FillOptions();
WeakAuras.UpdateGroupOrders(data);
WeakAuras.SortDisplayButtons();
self:ReloadTooltip();
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
function self.callbacks.OnClickGroupingSelf()
WeakAuras.SetGrouping();
OptionsPrivate.SetGrouping();
self:ReloadTooltip();
end
function self.callbacks.OnGroupClick()
WeakAuras.SetGrouping(data);
OptionsPrivate.SetGrouping(data);
end
function self.callbacks.OnDeleteClick()
if (WeakAuras.IsImporting()) then return end;
local toDelete = {data}
local parents = data.parent and {[data.parent] = true}
WeakAuras.ConfirmDelete(toDelete, parents)
OptionsPrivate.ConfirmDelete(toDelete, parents)
end
function self.callbacks.OnDuplicateClick()
if (WeakAuras.IsImporting()) then return end;
if data.controlledChildren then
local new_idGroup = WeakAuras.DuplicateAura(data)
local new_idGroup = OptionsPrivate.DuplicateAura(data)
for index, childId in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId)
WeakAuras.DuplicateAura(childData, new_idGroup)
OptionsPrivate.DuplicateAura(childData, new_idGroup)
end
WeakAuras.SortDisplayButtons()
WeakAuras.PickAndEditDisplay(new_idGroup)
OptionsPrivate.PickAndEditDisplay(new_idGroup)
else
local new_id = WeakAuras.DuplicateAura(data)
local new_id = OptionsPrivate.DuplicateAura(data)
WeakAuras.SortDisplayButtons()
WeakAuras.PickAndEditDisplay(new_id)
OptionsPrivate.PickAndEditDisplay(new_id)
end
end
@@ -660,11 +652,11 @@ local methods = {
end
end
tinsert(toDelete, data)
WeakAuras.ConfirmDelete(toDelete);
OptionsPrivate.ConfirmDelete(toDelete);
end
function self.callbacks.OnUngroupClick()
WeakAuras.Ungroup(data);
OptionsPrivate.Ungroup(data);
end
function self.callbacks.OnUpGroupClick()
@@ -693,8 +685,8 @@ local methods = {
WeakAuras.SortDisplayButtons();
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index-1]).uid, "main", updata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", downdata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
OptionsPrivate.Private.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index-1]).uid, "main", updata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
OptionsPrivate.Private.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", downdata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
WeakAuras.UpdateDisplayButton(parentData);
WeakAuras.FillOptions()
end
@@ -732,8 +724,8 @@ local methods = {
WeakAuras.SortDisplayButtons()
local updata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = -32};
local downdata = {duration = 0.15, type = "custom", use_translate = true, x = 0, y = 32};
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index+1]).uid, "main", downdata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
WeakAuras.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", updata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
OptionsPrivate.Private.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index+1]).uid, "main", downdata, self.frame, true, function() WeakAuras.SortDisplayButtons() end);
OptionsPrivate.Private.Animate("button", WeakAuras.GetData(parentData.controlledChildren[index]).uid, "main", updata, otherbutton.frame, true, function() WeakAuras.SortDisplayButtons() end);
WeakAuras.UpdateDisplayButton(parentData);
WeakAuras.FillOptions()
end
@@ -746,7 +738,7 @@ local methods = {
end
function self.callbacks.OnViewClick()
WeakAuras.PauseAllDynamicGroups();
OptionsPrivate.Private.PauseAllDynamicGroups();
if(self.view.func() == 2) then
for index, childId in ipairs(data.controlledChildren) do
@@ -758,7 +750,7 @@ local methods = {
end
end
WeakAuras.ResumeAllDynamicGroups();
OptionsPrivate.Private.ResumeAllDynamicGroups();
end
function self.callbacks.ViewTest()
@@ -807,26 +799,26 @@ local methods = {
local oldid = data.id;
if not(newid == oldid) then
WeakAuras.Rename(data, newid);
WeakAuras.HandleRename(data, oldid, newid)
OptionsPrivate.HandleRename(data, oldid, newid)
end
end
function self.callbacks.OnDragStart()
if WeakAuras.IsImporting() or self:IsGroup() then return end;
if #WeakAuras.tempGroup.controlledChildren == 0 then
if #OptionsPrivate.tempGroup.controlledChildren == 0 then
WeakAuras.PickDisplay(data.id);
end
WeakAuras.SetDragging(data);
OptionsPrivate.SetDragging(data);
end
function self.callbacks.OnDragStop()
if not self.dragging then return end
WeakAuras.SetDragging(data, true)
OptionsPrivate.SetDragging(data, true)
end
function self.callbacks.OnKeyDown(self, key)
if (key == "ESCAPE") then
WeakAuras.SetDragging();
OptionsPrivate.SetDragging();
end
end
@@ -906,7 +898,7 @@ local methods = {
text = regionData.displayName,
notCheckable = true,
func = function()
WeakAuras.ConvertDisplay(data, regionType);
OptionsPrivate.ConvertDisplay(data, regionType);
WeakAuras_DropDownMenu:Hide();
end
});
@@ -929,12 +921,12 @@ local methods = {
tinsert(self.menu, {
text = L["Export to string..."],
notCheckable = true,
func = function() WeakAuras.ExportToString(data.id) end
func = function() OptionsPrivate.ExportToString(data.id) end
});
tinsert(self.menu, {
text = L["Export to Lua table..."],
notCheckable = true,
func = function() WeakAuras.ExportToTable(data.id) end
func = function() OptionsPrivate.ExportToTable(data.id) end
});
if WeakAurasCompanion then
@@ -1060,14 +1052,14 @@ local methods = {
namestable[1] = L["No Children"];
end
else
WeakAuras.GetTriggerDescription(data, -1, namestable)
OptionsPrivate.Private.GetTriggerDescription(data, -1, namestable)
end
if(WeakAuras.CanHaveClones(data)) then
if(OptionsPrivate.Private.CanHaveClones(data)) then
tinsert(namestable, {" ", "|cFF00FF00"..L["Auto-cloning enabled"]})
end
if(WeakAuras.IsDefinedByAddon(data.id)) then
if(OptionsPrivate.Private.IsDefinedByAddon(data.id)) then
tinsert(namestable, " ");
tinsert(namestable, {" ", "|cFF00FFFF"..L["Addon"]..": "..WeakAuras.IsDefinedByAddon(data.id)});
tinsert(namestable, {" ", "|cFF00FFFF"..L["Addon"]..": "..OptionsPrivate.Private.IsDefinedByAddon(data.id)});
end
local hasDescription = data.desc and data.desc ~= "";
@@ -1102,8 +1094,8 @@ local methods = {
self:SetDescription({data.id, displayName}, unpack(namestable));
end,
["ReloadTooltip"] = function(self)if(
WeakAuras.IsPickedMultiple() and WeakAuras.IsDisplayPicked(self.data.id)) then
Show_Long_Tooltip(self.frame, WeakAuras.MultipleDisplayTooltipDesc());
OptionsPrivate.IsPickedMultiple() and OptionsPrivate.IsDisplayPicked(self.data.id)) then
Show_Long_Tooltip(self.frame, OptionsPrivate.MultipleDisplayTooltipDesc());
else
Show_Long_Tooltip(self.frame, self.frame.description);
end
@@ -1250,7 +1242,7 @@ local methods = {
end)
Show_DropIndicator(id)
end
WeakAuras.UpdateButtonsScroll()
OptionsPrivate.UpdateButtonsScroll()
end,
["Drop"] = function(self, reset)
Show_DropIndicator()
@@ -1281,7 +1273,7 @@ local methods = {
-- exit if we have no target or only want to reset
self.multi = nil
if reset or not target then
return WeakAuras.UpdateButtonsScroll()
return OptionsPrivate.UpdateButtonsScroll()
end
local action = GetAction(target, area, self)
if action then
@@ -1370,7 +1362,7 @@ local methods = {
end,
["Expand"] = function(self, reloadTooltip)
self.expand:Enable();
WeakAuras.SetCollapsed(self.data.id, "displayButton", "", false)
OptionsPrivate.SetCollapsed(self.data.id, "displayButton", "", false)
self.expand:SetNormalTexture("Interface\\BUTTONS\\UI-MinusButton-Up.blp");
self.expand:SetPushedTexture("Interface\\BUTTONS\\UI-MinusButton-Down.blp");
self.expand.title = L["Collapse"];
@@ -1384,7 +1376,7 @@ local methods = {
end,
["Collapse"] = function(self, reloadTooltip)
self.expand:Enable();
WeakAuras.SetCollapsed(self.data.id, "displayButton", "", true)
OptionsPrivate.SetCollapsed(self.data.id, "displayButton", "", true)
self.expand:SetNormalTexture("Interface\\BUTTONS\\UI-PlusButton-Up.blp");
self.expand:SetPushedTexture("Interface\\BUTTONS\\UI-PlusButton-Down.blp");
self.expand.title = L["Expand"];
@@ -1400,7 +1392,7 @@ local methods = {
self.expand.func = func;
end,
["GetExpanded"] = function(self)
return not WeakAuras.IsCollapsed(self.data.id, "displayButton", "", true)
return not OptionsPrivate.IsCollapsed(self.data.id, "displayButton", "", true)
end,
["DisableExpand"] = function(self)
self.expand:Disable();
@@ -1798,8 +1790,8 @@ local function Constructor()
button.description = {};
button:SetScript("OnEnter", function()
if(WeakAuras.IsPickedMultiple() and WeakAuras.IsDisplayPicked(button.id)) then
Show_Long_Tooltip(button, WeakAuras.MultipleDisplayTooltipDesc());
if(OptionsPrivate.IsPickedMultiple() and OptionsPrivate.IsDisplayPicked(button.id)) then
Show_Long_Tooltip(button, OptionsPrivate.MultipleDisplayTooltipDesc());
else
if not(button.terribleCodeOrganizationHackTable.IsGroupingOrCopying()) then
button.terribleCodeOrganizationHackTable.SetNormalTooltip();
@@ -1831,9 +1823,9 @@ local function Constructor()
if(priority >= self.visibility) then
self.visibility = priority;
if(self.region and self.region.Expand) then
WeakAuras.FakeStatesFor(self.region.id, true)
if (WeakAuras.mouseFrame) then
WeakAuras.mouseFrame:expand(self.region.id);
OptionsPrivate.Private.FakeStatesFor(self.region.id, true)
if (OptionsPrivate.Private.mouseFrame) then
OptionsPrivate.Private.mouseFrame:expand(self.region.id);
end
end
end
@@ -1848,9 +1840,9 @@ local function Constructor()
if(priority >= self.visibility) then
self.visibility = 0;
if(self.region and self.region.Collapse) then
WeakAuras.FakeStatesFor(self.region.id, false)
if (WeakAuras.mouseFrame) then
WeakAuras.mouseFrame:collapse(self.region.id);
OptionsPrivate.Private.FakeStatesFor(self.region.id, false)
if (OptionsPrivate.Private.mouseFrame) then
OptionsPrivate.Private.mouseFrame:collapse(self.region.id);
end
end
end
@@ -3,7 +3,7 @@ Button Widget for our Expand button
-------------------------------------------------------------------------------]]
if not WeakAuras.IsCorrectVersion() then return end
local Type, Version = "WeakAurasExpand", 1
local Type, Version = "WeakAurasExpand", 2
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -1,7 +1,9 @@
--[[-----------------------------------------------------------------------------
Anchor for a Expandable section
-------------------------------------------------------------------------------]]
local Type, Version = "WeakAurasExpandAnchor", 1
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local Type, Version = "WeakAurasExpandAnchor", 2
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -27,8 +29,8 @@ local function OnFrameShow(frame)
local self = frame.obj
local option = self.userdata.option
if option and option.arg and option.arg.expanderName then
WeakAuras.expanderAnchors[option.arg.expanderName] = self
local otherWidget = WeakAuras.expanderButtons[option.arg.expanderName]
OptionsPrivate.expanderAnchors[option.arg.expanderName] = self
local otherWidget = OptionsPrivate.expanderButtons[option.arg.expanderName]
if otherWidget then
otherWidget:SetAnchor(self)
end
@@ -39,9 +41,9 @@ local function OnFrameHide(frame)
local self = frame.obj
local option = self.userdata.option
if option and option.arg and option.arg.expanderName then
WeakAuras.expanderAnchors[option.arg.expanderName] = nil
OptionsPrivate.expanderAnchors[option.arg.expanderName] = nil
local otherWidget = WeakAuras.expanderButtons[option.arg.expanderName]
local otherWidget = OptionsPrivate.expanderButtons[option.arg.expanderName]
if otherWidget then
otherWidget:SetAnchor(nil)
end
@@ -2,8 +2,9 @@
Button Widget for our Expand button
-------------------------------------------------------------------------------]]
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local Type, Version = "WeakAurasExpandSmall", 1
local Type, Version = "WeakAurasExpandSmall", 2
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -144,9 +145,9 @@ local function OnFrameShow(frame)
local self = frame.obj
local option = self.userdata.option
if option and option.arg and option.arg.expanderName then
WeakAuras.expanderButtons[option.arg.expanderName] = self
OptionsPrivate.expanderButtons[option.arg.expanderName] = self
local otherWidget = WeakAuras.expanderAnchors[option.arg.expanderName]
local otherWidget = OptionsPrivate.expanderAnchors[option.arg.expanderName]
if otherWidget then
self:SetAnchor(otherWidget)
end
@@ -157,9 +158,9 @@ local function OnFrameHide(frame)
local self = frame.obj
local option = self.userdata.option
if option and option.arg and option.arg.expanderName then
WeakAuras.expanderButtons[option.arg.expanderName] = nil
OptionsPrivate.expanderButtons[option.arg.expanderName] = nil
local otherWidget = WeakAuras.expanderAnchors[option.arg.expanderName]
local otherWidget = OptionsPrivate.expanderAnchors[option.arg.expanderName]
if otherWidget then
self:SetAnchor(nil)
end
@@ -1,6 +1,6 @@
if not WeakAuras.IsCorrectVersion() then return end
local Type, Version = "WeakAurasMultiLineEditBox", 34
local Type, Version = "WeakAurasMultiLineEditBox", 35
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -234,4 +234,4 @@ local function Constructor()
return AceGUI:RegisterAsWidget(widget)
end
AceGUI:RegisterWidgetType(Type, Constructor, Version)
AceGUI:RegisterWidgetType(Type, Constructor, Version)
+41 -44
View File
@@ -3,19 +3,16 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local removeFuncs = WeakAuras.commonOptions.removeFuncs
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("action")
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("action")
local getAll = WeakAuras.commonOptions.CreateGetAll("action")
local setAll = WeakAuras.commonOptions.CreateSetAll("action", getAll)
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("action")
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("action")
local getAll = OptionsPrivate.commonOptions.CreateGetAll("action")
local setAll = OptionsPrivate.commonOptions.CreateSetAll("action", getAll)
local send_chat_message_types = WeakAuras.send_chat_message_types;
local sound_types = WeakAuras.sound_types;
function WeakAuras.GetActionOptions(data)
function OptionsPrivate.GetActionOptions(data)
local action = {
type = "group",
name = L["Actions"],
@@ -93,7 +90,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Message Type"],
order = 2,
values = send_chat_message_types,
values = OptionsPrivate.Private.send_chat_message_types,
disabled = function() return not data.actions.start.do_message end,
control = "WeakAurasSortedDropdown"
},
@@ -135,7 +132,7 @@ function WeakAuras.GetActionOptions(data)
order = 4,
disabled = function() return not data.actions.start.do_message end,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
return L["Dynamic text tooltip"] .. OptionsPrivate.Private.GetAdditionalProperties(data)
end,
},
-- texteditor added later
@@ -172,7 +169,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Sound"],
order = 8.4,
values = sound_types,
values = OptionsPrivate.Private.sound_types,
disabled = function() return not data.actions.start.do_sound end,
control = "WeakAurasSortedDropdown"
},
@@ -181,7 +178,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Sound Channel"],
order = 8.5,
values = WeakAuras.sound_channel_types,
values = OptionsPrivate.Private.sound_channel_types,
disabled = function() return not data.actions.start.do_sound end,
get = function() return data.actions.start.sound_channel or "Master" end
},
@@ -212,7 +209,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Glow Action"],
order = 10.2,
values = WeakAuras.glow_action_types,
values = OptionsPrivate.Private.glow_action_types,
disabled = function() return not data.actions.start.do_glow end
},
start_glow_frame_type = {
@@ -248,7 +245,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Glow Type"],
order = 10.4,
values = WeakAuras.glow_types,
values = OptionsPrivate.Private.glow_types,
hidden = function()
return not data.actions.start.do_glow
or data.actions.start.glow_action ~= "show"
@@ -274,9 +271,9 @@ function WeakAuras.GetActionOptions(data)
func = function()
if(data.controlledChildren and data.controlledChildren[1]) then
WeakAuras.PickDisplay(data.controlledChildren[1]);
WeakAuras.StartFrameChooser(WeakAuras.GetData(data.controlledChildren[1]), {"actions", "start", "glow_frame"});
OptionsPrivate.StartFrameChooser(WeakAuras.GetData(data.controlledChildren[1]), {"actions", "start", "glow_frame"});
else
WeakAuras.StartFrameChooser(data, {"actions", "start", "glow_frame"});
OptionsPrivate.StartFrameChooser(data, {"actions", "start", "glow_frame"});
end
end
},
@@ -465,7 +462,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Message Type"],
order = 22,
values = send_chat_message_types,
values = OptionsPrivate.Private.send_chat_message_types,
disabled = function() return not data.actions.finish.do_message end,
control = "WeakAurasSortedDropdown"
},
@@ -507,7 +504,7 @@ function WeakAuras.GetActionOptions(data)
order = 24,
disabled = function() return not data.actions.finish.do_message end,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
return L["Dynamic text tooltip"] .. OptionsPrivate.Private.GetAdditionalProperties(data)
end,
},
-- texteditor added below
@@ -522,7 +519,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Sound"],
order = 28.1,
values = sound_types,
values = OptionsPrivate.Private.sound_types,
disabled = function() return not data.actions.finish.do_sound end,
control = "WeakAurasSortedDropdown"
},
@@ -531,7 +528,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Sound Channel"],
order = 28.5,
values = WeakAuras.sound_channel_types,
values = OptionsPrivate.Private.sound_channel_types,
disabled = function() return not data.actions.finish.do_sound end,
get = function() return data.actions.finish.sound_channel or "Master" end
},
@@ -562,7 +559,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Glow Action"],
order = 30.2,
values = WeakAuras.glow_action_types,
values = OptionsPrivate.Private.glow_action_types,
disabled = function() return not data.actions.finish.do_glow end
},
finish_glow_frame_type = {
@@ -598,7 +595,7 @@ function WeakAuras.GetActionOptions(data)
width = WeakAuras.normalWidth,
name = L["Glow Type"],
order = 30.4,
values = WeakAuras.glow_types,
values = OptionsPrivate.Private.glow_types,
hidden = function()
return not data.actions.finish.do_glow
or data.actions.finish.glow_action ~= "show"
@@ -624,9 +621,9 @@ function WeakAuras.GetActionOptions(data)
func = function()
if(data.controlledChildren and data.controlledChildren[1]) then
WeakAuras.PickDisplay(data.controlledChildren[1]);
WeakAuras.StartFrameChooser(WeakAuras.GetData(data.controlledChildren[1]), {"actions", "finish", "glow_frame"});
OptionsPrivate.StartFrameChooser(WeakAuras.GetData(data.controlledChildren[1]), {"actions", "finish", "glow_frame"});
else
WeakAuras.StartFrameChooser(data, {"actions", "finish", "glow_frame"});
OptionsPrivate.StartFrameChooser(data, {"actions", "finish", "glow_frame"});
end
end
},
@@ -810,18 +807,18 @@ function WeakAuras.GetActionOptions(data)
-- Text format option helpers
WeakAuras.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "init", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-init",
OptionsPrivate.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "init", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-init",
0.011, function() return not data.actions.init.do_custom end, {"actions", "init", "custom"}, true);
WeakAuras.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "start_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
5, function() return not (data.actions.start.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.start.message)) end, {"actions", "start", "message_custom"}, false);
OptionsPrivate.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "start_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
5, function() return not (data.actions.start.do_message and OptionsPrivate.Private.ContainsCustomPlaceHolder(data.actions.start.message)) end, {"actions", "start", "message_custom"}, false);
local startHidden = function()
return WeakAuras.IsCollapsed("format_option", "actions", "start_message", true)
return OptionsPrivate.IsCollapsed("format_option", "actions", "start_message", true)
end
local startSetHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "actions", "start_message", hidden)
OptionsPrivate.SetCollapsed("format_option", "actions", "start_message", hidden)
end
local startGet = function(key)
@@ -863,25 +860,25 @@ function WeakAuras.GetActionOptions(data)
local startGet = function(key)
return childData.actions.start["message_format_" .. key]
end
WeakAuras.AddTextFormatOption(childData.actions and childData.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
end
else
WeakAuras.AddTextFormatOption(data.actions and data.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
OptionsPrivate.AddTextFormatOption(data.actions and data.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
end
WeakAuras.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "start", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-show",
OptionsPrivate.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "start", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-show",
13, function() return not data.actions.start.do_custom end, {"actions", "start", "custom"}, true);
WeakAuras.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "finish_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
25, function() return not (data.actions.finish.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.finish.message)) end, {"actions", "finish", "message_custom"}, false);
OptionsPrivate.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "finish_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
25, function() return not (data.actions.finish.do_message and OptionsPrivate.Private.ContainsCustomPlaceHolder(data.actions.finish.message)) end, {"actions", "finish", "message_custom"}, false);
local finishHidden = function()
return WeakAuras.IsCollapsed("format_option", "actions", "finish_message", true)
return OptionsPrivate.IsCollapsed("format_option", "actions", "finish_message", true)
end
local finishSetHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "actions", "finish_message", hidden)
OptionsPrivate.SetCollapsed("format_option", "actions", "finish_message", hidden)
end
local finishGet = function(key)
@@ -922,13 +919,13 @@ function WeakAuras.GetActionOptions(data)
local finishGet = function(key)
return childData.actions.finish["message_format_" .. key]
end
WeakAuras.AddTextFormatOption(childData.actions and childData.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
end
else
WeakAuras.AddTextFormatOption(data.actions and data.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
OptionsPrivate.AddTextFormatOption(data.actions and data.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
end
WeakAuras.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "finish", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-hide",
OptionsPrivate.commonOptions.AddCodeOption(action.args, data, L["Custom Code"], "finish", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-hide",
32, function() return not data.actions.finish.do_custom end, {"actions", "finish", "custom"}, true);
if data.controlledChildren then
@@ -943,7 +940,7 @@ function WeakAuras.GetActionOptions(data)
if(type(data.id) == "string") then
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
end
action.hidden = function(info, ...) return hiddenAll(data, info, ...); end;
+47 -47
View File
@@ -3,27 +3,14 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local removeFuncs = WeakAuras.commonOptions.removeFuncs
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("animation")
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("animation")
local getAll = WeakAuras.commonOptions.CreateGetAll("animation")
local setAll = WeakAuras.commonOptions.CreateSetAll("animation", getAll)
local anim_types = WeakAuras.anim_types;
local anim_translate_types = WeakAuras.anim_translate_types;
local anim_scale_types = WeakAuras.anim_scale_types;
local anim_alpha_types = WeakAuras.anim_alpha_types;
local anim_rotate_types = WeakAuras.anim_rotate_types;
local anim_color_types = WeakAuras.anim_color_types;
local anim_start_preset_types = WeakAuras.anim_start_preset_types;
local anim_main_preset_types = WeakAuras.anim_main_preset_types;
local anim_finish_preset_types = WeakAuras.anim_finish_preset_types;
local duration_types = WeakAuras.duration_types;
local duration_types_no_choice = WeakAuras.duration_types_no_choice;
local anim_ease_types = WeakAuras.anim_ease_types;
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("animation")
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("animation")
local getAll = OptionsPrivate.commonOptions.CreateGetAll("animation")
local setAll = OptionsPrivate.commonOptions.CreateSetAll("animation", getAll)
local function filterAnimPresetTypes(intable, id)
local ret = {};
@@ -32,7 +19,7 @@ local function filterAnimPresetTypes(intable, id)
local data = WeakAuras.GetData(id);
if(region and regionType and data) then
for key, value in pairs(intable) do
local preset = WeakAuras.anim_presets[key];
local preset = OptionsPrivate.Private.anim_presets[key];
if(preset) then
if(regionType == "group" or regionType == "dynamicgroup") then
local valid = true;
@@ -56,7 +43,20 @@ local function filterAnimPresetTypes(intable, id)
return ret;
end
function WeakAuras.GetAnimationOptions(data)
function OptionsPrivate.GetAnimationOptions(data)
local anim_types = OptionsPrivate.Private.anim_types
local anim_translate_types = OptionsPrivate.Private.anim_translate_types;
local anim_scale_types = OptionsPrivate.Private.anim_scale_types;
local anim_alpha_types = OptionsPrivate.Private.anim_alpha_types;
local anim_rotate_types = OptionsPrivate.Private.anim_rotate_types;
local anim_color_types = OptionsPrivate.Private.anim_color_types;
local anim_start_preset_types = OptionsPrivate.Private.anim_start_preset_types;
local anim_main_preset_types = OptionsPrivate.Private.anim_main_preset_types;
local anim_finish_preset_types = OptionsPrivate.Private.anim_finish_preset_types;
local duration_types = OptionsPrivate.Private.duration_types;
local duration_types_no_choice = OptionsPrivate.Private.duration_types_no_choice;
local anim_ease_types = OptionsPrivate.Private.anim_ease_types;
local id = data.id
local animation = {
type = "group",
@@ -85,10 +85,10 @@ function WeakAuras.GetAnimationOptions(data)
data.animation[field] = data.animation[field] or {};
data.animation[field][value] = v;
if(field == "main") then
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
if(WeakAuras.clones[id]) then
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
WeakAuras.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
end
end
end
@@ -154,7 +154,7 @@ function WeakAuras.GetAnimationOptions(data)
order = 33,
values = duration_types_no_choice,
disabled = true,
hidden = function() return data.animation.start.type ~= "custom" or WeakAuras.CanHaveDuration(data) end,
hidden = function() return data.animation.start.type ~= "custom" or OptionsPrivate.Private.CanHaveDuration(data) end,
get = function() return "seconds" end
},
start_duration_type = {
@@ -163,7 +163,7 @@ function WeakAuras.GetAnimationOptions(data)
name = L["Time in"],
order = 33,
values = duration_types,
hidden = function() return data.animation.start.type ~= "custom" or not WeakAuras.CanHaveDuration(data) end
hidden = function() return data.animation.start.type ~= "custom" or not OptionsPrivate.Private.CanHaveDuration(data) end
},
start_duration = {
type = "input",
@@ -400,7 +400,7 @@ function WeakAuras.GetAnimationOptions(data)
order = 53,
values = duration_types_no_choice,
disabled = true,
hidden = function() return data.animation.main.type ~= "custom" or WeakAuras.CanHaveDuration(data) end,
hidden = function() return data.animation.main.type ~= "custom" or OptionsPrivate.Private.CanHaveDuration(data) end,
get = function() return "seconds" end
},
main_duration_type = {
@@ -409,7 +409,7 @@ function WeakAuras.GetAnimationOptions(data)
name = L["Time in"],
order = 53,
values = duration_types,
hidden = function() return data.animation.main.type ~= "custom" or not WeakAuras.CanHaveDuration(data) end
hidden = function() return data.animation.main.type ~= "custom" or not OptionsPrivate.Private.CanHaveDuration(data) end
},
main_duration = {
type = "input",
@@ -843,10 +843,10 @@ function WeakAuras.GetAnimationOptions(data)
}
local function extraSetFunction()
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[id].region, false, nil, true);
if(WeakAuras.clones[id]) then
for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do
WeakAuras.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, cloneRegion, false, nil, true, cloneId);
end
end
end
@@ -855,93 +855,93 @@ function WeakAuras.GetAnimationOptions(data)
local function hideStartAlphaFunc()
return data.animation.start.type ~= "custom" or data.animation.start.alphaType ~= "custom" or not data.animation.start.use_alpha
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
35.3, hideStartAlphaFunc, {"animation", "start", "alphaFunc"}, false);
local function hideStartTranslate()
return data.animation.start.type ~= "custom" or data.animation.start.translateType ~= "custom" or not data.animation.start.use_translate
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
39.3, hideStartTranslate, {"animation", "start", "translateFunc"}, false);
local function hideStartScale()
return data.animation.start.type ~= "custom" or data.animation.start.scaleType ~= "custom" or not (data.animation.start.use_scale and WeakAuras.regions[id].region.Scale)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-size",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-size",
43.3, hideStartScale, {"animation", "start", "scaleFunc"}, false);
local function hideStartRotateFunc()
return data.animation.start.type ~= "custom" or data.animation.start.rotateType ~= "custom" or not (data.animation.start.use_rotate and WeakAuras.regions[id].region.Rotate)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
47.3, hideStartRotateFunc, {"animation", "start", "rotateFunc"}, false);
local function hideStartColorFunc()
return data.animation.start.type ~= "custom" or data.animation.start.colorType ~= "custom" or not (data.animation.start.use_color and WeakAuras.regions[id].region.Color)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "start_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
48.7, hideStartColorFunc, {"animation", "start", "colorFunc"}, false);
-- Text Editors for "main"
local function hideMainAlphaFunc()
return data.animation.main.type ~= "custom" or data.animation.main.alphaType ~= "custom" or not data.animation.main.use_alpha
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
55.3, hideMainAlphaFunc, {"animation", "main", "alphaFunc"}, false, nil, extraSetFunction);
local function hideMainTranslate()
return data.animation.main.type ~= "custom" or data.animation.main.translateType ~= "custom" or not data.animation.main.use_translate
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
59.3, hideMainTranslate, {"animation", "main", "translateFunc"}, false, nil, extraSetFunction);
local function hideMainScale()
return data.animation.main.type ~= "custom" or data.animation.main.scaleType ~= "custom" or not (data.animation.main.use_scale and WeakAuras.regions[id].region.Scale)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-sizes",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-sizes",
63.3, hideMainScale, {"animation", "main", "scaleFunc"}, false, nil, extraSetFunction);
local function hideMainRotateFunc()
return data.animation.main.type ~= "custom" or data.animation.main.rotateType ~= "custom" or not (data.animation.main.use_rotate and WeakAuras.regions[id].region.Rotate)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
67.3, hideMainRotateFunc, {"animation", "main", "rotateFunc"}, false, nil, extraSetFunction);
local function hideMainColorFunc()
return data.animation.main.type ~= "custom" or data.animation.main.colorType ~= "custom" or not (data.animation.main.use_color and WeakAuras.regions[id].region.Color)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "main_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
68.7, hideMainColorFunc, {"animation", "main", "colorFunc"}, false, nil, extraSetFunction);
-- Text Editors for "finish"
local function hideFinishAlphaFunc()
return data.animation.finish.type ~= "custom" or data.animation.finish.alphaType ~= "custom" or not data.animation.finish.use_alpha
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_alphaFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#alpha-opacity",
75.3, hideFinishAlphaFunc, {"animation", "finish", "alphaFunc"}, false);
local function hideFinishTranslate()
return data.animation.finish.type ~= "custom" or data.animation.finish.translateType ~= "custom" or not data.animation.finish.use_translate
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_translateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#translate-position",
79.3, hideFinishTranslate, {"animation", "finish", "translateFunc"}, false);
local function hideFinishScale()
return data.animation.finish.type ~= "custom" or data.animation.finish.scaleType ~= "custom" or not (data.animation.finish.use_scale and WeakAuras.regions[id].region.Scale)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-size",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_scaleFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#scale-size",
83.3, hideFinishScale, {"animation", "finish", "scaleFunc"}, false);
local function hideFinishRotateFunc()
return data.animation.finish.type ~= "custom" or data.animation.finish.rotateType ~= "custom" or not (data.animation.finish.use_rotate and WeakAuras.regions[id].region.Rotate)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_rotateFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#rotate",
87.3, hideFinishRotateFunc, {"animation", "finish", "rotateFunc"}, false);
local function hideFinishColorFunc()
return data.animation.finish.type ~= "custom" or data.animation.finish.colorType ~= "custom" or not (data.animation.finish.use_color and WeakAuras.regions[id].region.Color)
end
WeakAuras.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
OptionsPrivate.commonOptions.AddCodeOption(animation.args, data, L["Custom Function"], "finish_colorFunc", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#color",
88.7, hideFinishColorFunc, {"animation", "finish", "colorFunc"}, false);
if(data.controlledChildren) then
@@ -956,7 +956,7 @@ function WeakAuras.GetAnimationOptions(data)
if(type(data.id) == "string") then
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
end
animation.hidden = function(info, ...) return hiddenAll(data, info, ...); end;
+44 -46
View File
@@ -68,8 +68,6 @@ local tinsert, tremove, tconcat = table.insert, table.remove, table.concat
local conflictBlue = "|cFF4080FF"
local conflict = {} -- magic value
local optionClasses = WeakAuras.author_option_classes
local function atLeastOneSet(references, key)
for id, optionData in pairs(references) do
local childOption = optionData.options[optionData.index]
@@ -539,7 +537,7 @@ typeControlAdders = {
name = name(option, "default", L["Default"]),
desc = desc(option, "default"),
order = order(),
values = WeakAuras.bool_types,
values = OptionsPrivate.Private.bool_types,
get = function()
if option.default == nil then
return
@@ -740,7 +738,7 @@ typeControlAdders = {
name = name(option, "fontSize", L["Font Size"]),
desc = desc(option, "fontSize"),
order = order(),
values = WeakAuras.font_sizes,
values = OptionsPrivate.Private.font_sizes,
get = get(option, "fontSize"),
set = set(data, option, "fontSize")
}
@@ -1111,7 +1109,7 @@ typeControlAdders = {
name = name(option, "groupType", L["Group Type"]),
order = order(),
width = WeakAuras.doubleWidth,
values = WeakAuras.group_option_types,
values = OptionsPrivate.Private.group_option_types,
get = get(option, "groupType"),
set = function(_, value)
for id, optionData in pairs(option.references) do
@@ -1144,7 +1142,7 @@ typeControlAdders = {
local childOption = optionData.options[optionData.index]
local childData = optionData.data
childOption.collapse = value
WeakAuras.SetCollapsed(id, "config", optionData.path, value)
OptionsPrivate.SetCollapsed(id, "config", optionData.path, value)
WeakAuras.Add(childData)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -1158,7 +1156,7 @@ typeControlAdders = {
desc = desc(option, "limitType", L["Determines how many entries can be in the table."]),
order = order(),
width = WeakAuras.normalWidth,
values = WeakAuras.group_limit_types,
values = OptionsPrivate.Private.group_limit_types,
get = get(option, "limitType"),
set = function(_, value)
for id, optionData in pairs(option.references) do
@@ -1220,8 +1218,8 @@ typeControlAdders = {
return option.nameSource == -1
end,
}
local nameSources = CopyTable(WeakAuras.array_entry_name_types)
local validNameSourceTypes = WeakAuras.name_source_option_types
local nameSources = CopyTable(OptionsPrivate.Private.array_entry_name_types)
local validNameSourceTypes = OptionsPrivate.Private.name_source_option_types
if option.limitType ~= "fixed" then
nameSources[-1] = nil
end
@@ -1320,7 +1318,7 @@ typeControlAdders = {
width = 1,
useDesc = false,
}
WeakAuras.SetCollapsed(id, "author", path, false)
OptionsPrivate.SetCollapsed(id, "author", path, false)
WeakAuras.Add(childData)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -1349,7 +1347,7 @@ local function up(data, options, index)
local optionID = optionData.index
local childData = optionData.data
local childOptions = optionData.options
WeakAuras.MoveCollapseDataUp(id, "author", path)
OptionsPrivate.MoveCollapseDataUp(id, "author", path)
childOptions[optionID], childOptions[optionID - 1] = childOptions[optionID - 1], childOptions[optionID]
WeakAuras.Add(childData)
end
@@ -1372,7 +1370,7 @@ local function down(data, options, index)
local optionID = optionData.index
local childData = optionData.data
local childOptions = optionData.options
WeakAuras.MoveCollapseDataUp(id, "author", path)
OptionsPrivate.MoveCollapseDataDown(id, "author", path)
childOptions[optionID], childOptions[optionID + 1] = childOptions[optionID + 1], childOptions[optionID]
WeakAuras.Add(childData)
end
@@ -1389,7 +1387,7 @@ local function duplicate(data, options, index)
local childData = optionData.data
local path = optionData.path
path[#path] = path[#path] + 1 -- this data is being regenerated very soon
WeakAuras.InsertCollapsed(id, "author", optionData.path, false)
OptionsPrivate.InsertCollapsed(id, "author", optionData.path, false)
local newOption = CopyTable(childOptions[optionID])
if newOption.key then
local existingKeys = {}
@@ -1436,7 +1434,7 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local collapsed = false
for id, optionData in pairs(option.references) do
if WeakAuras.IsCollapsed(id, "author", optionData.path, true) then
if OptionsPrivate.IsCollapsed(id, "author", optionData.path, true) then
collapsed = true
break
end
@@ -1450,18 +1448,18 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
end
local optionBelow = options[i + 1]
local isAboveGroup = optionBelow and optionClasses[optionBelow.type] == "group"
local isAboveGroup = optionBelow and OptionsPrivate.Private.author_option_classes[optionBelow.type] == "group"
if isAboveGroup then
buttonWidth = buttonWidth + 0.15
end
local optionAbove = options[i - 1]
local isBelowGroup = optionAbove and optionClasses[optionAbove.type] == "group"
local isBelowGroup = optionAbove and OptionsPrivate.Private.author_option_classes[optionAbove.type] == "group"
if isBelowGroup then
buttonWidth = buttonWidth + 0.15
end
local optionClass = optionClasses[option.type]
local optionName = optionClass == "noninteractive" and WeakAuras.author_option_types[option.type]
local optionClass = OptionsPrivate.Private.author_option_classes[option.type]
local optionName = optionClass == "noninteractive" and OptionsPrivate.Private.author_option_types[option.type]
or option.name
args[prefix .. "collapse"] = {
@@ -1471,7 +1469,7 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
width = WeakAuras.doubleWidth - buttonWidth,
func = function()
for id, optionData in pairs(option.references) do
WeakAuras.SetCollapsed(id, "author", optionData.path, not collapsed)
OptionsPrivate.SetCollapsed(id, "author", optionData.path, not collapsed)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
end,
@@ -1493,11 +1491,11 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local groupData = optionAbove.references[id]
if groupData then
local childGroup = groupData.options[groupData.index]
local childCollapsed = WeakAuras.IsCollapsed(id, "author", optionData.path, true)
WeakAuras.RemoveCollapsed(id, "author", optionData.path)
local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true)
OptionsPrivate.RemoveCollapsed(id, "author", optionData.path)
local newPath = groupData.path
tinsert(newPath, #childGroup.subOptions + 1)
WeakAuras.InsertCollapsed(id, "author", newPath, childCollapsed)
OptionsPrivate.InsertCollapsed(id, "author", newPath, childCollapsed)
local childOption = tremove(optionData.options, optionData.index)
local childData = optionData.data
tinsert(childGroup.subOptions, childOption)
@@ -1522,11 +1520,11 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local groupData = optionBelow.references[id]
if groupData then
local childGroup = groupData.options[groupData.index]
local childCollapsed = WeakAuras.IsCollapsed(id, "author", optionData.path, true)
WeakAuras.RemoveCollapsed(id, "author", optionData.path)
local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true)
OptionsPrivate.RemoveCollapsed(id, "author", optionData.path)
local newPath = groupData.path
tinsert(newPath, 1)
WeakAuras.InsertCollapsed(id, "author", newPath, childCollapsed)
OptionsPrivate.InsertCollapsed(id, "author", newPath, childCollapsed)
local childOption = tremove(optionData.options, optionData.index)
local childData = optionData.data
tinsert(childGroup.subOptions, 1, childOption)
@@ -1553,11 +1551,11 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local parent = optionData.parent
local parentOptions = parent and parent.references[id].options or optionData.data.authorOptions
local childOption = tremove(optionData.options, optionData.index)
local childCollapsed = WeakAuras.IsCollapsed(id, "author", optionData.path, true)
WeakAuras.RemoveCollapsed(id, "author", optionData.path)
local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true)
OptionsPrivate.RemoveCollapsed(id, "author", optionData.path)
tinsert(parentOptions, path[#path - 1], childOption)
path[#path] = nil
WeakAuras.InsertCollapsed(id, "author", path)
OptionsPrivate.InsertCollapsed(id, "author", path)
WeakAuras.Add(optionData.data)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -1579,12 +1577,12 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local parent = optionData.parent
local parentOptions = parent and parent.references[id].options or optionData.data.authorOptions
local childOption = tremove(optionData.options, optionData.index)
local childCollapsed = WeakAuras.IsCollapsed(id, "author", optionData.path, true)
WeakAuras.RemoveCollapsed(id, "author", optionData.path)
local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true)
OptionsPrivate.RemoveCollapsed(id, "author", optionData.path)
tinsert(parentOptions, path[#path - 1] + 1, childOption)
path[#path] = nil
path[#path] = path[#path] + 1
WeakAuras.InsertCollapsed(id, "author", path)
OptionsPrivate.InsertCollapsed(id, "author", path)
WeakAuras.Add(optionData.data)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -1645,7 +1643,7 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
local optionIndex = optionData.index
local childData = optionData.data
local parentOption = optionData.parent
WeakAuras.RemoveCollapsed(id, "author", optionData.path)
OptionsPrivate.RemoveCollapsed(id, "author", optionData.path)
tremove(childOptions, optionIndex)
if parentOption and parentOption.groupType == "array" then
local dereferencedParent = parentOption.references[id]
@@ -1671,15 +1669,15 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
name = L["Option Type"],
desc = descType(option),
order = order(),
values = WeakAuras.author_option_types,
values = OptionsPrivate.Private.author_option_types,
get = get(option, "type"),
set = function(_, value)
if value == option.type then
return
end
local author_option_fields = WeakAuras.author_option_fields
local author_option_fields = OptionsPrivate.Private.author_option_fields
local commonFields, newFields = author_option_fields.common, author_option_fields[value]
local newClass = optionClasses[value]
local newClass = OptionsPrivate.Private.author_option_classes[value]
for id, optionData in pairs(option.references) do
local childOption = optionData.options[optionData.index]
local childData = optionData.data
@@ -1723,7 +1721,7 @@ function addAuthorModeOption(options, args, data, order, prefix, i)
childOption.key = newKey
end
end
if parentOption and parentOption.groupType == "array" and not WeakAuras.array_entry_name_types[value] then
if parentOption and parentOption.groupType == "array" and not OptionsPrivate.Private.array_entry_name_types[value] then
local dereferencedParent = parentOption.references[id]
if dereferencedParent.nameSource == optionData.index then
dereferencedParent.nameSource = 0
@@ -1839,7 +1837,7 @@ end
local function addUserModeOption(options, args, data, order, prefix, i)
local option = options[i]
local optionType = option.type
local optionClass = optionClasses[optionType]
local optionClass = OptionsPrivate.Private.author_option_classes[optionType]
local userOption
if optionClass == "simple" then
@@ -1867,7 +1865,7 @@ local function addUserModeOption(options, args, data, order, prefix, i)
defaultCollapsed = option.collapse
end
for id, optionData in pairs(option.references) do
if WeakAuras.IsCollapsed(id, "config", optionData.path, defaultCollapsed) then
if OptionsPrivate.IsCollapsed(id, "config", optionData.path, defaultCollapsed) then
collapsed = true
break
end
@@ -1879,7 +1877,7 @@ local function addUserModeOption(options, args, data, order, prefix, i)
width = WeakAuras.doubleWidth,
func = function()
for id, optionData in pairs(option.references) do
WeakAuras.SetCollapsed(id, "config", optionData.path, not collapsed)
OptionsPrivate.SetCollapsed(id, "config", optionData.path, not collapsed)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
end,
@@ -2405,7 +2403,7 @@ local function valuesAreEqual(t1, t2)
end
local function allChoicesAreDefault(option, config, id, path)
local optionClass = optionClasses[option.type]
local optionClass = OptionsPrivate.Private.author_option_classes[option.type]
if optionClass == "simple" then
return valuesAreEqual(option.default, config[option.key])
elseif optionClass == "group" then
@@ -2432,7 +2430,7 @@ local function allChoicesAreDefault(option, config, id, path)
path[#path] = nil
end
if option.useCollapse then
local isCollapsed = WeakAuras.IsCollapsed(id, "config", path, option.collapse)
local isCollapsed = OptionsPrivate.IsCollapsed(id, "config", path, option.collapse)
if isCollapsed ~= option.collapse then
return false
end
@@ -2449,7 +2447,7 @@ local function createorder(startorder)
end
end
function WeakAuras.GetAuthorOptions(data)
function OptionsPrivate.GetAuthorOptions(data)
-- initialize the process
local authorOptions = {
type = "group",
@@ -2519,7 +2517,7 @@ function WeakAuras.GetAuthorOptions(data)
width = 1,
useDesc = false,
}
WeakAuras.SetCollapsed(childData.id, "author", i, false)
OptionsPrivate.SetCollapsed(childData.id, "author", i, false)
WeakAuras.Add(childData)
end
else
@@ -2532,7 +2530,7 @@ function WeakAuras.GetAuthorOptions(data)
width = 1,
useDesc = false,
}
WeakAuras.SetCollapsed(data.id, "author", i, false)
OptionsPrivate.SetCollapsed(data.id, "author", i, false)
WeakAuras.Add(data)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -2557,13 +2555,13 @@ function WeakAuras.GetAuthorOptions(data)
if data.controlledChildren then
for _, id in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(id)
WeakAuras.ResetCollapsed(id, "config")
OptionsPrivate.ResetCollapsed(id, "config")
childData.config = {} -- config validation in Add() will set all the needed keys to their defaults
WeakAuras.Add(childData)
end
else
data.config = {}
WeakAuras.ResetCollapsed(data.id, "config")
OptionsPrivate.ResetCollapsed(data.id, "config")
WeakAuras.Add(data)
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
+44 -36
View File
@@ -3,14 +3,6 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L;
local operator_types = WeakAuras.operator_types;
local debuff_types = WeakAuras.debuff_types;
local tooltip_count = WeakAuras.tooltip_count;
local unit_types = WeakAuras.unit_types;
local actual_unit_types_with_specific = WeakAuras.actual_unit_types_with_specific;
local group_aura_name_info_types = WeakAuras.group_aura_name_info_types;
local group_aura_stack_info_types = WeakAuras.group_aura_stack_info_types;
local function getAuraMatchesLabel(name)
local ids = WeakAuras.spellCache.GetSpellsMatching(name)
if(ids) then
@@ -58,6 +50,22 @@ end
local noop = function() end
local function CanShowNameInfo(data)
if(data.regionType == "aurabar" or data.regionType == "icon" or data.regionType == "text") then
return true;
else
return false;
end
end
local function CanShowStackInfo(data)
if(data.regionType == "aurabar" or data.regionType == "icon" or data.regionType == "text") then
return true;
else
return false;
end
end
local function GetBuffTriggerOptions(data, triggernum)
local trigger = data.triggers[triggernum].trigger
trigger.names = trigger.names or {}
@@ -82,10 +90,10 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.doubleWidth - 0.8,
order = 8.2,
name = function()
if (not WeakAuras.CanConvertBuffTrigger2) then
if (not OptionsPrivate.Private.CanConvertBuffTrigger2) then
return "";
end
local _, err = WeakAuras.CanConvertBuffTrigger2(trigger);
local _, err = OptionsPrivate.Private.CanConvertBuffTrigger2(trigger);
return err or "";
end,
},
@@ -107,20 +115,20 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Convert to New Aura Trigger"],
order = 8.5,
disabled = function()
if (not WeakAuras.CanConvertBuffTrigger2) then
if (not OptionsPrivate.Private.CanConvertBuffTrigger2) then
return true;
end
if (not WeakAuras.CanConvertBuffTrigger2(trigger)) then
if (not OptionsPrivate.Private.CanConvertBuffTrigger2(trigger)) then
return true;
end
return false;
end,
desc = function()
local _, err = WeakAuras.CanConvertBuffTrigger2(trigger);
local _, err = OptionsPrivate.Private.CanConvertBuffTrigger2(trigger);
return err or ""
end,
func = function()
WeakAuras.ConvertBuffTrigger2(trigger);
OptionsPrivate.Private.ConvertBuffTrigger2(trigger);
WeakAuras.Add(data);
WeakAuras.UpdateDisplayButton(data)
WeakAuras.ClearAndUpdateOptions(data.id);
@@ -173,7 +181,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 11,
disabled = function() return not trigger.use_name end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
values = WeakAuras.string_operator_types,
values = OptionsPrivate.Private.string_operator_types,
set = noop
},
name = {
@@ -200,7 +208,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 14,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end,
values = WeakAuras.string_operator_types,
values = OptionsPrivate.Private.string_operator_types,
set = noop
},
tooltip = {
@@ -263,7 +271,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 20,
disabled = function() return not trigger.use_debuffClass end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
values = WeakAuras.debuff_class_types,
values = OptionsPrivate.Private.debuff_class_types,
set = noop
},
multiuse_name = {
@@ -579,9 +587,9 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 41,
values = function()
if(trigger.fullscan) then
return actual_unit_types_with_specific;
return OptionsPrivate.Private.actual_unit_types_with_specific;
else
return unit_types;
return OptionsPrivate.Private.unit_types;
end
end,
hidden = function() return not (trigger.type == "aura"); end,
@@ -627,7 +635,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 46,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
get = function() return trigger.group_countOperator; end,
set = noop
@@ -636,7 +644,7 @@ local function GetBuffTriggerOptions(data, triggernum)
type = "input",
name = L["Count"],
desc = function()
local groupType = unit_types[trigger.unit or "group"] or "|cFFFF0000error|r";
local groupType = OptionsPrivate.Private.unit_types[trigger.unit or "group"] or "|cFFFF0000error|r";
return L["Group aura count description"]:format(groupType, groupType, groupType, groupType, groupType, groupType, groupType);
end,
order = 47,
@@ -667,15 +675,15 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Name Info"],
order = 47.5,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group" and not trigger.groupclone); end,
disabled = function() return not WeakAuras.CanShowNameInfo(data); end,
disabled = function() return not CanShowNameInfo(data); end,
get = function()
if(WeakAuras.CanShowNameInfo(data)) then
if(CanShowNameInfo(data)) then
return trigger.name_info;
else
return nil;
end
end,
values = group_aura_name_info_types,
values = OptionsPrivate.Private.group_aura_name_info_types,
set = noop
},
stack_info = {
@@ -684,15 +692,15 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Stack Info"],
order = 47.6,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group" and not trigger.groupclone); end,
disabled = function() return not WeakAuras.CanShowStackInfo(data); end,
disabled = function() return not CanShowStackInfo(data); end,
get = function()
if(WeakAuras.CanShowStackInfo(data)) then
if(CanShowStackInfo(data)) then
return trigger.stack_info;
else
return nil;
end
end,
values = group_aura_stack_info_types,
values = OptionsPrivate.Private.group_aura_stack_info_types,
set = noop
},
hideAlone = {
@@ -718,7 +726,7 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.normalWidth,
name = L["Aura Type"],
order = 51,
values = debuff_types,
values = OptionsPrivate.Private.debuff_types,
hidden = function() return not (trigger.type == "aura"); end,
set = noop
},
@@ -732,7 +740,7 @@ local function GetBuffTriggerOptions(data, triggernum)
},
subcountCount = {
type = "select",
values = tooltip_count,
values = OptionsPrivate.Private.tooltip_count,
width = WeakAuras.doubleWidth,
name = L["Use nth value from tooltip:"],
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.subcount) end,
@@ -752,7 +760,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 57,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
disabled = function() return not trigger.useRem; end,
hidden = function() return not (trigger.type == "aura" and trigger.unit ~= "multi"); end,
get = function() return trigger.useRem and trigger.remOperator or nil end,
@@ -782,7 +790,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 62,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
disabled = function() return not trigger.useCount; end,
hidden = function() return not (trigger.type == "aura" and trigger.unit ~= "multi"); end,
get = function() return trigger.useCount and trigger.countOperator or nil end,
@@ -840,7 +848,7 @@ local function GetBuffTriggerOptions(data, triggernum)
type = "select",
width = WeakAuras.normalWidth,
name = "",
values = WeakAuras.bufftrigger_progress_behavior_types,
values = OptionsPrivate.Private.bufftrigger_progress_behavior_types,
order = 71.1,
get = function() return trigger.buffShowOn end,
hidden = function()
@@ -869,15 +877,15 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function()
-- For those that update without restarting
return not WeakAuras.CanConvertBuffTrigger2
return not OptionsPrivate.Private.CanConvertBuffTrigger2
end,
},
};
WeakAuras.commonOptions.AddCommonTriggerOptions(aura_options, data, triggernum)
WeakAuras.commonOptions.AddTriggerGetterSetter(aura_options, data, triggernum)
WeakAuras.AddTriggerMetaFunctions(aura_options, data, triggernum)
OptionsPrivate.commonOptions.AddCommonTriggerOptions(aura_options, data, triggernum)
OptionsPrivate.commonOptions.AddTriggerGetterSetter(aura_options, data, triggernum)
OptionsPrivate.AddTriggerMetaFunctions(aura_options, data, triggernum)
return {
["trigger." .. triggernum .. ".legacy_aura_options"] = aura_options
+20 -23
View File
@@ -3,9 +3,6 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local operator_types = WeakAuras.operator_types
local debuff_types = WeakAuras.debuff_types
local function getAuraMatchesLabel(name)
local ids = WeakAuras.spellCache.GetSpellsMatching(name)
if ids then
@@ -217,7 +214,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Unit"],
order = 10.1,
values = function()
return WeakAuras.unit_types_bufftrigger_2
return OptionsPrivate.Private.unit_types_bufftrigger_2
end,
hidden = function() return not trigger.type == "aura2" end
},
@@ -261,7 +258,7 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.normalWidth,
name = L["Aura Type"],
order = 11.1,
values = debuff_types,
values = OptionsPrivate.Private.debuff_types,
hidden = function() return not trigger.type == "aura2" end
},
use_debuffClass = {
@@ -281,7 +278,7 @@ local function GetBuffTriggerOptions(data, triggernum)
and not IsSingleMissing(trigger)
and trigger.use_debuffClass)
end,
values = WeakAuras.debuff_class_types,
values = OptionsPrivate.Private.debuff_class_types,
},
debuffClassSpace = {
type = "description",
@@ -371,7 +368,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 55.1,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and trigger.useNamePattern) end,
values = WeakAuras.string_operator_types
values = OptionsPrivate.Private.string_operator_types
},
namePattern_name = {
type = "input",
@@ -392,7 +389,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 60.1,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
disabled = function() return not trigger.useStacks end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.useStacks) end,
get = function() return trigger.useStacks and trigger.stacksOperator or nil end
@@ -425,7 +422,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 61.1,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
disabled = function() return not trigger.useRem end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.useRem) end,
get = function() return trigger.useRem and trigger.remOperator or nil end
@@ -458,7 +455,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 61.5,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
disabled = function() return not trigger.useTotal end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.useTotal) end,
get = function() return trigger.useTotal and trigger.totalOperator or nil end
@@ -508,7 +505,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 62.3,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.use_tooltip and trigger.fetchTooltip) end,
values = WeakAuras.string_operator_types
values = OptionsPrivate.Private.string_operator_types
},
tooltip = {
type = "input",
@@ -531,7 +528,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Tooltip Value #"],
order = 63.2,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = WeakAuras.tooltip_count
values = OptionsPrivate.Private.tooltip_count
},
use_tooltipValueSpace = {
type = "description",
@@ -546,7 +543,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 63.3,
hidden = function() return not (trigger.type == "aura2" and trigger.unit ~= "multi" and not IsSingleMissing(trigger) and trigger.use_tooltipValue and trigger.fetchTooltip) end,
values = WeakAuras.operator_types
values = OptionsPrivate.Private.operator_types
},
tooltipValue = {
type = "input",
@@ -735,13 +732,13 @@ local function GetBuffTriggerOptions(data, triggernum)
if (trigger.unit == "multi") then
return L["Compare against the number of units affected."]
else
local groupType = WeakAuras.unit_types_bufftrigger_2[trigger.unit or "group"] or "|cFFFF0000Error|r"
local groupType = OptionsPrivate.Private.unit_types_bufftrigger_2[trigger.unit or "group"] or "|cFFFF0000Error|r"
return L["Group aura count description"]:format(groupType, groupType, groupType, groupType, groupType, groupType, groupType)
end
end,
order = 70.2,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
hidden = function() return not (trigger.type == "aura2" and IsGroupTrigger(trigger) and trigger.useGroup_count) end,
get = function() return trigger.group_countOperator end
},
@@ -752,7 +749,7 @@ local function GetBuffTriggerOptions(data, triggernum)
if (trigger.unit == "multi") then
return L["Compare against the number of units affected."]
else
local groupType = WeakAuras.unit_types_bufftrigger_2[trigger.unit or "group"] or "|cFFFF0000Error|r"
local groupType = OptionsPrivate.Private.unit_types_bufftrigger_2[trigger.unit or "group"] or "|cFFFF0000Error|r"
return L["Group aura count description"]:format(groupType, groupType, groupType, groupType, groupType, groupType, groupType)
end
end,
@@ -774,7 +771,7 @@ local function GetBuffTriggerOptions(data, triggernum)
type = "select",
width = WeakAuras.normalWidth,
name = L["Show On"],
values = WeakAuras.bufftrigger_2_progress_behavior_types,
values = OptionsPrivate.Private.bufftrigger_2_progress_behavior_types,
order = 71.1,
hidden = function() return not (trigger.type == "aura2" and not IsGroupTrigger(trigger)) end,
get = function()
@@ -809,7 +806,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Operator"],
order = 71.4,
width = WeakAuras.halfWidth,
values = operator_types,
values = OptionsPrivate.Private.operator_types,
hidden = function() return not (trigger.type == "aura2" and HasMatchCount(trigger)) end,
desc = L["Counts the number of matches over all units."]
},
@@ -856,7 +853,7 @@ local function GetBuffTriggerOptions(data, triggernum)
perUnitMode = {
type = "select",
name = L["Show Matches for"],
values = WeakAuras.bufftrigger_2_per_unit_mode,
values = OptionsPrivate.Private.bufftrigger_2_per_unit_mode,
order = 72.4,
width = WeakAuras.normalWidth,
hidden = function()
@@ -891,7 +888,7 @@ local function GetBuffTriggerOptions(data, triggernum)
combineMode = {
type = "select",
name = L["Preferred Match"],
values = WeakAuras.bufftrigger_2_preferred_match_types,
values = OptionsPrivate.Private.bufftrigger_2_preferred_match_types,
order = 72.6,
width = WeakAuras.normalWidth,
hidden = function()
@@ -948,9 +945,9 @@ local function GetBuffTriggerOptions(data, triggernum)
true, true, "ignorespellid", 42, "useIgnoreExactSpellId", "ignoreAuraSpellids",
L["Ignored Spell ID"], L["Enter a Spell ID"])
WeakAuras.commonOptions.AddCommonTriggerOptions(aura_options, data, triggernum)
WeakAuras.commonOptions.AddTriggerGetterSetter(aura_options, data, triggernum)
WeakAuras.AddTriggerMetaFunctions(aura_options, data, triggernum)
OptionsPrivate.commonOptions.AddCommonTriggerOptions(aura_options, data, triggernum)
OptionsPrivate.commonOptions.AddTriggerGetterSetter(aura_options, data, triggernum)
OptionsPrivate.AddTriggerMetaFunctions(aura_options, data, triggernum)
return {
+1 -2
View File
@@ -15,7 +15,6 @@ WeakAuras.spellCache = spellCache
local cache
local metaData
local bestIcon = {}
local dynFrame = WeakAuras.dynFrame
-- Builds a cache of name/icon pairs from existing spell data
-- This is a rather slow operation, so it's only done once, and the result is subsequently saved
@@ -76,7 +75,7 @@ function spellCache.Build()
metaData.needsRebuild = false
end)
dynFrame:AddAction("spellCache", co)
OptionsPrivate.Private.dynFrame:AddAction("spellCache", co)
end
function spellCache.GetIcon(name)
+56 -58
View File
@@ -3,7 +3,6 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local regionOptions = WeakAuras.regionOptions
local point_types = WeakAuras.point_types;
local parsePrefix = function(input, data, create)
local subRegionIndex, property = string.match(input, "^sub%.(%d+)%..-%.(.+)")
@@ -67,15 +66,15 @@ local function addCollapsibleHeader(options, key, input, order, isGroupTab)
width = titleWidth,
func = function(info, button, secondCall)
if not nooptions and not secondCall then
local isCollapsed = WeakAuras.IsCollapsed("collapse", "region", key, false)
WeakAuras.SetCollapsed("collapse", "region", key, not isCollapsed)
local isCollapsed = OptionsPrivate.IsCollapsed("collapse", "region", key, false)
OptionsPrivate.SetCollapsed("collapse", "region", key, not isCollapsed)
end
end,
image = function()
if nooptions then
return "Interface\\AddOns\\WeakAuras\\Media\\Textures\\bullet1", 18, 18
else
local isCollapsed = WeakAuras.IsCollapsed("collapse", "region", key, false)
local isCollapsed = OptionsPrivate.IsCollapsed("collapse", "region", key, false)
return isCollapsed and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\expand" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\collapse", 18, 18
end
end,
@@ -175,18 +174,17 @@ local function addCollapsibleHeader(options, key, input, order, isGroupTab)
if hiddenFunc then
return function()
return hiddenFunc() or WeakAuras.IsCollapsed("collapse", "region", key, false)
return hiddenFunc() or OptionsPrivate.IsCollapsed("collapse", "region", key, false)
end
else
return function()
return WeakAuras.IsCollapsed("collapse", "region", key, false)
return OptionsPrivate.IsCollapsed("collapse", "region", key, false)
end
end
end
local function copyOptionTable(input, orderAdjustment, collapsedFunc)
local resultOption = {};
WeakAuras.DeepCopy(input, resultOption);
local resultOption = CopyTable(input);
resultOption.order = orderAdjustment + resultOption.order;
if collapsedFunc then
local oldHidden = resultOption.hidden;
@@ -315,7 +313,7 @@ local function CreateHiddenAll(subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -352,7 +350,7 @@ local function CreateDisabledAll(subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption);
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption);
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -422,7 +420,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local values = getValueFor(WeakAuras.EnsureOptions(childData, subOption), info, "values");
local values = getValueFor(OptionsPrivate.EnsureOptions(childData, subOption), info, "values");
if (values) then
if (type(values) == "function") then
values = values(info);
@@ -458,7 +456,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
if isToggle == nil then
local childData = WeakAuras.GetData(childId)
local childOption = getChildOption(WeakAuras.EnsureOptions(childData, subOption), info)
local childOption = getChildOption(OptionsPrivate.EnsureOptions(childData, subOption), info)
isToggle = childOption and childOption.type == "toggle"
end
@@ -466,7 +464,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
local regionType = regionPrefix(info[#info]);
if(childData and (not regionType or childData.regionType == regionType or regionType == "sub")) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local get = getValueFor(childOptions, info, "get");
if (combinedKeys) then
for key, _ in pairs(combinedKeys) do
@@ -513,7 +511,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOption = getChildOption(WeakAuras.EnsureOptions(childData, subOption), info);
local childOption = getChildOption(OptionsPrivate.EnsureOptions(childData, subOption), info);
if (childOption) then
local name;
if(type(childOption.name) == "function") then
@@ -552,7 +550,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOption = getChildOption(WeakAuras.EnsureOptions(childData, subOption), info);
local childOption = getChildOption(OptionsPrivate.EnsureOptions(childData, subOption), info);
if (childOption) then
local desc;
if(type(childOption.desc) == "function") then
@@ -600,7 +598,7 @@ local function replaceNameDescFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -683,7 +681,7 @@ local function replaceImageFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOption = WeakAuras.EnsureOptions(childData, subOption)
local childOption = OptionsPrivate.EnsureOptions(childData, subOption)
if not(childOption) then
return "error"
end
@@ -725,7 +723,7 @@ local function replaceValuesFuncs(intable, data, subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOption = WeakAuras.EnsureOptions(childData, subOption)
local childOption = OptionsPrivate.EnsureOptions(childData, subOption)
if not(childOption) then
return "error"
end
@@ -828,14 +826,14 @@ local function CreateGetAll(subOption)
for index, childId in ipairs(data.controlledChildren) do
if isToggle == nil then
local childData = WeakAuras.GetData(childId)
local childOptions = getChildOption(WeakAuras.EnsureOptions(childData, subOption), info)
local childOptions = getChildOption(OptionsPrivate.EnsureOptions(childData, subOption), info)
isToggle = childOptions and childOptions.type == "toggle"
end
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -875,13 +873,13 @@ end
local function CreateSetAll(subOption, getAll)
return function(data, info, ...)
WeakAuras.pauseOptionsProcessing(true);
WeakAuras.PauseAllDynamicGroups()
OptionsPrivate.Private.pauseOptionsProcessing(true);
OptionsPrivate.Private.PauseAllDynamicGroups()
local before = getAll(data, info, ...)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -904,11 +902,11 @@ local function CreateSetAll(subOption, getAll)
end
end
WeakAuras.ResumeAllDynamicGroups()
WeakAuras.pauseOptionsProcessing(false);
WeakAuras.ScanForLoads();
OptionsPrivate.Private.ResumeAllDynamicGroups()
OptionsPrivate.Private.pauseOptionsProcessing(false);
OptionsPrivate.Private.ScanForLoads();
WeakAuras.SortDisplayButtons();
WeakAuras.UpdateOptions()
OptionsPrivate.UpdateOptions()
end
end
@@ -918,7 +916,7 @@ local function CreateExecuteAll(subOption)
for index, childId in ipairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId);
if(childData) then
local childOptions = WeakAuras.EnsureOptions(childData, subOption)
local childOptions = OptionsPrivate.EnsureOptions(childData, subOption)
local childOption = childOptions;
local childOptionTable = {[0] = childOption};
for i=1,#info do
@@ -985,7 +983,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
data.xOffset = v;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
if(data.parent) then
local parentData = WeakAuras.GetData(data.parent);
if(parentData) then
@@ -1007,7 +1005,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
data.yOffset = v;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
if(data.parent) then
local parentData = WeakAuras.GetData(data.parent);
if(parentData) then
@@ -1022,7 +1020,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
name = L["Anchor"],
order = 70,
hidden = IsParentDynamicGroup,
values = point_types,
values = OptionsPrivate.Private.point_types,
disabled = disableSelfPoint,
},
anchorFrameType = {
@@ -1031,7 +1029,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
name = L["Anchored To"],
order = 72,
hidden = IsParentDynamicGroup,
values = (data.regionType == "group" or data.regionType == "dynamicgroup") and WeakAuras.anchor_frame_types_group or WeakAuras.anchor_frame_types,
values = (data.regionType == "group" or data.regionType == "dynamicgroup") and OptionsPrivate.Private.anchor_frame_types_group or OptionsPrivate.Private.anchor_frame_types,
},
-- Input field to select frame to anchor on
anchorFrameFrame = {
@@ -1059,7 +1057,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
return not (data.anchorFrameType == "SELECTFRAME")
end,
func = function()
WeakAuras.StartFrameChooser(data, {"anchorFrameFrame"});
OptionsPrivate.StartFrameChooser(data, {"anchorFrameFrame"});
end
},
anchorPoint = {
@@ -1085,7 +1083,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
return data.anchorFrameType == "MOUSE";
end
end,
values = point_types
values = OptionsPrivate.Private.point_types
},
anchorPointGroup = {
type = "select",
@@ -1123,7 +1121,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
width = WeakAuras.normalWidth,
name = L["Frame Strata"],
order = 78,
values = WeakAuras.frame_strata_types
values = OptionsPrivate.Private.frame_strata_types
},
anchorFrameSpace = {
type = "execute",
@@ -1136,7 +1134,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint)
end
},
};
WeakAuras.commonOptions.AddCodeOption(positionOptions, data, L["Custom Anchor"], "custom_anchor", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-anchor-function",
OptionsPrivate.commonOptions.AddCodeOption(positionOptions, data, L["Custom Anchor"], "custom_anchor", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-anchor-function",
72.1, function() return not(data.anchorFrameType == "CUSTOM" and not IsParentDynamicGroup()) end, {"customAnchor"}, nil, nil, nil, nil, nil, true)
return positionOptions;
end
@@ -1264,7 +1262,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
tinsert(extraFunctions, 1, {
buttonLabel = L["Expand"],
func = function(info)
WeakAuras.OpenTextEditor(WeakAuras.GetPickedDisplay(), path, encloseInFunction, multipath, reloadOptions, setOnParent, url)
OptionsPrivate.OpenTextEditor(OptionsPrivate.GetPickedDisplay(), path, encloseInFunction, multipath, reloadOptions, setOnParent, url)
end
});
@@ -1293,7 +1291,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p
extraSetFunction();
end
if (reloadOptions) then
WeakAuras.ClearOptions(data.id)
OptionsPrivate.ClearOptions(data.id)
end
end,
get = function(info)
@@ -1355,7 +1353,7 @@ local function AddCommonTriggerOptions(options, data, triggernum)
local trigger = data.triggers[triggernum].trigger
local trigger_types = {};
for type, triggerSystem in pairs(WeakAuras.triggerTypes) do
for type, triggerSystem in pairs(OptionsPrivate.Private.triggerTypes) do
trigger_types[type] = triggerSystem.GetName(type);
end
@@ -1379,7 +1377,7 @@ local function AddCommonTriggerOptions(options, data, triggernum)
end,
set = function(info, v)
trigger.type = v;
local prototype = trigger.event and WeakAuras.event_prototypes[trigger.event];
local prototype = trigger.event and OptionsPrivate.Private.event_prototypes[trigger.event];
if v == "status" and (not prototype or prototype.type == "event") then
trigger.event = "Cooldown Progress (Spell)"
elseif v == "event" and (not prototype or prototype.type == "status") then
@@ -1447,23 +1445,23 @@ local function AddTriggerGetterSetter(options, data, triggernum)
end
WeakAuras.commonOptions = {}
WeakAuras.commonOptions.parsePrefix = parsePrefix
WeakAuras.commonOptions.flattenRegionOptions = flattenRegionOptions
WeakAuras.commonOptions.fixMetaOrders = fixMetaOrders
WeakAuras.commonOptions.removeFuncs = removeFuncs
WeakAuras.commonOptions.CreateHiddenAll = CreateHiddenAll
WeakAuras.commonOptions.CreateDisabledAll = CreateDisabledAll
WeakAuras.commonOptions.replaceNameDescFuncs = replaceNameDescFuncs
WeakAuras.commonOptions.replaceImageFuncs = replaceImageFuncs
WeakAuras.commonOptions.replaceValuesFuncs = replaceValuesFuncs
WeakAuras.commonOptions.CreateGetAll = CreateGetAll
WeakAuras.commonOptions.CreateSetAll = CreateSetAll
WeakAuras.commonOptions.CreateExecuteAll = CreateExecuteAll
OptionsPrivate.commonOptions = {}
OptionsPrivate.commonOptions.parsePrefix = parsePrefix
OptionsPrivate.commonOptions.flattenRegionOptions = flattenRegionOptions
OptionsPrivate.commonOptions.fixMetaOrders = fixMetaOrders
OptionsPrivate.commonOptions.removeFuncs = removeFuncs
OptionsPrivate.commonOptions.CreateHiddenAll = CreateHiddenAll
OptionsPrivate.commonOptions.CreateDisabledAll = CreateDisabledAll
OptionsPrivate.commonOptions.replaceNameDescFuncs = replaceNameDescFuncs
OptionsPrivate.commonOptions.replaceImageFuncs = replaceImageFuncs
OptionsPrivate.commonOptions.replaceValuesFuncs = replaceValuesFuncs
OptionsPrivate.commonOptions.CreateGetAll = CreateGetAll
OptionsPrivate.commonOptions.CreateSetAll = CreateSetAll
OptionsPrivate.commonOptions.CreateExecuteAll = CreateExecuteAll
WeakAuras.commonOptions.PositionOptions = PositionOptions
WeakAuras.commonOptions.BorderOptions = BorderOptions
WeakAuras.commonOptions.AddCodeOption = AddCodeOption
OptionsPrivate.commonOptions.PositionOptions = PositionOptions
OptionsPrivate.commonOptions.BorderOptions = BorderOptions
OptionsPrivate.commonOptions.AddCodeOption = AddCodeOption
WeakAuras.commonOptions.AddCommonTriggerOptions = AddCommonTriggerOptions
WeakAuras.commonOptions.AddTriggerGetterSetter = AddTriggerGetterSetter
OptionsPrivate.commonOptions.AddCommonTriggerOptions = AddCommonTriggerOptions
OptionsPrivate.commonOptions.AddTriggerGetterSetter = AddTriggerGetterSetter
+61 -69
View File
@@ -249,8 +249,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
local change = {};
change.property = conditions[i].changes[j].property;
if (type(conditions[i].changes[j].value) == "table") then
change.value = {};
WeakAuras.DeepCopy(conditions[i].changes[j].value, change.value)
change.value = CopyTable(conditions[i].changes[j].value)
else
change.value = conditions[i].changes[j].value;
end
@@ -501,9 +500,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
args["condition" .. i .. "value" .. j .. "sound_type"] = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.sound_condition_types,
values = OptionsPrivate.Private.sound_condition_types,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "sound_type", L["Differences"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound_type", propertyType, WeakAuras.sound_condition_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound_type", propertyType, OptionsPrivate.Private.sound_condition_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.sound_type;
@@ -530,9 +529,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
args["condition" .. i .. "value" .. j .. "sound"] = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.sound_types,
values = OptionsPrivate.Private.sound_types,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "sound", L["Differences"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound", propertyType, WeakAuras.sound_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound", propertyType, OptionsPrivate.Private.sound_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.sound;
@@ -546,9 +545,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
args["condition" .. i .. "value" .. j .. "sound_channel"] = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.sound_channel_types,
values = OptionsPrivate.Private.sound_channel_types,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "sound_channel", L["Sound Channel"], L["Sound Channel"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound_channel", propertyType, WeakAuras.sound_channel_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "sound_channel", propertyType, OptionsPrivate.Private.sound_channel_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.sound_channel;
@@ -633,9 +632,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
args["condition" .. i .. "value" .. j .. "message type"] = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.send_chat_message_types,
values = OptionsPrivate.Private.send_chat_message_types,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "message_type", L["Differences"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "message_type", propertyType, WeakAuras.send_chat_message_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "message_type", propertyType, OptionsPrivate.Private.send_chat_message_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.message_type;
@@ -677,8 +676,8 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
order = order + 1;
local descMessage = descIfNoValue2(data, conditions[i].changes[j], "value", "message", propertyType);
if (not descMessage and data ~= WeakAuras.tempGroup) then
descMessage = L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
if (not descMessage and data ~= OptionsPrivate.tempGroup) then
descMessage = L["Dynamic text tooltip"] .. OptionsPrivate.Private.GetAdditionalProperties(data)
end
local message_getter = function()
@@ -728,21 +727,21 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
local hasTextFormatOption
local hidden = function()
return WeakAuras.IsCollapsed("format_option", "conditions", i .. "#" .. j , true)
return OptionsPrivate.IsCollapsed("format_option", "conditions", i .. "#" .. j , true)
end
local setHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "conditions", i .. "#" .. j, hidden)
OptionsPrivate.SetCollapsed("format_option", "conditions", i .. "#" .. j, hidden)
end
if data.controlledChildren then
for id, reference in pairs(conditions[i].changes[j].references) do
local input = reference.value and reference.value.message
hasTextFormatOption = WeakAuras.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden)
hasTextFormatOption = OptionsPrivate.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden)
end
else
local input = type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value["message"]
hasTextFormatOption = WeakAuras.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden)
hasTextFormatOption = OptionsPrivate.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden)
end
if hasTextFormatOption then
@@ -757,7 +756,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
local function customHidden()
local message = type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.message;
if (not message) then return true; end
return not WeakAuras.ContainsCustomPlaceHolder(message);
return not OptionsPrivate.Private.ContainsCustomPlaceHolder(message);
end
args["condition" .. i .. "value" .. j .. "custom"] = {
@@ -786,9 +785,9 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
local changeIndex = reference.changeIndex;
multipath[id] = {"conditions", conditionIndex, "changes", changeIndex, "value", "custom"};
end
WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
OptionsPrivate.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
else
WeakAuras.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
OptionsPrivate.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
end
end
}
@@ -815,7 +814,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
if (not message) then
return true;
end
if (not WeakAuras.ContainsPlaceHolders(message, "c")) then
if (not OptionsPrivate.Private.ContainsPlaceHolders(message, "c")) then
return true;
end
@@ -865,10 +864,10 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
childData.conditions[conditionIndex].changes[changeIndex].value = childData.conditions[conditionIndex].changes[changeIndex].value or {};
multipath[id] = {"conditions", conditionIndex, "changes", changeIndex, "value", "custom"};
end
WeakAuras.OpenTextEditor(data, multipath, true, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#run-custom-code");
OptionsPrivate.OpenTextEditor(data, multipath, true, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#run-custom-code");
else
data.conditions[i].changes[j].value = data.conditions[i].changes[j].value or {};
WeakAuras.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, true, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#run-custom-code");
OptionsPrivate.OpenTextEditor(data, {"conditions", i, "changes", j, "value", "custom"}, true, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#run-custom-code");
end
end
}
@@ -932,15 +931,15 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
return false
end
local glowTypesExcepButtonOverlay = CopyTable(WeakAuras.glow_types)
local glowTypesExcepButtonOverlay = CopyTable(OptionsPrivate.Private.glow_types)
glowTypesExcepButtonOverlay["buttonOverlay"] = nil
args["condition" .. i .. "value" .. j .. "glow_action"] = {
type = "select",
values = WeakAuras.glow_action_types,
values = OptionsPrivate.Private.glow_action_types,
width = WeakAuras.normalWidth,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "glow_action", L["Glow Action"], L["Glow Action"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_action", propertyType, WeakAuras.glow_action_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_action", propertyType, OptionsPrivate.Private.glow_action_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.glow_action;
@@ -950,7 +949,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
order = order + 1
args["condition" .. i .. "value" .. j .. "glow_frame_type"] = {
type = "select",
values = WeakAuras.glow_frame_types,
values = OptionsPrivate.Private.glow_frame_types,
width = WeakAuras.normalWidth,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "glow_frame_type", L["Glow Frame Type"], L["Glow Frame Type"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_frame_type", propertyType, {
@@ -961,23 +960,23 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.glow_frame_type;
end,
hidden = function() return not anyGlowExternal("glow_action", WeakAuras.glow_action_types) end,
hidden = function() return not anyGlowExternal("glow_action", OptionsPrivate.Private.glow_action_types) end,
set = setValueComplex("glow_frame_type")
}
order = order + 1
args["condition" .. i .. "value" .. j .. "glow_type"] = {
type = "select",
values = WeakAuras.glow_types,
values = OptionsPrivate.Private.glow_types,
width = WeakAuras.normalWidth,
name = blueIfNoValue2(data, conditions[i].changes[j], "value", "glow_type", L["Glow Type"], L["Glow Type"]),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_type", propertyType, WeakAuras.glow_types),
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_type", propertyType, OptionsPrivate.Private.glow_types),
order = order,
get = function()
return type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value.glow_type;
end,
set = setValueComplex("glow_type"),
hidden = function()
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_frame_type", WeakAuras.glow_frame_types))
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_frame_type", OptionsPrivate.Private.glow_frame_types))
end
}
order = order + 1
@@ -1003,7 +1002,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
desc = descIfNoValue2(data, conditions[i].changes[j], "value", "glow_frame", propertyType),
order = order,
func = function()
WeakAuras.StartFrameChooser(data, {"conditions", i, "changes", j, "value", "glow_frame"});
OptionsPrivate.StartFrameChooser(data, {"conditions", i, "changes", j, "value", "glow_frame"});
end,
hidden = function()
return not anyGlowExternal("glow_frame_type", "FRAMESELECTOR")
@@ -1021,7 +1020,7 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
end,
set = setValueComplex("use_glow_color"),
hidden = function()
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", WeakAuras.glow_types))
return not (anyGlowExternal("glow_action", "show") and anyGlowExternal("glow_type", OptionsPrivate.Private.glow_types))
end
}
order = order + 1
@@ -1040,8 +1039,8 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
set = setValueColorComplex("glow_color"),
hidden = function()
return not (anyGlowExternal("glow_action", "show")
and anyGlowExternal("glow_frame_type", WeakAuras.glow_frame_types)
and anyGlowExternal("glow_type", WeakAuras.glow_types))
and anyGlowExternal("glow_frame_type", OptionsPrivate.Private.glow_frame_types)
and anyGlowExternal("glow_type", OptionsPrivate.Private.glow_types))
end,
disabled = function() return not anyGlowExternal("use_glow_color", true) end
}
@@ -1368,8 +1367,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
local copy = {};
copy.property = change.property;
if (type(change.value) == "table") then
copy.value = {};
WeakAuras.DeepCopy(change.value, copy.value);
copy.value = CopyTable(change.value);
else
copy.value = change.value;
end
@@ -1510,11 +1508,11 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
end
if (currentConditionTemplate.type == "number" or currentConditionTemplate.type == "timer") then
local opTypes = WeakAuras.operator_types
local opTypes = OptionsPrivate.Private.operator_types
if currentConditionTemplate.operator_types == "without_equal" then
opTypes = WeakAuras.operator_types_without_equal
opTypes = OptionsPrivate.Private.operator_types_without_equal
elseif currentConditionTemplate.operator_types == "only_equal" then
opTypes = WeakAuras.equality_operator_types
opTypes = OptionsPrivate.Private.equality_operator_types
end
args["condition" .. i .. tostring(path) .. "_op"] = {
@@ -1552,7 +1550,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
type = "select",
width = WeakAuras.normalWidth,
order = order,
values = WeakAuras.equality_operator_types,
values = OptionsPrivate.Private.equality_operator_types,
get = function()
return check.op;
end,
@@ -1615,7 +1613,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
name = blueIfNoValue(data, conditions[i].check, "value", L["Differences"]),
desc = descIfNoValue(data, conditions[i].check, "value", currentConditionTemplate.type),
order = order,
values = WeakAuras.bool_types,
values = OptionsPrivate.Private.bool_types,
get = function()
return check and check.value;
end,
@@ -1630,7 +1628,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
type = "select",
width = WeakAuras.normalWidth,
order = order,
values = WeakAuras.string_operator_types,
values = OptionsPrivate.Private.string_operator_types,
get = function()
return check and check.op;
end,
@@ -1699,7 +1697,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
end
tinsert(multipath[id], "value")
end
WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
OptionsPrivate.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
else
for i, v in ipairs(path) do
print(i, v)
@@ -1712,7 +1710,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
end
tinsert(fullPath, "value")
WeakAuras.OpenTextEditor(data, fullPath, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
OptionsPrivate.OpenTextEditor(data, fullPath, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check");
end
end
}
@@ -1772,13 +1770,13 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
if data.controlledChildren then
for id, reference in pairs(conditions[i].check.references) do
local index = reference.conditionIndex;
if WeakAuras.IsCollapsed(id, "condition", index, false) then
if OptionsPrivate.IsCollapsed(id, "condition", index, false) then
collapsed = true;
break;
end
end
else
collapsed = WeakAuras.IsCollapsed(data.id, "condition", i, false);
collapsed = OptionsPrivate.IsCollapsed(data.id, "condition", i, false);
end
args["condition" .. i .. "header"] = {
@@ -1790,10 +1788,10 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
if data.controlledChildren then
for id, reference in pairs(conditions[i].check.references) do
local index = reference.conditionIndex
WeakAuras.SetCollapsed(id, "condition", index, not collapsed);
OptionsPrivate.SetCollapsed(id, "condition", index, not collapsed);
end
else
WeakAuras.SetCollapsed(data.id, "condition", i, not collapsed);
OptionsPrivate.SetCollapsed(data.id, "condition", i, not collapsed);
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
end,
@@ -2041,8 +2039,7 @@ local function mergeConditionTemplates(allConditionTemplates, auraConditionsTemp
allConditionTemplates[triggernum] = allConditionTemplates[triggernum] or {};
for conditionName in pairs(auraTemplatesForTrigger) do
if not allConditionTemplates[triggernum][conditionName] then
allConditionTemplates[triggernum][conditionName] = {};
WeakAuras.DeepCopy(auraTemplatesForTrigger[conditionName], allConditionTemplates[triggernum][conditionName]);
allConditionTemplates[triggernum][conditionName] = CopyTable(auraTemplatesForTrigger[conditionName]);
else
if (allConditionTemplates[triggernum][conditionName].type ~= auraTemplatesForTrigger[conditionName].type) then
-- Two different trigger types have a condition of the same name, with incompatible types
@@ -2126,11 +2123,11 @@ local function createConditionTemplates(data)
local data = WeakAuras.GetData(id);
numTriggers = max(numTriggers, #data.triggers);
local auraConditionsTemplate = WeakAuras.GetTriggerConditions(data);
local auraConditionsTemplate = OptionsPrivate.Private.GetTriggerConditions(data);
mergeConditionTemplates(allConditionTemplates, auraConditionsTemplate, numTriggers)
end
else
allConditionTemplates = WeakAuras.GetTriggerConditions(data);
allConditionTemplates = OptionsPrivate.Private.GetTriggerConditions(data);
numTriggers = #data.triggers;
end
@@ -2144,13 +2141,12 @@ local function createConditionTemplates(data)
type = "combination"
}
}
allConditionTemplates[-1] = WeakAuras.GetGlobalConditions();
allConditionTemplates[-1] = OptionsPrivate.Private.GetGlobalConditions();
local conditionTemplates = createConditionTemplatesValueList(allConditionTemplates, numTriggers);
if (data.controlledChildren) then
conditionTemplates.displayWithCopy = {};
WeakAuras.DeepCopy(conditionTemplates.display, conditionTemplates.displayWithCopy);
conditionTemplates.displayWithCopy = CopyTable(conditionTemplates.display);
conditionTemplates.displayWithCopy[9998] = "" .. L["Copy to all auras"] .. "";
conditionTemplates.indexToTrigger[9998] = "COPY";
@@ -2168,7 +2164,7 @@ local function buildAllPotentialProperties(data, category)
if (data.controlledChildren) then
for _, id in ipairs(data.controlledChildren) do
local auradata = WeakAuras.GetData(id);
local regionProperties = WeakAuras.GetProperties(auradata);
local regionProperties = OptionsPrivate.Private.GetProperties(auradata);
if (regionProperties) then
for k, v in pairs(regionProperties) do
if (v.category == category) then
@@ -2186,15 +2182,14 @@ local function buildAllPotentialProperties(data, category)
end
end
else
allProperties.propertyMap[k] = {};
WeakAuras.DeepCopy(v, allProperties.propertyMap[k])
allProperties.propertyMap[k] = CopyTable(v)
end
end
end
end
end
else
local regionProperties = WeakAuras.GetProperties(data);
local regionProperties = OptionsPrivate.Private.GetProperties(data);
if (regionProperties) then
for k, v in pairs(regionProperties) do
if (v.category == category) then
@@ -2231,8 +2226,7 @@ local function buildAllPotentialProperties(data, category)
allProperties.indexToProperty[9999] = "DELETE";
if (data.controlledChildren) then
allProperties.displayWithCopy = {};
WeakAuras.DeepCopy(allProperties.display, allProperties.displayWithCopy);
allProperties.displayWithCopy = CopyTable(allProperties.display);
allProperties.displayWithCopy[9998] = "" .. L["Copy to all auras"] .. "";
allProperties.indexToProperty[9998] = "COPY";
@@ -2346,7 +2340,7 @@ local function SubPropertiesForChange(change)
local getter = function(key)
return change.value["message_format_" .. key]
end
WeakAuras.AddTextFormatOption(input, false, getter, function(key)
OptionsPrivate.AddTextFormatOption(input, false, getter, function(key)
tinsert(result, "message_format_" .. key)
end)
end
@@ -2426,8 +2420,7 @@ local function mergeCondition(all, aura, id, conditionIndex, allProperties)
for changeIndex, change in ipairs(aura.changes) do
local matchIndex = findMatchingProperty(all.changes, change, id);
if (not matchIndex) then
local copy = {};
WeakAuras.DeepCopy(change, copy);
local copy = CopyTable(change);
local propertyType = change.property and allProperties.propertyMap[change.property] and allProperties.propertyMap[change.property].type;
if (propertyType == "chat" or propertyType == "sound" or propertyType == "customcode" or propertyType == "glowexternal") then
@@ -2463,8 +2456,7 @@ local function mergeConditions(all, aura, id, allConditionTemplates, propertyTyp
for conditionIndex, condition in ipairs(aura) do
local match = findMatchingCondition(all, condition, currentInsertPoint, allConditionTemplates);
if (not match) then
local copy = {};
WeakAuras.DeepCopy(condition, copy);
local copy = CopyTable(condition);
copy.check.samevalue = true;
copy.check.sameop = true;
copy.check.references = {};
@@ -2504,7 +2496,7 @@ local function mergeConditions(all, aura, id, allConditionTemplates, propertyTyp
end
end
function WeakAuras.GetConditionOptions(data)
function OptionsPrivate.GetConditionOptions(data)
local options = {
type = "group",
name = L["Conditions"],
@@ -2557,7 +2549,7 @@ function WeakAuras.GetConditionOptions(data)
aura[conditionVariable][#aura[conditionVariable]].changes = {};
aura[conditionVariable][#aura[conditionVariable]].changes[1] = {}
aura[conditionVariable][#aura[conditionVariable]].category = category;
WeakAuras.SetCollapsed(id, "condition", #aura[conditionVariable], false);
OptionsPrivate.SetCollapsed(id, "condition", #aura[conditionVariable], false);
WeakAuras.Add(aura);
end
WeakAuras.ClearAndUpdateOptions(data.id, true)
@@ -2567,7 +2559,7 @@ function WeakAuras.GetConditionOptions(data)
conditions[#conditions].changes = {};
conditions[#conditions].changes[1] = {}
conditions[#conditions].category = category;
WeakAuras.SetCollapsed(data.id, "condition", #conditions, false);
OptionsPrivate.SetCollapsed(data.id, "condition", #conditions, false);
WeakAuras.Add(data);
WeakAuras.ClearAndUpdateOptions(data.id, true)
end
+26 -27
View File
@@ -1,26 +1,25 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local regionOptions = WeakAuras.regionOptions
local flattenRegionOptions = WeakAuras.commonOptions.flattenRegionOptions
local fixMetaOrders = WeakAuras.commonOptions.fixMetaOrders
local parsePrefix = WeakAuras.commonOptions.parsePrefix
local removeFuncs = WeakAuras.commonOptions.removeFuncs
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("region")
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("region")
local getAll = WeakAuras.commonOptions.CreateGetAll("region")
local setAll = WeakAuras.commonOptions.CreateSetAll("region", getAll)
local flattenRegionOptions = OptionsPrivate.commonOptions.flattenRegionOptions
local fixMetaOrders = OptionsPrivate.commonOptions.fixMetaOrders
local parsePrefix = OptionsPrivate.commonOptions.parsePrefix
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("region")
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("region")
local getAll = OptionsPrivate.commonOptions.CreateGetAll("region")
local setAll = OptionsPrivate.commonOptions.CreateSetAll("region", getAll)
local function AddSubRegionImpl(data, subRegionName)
data.subRegions = data.subRegions or {}
if WeakAuras.subRegionTypes[subRegionName] and WeakAuras.subRegionTypes[subRegionName] then
if WeakAuras.subRegionTypes[subRegionName].supports(data.regionType) then
local default = WeakAuras.subRegionTypes[subRegionName].default
if OptionsPrivate.Private.subRegionTypes[subRegionName] and OptionsPrivate.Private.subRegionTypes[subRegionName] then
if OptionsPrivate.Private.subRegionTypes[subRegionName].supports(data.regionType) then
local default = OptionsPrivate.Private.subRegionTypes[subRegionName].default
local subRegionData = type(default) == "function" and default(data.regionType) or CopyTable(default)
subRegionData.type = subRegionName
tinsert(data.subRegions, subRegionData)
@@ -31,7 +30,7 @@ local function AddSubRegionImpl(data, subRegionName)
end
local function AddSubRegion(data, subRegionName)
if (WeakAuras.ApplyToDataOrChildData(data, AddSubRegionImpl, subRegionName)) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(data, AddSubRegionImpl, subRegionName)) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
end
@@ -48,7 +47,7 @@ local function AddOptionsForSupportedSubRegion(regionOption, data, supported)
result.__title = L["Add Extra Elements"]
result.__topLine = true
for subRegionType in pairs(supported) do
if WeakAuras.subRegionTypes[subRegionType].supportsAdd then
if OptionsPrivate.Private.subRegionTypes[subRegionType].supportsAdd then
hasSubRegions = true
result[subRegionType .. "space"] = {
type = "description",
@@ -60,7 +59,7 @@ local function AddOptionsForSupportedSubRegion(regionOption, data, supported)
result[subRegionType] = {
type = "execute",
width = WeakAuras.normalWidth,
name = string.format(L["Add %s"], WeakAuras.subRegionTypes[subRegionType].displayName),
name = string.format(L["Add %s"], OptionsPrivate.Private.subRegionTypes[subRegionType].displayName),
order = order,
func = function()
AddSubRegion(data, subRegionType)
@@ -84,7 +83,7 @@ local function union(table1, table2)
return meta;
end
function WeakAuras.GetDisplayOptions(data)
function OptionsPrivate.GetDisplayOptions(data)
local id = data.id
if not data.controlledChildren then
@@ -100,10 +99,10 @@ function WeakAuras.GetDisplayOptions(data)
local subIndex = {}
for index, subRegionData in ipairs(data.subRegions) do
local subRegionType = subRegionData.type
if WeakAuras.subRegionOptions[subRegionType] then
if OptionsPrivate.Private.subRegionOptions[subRegionType] then
hasSubElements = true
subIndex[subRegionType] = subIndex[subRegionType] and subIndex[subRegionType] + 1 or 1
local options, common = WeakAuras.subRegionOptions[subRegionType].create(data, subRegionData, index, subIndex[subRegionType])
local options, common = OptionsPrivate.Private.subRegionOptions[subRegionType].create(data, subRegionData, index, subIndex[subRegionType])
options.__order = 200 + index
regionOption["sub." .. index .. "." .. subRegionType] = options
commonOption[subRegionType] = common
@@ -119,7 +118,7 @@ function WeakAuras.GetDisplayOptions(data)
end
local supported = {}
for subRegionName, subRegionType in pairs(WeakAuras.subRegionTypes) do
for subRegionName, subRegionType in pairs(OptionsPrivate.Private.subRegionTypes) do
if subRegionType.supports(data.regionType) then
supported[subRegionName] = true
end
@@ -189,7 +188,7 @@ function WeakAuras.GetDisplayOptions(data)
WeakAuras.Add(parentData);
end
end
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end,
args = options
};
@@ -227,7 +226,7 @@ function WeakAuras.GetDisplayOptions(data)
},
}
end
for subRegionName, subRegionType in pairs(WeakAuras.subRegionTypes) do
for subRegionName, subRegionType in pairs(OptionsPrivate.Private.subRegionTypes) do
if subRegionType.supports(childData.regionType) then
supportedSubRegions[subRegionName] = true
end
@@ -238,13 +237,13 @@ function WeakAuras.GetDisplayOptions(data)
for index, subRegionData in ipairs(childData.subRegions) do
local subRegionType = subRegionData.type
local alreadyHandled = handledSubRegionTypes[index] and handledSubRegionTypes[index][subRegionType]
if WeakAuras.subRegionOptions[subRegionType] and not alreadyHandled then
if OptionsPrivate.Private.subRegionOptions[subRegionType] and not alreadyHandled then
handledSubRegionTypes[index] = handledSubRegionTypes[index] or {}
handledSubRegionTypes[index][subRegionType] = true
hasSubElements = true
subIndex[subRegionType] = subIndex[subRegionType] and subIndex[subRegionType] + 1 or 1
local options, common = WeakAuras.subRegionOptions[subRegionType].create(data, nil, index, subIndex[subRegionType])
local options, common = OptionsPrivate.Private.subRegionOptions[subRegionType].create(data, nil, index, subIndex[subRegionType])
options.__order = 200 + index
allOptions["sub." .. index .. "." .. subRegionType] = options
@@ -295,7 +294,7 @@ function WeakAuras.GetDisplayOptions(data)
if(type(data.id) == "string") then
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
end
region.hidden = function(info, ...) return hiddenAll(data, info, ...); end;
+23 -26
View File
@@ -7,18 +7,16 @@ local pairs = pairs
local AceGUI = LibStub("AceGUI-3.0")
local collisions = WeakAuras.collisions
local displayButtons = WeakAuras.displayButtons
local savedVars = WeakAuras.savedVars
local importAddonButtons = {}
local importDisplayButtons = {}
WeakAuras.importDisplayButtons = importDisplayButtons
function WeakAuras.CreateImportButtons()
function OptionsPrivate.CreateImportButtons()
wipe(importAddonButtons);
wipe(importDisplayButtons);
for addonName, addonData in pairs(WeakAuras.addons) do
for addonName, addonData in pairs(OptionsPrivate.Private) do
local addonButton = AceGUI:Create("WeakAurasImportButton");
importAddonButtons[addonName] = addonButton;
addonButton:SetTitle(addonData.displayName);
@@ -56,7 +54,7 @@ function WeakAuras.CreateImportButtons()
end
end
end
WeakAuras.ResolveCollisions(function()
OptionsPrivate.Private.ResolveCollisions(function()
for groupId, dataFromAddon in pairs(addonData.displays) do
if(dataFromAddon.controlledChildren) then
local data = WeakAuras.GetData(groupId);
@@ -75,7 +73,7 @@ function WeakAuras.CreateImportButtons()
end
end
WeakAuras.ScanForLoads();
OptionsPrivate.Private.ScanForLoads();
WeakAuras.SortDisplayButtons();
end);
end);
@@ -83,7 +81,7 @@ function WeakAuras.CreateImportButtons()
local function UpdateAddonChecked()
local shouldBeChecked = true;
for id, data in pairs(addonData.displays) do
if not(WeakAuras.IsDefinedByAddon(id)) then
if not(OptionsPrivate.Private.IsDefinedByAddon(id)) then
shouldBeChecked = false;
break;
end
@@ -106,7 +104,7 @@ function WeakAuras.CreateImportButtons()
local function UpdateGroupChecked()
local shouldBeChecked = true;
for index, childId in pairs(data.controlledChildren) do
if not(WeakAuras.IsDefinedByAddon(childId)) then
if not(OptionsPrivate.Private.IsDefinedByAddon(childId)) then
shouldBeChecked = false;
break;
end
@@ -121,7 +119,7 @@ function WeakAuras.CreateImportButtons()
local childButton = AceGUI:Create("WeakAurasImportButton");
importDisplayButtons[childId] = childButton;
local data = WeakAuras.addons[addonName].displays[childId];
local data = OptionsPrivate.Private[addonName].displays[childId];
childButton:SetTitle(childId);
childButton:SetDescription(data.desc);
@@ -134,14 +132,14 @@ function WeakAuras.CreateImportButtons()
else
WeakAuras.DisableAddonDisplay(childId);
end
WeakAuras.ResolveCollisions(function()
WeakAuras.ScanForLoads();
OptionsPrivate.Private.ResolveCollisions(function()
OptionsPrivate.Private.ScanForLoads();
WeakAuras.SortDisplayButtons();
UpdateGroupChecked();
end);
end);
childButton.updateChecked = UpdateGroupChecked;
childButton.checkbox:SetChecked(WeakAuras.IsDefinedByAddon(childId));
childButton.checkbox:SetChecked(OptionsPrivate.Private.IsDefinedByAddon(childId));
end
groupButton:SetClick(function()
@@ -160,7 +158,7 @@ function WeakAuras.CreateImportButtons()
WeakAuras.DisableAddonDisplay(childId);
end
end
WeakAuras.ResolveCollisions(function()
OptionsPrivate.Private.ResolveCollisions(function()
local data = WeakAuras.GetData(id);
if(data) then
for index, childId in pairs(data.controlledChildren) do
@@ -175,7 +173,7 @@ function WeakAuras.CreateImportButtons()
WeakAuras.ClearAndUpdateOptions(data.id);
end
WeakAuras.ScanForLoads();
OptionsPrivate.Private.ScanForLoads();
WeakAuras.SortDisplayButtons();
UpdateAddonChecked();
end);
@@ -204,13 +202,13 @@ function WeakAuras.CreateImportButtons()
else
WeakAuras.DisableAddonDisplay(id);
end
WeakAuras.ResolveCollisions(function()
OptionsPrivate.Private.ResolveCollisions(function()
WeakAuras.SortDisplayButtons()
UpdateAddonChecked();
end);
end);
displayButton.updateChecked = UpdateAddonChecked;
displayButton.checkbox:SetChecked(WeakAuras.IsDefinedByAddon(id));
displayButton.checkbox:SetChecked(OptionsPrivate.Private.IsDefinedByAddon(id));
end
end
@@ -229,7 +227,7 @@ function WeakAuras.SortImportButtons(newContainer)
container = newContainer or container;
wipe(container.children);
local toSort = {};
for addon, addonData in pairs(WeakAuras.addons) do
for addon, addonData in pairs(OptionsPrivate.Private) do
container:AddChild(importAddonButtons[addon]);
wipe(toSort);
for id, data in pairs(addonData.displays) do
@@ -262,29 +260,28 @@ function WeakAuras.SortImportButtons(newContainer)
end
function WeakAuras.EnableAddonDisplay(id)
local db = savedVars.db
local db = OptionsPrivate.savedVars.db
if not(db.registered[id]) then
local addon, data;
for addonName, addonData in pairs(WeakAuras.addons) do
for addonName, addonData in pairs(OptionsPrivate.Private) do
if(addonData.displays[id]) then
addon = addonName;
data = {}
WeakAuras.DeepCopy(addonData.displays[id], data);
data = CopyTable(addonData.displays[id]);
break;
end
end
if(db.displays[id]) then
-- ID collision
collisions[id] = {addon, data};
OptionsPrivate.Private.collisions[id] = {addon, data};
else
db.registered[id] = addon;
if(data.controlledChildren) then
wipe(data.controlledChildren);
end
WeakAuras.Add(data);
WeakAuras.SyncParentChildRelationships(true);
WeakAuras.AddDisplayButton(data);
OptionsPrivate.Private.SyncParentChildRelationships(true);
OptionsPrivate.AddDisplayButton(data);
end
end
end
@@ -297,7 +294,7 @@ end
function WeakAuras.DisableAddonDisplay(id)
local frame = WeakAuras.OptionsFrame()
local db = savedVars.db
local db = OptionsPrivate.savedVars.db
db.registered[id] = false;
local data = WeakAuras.GetData(id);
if(data) then
@@ -320,7 +317,7 @@ function WeakAuras.DisableAddonDisplay(id)
end
WeakAuras.Delete(data);
WeakAuras.SyncParentChildRelationships(true);
OptionsPrivate.Private.SyncParentChildRelationships(true);
frame.buttonsScroll:DeleteChild(displayButtons[id]);
displayButtons[id] = nil;
+28 -37
View File
@@ -3,15 +3,6 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L;
local event_types = WeakAuras.event_types;
local status_types = WeakAuras.status_types;
local check_types = WeakAuras.check_types;
local subevent_prefix_types = WeakAuras.subevent_prefix_types;
local subevent_actual_prefix_types = WeakAuras.subevent_actual_prefix_types;
local subevent_suffix_types = WeakAuras.subevent_suffix_types;
local custom_trigger_types = WeakAuras.custom_trigger_types;
local eventend_types = WeakAuras.eventend_types;
local function GetCustomTriggerOptions(data, triggernum)
local id = data.id;
local trigger = data.triggers[triggernum].trigger
@@ -38,7 +29,7 @@ local function GetCustomTriggerOptions(data, triggernum)
name = L["Event Type"],
order = 7,
width = WeakAuras.doubleWidth,
values = custom_trigger_types,
values = OptionsPrivate.Private.custom_trigger_types,
hidden = function() return not (trigger.type == "custom") end,
get = function(info)
return trigger.custom_type
@@ -55,7 +46,7 @@ local function GetCustomTriggerOptions(data, triggernum)
name = L["Check On..."],
width = WeakAuras.doubleWidth / 3,
order = 8,
values = check_types,
values = OptionsPrivate.Private.check_types,
hidden = function() return not (trigger.type == "custom"
and (trigger.custom_type == "status" or trigger.custom_type == "stateupdate")
and trigger.check ~= "update")
@@ -72,7 +63,7 @@ local function GetCustomTriggerOptions(data, triggernum)
name = L["Check On..."],
order = 9,
width = WeakAuras.doubleWidth,
values = check_types,
values = OptionsPrivate.Private.check_types,
hidden = function() return not (trigger.type == "custom"
and (trigger.custom_type == "status" or trigger.custom_type == "stateupdate")
and trigger.check == "update")
@@ -125,12 +116,12 @@ local function GetCustomTriggerOptions(data, triggernum)
trueEvent = string.upper(i)
elseif trueEvent == "CLEU" or trueEvent == "COMBAT_LOG_EVENT_UNFILTERED" then
local subevent = string.upper(i)
if not WeakAuras.IsCLEUSubevent(subevent) then
if not OptionsPrivate.Private.IsCLEUSubevent(subevent) then
return "|cFFFF0000"..L["%s is not a valid SubEvent for COMBAT_LOG_EVENT_UNFILTERED"]:format(subevent)
end
elseif trueEvent:match("^UNIT_") then
local unit = string.lower(i)
if not WeakAuras.baseUnitId[unit] and not WeakAuras.multiUnitId[unit] then
if not OptionsPrivate.Private.baseUnitId[unit] and not OptionsPrivate.Private.multiUnitId[unit] then
return "|cFFFF0000"..L["Unit %s is not a valid unit for RegisterUnitEvent"]:format(unit)
end
end
@@ -156,12 +147,12 @@ local function GetCustomTriggerOptions(data, triggernum)
if not trueEvent then
trueEvent = string.upper(i)
elseif trueEvent == "CLEU" or trueEvent == "COMBAT_LOG_EVENT_UNFILTERED" then
if not WeakAuras.IsCLEUSubevent(string.upper(i)) then
if not OptionsPrivate.Private.IsCLEUSubevent(string.upper(i)) then
return false
end
elseif trueEvent:match("^UNIT_") then
local unit = string.lower(i)
if not WeakAuras.baseUnitId[unit] then
if not OptionsPrivate.Private.baseUnitId[unit] then
return false
end
end
@@ -177,7 +168,7 @@ local function GetCustomTriggerOptions(data, triggernum)
name = L["Hide"],
order = 12,
hidden = function() return not (trigger.type == "custom" and trigger.custom_type == "event" and trigger.custom_hide ~= "custom") end,
values = eventend_types,
values = OptionsPrivate.Private.eventend_types,
get = function() trigger.custom_hide = trigger.custom_hide or "timed"; return trigger.custom_hide end,
set = function(info, v)
trigger.custom_hide = v;
@@ -191,7 +182,7 @@ local function GetCustomTriggerOptions(data, triggernum)
order = 12,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "custom" and trigger.custom_type == "event" and trigger.custom_hide == "custom") end,
values = eventend_types,
values = OptionsPrivate.Private.eventend_types,
get = function() return trigger.custom_hide end,
set = function(info, v)
trigger.custom_hide = v;
@@ -275,21 +266,21 @@ local function GetCustomTriggerOptions(data, triggernum)
local function hideCustomTrigger()
return not (trigger.type == "custom")
end
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Custom Trigger"], "custom_trigger", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-trigger",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Custom Trigger"], "custom_trigger", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-trigger",
10, hideCustomTrigger, appendToTriggerPath("custom"), false, true, extraSetFunction, nil, true);
local function hideCustomVariables()
return not (trigger.type == "custom" and trigger.custom_type == "stateupdate");
end
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Custom Variables"], "custom_variables", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-variables",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Custom Variables"], "custom_variables", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-variables",
11, hideCustomVariables, appendToTriggerPath("customVariables"), false, true, extraSetFunctionReload, nil, true);
local function hideCustomUntrigger()
return not (trigger.type == "custom"
and (trigger.custom_type == "status" or (trigger.custom_type == "event" and trigger.custom_hide == "custom")))
end
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Custom Untrigger"], "custom_untrigger", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-untrigger",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Custom Untrigger"], "custom_untrigger", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-untrigger",
14, hideCustomUntrigger, appendToUntriggerPath("custom"), false, true, extraSetFunction);
local function hideCustomDuration()
@@ -297,7 +288,7 @@ local function GetCustomTriggerOptions(data, triggernum)
and (trigger.custom_type == "status"
or (trigger.custom_type == "event" and (trigger.custom_hide ~= "timed" or trigger.dynamicDuration))))
end
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Duration Info"], "custom_duration", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#duration-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Duration Info"], "custom_duration", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#duration-info",
16, hideCustomDuration, appendToTriggerPath("customDuration"), false, true, extraSetFunctionReload);
local function hideIfTriggerStateUpdate()
@@ -328,17 +319,17 @@ local function GetCustomTriggerOptions(data, triggernum)
}
}
WeakAuras.commonOptions.AddCodeOption(customOptions, data, string.format(L["Overlay %s Info"], i), "custom_overlay" .. i, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#overlay-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, string.format(L["Overlay %s Info"], i), "custom_overlay" .. i, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#overlay-info",
17 + i / 10, hideOverlay, appendToTriggerPath("customOverlay" .. i), false, true, extraSetFunctionReload, extraFunctions);
end
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Name Info"], "custom_name", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#name-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Name Info"], "custom_name", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#name-info",
18, hideIfTriggerStateUpdate, appendToTriggerPath("customName"), false, true, extraSetFunctionReload);
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Icon Info"], "custom_icon", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#icon-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Icon Info"], "custom_icon", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#icon-info",
20, hideIfTriggerStateUpdate, appendToTriggerPath("customIcon"), false, true, extraSetFunction);
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Texture Info"], "custom_texture", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#texture-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Texture Info"], "custom_texture", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#texture-info",
22, hideIfTriggerStateUpdate, appendToTriggerPath("customTexture"), false, true, extraSetFunction);
WeakAuras.commonOptions.AddCodeOption(customOptions, data, L["Stack Info"], "custom_stacks", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#stack-info",
OptionsPrivate.commonOptions.AddCodeOption(customOptions, data, L["Stack Info"], "custom_stacks", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#stack-info",
23, hideIfTriggerStateUpdate, appendToTriggerPath("customStacks"), false, true, extraSetFunctionReload);
return customOptions;
@@ -365,9 +356,9 @@ local function GetGenericTriggerOptions(data, triggernum)
values = function()
local type= trigger.type;
if(type == "event") then
return event_types;
return OptionsPrivate.Private.event_types;
elseif(type == "status") then
return status_types;
return OptionsPrivate.Private.status_types;
end
end,
get = function(info)
@@ -375,7 +366,7 @@ local function GetGenericTriggerOptions(data, triggernum)
end,
set = function(info, v)
trigger.event = v
local prototype = WeakAuras.event_prototypes[v];
local prototype = OptionsPrivate.Private.event_prototypes[v];
if(prototype) then
if(prototype.automaticrequired) then
trigger.unevent = "auto";
@@ -391,8 +382,8 @@ local function GetGenericTriggerOptions(data, triggernum)
},
}
WeakAuras.commonOptions.AddCommonTriggerOptions(options, data, triggernum)
WeakAuras.AddTriggerMetaFunctions(options, data, triggernum)
OptionsPrivate.commonOptions.AddCommonTriggerOptions(options, data, triggernum)
OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
local combatLogOptions =
{
@@ -401,7 +392,7 @@ local function GetGenericTriggerOptions(data, triggernum)
name = L["Message Prefix"],
width = WeakAuras.normalWidth,
order = 8,
values = subevent_prefix_types,
values = OptionsPrivate.Private.subevent_prefix_types,
control = "WeakAurasSortedDropdown",
hidden = function() return not (trigger.type == "event" and trigger.event == "Combat Log"); end,
get = function(info)
@@ -417,9 +408,9 @@ local function GetGenericTriggerOptions(data, triggernum)
width = WeakAuras.normalWidth,
name = L["Message Suffix"],
order = 9,
values = subevent_suffix_types,
values = OptionsPrivate.Private.subevent_suffix_types,
control = "WeakAurasSortedDropdown",
hidden = function() return not (trigger.type == "event" and trigger.event == "Combat Log" and subevent_actual_prefix_types[trigger.subeventPrefix]); end,
hidden = function() return not (trigger.type == "event" and trigger.event == "Combat Log" and OptionsPrivate.Private.subevent_actual_prefix_types[trigger.subeventPrefix]); end,
get = function(info)
return trigger.subeventSuffix
end,
@@ -441,8 +432,8 @@ local function GetGenericTriggerOptions(data, triggernum)
elseif (triggerType == "status" or triggerType == "event") then
local prototypeOptions;
local trigger, untrigger = data.triggers[triggernum].trigger, data.triggers[triggernum].untrigger;
if(WeakAuras.event_prototypes[trigger.event]) then
prototypeOptions = WeakAuras.ConstructOptions(WeakAuras.event_prototypes[trigger.event], data, 10, triggernum);
if(OptionsPrivate.Private.event_prototypes[trigger.event]) then
prototypeOptions = OptionsPrivate.ConstructOptions(OptionsPrivate.Private.event_prototypes[trigger.event], data, 10, triggernum);
if (trigger.event == "Combat Log") then
WeakAuras.Mixin(prototypeOptions, combatLogOptions);
end
+4 -4
View File
@@ -3,10 +3,10 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local regionOptions = WeakAuras.regionOptions;
local parsePrefix = WeakAuras.commonOptions.parsePrefix
local flattenRegionOptions = WeakAuras.commonOptions.flattenRegionOptions
local parsePrefix = OptionsPrivate.commonOptions.parsePrefix
local flattenRegionOptions = OptionsPrivate.commonOptions.flattenRegionOptions
function WeakAuras.GetGroupOptions(data)
function OptionsPrivate.GetGroupOptions(data)
local regionOption;
local id = data.id
if (regionOptions[data.regionType]) then
@@ -54,7 +54,7 @@ function WeakAuras.GetGroupOptions(data)
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end,
hidden = function() return false end,
disabled = function() return false end,
+3 -3
View File
@@ -3,7 +3,7 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
function WeakAuras.GetInformationOptions(data)
function OptionsPrivate.GetInformationOptions(data)
local isGroup = data.controlledChildren
local isTmpGroup = type(data.id) == "table"
@@ -35,7 +35,7 @@ function WeakAuras.GetInformationOptions(data)
if data.id ~= newid and not WeakAuras.GetData(newid) then
local oldid = data.id
WeakAuras.Rename(data, newid);
WeakAuras.HandleRename(data, oldid, newid)
OptionsPrivate.HandleRename(data, oldid, newid)
end
end
}
@@ -85,7 +85,7 @@ function WeakAuras.GetInformationOptions(data)
local childData = WeakAuras.GetData(childId)
childData.url = v
WeakAuras.Add(childData)
WeakAuras.ClearOptions(childData.id)
OptionsPrivate.ClearOptions(childData.id)
end
end
+56 -55
View File
@@ -3,23 +3,16 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local removeFuncs = WeakAuras.commonOptions.removeFuncs
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("load")
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("load")
local getAll = WeakAuras.commonOptions.CreateGetAll("load")
local setAll = WeakAuras.commonOptions.CreateSetAll("load", getAll)
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("load")
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("load")
local getAll = OptionsPrivate.commonOptions.CreateGetAll("load")
local setAll = OptionsPrivate.commonOptions.CreateSetAll("load", getAll)
local operator_types = WeakAuras.operator_types;
local operator_types_without_equal = WeakAuras.operator_types_without_equal;
local string_operator_types = WeakAuras.string_operator_types;
local ValidateNumeric = WeakAuras.ValidateNumeric;
local eventend_types = WeakAuras.eventend_types;
local timedeventend_types = WeakAuras.timedeventend_types;
local autoeventend_types = WeakAuras.autoeventend_types;
local spellCache = WeakAuras.spellCache;
@@ -73,7 +66,7 @@ local function CorrectItemName(input)
end
-- Also used by the GenericTrigger
function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, triggertype, unevent)
function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum, triggertype, unevent)
local trigger, untrigger;
if(data.controlledChildren) then
trigger, untrigger = {}, {};
@@ -118,15 +111,15 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
name = type(arg.display) == "function" and arg.display(trigger) or arg.display,
order = order,
image = function()
local collapsed = WeakAuras.IsCollapsed("trigger", name, "", true)
local collapsed = OptionsPrivate.IsCollapsed("trigger", name, "", true)
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
imageHeight = 15,
func = function(info, button, secondCall)
if not secondCall then
local collapsed = WeakAuras.IsCollapsed("trigger", name, "", true)
WeakAuras.SetCollapsed("trigger", name, "", not collapsed)
local collapsed = OptionsPrivate.IsCollapsed("trigger", name, "", true)
OptionsPrivate.SetCollapsed("trigger", name, "", not collapsed)
end
end,
arg = {
@@ -137,7 +130,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
isCollapsedFunctions = isCollapsedFunctions or {};
isCollapsedFunctions[name] = function()
return WeakAuras.IsCollapsed("trigger", name, "", true);
return OptionsPrivate.IsCollapsed("trigger", name, "", true);
end
elseif(name and not arg.hidden) then
local realname = name;
@@ -187,7 +180,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -236,7 +229,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -284,7 +277,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -315,7 +308,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
name = L["Operator"],
order = order,
hidden = hidden,
values = arg.operator_types == "without_equal" and operator_types_without_equal or operator_types,
values = arg.operator_types == "without_equal" and OptionsPrivate.Private.operator_types_without_equal or OptionsPrivate.Private.operator_types,
disabled = function() return not trigger["use_"..realname]; end,
get = function() return trigger["use_"..realname] and trigger[realname.."_operator"] or nil; end,
set = function(info, v)
@@ -324,7 +317,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -338,7 +331,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end
elseif(arg.required and triggertype == "untrigger") then
@@ -363,7 +356,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -377,7 +370,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end
elseif(arg.required and triggertype == "untrigger") then
@@ -400,7 +393,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -423,7 +416,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end
elseif(arg.required and triggertype == "untrigger") then
@@ -438,7 +431,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
name = L["Operator"],
order = order,
hidden = hidden,
values = string_operator_types,
values = OptionsPrivate.Private.string_operator_types,
disabled = function() return not trigger["use_"..realname]; end,
get = function() return trigger["use_"..realname] and trigger[realname.."_operator"] or nil; end,
set = function(info, v)
@@ -447,7 +440,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -461,7 +454,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end
elseif(arg.required and triggertype == "untrigger") then
@@ -484,7 +477,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -498,7 +491,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end
elseif(arg.required and triggertype == "untrigger") then
@@ -521,7 +514,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
set = function(info, v)
trigger["use_exact_"..realname] = v;
WeakAuras.Add(data);
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -616,7 +609,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -629,7 +622,11 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if(type(arg.values) == "function") then
values = arg.values(trigger);
else
values = WeakAuras[arg.values];
if OptionsPrivate.Private[arg.values] then
values = OptionsPrivate.Private[arg.values]
else
values = WeakAuras[arg.values];
end
end
options[name] = {
type = "select",
@@ -667,7 +664,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -691,7 +688,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -745,7 +742,11 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if(type(arg.values) == "function") then
values = arg.values(trigger);
else
values = WeakAuras[arg.values];
if OptionsPrivate.Private[arg.values] then
values = OptionsPrivate.Private[arg.values]
else
values = WeakAuras[arg.values];
end
end
options[name] = {
type = "select",
@@ -766,7 +767,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -780,7 +781,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -812,7 +813,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -834,7 +835,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if (reloadOptions) then
WeakAuras.ClearAndUpdateOptions(data.id)
end
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
WeakAuras.SortDisplayButtons();
@@ -887,7 +888,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
end
if(unevent == "custom") then
local unevent_options = WeakAuras.ConstructOptions(prototype, data, order, triggernum, "untrigger");
local unevent_options = OptionsPrivate.ConstructOptions(prototype, data, order, triggernum, "untrigger");
options = union(options, unevent_options);
end
if (prototype.timedrequired) then
@@ -895,18 +896,18 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
local func = prototype.timedrequired
options.unevent.values = function()
if func(trigger) then
return timedeventend_types
return OptionsPrivate.Private.timedeventend_types
else
return eventend_types
return OptionsPrivate.Private.eventend_types
end
end
else
options.unevent.values = timedeventend_types;
options.unevent.values = OptionsPrivate.Private.timedeventend_types;
end
elseif (prototype.automatic) then
options.unevent.values = autoeventend_types;
options.unevent.values = OptionsPrivate.Private.autoeventend_types;
else
options.unevent.values = eventend_types;
options.unevent.values = OptionsPrivate.Private.eventend_types;
end
end
@@ -926,7 +927,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
return options;
end
function WeakAuras.GetLoadOptions(data)
function OptionsPrivate.GetLoadOptions(data)
local load = {
type = "group",
name = L["Load"],
@@ -936,13 +937,13 @@ function WeakAuras.GetLoadOptions(data)
data.load[info[#info]] = (v ~= "" and v) or nil;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ScanForLoads({[data.id] = true});
OptionsPrivate.Private.ScanForLoads({[data.id] = true});
WeakAuras.SortDisplayButtons();
end,
args = {}
}
load.args = WeakAuras.ConstructOptions(WeakAuras.load_prototype, data, 10, nil, "load");
load.args = OptionsPrivate.ConstructOptions(OptionsPrivate.Private.load_prototype, data, 10, nil, "load");
if(data.controlledChildren) then
removeFuncs(load);
@@ -956,7 +957,7 @@ function WeakAuras.GetLoadOptions(data)
if(type(data.id) == "string") then
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
end
load.hidden = function(info, ...) return hiddenAll(data, info, ...); end;
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
-- Lua APIs
local pairs = pairs
@@ -117,7 +118,7 @@ local function ConstructCodeReview(frame)
return group
end
function WeakAuras.CodeReview(frame)
function OptionsPrivate.CodeReview(frame)
codeReview = codeReview or ConstructCodeReview(frame)
return codeReview
end
@@ -13,15 +13,12 @@ local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local WeakAuras = WeakAuras
local L = WeakAuras.L
local valueFromPath = WeakAuras.ValueFromPath
local valueToPath = WeakAuras.ValueToPath
local frameChooserFrame
local frameChooserBox
local oldFocus
local oldFocusName
function WeakAuras.StartFrameChooser(data, path)
function OptionsPrivate.StartFrameChooser(data, path)
local frame = WeakAuras.OptionsFrame();
if not(frameChooserFrame) then
frameChooserFrame = CreateFrame("frame");
@@ -35,15 +32,15 @@ function WeakAuras.StartFrameChooser(data, path)
frameChooserBox:SetBackdropBorderColor(0, 1, 0);
frameChooserBox:Hide();
end
local givenValue = valueFromPath(data, path);
local givenValue = OptionsPrivate.Private.ValueFromPath(data, path);
frameChooserFrame:SetScript("OnUpdate", function()
if(IsMouseButtonDown("RightButton")) then
valueToPath(data, path, givenValue);
WeakAuras.StopFrameChooser(data);
OptionsPrivate.Private.ValueToPath(data, path, givenValue);
OptionsPrivate.StopFrameChooser(data);
WeakAuras.FillOptions()
elseif(IsMouseButtonDown("LeftButton") and oldFocusName) then
WeakAuras.StopFrameChooser(data);
OptionsPrivate.StopFrameChooser(data);
else
SetCursor("CAST_CURSOR");
@@ -76,7 +73,7 @@ function WeakAuras.StartFrameChooser(data, path)
end
if(focusName ~= oldFocusName) then
valueToPath(data, path, focusName);
OptionsPrivate.Private.ValueToPath(data, path, focusName);
oldFocusName = focusName;
WeakAuras.FillOptions()
end
@@ -91,7 +88,7 @@ function WeakAuras.StartFrameChooser(data, path)
end);
end
function WeakAuras.StopFrameChooser(data)
function OptionsPrivate.StopFrameChooser(data)
if(frameChooserFrame) then
frameChooserFrame:SetScript("OnUpdate", nil);
frameChooserBox:Hide();
@@ -202,7 +202,7 @@ local function ConstructIconPicker(frame)
return group
end
function WeakAuras.IconPicker(frame)
function OptionsPrivate.IconPicker(frame)
iconPicker = iconPicker or ConstructIconPicker(frame)
return iconPicker
end
@@ -52,7 +52,7 @@ local function ConstructImportExport(frame)
if(mode == "export") then
displayStr = WeakAuras.DisplayToString(id, true);
elseif(mode == "table") then
displayStr = WeakAuras.DataToString(id);
displayStr = OptionsPrivate.Private.DataToString(id);
end
input.editBox:SetScript("OnEscapePressed", function() group:Close(); end);
input.editBox:SetScript("OnChar", function() input:SetText(displayStr); input.editBox:HighlightText(); end);
@@ -92,7 +92,7 @@ local function ConstructImportExport(frame)
return group
end
function WeakAuras.ImportExport(frame)
function OptionsPrivate.ImportExport(frame)
importexport = importexport or ConstructImportExport(frame)
return importexport
end
@@ -204,7 +204,7 @@ local function ConstructModelPicker(frame)
return group
end
function WeakAuras.ModelPicker(frame)
function OptionsPrivate.ModelPicker(frame)
modelPicker = modelPicker or ConstructModelPicker(frame)
return modelPicker
end
+11 -13
View File
@@ -14,8 +14,6 @@ local WeakAuras = WeakAuras
local moversizer
local mover
local savedVars = WeakAuras.savedVars
local function EnsureTexture(self, texture)
if texture then
return texture
@@ -45,7 +43,7 @@ local function moveOnePxl(direction)
end
WeakAuras.Add(data, nil, true)
WeakAuras.UpdateThumbnail(data)
WeakAuras.ResetMoverSizer()
OptionsPrivate.ResetMoverSizer()
if data.parent then
local parentData = WeakAuras.GetData(data.parent)
if parentData then
@@ -494,14 +492,14 @@ local function ConstructMoverSizer(parent)
frame:ScaleCorners(region:GetWidth(), region:GetHeight())
local regionStrata = region:GetFrameStrata()
if regionStrata then
local strata = math.min(tIndexOf(WeakAuras.frame_strata_types, regionStrata) + 1, 9)
frame:SetFrameStrata(WeakAuras.frame_strata_types[strata])
mover:SetFrameStrata(WeakAuras.frame_strata_types[strata])
local strata = math.min(tIndexOf(OptionsPrivate.Private.frame_strata_types, regionStrata) + 1, 9)
frame:SetFrameStrata(OptionsPrivate.Private.frame_strata_types[strata])
mover:SetFrameStrata(OptionsPrivate.Private.frame_strata_types[strata])
end
local db = savedVars.db
local db = OptionsPrivate.savedVars.db
mover.startMoving = function()
WeakAuras.CancelAnimation(region, true, true, true, true, true)
OptionsPrivate.Private.CancelAnimation(region, true, true, true, true, true)
mover:ClearAllPoints()
if data.regionType == "group" then
mover:SetPoint(mover.selfPoint, region, mover.anchorPoint, region.blx * scale, region.bly * scale)
@@ -617,7 +615,7 @@ local function ConstructMoverSizer(parent)
end
end
WeakAuras.FillOptions()
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
-- hide alignment lines
frame.lineY:Hide()
frame.lineX:Hide()
@@ -639,7 +637,7 @@ local function ConstructMoverSizer(parent)
if region:IsResizable() then
frame.startSizing = function(point)
mover.isMoving = true
WeakAuras.CancelAnimation(region, true, true, true, true, true)
OptionsPrivate.Private.CancelAnimation(region, true, true, true, true, true)
local rSelfPoint, rAnchor, rAnchorPoint, rXOffset, rYOffset = region:GetPoint(1)
region:StartSizing(point)
frame.text:ClearAllPoints()
@@ -737,7 +735,7 @@ local function ConstructMoverSizer(parent)
frame.text:Hide()
frame:SetScript("OnUpdate", nil)
WeakAuras.FillOptions()
WeakAuras.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
OptionsPrivate.Private.Animate("display", data.uid, "main", data.animation.main, WeakAuras.regions[data.id].region, false, nil, true)
-- hide alignment lines
frame.lineY:Hide()
frame.lineX:Hide()
@@ -835,7 +833,7 @@ local function ConstructMoverSizer(parent)
self.alignCurrentAlpha = newAlpha
end
local db = savedVars.db
local db = OptionsPrivate.savedVars.db
local region = self.moving.region
local data = self.moving.data
if not self.isMoving then
@@ -974,7 +972,7 @@ local function ConstructMoverSizer(parent)
return frame, mover
end
function WeakAuras.MoverSizer(parent)
function OptionsPrivate.MoverSizer(parent)
if not moversizer or not mover then
moversizer, mover = ConstructMoverSizer(parent)
end
+46 -58
View File
@@ -18,12 +18,10 @@ local WeakAuras = WeakAuras
local L = WeakAuras.L
local displayButtons = WeakAuras.displayButtons
local loaded = WeakAuras.loaded
local regionOptions = WeakAuras.regionOptions
local savedVars = WeakAuras.savedVars
local tempGroup = WeakAuras.tempGroup
local tempGroup = OptionsPrivate.tempGroup
local prettyPrint = WeakAuras.prettyPrint
local aceOptions = WeakAuras.aceOptions
local aceOptions = {}
local function CreateDecoration(frame)
local deco = CreateFrame("Frame", nil, frame)
@@ -135,11 +133,11 @@ local defaultHeight = 665
local minWidth = 750
local minHeight = 240
function WeakAuras.CreateFrame()
function OptionsPrivate.CreateFrame()
local WeakAuras_DropDownMenu = CreateFrame("frame", "WeakAuras_DropDownMenu", nil, "UIDropDownMenuTemplate")
local frame
local db = savedVars.db
local odb = savedVars.odb
local db = OptionsPrivate.savedVars.db
local odb = OptionsPrivate.savedVars.odb
-------- Mostly Copied from AceGUIContainer-Frame--------
frame = CreateFrame("FRAME", "WeakAurasOptions", UIParent)
tinsert(UISpecialFrames, frame:GetName())
@@ -173,15 +171,10 @@ function WeakAuras.CreateFrame()
frame:Hide()
frame:SetScript("OnHide", function()
WeakAuras.ClearFakeStates()
WeakAuras.SetDragging()
OptionsPrivate.Private.ClearFakeStates()
OptionsPrivate.SetDragging()
local tutFrame = WeakAuras.TutorialsFrame and WeakAuras.TutorialsFrame()
if tutFrame and tutFrame:IsVisible() then
tutFrame:Hide()
end
WeakAuras.PauseAllDynamicGroups()
OptionsPrivate.Private.PauseAllDynamicGroups()
for id, data in pairs(WeakAuras.regions) do
data.region:Collapse()
@@ -194,12 +187,11 @@ function WeakAuras.CreateFrame()
end
end
WeakAuras.ResumeAllDynamicGroups()
WeakAuras.ReloadAll()
WeakAuras.Resume()
OptionsPrivate.Private.ResumeAllDynamicGroups()
OptionsPrivate.Private.Resume()
if WeakAuras.mouseFrame then
WeakAuras.mouseFrame:OptionsClosed()
if OptionsPrivate.Private.mouseFrame then
OptionsPrivate.Private.mouseFrame:OptionsClosed()
end
end)
@@ -537,14 +529,14 @@ function WeakAuras.CreateFrame()
container.content:SetPoint("BOTTOMRIGHT", 0, 0)
frame.container = container
frame.texturePicker = WeakAuras.TexturePicker(frame)
frame.iconPicker = WeakAuras.IconPicker(frame)
frame.modelPicker = WeakAuras.ModelPicker(frame)
frame.importexport = WeakAuras.ImportExport(frame)
frame.texteditor = WeakAuras.TextEditor(frame)
frame.codereview = WeakAuras.CodeReview(frame)
frame.texturePicker = OptionsPrivate.TexturePicker(frame)
frame.iconPicker = OptionsPrivate.IconPicker(frame)
frame.modelPicker = OptionsPrivate.ModelPicker(frame)
frame.importexport = OptionsPrivate.ImportExport(frame)
frame.texteditor = OptionsPrivate.TextEditor(frame)
frame.codereview = OptionsPrivate.CodeReview(frame)
frame.moversizer, frame.mover = WeakAuras.MoverSizer(frame)
frame.moversizer, frame.mover = OptionsPrivate.MoverSizer(frame)
-- filter line
local filterInput = CreateFrame("editbox", "WeakAurasFilterInput", frame, "InputBoxTemplate")
@@ -609,7 +601,7 @@ function WeakAuras.CreateFrame()
local importButton = AceGUI:Create("WeakAurasToolbarButton")
importButton:SetText(L["Import"])
importButton:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\importsmall")
importButton:SetCallback("OnClick", WeakAuras.ImportFromString)
importButton:SetCallback("OnClick", OptionsPrivate.ImportFromString)
toolbarContainer:AddChild(importButton)
local magnetButton = AceGUI:Create("WeakAurasToolbarButton")
@@ -701,7 +693,7 @@ function WeakAuras.CreateFrame()
local numAddons = 0
for addon, addonData in pairs(WeakAuras.addons) do
for addon, addonData in pairs(OptionsPrivate.Private) do
numAddons = numAddons + 1
end
@@ -733,26 +725,26 @@ function WeakAuras.CreateFrame()
loadedButton:SetExpandDescription(L["Expand all loaded displays"])
loadedButton:SetCollapseDescription(L["Collapse all loaded displays"])
loadedButton:SetViewClick(function()
WeakAuras.PauseAllDynamicGroups()
OptionsPrivate.Private.PauseAllDynamicGroups()
if loadedButton.view.func() == 2 then
for id, child in pairs(displayButtons) do
if loaded[id] ~= nil then
if OptionsPrivate.Private.loaded[id] ~= nil then
child:PriorityHide(2)
end
end
else
for id, child in pairs(displayButtons) do
if loaded[id] ~= nil then
if OptionsPrivate.Private.loaded[id] ~= nil then
child:PriorityShow(2)
end
end
end
WeakAuras.ResumeAllDynamicGroups()
OptionsPrivate.Private.ResumeAllDynamicGroups()
end)
loadedButton:SetViewTest(function()
local none, all = true, true
for id, child in pairs(displayButtons) do
if loaded[id] ~= nil then
if OptionsPrivate.Private.loaded[id] ~= nil then
if child:GetVisibility() ~= 2 then
all = false
end
@@ -794,13 +786,13 @@ function WeakAuras.CreateFrame()
unloadedButton:SetViewClick(function()
if unloadedButton.view.func() == 2 then
for id, child in pairs(displayButtons) do
if loaded[id] == nil then
if OptionsPrivate.Private.loaded[id] == nil then
child:PriorityHide(2)
end
end
else
for id, child in pairs(displayButtons) do
if loaded[id] == nil then
if OptionsPrivate.Private.loaded[id] == nil then
child:PriorityShow(2)
end
end
@@ -809,7 +801,7 @@ function WeakAuras.CreateFrame()
unloadedButton:SetViewTest(function()
local none, all = true, true
for id, child in pairs(displayButtons) do
if loaded[id] == nil then
if OptionsPrivate.Private.loaded[id] == nil then
if child:GetVisibility() ~= 2 then
all = false
end
@@ -893,25 +885,21 @@ function WeakAuras.CreateFrame()
end
end
frame.GetSubOptions = function(self, id, tab)
return aceOptions[id] and aceOptions[id][tab]
end
frame.EnsureOptions = function(self, data, tab)
local id = data.id
aceOptions[id] = aceOptions[id] or {}
if not aceOptions[id][tab] then
local optionsGenerator =
{
group = WeakAuras.GetGroupOptions,
region = WeakAuras.GetDisplayOptions,
trigger = WeakAuras.GetTriggerOptions,
conditions = WeakAuras.GetConditionOptions,
load = WeakAuras.GetLoadOptions,
action = WeakAuras.GetActionOptions,
animation = WeakAuras.GetAnimationOptions,
authorOptions = WeakAuras.GetAuthorOptions,
information = WeakAuras.GetInformationOptions,
group = OptionsPrivate.GetGroupOptions,
region = OptionsPrivate.GetDisplayOptions,
trigger = OptionsPrivate.GetTriggerOptions,
conditions = OptionsPrivate.GetConditionOptions,
load = OptionsPrivate.GetLoadOptions,
action = OptionsPrivate.GetActionOptions,
animation = OptionsPrivate.GetAnimationOptions,
authorOptions = OptionsPrivate.GetAuthorOptions,
information = OptionsPrivate.GetInformationOptions,
}
if optionsGenerator[tab] then
aceOptions[id][tab] = optionsGenerator[tab](data)
@@ -996,7 +984,7 @@ function WeakAuras.CreateFrame()
end
frame.ClearPicks = function(self, noHide)
WeakAuras.PauseAllDynamicGroups()
OptionsPrivate.Private.PauseAllDynamicGroups()
frame.pickedDisplay = nil
frame.pickedOption = nil
@@ -1013,7 +1001,7 @@ function WeakAuras.CreateFrame()
container:ReleaseChildren()
self.moversizer:Hide()
WeakAuras.ResumeAllDynamicGroups()
OptionsPrivate.Private.ResumeAllDynamicGroups()
end
local function GetTarget(pickedDisplay)
@@ -1154,7 +1142,7 @@ function WeakAuras.CreateFrame()
importButton:SetIcon(frame.importThumbnail)
importButton:SetDescription(L["Import a display from an encoded string"])
importButton:SetClick(WeakAuras.ImportFromString)
importButton:SetClick(OptionsPrivate.ImportFromString)
containerScroll:AddChild(importButton)
end
@@ -1177,7 +1165,7 @@ function WeakAuras.CreateFrame()
container:SetLayout("fill")
container:AddChild(containerScroll)
WeakAuras.CreateImportButtons()
OptionsPrivate.CreateImportButtons()
WeakAuras.SortImportButtons(containerScroll)
else
error("An options button other than New or Addons was selected... but there are no other options buttons!")
@@ -1199,7 +1187,7 @@ function WeakAuras.CreateFrame()
displayButtons[data.parent]:Expand()
end
end
if loaded[id] ~= nil then
if OptionsPrivate.Private.loaded[id] ~= nil then
-- Under loaded
if not loadedButton:GetExpanded() then
loadedButton:Expand()
@@ -1260,17 +1248,17 @@ function WeakAuras.CreateFrame()
if type(self.pickedDisplay) == "string" then
if WeakAuras.GetData(self.pickedDisplay).controlledChildren then
wasGroup = true
elseif not WeakAuras.IsDisplayPicked(id) then
elseif not OptionsPrivate.IsDisplayPicked(id) then
tinsert(tempGroup.controlledChildren, self.pickedDisplay)
end
end
if wasGroup then
self:PickDisplay(id)
elseif not WeakAuras.IsDisplayPicked(id) then
elseif not OptionsPrivate.IsDisplayPicked(id) then
self.pickedDisplay = tempGroup
displayButtons[id]:Pick()
tinsert(tempGroup.controlledChildren, id)
WeakAuras.ClearOptions(tempGroup.id)
OptionsPrivate.ClearOptions(tempGroup.id)
self:FillOptions()
end
end
+37 -41
View File
@@ -17,9 +17,6 @@ local L = WeakAuras.L
local textEditor
local valueFromPath = WeakAuras.ValueFromPath
local valueToPath = WeakAuras.ValueToPath
local editor_themes = {
["Standard"] = {
["Table"] = "|c00ff3333",
@@ -149,36 +146,6 @@ end]=]
},
}
local function settings_dropdown_initialize(frame, level, menu)
for k, v in pairs(editor_themes) do
local item = {
text = k,
isNotRadio = false,
checked = function()
return WeakAurasSaved.editor_theme == k
end,
func = function()
WeakAurasSaved.editor_theme = k
set_scheme()
WeakAuras.editor.editBox:SetText(WeakAuras.editor.editBox:GetText())
end
}
UIDropDownMenu_AddButton(item)
end
UIDropDownMenu_AddButton(
{
text = L["Bracket Matching"],
isNotRadio = true,
checked = function()
return WeakAurasSaved.editor_bracket_matching
end,
func = function()
WeakAurasSaved.editor_bracket_matching = not WeakAurasSaved.editor_bracket_matching
end
}
)
end
local function ConstructTextEditor(frame)
local group = AceGUI:Create("InlineGroup")
group.frame:SetParent(frame)
@@ -260,6 +227,36 @@ local function ConstructTextEditor(frame)
urlText:SetPoint("RIGHT", settings_frame, "LEFT")
local dropdown = CreateFrame("Frame", "SettingsMenuFrame", settings_frame, "UIDropDownMenuTemplate")
local function settings_dropdown_initialize(frame, level, menu)
for k, v in pairs(editor_themes) do
local item = {
text = k,
isNotRadio = false,
checked = function()
return WeakAurasSaved.editor_theme == k
end,
func = function()
WeakAurasSaved.editor_theme = k
set_scheme()
editor.editBox:SetText(editor.editBox:GetText())
end
}
UIDropDownMenu_AddButton(item)
end
UIDropDownMenu_AddButton(
{
text = L["Bracket Matching"],
isNotRadio = true,
checked = function()
return WeakAurasSaved.editor_bracket_matching
end,
func = function()
WeakAurasSaved.editor_bracket_matching = not WeakAurasSaved.editor_bracket_matching
end
}
)
end
UIDropDownMenu_Initialize(dropdown, settings_dropdown_initialize, "MENU")
settings_frame:SetScript(
@@ -331,8 +328,8 @@ local function ConstructTextEditor(frame)
button:SetCallback(
"OnClick",
function()
WeakAuras.editor.editBox:Insert(snippet.snippet)
WeakAuras.editor:SetFocus()
editor.editBox:Insert(snippet.snippet)
editor:SetFocus()
end
)
button.deleteButton:SetScript(
@@ -635,7 +632,7 @@ local function ConstructTextEditor(frame)
local combinedText = ""
for index, childId in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local text = valueFromPath(childData, multipath and path[childId] or path)
local text = OptionsPrivate.Private.ValueFromPath(childData, multipath and path[childId] or path)
if text then
if not (singleText) then
singleText = text
@@ -661,7 +658,7 @@ local function ConstructTextEditor(frame)
editor.combinedText = true
end
else
editor:SetText(valueFromPath(data, path) or "")
editor:SetText(OptionsPrivate.Private.ValueFromPath(data, path) or "")
end
editor:SetFocus()
end
@@ -716,11 +713,11 @@ local function ConstructTextEditor(frame)
for index, childId in pairs(self.data.controlledChildren) do
local text = editor.combinedText and (textById[childId] or "") or editor:GetText()
local childData = WeakAuras.GetData(childId)
valueToPath(childData, self.multipath and self.path[childId] or self.path, text)
OptionsPrivate.Private.ValueToPath(childData, self.multipath and self.path[childId] or self.path, text)
WeakAuras.Add(childData)
end
else
valueToPath(self.data, self.path, editor:GetText())
OptionsPrivate.Private.ValueToPath(self.data, self.path, editor:GetText())
WeakAuras.Add(self.data)
end
if (self.reloadOptions) then
@@ -742,12 +739,11 @@ local function ConstructTextEditor(frame)
frame:UpdateFrameVisible()
WeakAuras.FillOptions()
end
WeakAuras.editor = editor
return group
end
function WeakAuras.TextEditor(frame)
function OptionsPrivate.TextEditor(frame)
textEditor = textEditor or ConstructTextEditor(frame)
return textEditor
end
@@ -221,7 +221,6 @@ local function ConstructTexturePicker(frame)
else
_, givenPath = next(self.givenPath);
end
WeakAuras.debug(givenPath, 3);
for categoryName, category in pairs(self.textures) do
if not(picked) then
for texturePath, textureName in pairs(category) do
@@ -279,7 +278,7 @@ local function ConstructTexturePicker(frame)
return group
end
function WeakAuras.TexturePicker(frame)
function OptionsPrivate.TexturePicker(frame)
texturePicker = texturePicker or ConstructTexturePicker(frame)
return texturePicker
end
+18 -18
View File
@@ -24,7 +24,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Orientation"],
order = 25,
values = WeakAuras.orientation_types,
values = OptionsPrivate.Private.orientation_types,
set = function(info, v)
if(
(
@@ -58,7 +58,7 @@ local function createOptions(id, data)
data.orientation = v;
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
inverse = {
@@ -71,7 +71,7 @@ local function createOptions(id, data)
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip on Mouseover"],
hidden = function() return not WeakAuras.CanHaveTooltip(data) end,
hidden = function() return not OptionsPrivate.Private.CanHaveTooltip(data) end,
order = 38
},
bar_header = {
@@ -120,15 +120,15 @@ local function createOptions(id, data)
name = L["Auto"],
desc = L["Choose whether the displayed icon is automatic or defined manually"],
order = 40.3,
disabled = function() return not WeakAuras.CanHaveAuto(data); end,
get = function() return WeakAuras.CanHaveAuto(data) and data.auto end,
disabled = function() return not OptionsPrivate.Private.CanHaveAuto(data); end,
get = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto end,
hidden = function() return not data.icon end,
},
displayIcon = {
type = "input",
width = WeakAuras.normalWidth,
name = L["Display Icon"],
hidden = function() return WeakAuras.CanHaveAuto(data) and data.auto or not data.icon; end,
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto or not data.icon; end,
disabled = function() return not data.icon end,
order = 40.4,
get = function()
@@ -144,16 +144,16 @@ local function createOptions(id, data)
type = "execute",
width = WeakAuras.normalWidth,
name = L["Choose"],
hidden = function() return WeakAuras.CanHaveAuto(data) and data.auto or not data.icon; end,
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto or not data.icon; end,
disabled = function() return not data.icon end,
order = 40.5,
func = function() WeakAuras.OpenIconPicker(data, "displayIcon"); end
func = function() OptionsPrivate.OpenIconPicker(data, "displayIcon"); end
},
icon_side = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Icon Position"],
values = WeakAuras.icon_side_types,
values = OptionsPrivate.Private.icon_side_types,
hidden = function() return data.orientation:find("VERTICAL") or not data.icon end,
order = 40.6,
},
@@ -161,7 +161,7 @@ local function createOptions(id, data)
type = "select",
width = WeakAuras.normalWidth,
name = L["Icon Position"],
values = WeakAuras.rotated_icon_side_types,
values = OptionsPrivate.Private.rotated_icon_side_types,
hidden = function() return data.orientation:find("HORIZONTAL") or not data.icon end,
order = 40.7,
get = function()
@@ -241,7 +241,7 @@ local function createOptions(id, data)
width = WeakAuras.halfWidth,
order = 44.3,
func = function()
WeakAuras.OpenTexturePicker(data, data, "sparkTexture", WeakAuras.texture_types);
OptionsPrivate.OpenTexturePicker(data, data, "sparkTexture", OptionsPrivate.Private.texture_types);
end,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
@@ -260,7 +260,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Blend Mode"],
order = 44.5,
values = WeakAuras.blend_types,
values = OptionsPrivate.Private.blend_types,
disabled = function() return not data.spark end,
hidden = function() return not data.spark end,
},
@@ -311,7 +311,7 @@ local function createOptions(id, data)
sparkRotationMode = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.spark_rotation_types,
values = OptionsPrivate.Private.spark_rotation_types,
name = L["Rotation Mode"],
order = 45,
disabled = function() return not data.spark end,
@@ -339,7 +339,7 @@ local function createOptions(id, data)
sparkHidden = {
type = "select",
width = WeakAuras.normalWidth,
values = WeakAuras.spark_hide_types,
values = OptionsPrivate.Private.spark_hide_types,
name = L["Hide on"],
order = 45.3,
disabled = function() return not data.spark end,
@@ -354,7 +354,7 @@ local function createOptions(id, data)
options = WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, 36.5);
local overlayInfo = WeakAuras.GetOverlayInfo(data);
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
if (overlayInfo and next(overlayInfo)) then
options["overlayheader"] = {
type = "header",
@@ -397,7 +397,7 @@ local function createOptions(id, data)
return {
aurabar = options,
position = WeakAuras.commonOptions.PositionOptions(id, data),
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
};
end
@@ -734,12 +734,12 @@ local function subCreateOptions(parentData, data, index, subIndex)
__title = L["Foreground"],
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "aurabar_bar")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "aurabar_bar")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "aurabar_bar")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "aurabar_bar")) then
WeakAuras.ClearAndUpdateOptions(parentData.id, parentData)
end
end,
+19 -19
View File
@@ -98,7 +98,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Choose"],
order = 0.51,
func = function() WeakAuras.OpenIconPicker(data, "groupIcon", true) end
func = function() OptionsPrivate.OpenIconPicker(data, "groupIcon", true) end
},
-- grow options
grow = {
@@ -106,7 +106,7 @@ local function createOptions(id, data)
width = WeakAuras.doubleWidth,
name = L["Grow"],
order = 1,
values = WeakAuras.grow_types,
values = OptionsPrivate.Private.grow_types,
set = function(info, v)
data.grow = v
local selfPoint = selfPoints[data.grow] or selfPoints.default
@@ -116,7 +116,7 @@ local function createOptions(id, data)
data.selfPoint = selfPoint
WeakAuras.Add(data)
WeakAuras.ClearAndUpdateOptions(data.id)
WeakAuras.ResetMoverSizer()
OptionsPrivate.ResetMoverSizer()
end,
},
useAnchorPerUnit = {
@@ -150,7 +150,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Align"],
order = 2,
values = WeakAuras.align_types,
values = OptionsPrivate.Private.align_types,
set = function(info, v)
data.align = v
local selfPoint = selfPoints[data.grow] or selfPoints.default
@@ -160,7 +160,7 @@ local function createOptions(id, data)
data.selfPoint = selfPoint
WeakAuras.Add(data)
WeakAuras.ClearAndUpdateOptions(data.id)
WeakAuras.ResetMoverSizer()
OptionsPrivate.ResetMoverSizer()
end,
hidden = function() return (data.grow == "CUSTOM" or data.grow == "LEFT" or data.grow == "RIGHT" or data.grow == "HORIZONTAL" or data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE" or data.grow == "GRID") end,
disabled = function() return data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE" end
@@ -170,7 +170,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Align"],
order = 3,
values = WeakAuras.rotated_align_types,
values = OptionsPrivate.Private.rotated_align_types,
hidden = function() return (data.grow == "CUSTOM" or data.grow == "UP" or data.grow == "DOWN" or data.grow == "VERTICAL" or data.grow == "CIRCLE" or data.grow == "COUNTERCIRCLE" or data.grow == "GRID") end,
get = function() return data.align; end,
set = function(info, v)
@@ -182,7 +182,7 @@ local function createOptions(id, data)
data.selfPoint = selfPoint
WeakAuras.Add(data)
WeakAuras.ClearAndUpdateOptions(data.id)
WeakAuras.ResetMoverSizer()
OptionsPrivate.ResetMoverSizer()
end,
},
-- circle grow options
@@ -191,7 +191,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Constant Factor"],
order = 4,
values = WeakAuras.circular_group_constant_factor_types,
values = OptionsPrivate.Private.circular_group_constant_factor_types,
hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end
},
rotation = {
@@ -238,13 +238,13 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Grid direction"],
order = 8,
values = WeakAuras.grid_types,
values = OptionsPrivate.Private.grid_types,
hidden = function() return data.grow ~= "GRID" end,
set = function(info, value)
data.selfPoint = gridSelfPoints[value]
data.gridType = value
WeakAuras.Add(data)
WeakAuras.ResetMoverSizer()
OptionsPrivate.ResetMoverSizer()
end,
},
gridWidth = {
@@ -321,7 +321,7 @@ local function createOptions(id, data)
width = WeakAuras.doubleWidth,
name = L["Sort"],
order = 20,
values = WeakAuras.group_sort_types
values = OptionsPrivate.Private.group_sort_types
},
-- custom sort option added below
hybridPosition = {
@@ -329,7 +329,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Hybrid Position"],
order = 21,
values = WeakAuras.group_hybrid_position_types,
values = OptionsPrivate.Private.group_hybrid_position_types,
hidden = function() return not(data.sort == "hybrid") end,
},
hybridSortMode = {
@@ -337,7 +337,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Hybrid Sort Mode"],
order = 22,
values = WeakAuras.group_hybrid_sort_types,
values = OptionsPrivate.Private.group_hybrid_sort_types,
hidden = function() return not(data.sort == "hybrid") end,
},
sortHybrid = {
@@ -409,7 +409,7 @@ local function createOptions(id, data)
data.yOffset = data.yOffset/(1-change)
data.scale = v
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
endHeader = {
@@ -419,23 +419,23 @@ local function createOptions(id, data)
},
};
WeakAuras.commonOptions.AddCodeOption(options, data, L["Custom Grow"], "custom_grow", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#grow",
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Grow"], "custom_grow", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#grow",
2, function() return data.grow ~= "CUSTOM" end, {"customGrow"}, nil, nil, nil, nil, nil, true)
WeakAuras.commonOptions.AddCodeOption(options, data, L["Custom Sort"], "custom_sort", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-sort",
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Sort"], "custom_sort", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-sort",
21, function() return data.sort ~= "custom" end, {"customSort"}, nil, nil, nil, nil, nil, true)
WeakAuras.commonOptions.AddCodeOption(options, data, L["Custom Anchor"], "custom_anchor_per_unit", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#group-by-frame",
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Anchor"], "custom_anchor_per_unit", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#group-by-frame",
1.7, function() return not(data.grow ~= "CUSTOM" and data.useAnchorPerUnit and data.anchorPerUnit == "CUSTOM") end, {"customAnchorPerUnit"}, nil, nil, nil, nil, nil, true)
local borderHideFunc = function() return data.useAnchorPerUnit or data.grow == "CUSTOM" end
local disableSelfPoint = function() return data.grow ~= "CUSTOM" and data.grow ~= "GRID" and not data.useAnchorPerUnit end
for k, v in pairs(WeakAuras.commonOptions.BorderOptions(id, data, nil, borderHideFunc, 70)) do
for k, v in pairs(OptionsPrivate.commonOptions.BorderOptions(id, data, nil, borderHideFunc, 70)) do
options[k] = v
end
return {
dynamicgroup = options,
position = WeakAuras.commonOptions.PositionOptions(id, data, nil, true, disableSelfPoint),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, disableSelfPoint),
};
end
+12 -12
View File
@@ -80,14 +80,14 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Choose"],
order = 0.51,
func = function() WeakAuras.OpenIconPicker(data, "groupIcon", true) end
func = function() OptionsPrivate.OpenIconPicker(data, "groupIcon", true) end
},
align_h = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Horizontal Align"],
order = 10,
values = WeakAuras.align_types,
values = OptionsPrivate.Private.align_types,
get = function()
if(#data.controlledChildren < 1) then
return nil;
@@ -145,7 +145,7 @@ local function createOptions(id, data)
end
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
align_v = {
@@ -153,7 +153,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Vertical Align"],
order = 15,
values = WeakAuras.rotated_align_types,
values = OptionsPrivate.Private.rotated_align_types,
get = function()
if(#data.controlledChildren < 1) then
return nil;
@@ -211,7 +211,7 @@ local function createOptions(id, data)
end
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
distribute_h = {
@@ -294,7 +294,7 @@ local function createOptions(id, data)
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
distribute_v = {
@@ -377,7 +377,7 @@ local function createOptions(id, data)
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
space_h = {
@@ -460,7 +460,7 @@ local function createOptions(id, data)
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
space_v = {
@@ -543,7 +543,7 @@ local function createOptions(id, data)
end
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
scale = {
@@ -564,7 +564,7 @@ local function createOptions(id, data)
data.yOffset = data.yOffset/(1-change)
data.scale = v
WeakAuras.Add(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end
},
endHeader = {
@@ -574,13 +574,13 @@ local function createOptions(id, data)
},
};
for k, v in pairs(WeakAuras.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
for k, v in pairs(OptionsPrivate.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
options[k] = v
end
return {
group = options,
position = WeakAuras.commonOptions.PositionOptions(id, data, nil, true, true),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true, true),
};
end
+17 -17
View File
@@ -6,7 +6,7 @@ local L = WeakAuras.L
local function createOptions(id, data)
local hiddenIconExtra = function()
return WeakAuras.IsCollapsed("icon", "icon", "iconextra", true);
return OptionsPrivate.IsCollapsed("icon", "icon", "iconextra", true);
end
local indentWidth = 0.15
@@ -25,14 +25,14 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Automatic Icon"],
order = 2,
disabled = function() return not WeakAuras.CanHaveAuto(data); end,
get = function() return WeakAuras.CanHaveAuto(data) and data.auto; end
disabled = function() return not OptionsPrivate.Private.CanHaveAuto(data); end,
get = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end
},
displayIcon = {
type = "input",
width = WeakAuras.normalWidth,
name = L["Display Icon"],
hidden = function() return WeakAuras.CanHaveAuto(data) and data.auto; end,
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end,
order = 3,
get = function()
return data.displayIcon and tostring(data.displayIcon) or "";
@@ -47,9 +47,9 @@ local function createOptions(id, data)
type = "execute",
width = WeakAuras.normalWidth,
name = L["Choose"],
hidden = function() return WeakAuras.CanHaveAuto(data) and data.auto; end,
hidden = function() return OptionsPrivate.Private.CanHaveAuto(data) and data.auto; end,
order = 4,
func = function() WeakAuras.OpenIconPicker(data, "displayIcon"); end
func = function() OptionsPrivate.OpenIconPicker(data, "displayIcon"); end
},
desaturate = {
type = "toggle",
@@ -61,7 +61,7 @@ local function createOptions(id, data)
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip on Mouseover"],
hidden = function() return not WeakAuras.CanHaveTooltip(data) end,
hidden = function() return not OptionsPrivate.Private.CanHaveTooltip(data) end,
order = 6
},
iconExtraDescription = {
@@ -94,14 +94,14 @@ local function createOptions(id, data)
width = WeakAuras.doubleWidth,
order = 7,
image = function()
local collapsed = WeakAuras.IsCollapsed("icon", "icon", "iconextra", true);
local collapsed = OptionsPrivate.IsCollapsed("icon", "icon", "iconextra", true);
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
imageHeight = 15,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("icon", "icon", "iconextra", true);
WeakAuras.SetCollapsed("icon", "icon", "iconextra", not collapsed);
local collapsed = OptionsPrivate.IsCollapsed("icon", "icon", "iconextra", true);
OptionsPrivate.SetCollapsed("icon", "icon", "iconextra", not collapsed);
end,
arg = {
expanderName = "icon"
@@ -183,16 +183,16 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Show Cooldown"],
order = 11.1,
disabled = function() return not WeakAuras.CanHaveDuration(data); end,
get = function() return WeakAuras.CanHaveDuration(data) and data.cooldown; end
disabled = function() return not OptionsPrivate.Private.CanHaveDuration(data); end,
get = function() return OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown; end
},
inverse = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Inverse"],
order = 11.2,
disabled = function() return not (WeakAuras.CanHaveDuration(data) and data.cooldown); end,
get = function() return data.inverse and WeakAuras.CanHaveDuration(data) and data.cooldown; end,
disabled = function() return not (OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown); end,
get = function() return data.inverse and OptionsPrivate.Private.CanHaveDuration(data) and data.cooldown; end,
hidden = function() return not data.cooldown end
},
cooldownEdge = {
@@ -200,7 +200,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Cooldown Edge"],
order = 11.3,
disabled = function() return not WeakAuras.CanHaveDuration(data) end,
disabled = function() return not OptionsPrivate.Private.CanHaveDuration(data) end,
hidden = function() return not data.cooldown end,
},
endHeader = {
@@ -212,7 +212,7 @@ local function createOptions(id, data)
return {
icon = options,
position = WeakAuras.commonOptions.PositionOptions(id, data),
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
};
end
@@ -236,7 +236,7 @@ local function modifyThumbnail(parent, frame, data)
end
if data then
local name, icon = WeakAuras.GetNameAndIcon(data);
local name, icon = OptionsPrivate.Private.GetNameAndIcon(data);
frame:SetIcon(icon)
end
end
+3 -3
View File
@@ -31,7 +31,7 @@ local function createOptions(id, data)
name = L["Choose"],
order = 2,
func = function()
WeakAuras.OpenModelPicker(data);
OptionsPrivate.OpenModelPicker(data);
end,
hidden = function() return data.modelIsUnit end
},
@@ -116,13 +116,13 @@ local function createOptions(id, data)
}
end
for k, v in pairs(WeakAuras.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
for k, v in pairs(OptionsPrivate.commonOptions.BorderOptions(id, data, nil, nil, 70)) do
options[k] = v
end
return {
model = options,
position = WeakAuras.commonOptions.PositionOptions(id, data, nil, nil, nil),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, nil, nil),
};
end
@@ -34,7 +34,7 @@ local function createOptions(id, data)
width = WeakAuras.halfWidth,
order = 12,
func = function()
WeakAuras.OpenTexturePicker(data, data, "foregroundTexture", WeakAuras.texture_types);
OptionsPrivate.OpenTexturePicker(data, data, "foregroundTexture", OptionsPrivate.Private.texture_types);
end
},
sameTexture = {
@@ -49,7 +49,7 @@ local function createOptions(id, data)
width = WeakAuras.halfWidth,
order = 17,
func = function()
WeakAuras.OpenTexturePicker(data, data, "backgroundTexture", WeakAuras.texture_types);
OptionsPrivate.OpenTexturePicker(data, data, "backgroundTexture", OptionsPrivate.Private.texture_types);
end,
disabled = function() return data.sameTexture; end
},
@@ -70,7 +70,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Blend Mode"],
order = 20,
values = WeakAuras.blend_types
values = OptionsPrivate.Private.blend_types
},
backgroundOffset = {
type = "range",
@@ -86,7 +86,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Orientation"],
order = 35,
values = WeakAuras.orientation_with_circle_types
values = OptionsPrivate.Private.orientation_with_circle_types
},
compress = {
type = "toggle",
@@ -175,7 +175,7 @@ local function createOptions(id, data)
WeakAuras.Add(parentData);
end
end
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end,
},
crop_y = {
@@ -198,7 +198,7 @@ local function createOptions(id, data)
WeakAuras.Add(parentData);
end
end
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end,
},
rotation = {
@@ -250,7 +250,7 @@ local function createOptions(id, data)
name = L["Slant Mode"],
order = 55.5,
hidden = function() return not data.slanted or data.orientation == "CLOCKWISE" or data.orientation == "ANTICLOCKWISE" end,
values = WeakAuras.slant_mode
values = OptionsPrivate.Private.slant_mode
},
spacer = {
type = "header",
@@ -265,7 +265,7 @@ local function createOptions(id, data)
};
options = WeakAuras.regionPrototype.AddAdjustedDurationOptions(options, data, 57);
local overlayInfo = WeakAuras.GetOverlayInfo(data);
local overlayInfo = OptionsPrivate.Private.GetOverlayInfo(data);
if (overlayInfo and next(overlayInfo)) then
options["overlayheader"] = {
type = "header",
@@ -307,7 +307,7 @@ local function createOptions(id, data)
return {
progresstexture = options,
position = WeakAuras.commonOptions.PositionOptions(id, data),
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
};
end
@@ -773,7 +773,7 @@ local templates = {
}
local function GetAnchors(data)
return WeakAuras.default_types_for_anchor
return OptionsPrivate.Private.default_types_for_anchor
end
WeakAuras.RegisterRegionOptions("progresstexture", createOptions, createIcon, L["Progress Texture"], createThumbnail, modifyThumbnail, L["Shows a texture that changes based on duration"], templates, GetAnchors);
@@ -68,7 +68,7 @@ local function createOptions(id, data)
name = L["Choose"],
order = 12,
func = function()
WeakAuras.OpenTexturePicker(data, data, "foregroundTexture", texture_types, setTextureFunc);
OptionsPrivate.OpenTexturePicker(data, data, "foregroundTexture", texture_types, setTextureFunc);
end
},
sameTexture = {
@@ -203,7 +203,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Blend Mode"],
order = 20,
values = WeakAuras.blend_types
values = OptionsPrivate.Private.blend_types
},
animationType = {
type = "select",
@@ -283,10 +283,10 @@ local function createOptions(id, data)
},
};
if WeakAuras.commonOptions then
if OptionsPrivate.commonOptions then
return {
stopmotion = options,
position = WeakAuras.commonOptions.PositionOptions(id, data, 2),
position = OptionsPrivate.commonOptions.PositionOptions(id, data, 2),
};
else
return {
+20 -20
View File
@@ -8,7 +8,7 @@ local screenWidth, screenHeight = math.ceil(GetScreenWidth() / 20) * 20, math.ce
local indentWidth = 0.15
local hiddenFontExtra = function()
return WeakAuras.IsCollapsed("text", "text", "fontflags", true)
return OptionsPrivate.IsCollapsed("text", "text", "fontflags", true)
end
local function createOptions(id, data)
@@ -19,7 +19,7 @@ local function createOptions(id, data)
type = "input",
width = WeakAuras.doubleWidth,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
return L["Dynamic text tooltip"] .. OptionsPrivate.Private.GetAdditionalProperties(data)
end,
multiline = true,
name = L["Display Text"],
@@ -28,19 +28,19 @@ local function createOptions(id, data)
return data.displayText;
end,
set = function(info, v)
data.displayText = WeakAuras.ReplaceLocalizedRaidMarkers(v);
data.displayText = OptionsPrivate.Private.ReplaceLocalizedRaidMarkers(v);
WeakAuras.Add(data);
WeakAuras.ClearAndUpdateOptions(data.id)
WeakAuras.UpdateThumbnail(data);
WeakAuras.ResetMoverSizer();
OptionsPrivate.ResetMoverSizer();
end,
},
customTextUpdate = {
type = "select",
width = WeakAuras.doubleWidth,
hidden = function() return not WeakAuras.ContainsCustomPlaceHolder(data.displayText); end,
hidden = function() return not OptionsPrivate.Private.ContainsCustomPlaceHolder(data.displayText); end,
name = L["Update Custom Text On..."],
values = WeakAuras.text_check_types,
values = OptionsPrivate.Private.text_check_types,
order = 36
},
-- code editor added below
@@ -76,7 +76,7 @@ local function createOptions(id, data)
type = "execute",
control = "WeakAurasExpandSmall",
name = function()
local textFlags = WeakAuras.font_flags[data.outline]
local textFlags = OptionsPrivate.Private.font_flags[data.outline]
local color = format("%02x%02x%02x%02x",
data.shadowColor[4] * 255, data.shadowColor[1] * 255,
data.shadowColor[2] * 255, data.shadowColor[3]*255)
@@ -106,11 +106,11 @@ local function createOptions(id, data)
return secondline
end,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("text", "text", "fontflags", true)
WeakAuras.SetCollapsed("text", "text", "fontflags", not collapsed)
local collapsed = OptionsPrivate.IsCollapsed("text", "text", "fontflags", true)
OptionsPrivate.SetCollapsed("text", "text", "fontflags", not collapsed)
end,
image = function()
local collapsed = WeakAuras.IsCollapsed("text", "text", "fontflags", true)
local collapsed = OptionsPrivate.IsCollapsed("text", "text", "fontflags", true)
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
@@ -132,7 +132,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth - indentWidth,
name = L["Outline"],
order = 48.2,
values = WeakAuras.font_flags,
values = OptionsPrivate.Private.font_flags,
hidden = hiddenFontExtra
},
shadowColor = {
@@ -184,7 +184,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth - indentWidth,
name = L["Justify"],
order = 48.8,
values = WeakAuras.justify_types,
values = OptionsPrivate.Private.justify_types,
hidden = hiddenFontExtra,
},
text_font_space55 = {
@@ -207,7 +207,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth - indentWidth,
name = L["Width"],
order = 49,
values = WeakAuras.text_automatic_width,
values = OptionsPrivate.Private.text_automatic_width,
hidden = hiddenFontExtra,
},
fixedWidth = {
@@ -232,7 +232,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth - indentWidth,
name = L["Overflow"],
order = 49.4,
values = WeakAuras.text_word_wrap,
values = OptionsPrivate.Private.text_word_wrap,
hidden = function() return hiddenFontExtra() or data.automaticWidth ~= "Fixed" end
},
@@ -254,17 +254,17 @@ local function createOptions(id, data)
},
};
WeakAuras.commonOptions.AddCodeOption(options, data, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
37, function() return not WeakAuras.ContainsCustomPlaceHolder(data.displayText) end, {"customText"}, false);
OptionsPrivate.commonOptions.AddCodeOption(options, data, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
37, function() return not OptionsPrivate.Private.ContainsCustomPlaceHolder(data.displayText) end, {"customText"}, false);
-- Add Text Format Options
local input = data.displayText
local hidden = function()
return WeakAuras.IsCollapsed("format_option", "text", "displayText", true)
return OptionsPrivate.IsCollapsed("format_option", "text", "displayText", true)
end
local setHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "text", "displayText", hidden)
OptionsPrivate.SetCollapsed("format_option", "text", "displayText", hidden)
end
local get = function(key)
@@ -286,7 +286,7 @@ local function createOptions(id, data)
options["displayText_format_" .. key] = option
end
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
addOption("footer", {
type = "description",
name = "",
@@ -296,7 +296,7 @@ local function createOptions(id, data)
return {
text = options;
position = WeakAuras.commonOptions.PositionOptions(id, data, nil, true);
position = OptionsPrivate.commonOptions.PositionOptions(id, data, nil, true);
};
end
+4 -4
View File
@@ -32,7 +32,7 @@ local function createOptions(id, data)
width = WeakAuras.halfWidth,
order = 7,
func = function()
WeakAuras.OpenTexturePicker(data, data, "texture", WeakAuras.texture_types);
OptionsPrivate.OpenTexturePicker(data, data, "texture", OptionsPrivate.Private.texture_types);
end
},
color = {
@@ -47,7 +47,7 @@ local function createOptions(id, data)
width = WeakAuras.normalWidth,
name = L["Blend Mode"],
order = 12,
values = WeakAuras.blend_types
values = OptionsPrivate.Private.blend_types
},
mirror = {
type = "toggle",
@@ -101,7 +101,7 @@ local function createOptions(id, data)
return {
texture = options,
position = WeakAuras.commonOptions.PositionOptions(id, data),
position = OptionsPrivate.commonOptions.PositionOptions(id, data),
};
end
@@ -230,7 +230,7 @@ local templates = {
}
local function GetAnchors(data)
return WeakAuras.default_types_for_anchor
return OptionsPrivate.Private.default_types_for_anchor
end
WeakAuras.RegisterRegionOptions("texture", createOptions, createIcon, L["Texture"], createThumbnail, modifyThumbnail, L["Shows a custom texture"], templates, GetAnchors);
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local SharedMedia = LibStub("LibSharedMedia-3.0");
local L = WeakAuras.L;
@@ -8,22 +9,22 @@ local function createOptions(parentData, data, index, subIndex)
__title = L["Model %s"]:format(subIndex),
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subbarmodel")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "subbarmodel")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subbarmodel")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "subbarmodel")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__duplicate = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subbarmodel")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subbarmodel")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__delete = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subbarmodel")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subbarmodel")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
@@ -45,7 +46,7 @@ local function createOptions(parentData, data, index, subIndex)
name = L["Choose"],
order = 11,
func = function()
WeakAuras.OpenModelPicker(data, parentData);
OptionsPrivate.OpenModelPicker(data, parentData);
end,
},
bar_model_clip = {
+6 -5
View File
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local SharedMedia = LibStub("LibSharedMedia-3.0");
local L = WeakAuras.L;
@@ -10,22 +11,22 @@ local function createOptions(parentData, data, index, subIndex)
__title = L["Border %s"]:format(subIndex),
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subborder")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "subborder")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subborder")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "subborder")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__duplicate = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subtext")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subtext")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__delete = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subborder")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subborder")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
@@ -73,7 +74,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
name = L["Border Anchor"],
order = 7,
values = WeakAuras.aurabar_anchor_areas,
values = OptionsPrivate.Private.aurabar_anchor_areas,
hidden = function() return parentData.regionType ~= "aurabar" end
}
}
+11 -10
View File
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local SharedMedia = LibStub("LibSharedMedia-3.0");
local L = WeakAuras.L;
@@ -12,29 +13,29 @@ local indentWidth = 0.15
local function createOptions(parentData, data, index, subIndex)
local hiddenGlowExtra = function()
return WeakAuras.IsCollapsed("glow", "glow", "glowextra" .. index, true);
return OptionsPrivate.IsCollapsed("glow", "glow", "glowextra" .. index, true);
end
local options = {
__title = L["Glow %s"]:format(subIndex),
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subglow")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "subglow")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subglow")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "subglow")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__duplicate = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subglow")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subglow")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__delete = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subglow")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subglow")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
@@ -49,14 +50,14 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
name = L["Type"],
order = 2,
values = WeakAuras.glow_types,
values = OptionsPrivate.Private.glow_types,
},
glow_anchor = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Glow Anchor"],
order = 3,
values = WeakAuras.aurabar_anchor_areas,
values = OptionsPrivate.Private.aurabar_anchor_areas,
hidden = function() return parentData.regionType ~= "aurabar" end
},
glowExtraDescription = {
@@ -107,14 +108,14 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.doubleWidth,
order = 4,
image = function()
local collapsed = WeakAuras.IsCollapsed("glow", "glow", "glowextra" .. index, true);
local collapsed = OptionsPrivate.IsCollapsed("glow", "glow", "glowextra" .. index, true);
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
imageHeight = 15,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("glow", "glow", "glowextra" .. index, true);
WeakAuras.SetCollapsed("glow", "glow", "glowextra" .. index, not collapsed);
local collapsed = OptionsPrivate.IsCollapsed("glow", "glow", "glowextra" .. index, true);
OptionsPrivate.SetCollapsed("glow", "glow", "glowextra" .. index, not collapsed);
end,
arg = {
expanderName = "glow" .. index .. "#" .. subIndex
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
-- Magic constant
local deleteCondition = {}
@@ -44,7 +45,7 @@ function WeakAuras.DeleteSubRegion(data, index, regionType)
end
end
function WeakAuras.MoveSubRegionUp(data, index, regionType)
function OptionsPrivate.MoveSubRegionUp(data, index, regionType)
if not data.subRegions or index <= 1 then
return
end
@@ -63,7 +64,7 @@ function WeakAuras.MoveSubRegionUp(data, index, regionType)
end
end
function WeakAuras.MoveSubRegionDown(data, index, regionType)
function OptionsPrivate.MoveSubRegionDown(data, index, regionType)
if not data.subRegions then
return
end
@@ -82,7 +83,7 @@ function WeakAuras.MoveSubRegionDown(data, index, regionType)
end
end
function WeakAuras.DuplicateSubRegion(data, index, regionType)
function OptionsPrivate.DuplicateSubRegion(data, index, regionType)
if not data.subRegions then
return
end
+29 -28
View File
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local SharedMedia = LibStub("LibSharedMedia-3.0")
local L = WeakAuras.L
@@ -22,7 +23,7 @@ local function createOptions(parentData, data, index, subIndex)
-- The toggles for font flags is intentionally not keyed on the id
-- So that all auras share the state of that toggle
local hiddenFontExtra = function()
return WeakAuras.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
return OptionsPrivate.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
end
local indentWidth = 0.15
@@ -31,22 +32,22 @@ local function createOptions(parentData, data, index, subIndex)
__title = L["Text %s"]:format(subIndex),
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subtext")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "subtext")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subtext")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "subtext")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__duplicate = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subtext")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subtext")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__delete = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subtext")) then
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subtext")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
@@ -67,12 +68,12 @@ local function createOptions(parentData, data, index, subIndex)
type = "input",
width = WeakAuras.normalWidth,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(parentData)
return L["Dynamic text tooltip"] .. OptionsPrivate.Private.GetAdditionalProperties(parentData)
end,
name = L["Display Text"],
order = 11,
set = function(info, v)
data.text_text = WeakAuras.ReplaceLocalizedRaidMarkers(v)
data.text_text = OptionsPrivate.Private.ReplaceLocalizedRaidMarkers(v)
WeakAuras.Add(parentData)
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
@@ -98,7 +99,7 @@ local function createOptions(parentData, data, index, subIndex)
type = "execute",
control = "WeakAurasExpandSmall",
name = function()
local textFlags = WeakAuras.font_flags[data.text_fontType]
local textFlags = OptionsPrivate.Private.font_flags[data.text_fontType]
local color = format("%02x%02x%02x%02x",
data.text_shadowColor[4] * 255, data.text_shadowColor[1] * 255,
data.text_shadowColor[2] * 255, data.text_shadowColor[3]*255)
@@ -130,11 +131,11 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.doubleWidth,
order = 44,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
WeakAuras.SetCollapsed("subtext", "subtext", "fontflags" .. index, not collapsed)
local collapsed = OptionsPrivate.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
OptionsPrivate.SetCollapsed("subtext", "subtext", "fontflags" .. index, not collapsed)
end,
image = function()
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
local collapsed = OptionsPrivate.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
@@ -157,7 +158,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth - indentWidth,
name = L["Outline"],
order = 46,
values = WeakAuras.font_flags,
values = OptionsPrivate.Private.font_flags,
hidden = hiddenFontExtra
},
text_shadowColor = {
@@ -208,7 +209,7 @@ local function createOptions(parentData, data, index, subIndex)
type = "select",
width = WeakAuras.normalWidth - indentWidth,
name = L["Alignment"],
values = WeakAuras.justify_types,
values = OptionsPrivate.Private.justify_types,
order = 50,
hidden = hiddenFontExtra
},
@@ -224,7 +225,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth - indentWidth,
name = L["Width"],
order = 51.5,
values = WeakAuras.text_automatic_width,
values = OptionsPrivate.Private.text_automatic_width,
hidden = hiddenFontExtra
},
text_font_space6 = {
@@ -256,7 +257,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
name = L["Overflow"],
order = 54,
values = WeakAuras.text_word_wrap,
values = OptionsPrivate.Private.text_word_wrap,
hidden = function() return hiddenFontExtra() or data.text_automaticWidth ~= "Fixed" end
},
@@ -282,10 +283,10 @@ local function createOptions(parentData, data, index, subIndex)
anchors = {}
for index, childId in ipairs(parentData.controlledChildren) do
local childData = WeakAuras.GetData(childId)
WeakAuras.Mixin(anchors, WeakAuras.GetAnchorsForData(childData, "point"))
WeakAuras.Mixin(anchors, OptionsPrivate.Private.GetAnchorsForData(childData, "point"))
end
else
anchors = WeakAuras.GetAnchorsForData(parentData, "point")
anchors = OptionsPrivate.Private.GetAnchorsForData(parentData, "point")
end
-- Anchor Options
options.text_anchorsDescription = {
@@ -319,14 +320,14 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.doubleWidth,
order = 60,
image = function()
local collapsed = WeakAuras.IsCollapsed("subregion", "text_anchors", tostring(index), true)
local collapsed = OptionsPrivate.IsCollapsed("subregion", "text_anchors", tostring(index), true)
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
imageHeight = 15,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("subregion", "text_anchors", tostring(index), true)
WeakAuras.SetCollapsed("subregion", "text_anchors", tostring(index), not collapsed)
local collapsed = OptionsPrivate.IsCollapsed("subregion", "text_anchors", tostring(index), true)
OptionsPrivate.SetCollapsed("subregion", "text_anchors", tostring(index), not collapsed)
end,
arg = {
expanderName = "subtext_anchor" .. index .. "#" .. subIndex
@@ -335,7 +336,7 @@ local function createOptions(parentData, data, index, subIndex)
local hiddenFunction = function()
return WeakAuras.IsCollapsed("subregion", "text_anchors", tostring(index), true)
return OptionsPrivate.IsCollapsed("subregion", "text_anchors", tostring(index), true)
end
options.text_anchor_space = {
@@ -414,7 +415,7 @@ local function createOptions(parentData, data, index, subIndex)
end
for index, subRegion in ipairs(parentData.subRegions) do
if subRegion.type == "subtext" and WeakAuras.ContainsCustomPlaceHolder(subRegion.text_text) then
if subRegion.type == "subtext" and OptionsPrivate.Private.ContainsCustomPlaceHolder(subRegion.text_text) then
return false
end
end
@@ -429,7 +430,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.doubleWidth,
hidden = hideCustomTextOption,
name = L["Update Custom Text On..."],
values = WeakAuras.text_check_types,
values = OptionsPrivate.Private.text_check_types,
order = 3,
get = function() return parentData.customTextUpdate or "event" end,
set = function(info, v)
@@ -440,16 +441,16 @@ local function createOptions(parentData, data, index, subIndex)
},
}
WeakAuras.commonOptions.AddCodeOption(commonTextOptions, parentData, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
OptionsPrivate.commonOptions.AddCodeOption(commonTextOptions, parentData, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
4, hideCustomTextOption, {"customText"}, false)
-- Add Text Format Options
local hidden = function()
return WeakAuras.IsCollapsed("format_option", "text", "text_text", true)
return OptionsPrivate.IsCollapsed("format_option", "text", "text_text", true)
end
local setHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "text", "text_text", hidden)
OptionsPrivate.SetCollapsed("format_option", "text", "text_text", hidden)
end
local order = 12
@@ -478,7 +479,7 @@ local function createOptions(parentData, data, index, subIndex)
return childData["text_text_format_" .. key]
end
local input = childData["text_text"]
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
end
end
end
@@ -487,7 +488,7 @@ local function createOptions(parentData, data, index, subIndex)
return data["text_text_format_" .. key]
end
local input = data["text_text"]
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
end
addOption("footer", {
+17 -16
View File
@@ -1,4 +1,5 @@
if not WeakAuras.IsCorrectVersion() then return end
local AddonName, OptionsPrivate = ...
local SharedMedia = LibStub("LibSharedMedia-3.0");
local L = WeakAuras.L;
@@ -7,29 +8,29 @@ local indentWidth = WeakAuras.normalWidth * 0.06
local function createOptions(parentData, data, index, subIndex)
local hiddentickextras = function()
return WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
return OptionsPrivate.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
end
local options = {
__title = L["Tick %s"]:format(subIndex),
__order = 1,
__up = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subtick")) then
WeakAuras.ReloadOptions2(parentData.id, parentData)
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionUp, index, "subtick")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__down = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subtick")) then
WeakAuras.ReloadOptions2(parentData.id, parentData)
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.MoveSubRegionDown, index, "subtick")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__duplicate = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subtick")) then
WeakAuras.ReloadOptions2(parentData.id, parentData)
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subtick")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
__delete = function()
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subtick")) then
WeakAuras.ReloadOptions2(parentData.id, parentData)
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subtick")) then
WeakAuras.ClearAndUpdateOptions(parentData.id)
end
end,
tick_visible = {
@@ -50,7 +51,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
name = L["Tick Mode"],
order = 3,
values = WeakAuras.tick_placement_modes,
values = OptionsPrivate.Private.tick_placement_modes,
},
tick_placement = {
type = "input",
@@ -83,7 +84,7 @@ local function createOptions(parentData, data, index, subIndex)
local texturetext = ""
if data.use_texture then
local desaturatetext = data.tick_desaturate and L["|cFFFF0000desaturated|r "] or ""
local blendtext = WeakAuras.blend_types[data.tick_blend_mode]
local blendtext = OptionsPrivate.Private.blend_types[data.tick_blend_mode]
local rotationtext = data.tick_rotation ~= 0 and L[" rotated |cFFFF0000%s|r degrees"]:format(data.tick_rotation) or ""
local mirrortext = data.tick_mirror and L[" and |cFFFF0000mirrored|r"] or ""
texturetext = L["%s|cFFFF0000custom|r texture with |cFFFF0000%s|r blend mode%s%s"]:format(desaturatetext, blendtext, rotationtext, mirrortext)
@@ -103,11 +104,11 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.doubleWidth,
order = 6,
func = function(info, button)
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
WeakAuras.SetCollapsed("subtext", "subtext", "tickextras" .. index, not collapsed)
local collapsed = OptionsPrivate.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
OptionsPrivate.SetCollapsed("subtext", "subtext", "tickextras" .. index, not collapsed)
end,
image = function()
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
local collapsed = OptionsPrivate.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
return collapsed and "collapsed" or "expanded"
end,
imageWidth = 15,
@@ -147,7 +148,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
name = L["Blend Mode"],
order = 10,
values = WeakAuras.blend_types,
values = OptionsPrivate.Private.blend_types,
disabled = function() return not data.use_texture end,
hidden = hiddentickextras,
},
@@ -172,7 +173,7 @@ local function createOptions(parentData, data, index, subIndex)
width = WeakAuras.normalWidth,
order = 13,
func = function()
WeakAuras.OpenTexturePicker(data, "tick_texture", WeakAuras.texture_types);
OptionsPrivate.OpenTexturePicker(data, "tick_texture", OptionsPrivate.Private.texture_types);
end,
disabled = function() return not data.use_texture end,
hidden = hiddentickextras,
+21 -22
View File
@@ -3,20 +3,19 @@ local AddonName, OptionsPrivate = ...
local L = WeakAuras.L
local removeFuncs = WeakAuras.commonOptions.removeFuncs
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("trigger")
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("trigger")
local getAll = WeakAuras.commonOptions.CreateGetAll("trigger")
local setAll = WeakAuras.commonOptions.CreateSetAll("trigger", getAll)
local executeAll = WeakAuras.commonOptions.CreateExecuteAll("trigger")
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("trigger")
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("trigger")
local getAll = OptionsPrivate.commonOptions.CreateGetAll("trigger")
local setAll = OptionsPrivate.commonOptions.CreateSetAll("trigger", getAll)
local executeAll = OptionsPrivate.commonOptions.CreateExecuteAll("trigger")
local flattenRegionOptions = WeakAuras.commonOptions.flattenRegionOptions
local fixMetaOrders = WeakAuras.commonOptions.fixMetaOrders
local flattenRegionOptions = OptionsPrivate.commonOptions.flattenRegionOptions
local fixMetaOrders = OptionsPrivate.commonOptions.fixMetaOrders
local subevent_actual_prefix_types = WeakAuras.subevent_actual_prefix_types;
local spellCache = WeakAuras.spellCache
local function union(table1, table2)
@@ -43,9 +42,9 @@ local function GetGlobalOptions(data)
order = 2,
values = function()
if #data.triggers > 1 then
return WeakAuras.trigger_require_types;
return OptionsPrivate.Private.trigger_require_types;
else
return WeakAuras.trigger_require_types_one;
return OptionsPrivate.Private.trigger_require_types_one;
end
end,
get = function()
@@ -68,14 +67,14 @@ local function GetGlobalOptions(data)
order = 2.3,
values = function()
local vals = {};
vals[WeakAuras.trigger_modes.first_active] = L["Dynamic information from first active trigger"];
vals[OptionsPrivate.Private.trigger_modes.first_active] = L["Dynamic information from first active trigger"];
for i = 1, #data.triggers do
vals[i] = L["Dynamic information from Trigger %i"]:format(i);
end
return vals;
end,
get = function()
return data.triggers.activeTriggerMode or WeakAuras.trigger_modes.first_active;
return data.triggers.activeTriggerMode or OptionsPrivate.Private.trigger_modes.first_active;
end,
set = function(info, v)
data.triggers.activeTriggerMode = v;
@@ -90,7 +89,7 @@ local function GetGlobalOptions(data)
local function hideTriggerCombiner()
return not (data.triggers.disjunctive == "custom")
end
WeakAuras.commonOptions.AddCodeOption(globalTriggerOptions, data, L["Custom"], "custom_trigger_combination", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-activation",
OptionsPrivate.commonOptions.AddCodeOption(globalTriggerOptions, data, L["Custom"], "custom_trigger_combination", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-activation",
2.4, hideTriggerCombiner, {"triggers", "customTriggerLogic"}, false);
return {
@@ -103,13 +102,13 @@ local function AddOptions(allOptions, data)
local triggerOptions = {}
for index, trigger in ipairs(data.triggers) do
local triggerSystemOptionsFunction = trigger.trigger.type and WeakAuras.triggerTypesOptions[trigger.trigger.type]
local triggerSystemOptionsFunction = trigger.trigger.type and OptionsPrivate.Private.triggerTypesOptions[trigger.trigger.type]
if (triggerSystemOptionsFunction) then
triggerOptions = union(triggerOptions, triggerSystemOptionsFunction(data, index))
else
local options = {};
WeakAuras.commonOptions.AddCommonTriggerOptions(options, data, index)
WeakAuras.AddTriggerMetaFunctions(options, data, index)
OptionsPrivate.commonOptions.AddCommonTriggerOptions(options, data, index)
OptionsPrivate.AddTriggerMetaFunctions(options, data, index)
triggerOptions = union(triggerOptions, {
["trigger." .. index .. ".unknown"] = options
})
@@ -119,7 +118,7 @@ local function AddOptions(allOptions, data)
return union(allOptions, triggerOptions)
end
function WeakAuras.GetTriggerOptions(data)
function OptionsPrivate.GetTriggerOptions(data)
local allOptions = {}
if data.controlledChildren then
for index, childId in pairs(data.controlledChildren) do
@@ -223,7 +222,7 @@ local function moveTriggerDownImpl(data, i)
return true;
end
function WeakAuras.AddTriggerMetaFunctions(options, data, triggernum)
function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
options.__title = L["Trigger %s"]:format(triggernum)
options.__order = triggernum * 10
options.__add = function()
File diff suppressed because it is too large Load Diff