beta
This commit is contained in:
@@ -807,24 +807,7 @@ local methods = {
|
||||
if not(newid == oldid) then
|
||||
|
||||
WeakAuras.Rename(data, newid);
|
||||
WeakAuras.Add(data)
|
||||
|
||||
WeakAuras.displayButtons[newid] = WeakAuras.displayButtons[oldid];
|
||||
WeakAuras.displayButtons[newid]:SetData(data)
|
||||
WeakAuras.displayButtons[oldid] = nil;
|
||||
WeakAuras.ClearOptions(oldid)
|
||||
|
||||
WeakAuras.displayButtons[newid]:SetTitle(newid);
|
||||
|
||||
if(data.controlledChildren) then
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
WeakAuras.displayButtons[childId]:SetGroup(newid);
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.SetGrouping();
|
||||
WeakAuras.SortDisplayButtons();
|
||||
WeakAuras.PickDisplay(newid);
|
||||
WeakAuras.HandleRename(data, oldid, newid)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -943,21 +926,6 @@ local methods = {
|
||||
func = self.callbacks.OnDuplicateClick
|
||||
});
|
||||
|
||||
tinsert(self.menu, {
|
||||
text = L["Set tooltip description"],
|
||||
notCheckable = true,
|
||||
func = function() WeakAuras.ShowDisplayTooltip(data, nil, nil, nil, nil, nil, nil, "desc") end
|
||||
});
|
||||
|
||||
|
||||
if (data.url and data.url ~= "") then
|
||||
tinsert(self.menu, {
|
||||
text = L["Copy URL"],
|
||||
notCheckable = true,
|
||||
func = function() WeakAuras.ShowDisplayTooltip(data, nil, nil, nil, nil, nil, nil, "url") end
|
||||
});
|
||||
end
|
||||
|
||||
tinsert(self.menu, {
|
||||
text = L["Export to string..."],
|
||||
notCheckable = true,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
step (optional) -> like bigStep, but applies to number input as well
|
||||
]]
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local WeakAuras = WeakAuras
|
||||
local L = WeakAuras.L
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
-- Lua APIs
|
||||
local pairs, error, coroutine = pairs, error, coroutine
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
-- Nothing here
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
local regionOptions = WeakAuras.regionOptions
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
--- - action: The action function, called on activating a condition
|
||||
-- - type: The type
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local WeakAuras = WeakAuras;
|
||||
local L = WeakAuras.L;
|
||||
@@ -96,7 +97,8 @@ local function valueToString(a, propertytype)
|
||||
else
|
||||
return "";
|
||||
end
|
||||
elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode" or propertytype == "glowexternal") then
|
||||
elseif (propertytype == "chat" or propertytype == "sound" or propertytype == "customcode"
|
||||
or propertytype == "glowexternal" or propertytype == "customcheck") then
|
||||
return tostring(a);
|
||||
elseif (propertytype == "bool") then
|
||||
return (a == 1 or a == true) and L["True"] or L["False"];
|
||||
@@ -785,9 +787,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#chat-message---custom-code-1");
|
||||
WeakAuras.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#chat-message---custom-code-1");
|
||||
WeakAuras.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
|
||||
}
|
||||
@@ -1493,11 +1495,13 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
|
||||
check = getOrCreateSubCheck(conditions[i].check, path);
|
||||
check.op = v;
|
||||
WeakAuras.Add(data);
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end
|
||||
setValue = function(info, v)
|
||||
check = getOrCreateSubCheck(conditions[i].check, path);
|
||||
check.value = v;
|
||||
WeakAuras.Add(data);
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1644,6 +1648,98 @@ local function addControlsForIfLine(args, order, data, conditionVariable, condit
|
||||
set = setValue
|
||||
}
|
||||
order = order + 1;
|
||||
elseif currentConditionTemplate.type == "customcheck" then
|
||||
args["condition" .. i .. tostring(path) .. "_op"] = {
|
||||
name = blueIfNoValue(data, conditions[i].check, "op", L["Events"], L["Events"]),
|
||||
desc = descIfNoValue(data, conditions[i].check, "op", currentConditionTemplate.type) or "",
|
||||
type = "input",
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
get = function()
|
||||
return check and check.op;
|
||||
end,
|
||||
set = setOp
|
||||
}
|
||||
order = order + 1;
|
||||
|
||||
local multipath = {}
|
||||
|
||||
args["condition" .. i .. tostring(path) .. "_value"] = {
|
||||
type = "input",
|
||||
width = WeakAuras.doubleWidth,
|
||||
name = blueIfNoValue(data, conditions[i].check, "value", L["Custom Check"], L["Custom Check"]),
|
||||
desc = descIfNoValue(data, conditions[i].check, "value", currentConditionTemplate.type) or "",
|
||||
order = order,
|
||||
get = function()
|
||||
return check and check.value;
|
||||
end,
|
||||
set = setValue,
|
||||
multiline = true,
|
||||
control = "WeakAurasMultiLineEditBox",
|
||||
arg = {
|
||||
extraFunctions = {
|
||||
{
|
||||
buttonLabel = L["Expand"],
|
||||
func = function()
|
||||
if (data.controlledChildren) then
|
||||
-- Collect multi paths
|
||||
local multipath = {};
|
||||
for id, reference in pairs(conditions[i].check.references) do
|
||||
local conditionIndex = conditions[i].check.references[id].conditionIndex;
|
||||
multipath[id] ={ "conditions", i, "check" }
|
||||
for i, v in ipairs(path) do
|
||||
tinsert(multipath[id], "checks")
|
||||
tinsert(multipath[id], v)
|
||||
end
|
||||
tinsert(multipath[id], "value")
|
||||
end
|
||||
WeakAuras.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1");
|
||||
else
|
||||
for i, v in ipairs(path) do
|
||||
print(i, v)
|
||||
end
|
||||
|
||||
local fullPath = { "conditions", i, "check" }
|
||||
for i, v in ipairs(path) do
|
||||
tinsert(fullPath, "checks")
|
||||
tinsert(fullPath, v)
|
||||
end
|
||||
tinsert(fullPath, "value")
|
||||
|
||||
WeakAuras.OpenTextEditor(data, fullPath, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code-1");
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
args["condition" .. i .. tostring(path) .. "_value_error"] = {
|
||||
type = "description",
|
||||
name = function()
|
||||
if (not check.value) then
|
||||
return ""
|
||||
end
|
||||
local _, errorString = loadstring("return " .. check.value);
|
||||
return errorString and "|cFFFF0000"..errorString or "";
|
||||
end,
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
hidden = function()
|
||||
if (not check.value) then
|
||||
return true;
|
||||
end
|
||||
|
||||
local loadedFunction, errorString = loadstring("return " .. check.value);
|
||||
if(errorString and not loadedFunction) then
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
end
|
||||
end
|
||||
}
|
||||
order = order + 1
|
||||
elseif (currentConditionTemplate.type == "combination") then
|
||||
-- Do nothing
|
||||
else
|
||||
@@ -2109,7 +2205,7 @@ local function compareSubChecks(a, b, allConditionTemplates)
|
||||
end
|
||||
|
||||
local type = currentConditionTemplate.type;
|
||||
if (type == "number" or type == "timer" or type == "select" or type == "string") then
|
||||
if (type == "number" or type == "timer" or type == "select" or type == "string" or type == "customcheck") then
|
||||
if (a[i].op ~= b[i].op or a[i].value ~= b[i].value) then
|
||||
return false;
|
||||
end
|
||||
@@ -2131,7 +2227,12 @@ local function findMatchingCondition(all, needle, start, allConditionTemplates)
|
||||
end
|
||||
|
||||
if (condition.check.trigger == needle.check.trigger and condition.check.variable == needle.check.variable) then
|
||||
if (condition.check.trigger == -2) then
|
||||
if condition.check.variable == "customcheck" then
|
||||
-- Be a bit more strict for custom checks, there's little benefit in merging them
|
||||
if condition.check.op == needle.check.op and condition.check.value == needle.check.value then
|
||||
return start
|
||||
end
|
||||
elseif (condition.check.trigger == -2) then
|
||||
if (compareSubChecks(condition.check.checks, needle.check.checks, allConditionTemplates)) then
|
||||
return start;
|
||||
end
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
local regionOptions = WeakAuras.regionOptions
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
-- Lua APIs
|
||||
local tinsert, wipe = table.insert, wipe
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L;
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
local regionOptions = WeakAuras.regionOptions;
|
||||
local parsePrefix = WeakAuras.commonOptions.parsePrefix
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
function WeakAuras.GetInformationOptions(data)
|
||||
local isGroup = data.controlledChildren
|
||||
local isTmpGroup = type(data.id) == "table"
|
||||
|
||||
local options = {
|
||||
type = "group",
|
||||
name = L["Information"],
|
||||
order = 1,
|
||||
args = {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
local order = 1
|
||||
local args = options.args
|
||||
|
||||
-- NAME
|
||||
-- One Aura or Group: Allows editing of aura/group name
|
||||
-- Multi-selection: Don't allow any editing
|
||||
if not isTmpGroup then
|
||||
args.name = {
|
||||
type = "input",
|
||||
name = L["Name:"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
get = function()
|
||||
return data.id
|
||||
end,
|
||||
set = function(info, newid)
|
||||
if data.id ~= newid and not WeakAuras.GetData(newid) then
|
||||
local oldid = data.id
|
||||
WeakAuras.Rename(data, newid);
|
||||
WeakAuras.HandleRename(data, oldid, newid)
|
||||
end
|
||||
end
|
||||
}
|
||||
order = order + 1
|
||||
end
|
||||
|
||||
-- URL
|
||||
-- One Aura: Edit URL of the aura
|
||||
-- Group/Multi-selection: Edit URLs of both parent and children
|
||||
local sameURL = true
|
||||
local commonURL
|
||||
local desc = ""
|
||||
if not isTmpGroup then
|
||||
commonURL = data.url
|
||||
if data.url then
|
||||
desc = "|cFFE0E000"..data.id..": |r".. data.url .. "\n"
|
||||
end
|
||||
end
|
||||
if data.controlledChildren then
|
||||
for _, childId in ipairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
if childData.url then
|
||||
desc = desc .. "|cFFE0E000"..childData.id..": |r"..childData.url .. "\n"
|
||||
end
|
||||
if not commonURL then
|
||||
commonURL = childData.url or ""
|
||||
elseif childData.url ~= commonURL then
|
||||
sameURL = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
args.url = {
|
||||
type = "input",
|
||||
name = sameURL and L["URL"] or "|cFF4080FF" .. L["URL"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
get = function()
|
||||
if data.controlledChildren then
|
||||
return sameURL and commonURL or ""
|
||||
else
|
||||
return data.url
|
||||
end
|
||||
end,
|
||||
set = function(info, v)
|
||||
if data.controlledChildren then
|
||||
for _, childId in ipairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
childData.url = v
|
||||
WeakAuras.Add(childData)
|
||||
WeakAuras.ClearOptions(childData.id)
|
||||
end
|
||||
end
|
||||
|
||||
if not isTmpGroup then
|
||||
data.url = v
|
||||
WeakAuras.Add(data)
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end,
|
||||
desc = sameURL and "" or desc,
|
||||
order = order
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
if isGroup then
|
||||
args.url_note = {
|
||||
type = "description",
|
||||
name = isTmpGroup and L["|cFFE0E000Note:|r This sets the URL on all selected auras"]
|
||||
or L["|cFFE0E000Note:|r This sets the URL on this group and all its members."],
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order
|
||||
}
|
||||
order = order + 1
|
||||
end
|
||||
|
||||
|
||||
-- Description
|
||||
-- One Aura/Group: Edit description of the aura or group
|
||||
-- Multi-selection: No editing
|
||||
if not isTmpGroup then
|
||||
args.description = {
|
||||
type = "input",
|
||||
name = isGroup and L["Group Description"] or L["Description"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
multiline = true,
|
||||
order = order,
|
||||
get = function()
|
||||
return data.desc
|
||||
end,
|
||||
set = function(info, v)
|
||||
data.desc = v
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
if isGroup then
|
||||
args.description_note = {
|
||||
type = "description",
|
||||
name = string.format(L["|cFFE0E000Note:|r This sets the description only on '%s'"], data.id),
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
end
|
||||
end
|
||||
|
||||
return options
|
||||
end
|
||||
@@ -1,3 +1,6 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
local removeFuncs = WeakAuras.commonOptions.removeFuncs
|
||||
|
||||
@@ -807,7 +807,8 @@ function WeakAuras.CreateFrame()
|
||||
load = WeakAuras.GetLoadOptions,
|
||||
action = WeakAuras.GetActionOptions,
|
||||
animation = WeakAuras.GetAnimationOptions,
|
||||
authorOptions = WeakAuras.GetAuthorOptions
|
||||
authorOptions = WeakAuras.GetAuthorOptions,
|
||||
information = WeakAuras.GetInformationOptions,
|
||||
}
|
||||
if optionsGenerator[tab] then
|
||||
aceOptions[id][tab] = optionsGenerator[tab](data)
|
||||
@@ -845,11 +846,12 @@ function WeakAuras.CreateFrame()
|
||||
local tabs = {
|
||||
{ value = "region", text = L["Display"]},
|
||||
{ value = "trigger", text = L["Trigger"]},
|
||||
{ value = "conditions", text = L["Conditions"]},
|
||||
{ value = "load", text = L["Load"]},
|
||||
{ value = "action", text = L["Actions"]},
|
||||
{ value = "animation", text = L["Animations"]},
|
||||
{ value = "authorOptions", text = L["Custom Options"]}
|
||||
{ value = "conditions", text = L["Conditions"]},
|
||||
{ value = "authorOptions", text = L["Custom Options"]},
|
||||
{ value = "information", text = L["Information"]},
|
||||
}
|
||||
-- Check if group and not the temp group
|
||||
if data.controlledChildren and type(data.id) == "string" then
|
||||
|
||||
@@ -161,17 +161,18 @@ local function ConstructTexturePicker(frame)
|
||||
end
|
||||
|
||||
SetAll(self.data, self.field, texturePath);
|
||||
if(type(self.data.id) == "string") then
|
||||
WeakAuras.Add(self.data);
|
||||
WeakAuras.UpdateThumbnail(self.data);
|
||||
if(type(self.parentData.id) == "string") then
|
||||
WeakAuras.Add(self.parentData);
|
||||
WeakAuras.UpdateThumbnail(self.parentData);
|
||||
end
|
||||
group:UpdateList();
|
||||
local status = dropdown.status or dropdown.localstatus
|
||||
dropdown.dropdown:SetText(dropdown.list[status.selected]);
|
||||
end
|
||||
|
||||
function group.Open(self, data, field, textures, SetTextureFunc)
|
||||
self.data = data;
|
||||
function group.Open(self, data, parentData, field, textures, SetTextureFunc)
|
||||
self.data = data
|
||||
self.parentData = parentData
|
||||
self.field = field;
|
||||
self.textures = textures;
|
||||
self.SetTextureFunc = SetTextureFunc
|
||||
@@ -247,8 +248,8 @@ local function ConstructTexturePicker(frame)
|
||||
end
|
||||
|
||||
function group.CancelClose()
|
||||
if(group.data.controlledChildren) then
|
||||
for index, childId in pairs(group.data.controlledChildren) do
|
||||
if(group.parentData.controlledChildren) then
|
||||
for index, childId in pairs(group.parentData.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId);
|
||||
if(childData) then
|
||||
childData[group.field] = group.givenPath[childId];
|
||||
|
||||
@@ -240,7 +240,7 @@ local function createOptions(id, data)
|
||||
width = WeakAuras.halfWidth,
|
||||
order = 44.3,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePicker(data, "sparkTexture", WeakAuras.texture_types);
|
||||
WeakAuras.OpenTexturePicker(data, data, "sparkTexture", WeakAuras.texture_types);
|
||||
end,
|
||||
disabled = function() return not data.spark end,
|
||||
hidden = function() return not data.spark end,
|
||||
|
||||
@@ -33,7 +33,7 @@ local function createOptions(id, data)
|
||||
width = WeakAuras.halfWidth,
|
||||
order = 12,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePicker(data, "foregroundTexture", WeakAuras.texture_types);
|
||||
WeakAuras.OpenTexturePicker(data, data, "foregroundTexture", WeakAuras.texture_types);
|
||||
end
|
||||
},
|
||||
sameTexture = {
|
||||
@@ -48,7 +48,7 @@ local function createOptions(id, data)
|
||||
width = WeakAuras.halfWidth,
|
||||
order = 17,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePicker(data, "backgroundTexture", WeakAuras.texture_types);
|
||||
WeakAuras.OpenTexturePicker(data, data, "backgroundTexture", WeakAuras.texture_types);
|
||||
end,
|
||||
disabled = function() return data.sameTexture; end
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ local function createOptions(id, data)
|
||||
width = WeakAuras.halfWidth,
|
||||
order = 7,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePicker(data, "texture", WeakAuras.texture_types);
|
||||
WeakAuras.OpenTexturePicker(data, data, "texture", WeakAuras.texture_types);
|
||||
end
|
||||
},
|
||||
color = {
|
||||
|
||||
@@ -6,6 +6,9 @@ local L = WeakAuras.L;
|
||||
local indentWidth = WeakAuras.normalWidth * 0.06
|
||||
|
||||
local function createOptions(parentData, data, index, subIndex)
|
||||
local hiddentickextras = function()
|
||||
return WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
|
||||
end
|
||||
local options = {
|
||||
__title = L["Tick %s"]:format(subIndex),
|
||||
__order = 1,
|
||||
@@ -57,27 +60,66 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
validate = WeakAuras.ValidateNumeric,
|
||||
desc = L["Enter in a value for the tick's placement."],
|
||||
},
|
||||
tick_space1 = {
|
||||
type = "description",
|
||||
tick_thickness = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = "",
|
||||
name = L["Thickness"],
|
||||
order = 5,
|
||||
min = 0,
|
||||
softMax = 20,
|
||||
step = 1,
|
||||
},
|
||||
tick_extrasDescription = {
|
||||
type = "execute",
|
||||
control = "WeakAurasExpandSmall",
|
||||
name = function()
|
||||
local lengthtext = ""
|
||||
if data.automatic_length then
|
||||
lengthtext = L["|cFFFF0000Automatic|r length"]
|
||||
else
|
||||
lengthtext = L["Length of |cFFFF0000%s|r"]:format(data.tick_length)
|
||||
end
|
||||
|
||||
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 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)
|
||||
else
|
||||
texturetext = L["|cFFFF0000default|r texture"]
|
||||
end
|
||||
|
||||
local offsettext = ""
|
||||
if data.tick_xOffset ~=0 or data.tick_yOffset ~=0 then
|
||||
offsettext = L["Offset by |cFFFF0000%s|r/|cFFFF0000%s|r"]:format(data.tick_xOffset, data.tick_yOffset)
|
||||
end
|
||||
|
||||
local description = L["|cFFffcc00Extra:|r %s and %s %s"]:format(lengthtext, texturetext, offsettext)
|
||||
|
||||
return description
|
||||
end,
|
||||
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)
|
||||
end,
|
||||
image = function()
|
||||
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "tickextras" .. index, true)
|
||||
return collapsed and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\edit" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\editdown"
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24
|
||||
},
|
||||
automatic_length = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Automatic length"],
|
||||
order = 6,
|
||||
desc = L["Matches the height setting of a horizontal bar or width for a vertical bar."],
|
||||
},
|
||||
tick_thickness = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Thickness"],
|
||||
order = 7,
|
||||
min = 0,
|
||||
softMax = 20,
|
||||
step = 1,
|
||||
desc = L["Matches the height setting of a horizontal bar or width for a vertical bar."],
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_length = {
|
||||
type = "range",
|
||||
@@ -88,6 +130,84 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
softMax = 50,
|
||||
step = 1,
|
||||
disabled = function() return data.automatic_length end,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
use_texture = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Use Texture"],
|
||||
order = 9,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_blend_mode = {
|
||||
type = "select",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Blend Mode"],
|
||||
order = 10,
|
||||
values = WeakAuras.blend_types,
|
||||
disabled = function() return not data.use_texture end,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_texture = {
|
||||
type = "input",
|
||||
name = L["Texture"],
|
||||
order = 11,
|
||||
width = WeakAuras.doubleWidth,
|
||||
disabled = function() return not data.use_texture end,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_desaturate = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Desaturate"],
|
||||
order = 12,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
texture_chooser = {
|
||||
type = "execute",
|
||||
name = L["Choose"],
|
||||
width = WeakAuras.normalWidth,
|
||||
order = 13,
|
||||
func = function()
|
||||
WeakAuras.OpenTexturePicker(data, "tick_texture", WeakAuras.texture_types);
|
||||
end,
|
||||
disabled = function() return not data.use_texture end,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_rotation = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Rotation"],
|
||||
min = 0,
|
||||
max = 360,
|
||||
order = 14,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_mirror = {
|
||||
type = "toggle",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Mirror"],
|
||||
order = 15,
|
||||
disabled = function() return not data.use_texture end,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_xOffset = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["x-Offset"],
|
||||
order = 16,
|
||||
softMin = -200,
|
||||
softMax = 200,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
tick_yOffset = {
|
||||
type = "range",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["y-Offset"],
|
||||
order = 17,
|
||||
softMin = -200,
|
||||
softMax = 200,
|
||||
hidden = hiddentickextras,
|
||||
},
|
||||
}
|
||||
return options
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if not WeakAuras.IsCorrectVersion() then return end
|
||||
local AddonName, OptionsPrivate = ...
|
||||
|
||||
-- Lua APIs
|
||||
local tinsert, tremove, wipe = table.insert, table.remove, wipe
|
||||
@@ -1214,7 +1215,7 @@ function WeakAuras.DropIndicator()
|
||||
indicator:SetHeight(4)
|
||||
indicator:SetFrameStrata("FULLSCREEN")
|
||||
|
||||
local texture = indicator:CreateTexture(nil, "FULLSCREEN")
|
||||
local texture = indicator:CreateTexture(nil, "HIGHLIGHT")
|
||||
texture:SetBlendMode("ADD")
|
||||
texture:SetAllPoints(indicator)
|
||||
texture:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
|
||||
@@ -1253,8 +1254,8 @@ function WeakAuras.UpdateThumbnail(data)
|
||||
button:UpdateThumbnail()
|
||||
end
|
||||
|
||||
function WeakAuras.OpenTexturePicker(data, field, textures, stopMotion)
|
||||
frame.texturePicker:Open(data, field, textures, stopMotion);
|
||||
function WeakAuras.OpenTexturePicker(data, parentData, field, textures, stopMotion)
|
||||
frame.texturePicker:Open(data, parentData, field, textures, stopMotion);
|
||||
end
|
||||
|
||||
function WeakAuras.OpenIconPicker(data, field, groupIcon)
|
||||
@@ -1266,7 +1267,7 @@ function WeakAuras.OpenModelPicker(data, field, parentData)
|
||||
local loaded, reason = LoadAddOn("WeakAurasModelPaths");
|
||||
if not(loaded) then
|
||||
reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.")
|
||||
print(WeakAuras.printPrefix .. "ModelPaths could not be loaded, the addon is " .. reason);
|
||||
WeakAuras.prettyPrint("ModelPaths could not be loaded, the addon is " .. reason);
|
||||
WeakAuras.ModelPaths = {};
|
||||
end
|
||||
frame.modelPicker.modelTree:SetTree(WeakAuras.ModelPaths);
|
||||
@@ -1287,7 +1288,7 @@ function WeakAuras.OpenTriggerTemplate(data, targetId)
|
||||
local loaded, reason = LoadAddOn("WeakAurasTemplates");
|
||||
if not(loaded) then
|
||||
reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.")
|
||||
print(WeakAuras.printPrefix .. "Templates could not be loaded, the addon is " .. reason);
|
||||
WeakAuras.prettyPrint("Templates could not be loaded, the addon is " .. reason);
|
||||
return;
|
||||
end
|
||||
frame.newView = WeakAuras.CreateTemplateView(frame);
|
||||
@@ -1663,3 +1664,22 @@ function WeakAuras.AddTextFormatOption(input, withHeader, get, addOption, hidden
|
||||
|
||||
return next(seenSymbols) ~= nil
|
||||
end
|
||||
|
||||
function WeakAuras.HandleRename(data, oldid, newid)
|
||||
WeakAuras.displayButtons[newid] = WeakAuras.displayButtons[oldid];
|
||||
WeakAuras.displayButtons[newid]:SetData(data)
|
||||
WeakAuras.displayButtons[oldid] = nil;
|
||||
WeakAuras.ClearOptions(oldid)
|
||||
|
||||
WeakAuras.displayButtons[newid]:SetTitle(newid);
|
||||
|
||||
if(data.controlledChildren) then
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
WeakAuras.displayButtons[childId]:SetGroup(newid)
|
||||
end
|
||||
end
|
||||
|
||||
WeakAuras.SetGrouping()
|
||||
WeakAuras.SortDisplayButtons()
|
||||
WeakAuras.PickDisplay(newid)
|
||||
end
|
||||
@@ -44,6 +44,7 @@ TriggerOptions.lua
|
||||
LoadOptions.lua
|
||||
ActionOptions.lua
|
||||
AnimationOptions.lua
|
||||
InformationOptions.lua
|
||||
|
||||
BuffTrigger.lua
|
||||
BuffTrigger2.lua
|
||||
|
||||
Reference in New Issue
Block a user