From 6a1e56cfbaeedba8021840d2c3d20b69c0d7ee5e Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 6 Sep 2020 19:32:35 +0300 Subject: [PATCH] beta --- WeakAuras/Prototypes.lua | 40 +++++++++++++++++++ WeakAuras/Types.lua | 33 +++++++++++++++ WeakAurasOptions/ConditionOptions.lua | 4 +- .../OptionsFrames/OptionsFrame.lua | 3 +- WeakAurasOptions/SubRegionOptions/SubText.lua | 2 +- 5 files changed, 78 insertions(+), 4 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index f2c193c..8216f13 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1084,6 +1084,16 @@ WeakAuras.event_prototypes = { store = true, conditionType = "select" }, + { + name = "ignoreSelf", + display = L["Ignore Self"], + type = "toggle", + width = WeakAuras.doubleWidth, + enable = function(trigger) + return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" + end, + init = "not UnitIsUnit(\"player\", unit)" + }, { name = "ignoreDead", display = L["Ignore Dead"], @@ -1284,6 +1294,16 @@ WeakAuras.event_prototypes = { store = true, conditionType = "select" }, + { + name = "ignoreSelf", + display = L["Ignore Self"], + type = "toggle", + width = WeakAuras.doubleWidth, + enable = function(trigger) + return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" + end, + init = "not UnitIsUnit(\"player\", unit)" + }, { name = "ignoreDead", display = L["Ignore Dead"], @@ -1492,6 +1512,16 @@ WeakAuras.event_prototypes = { store = true, conditionType = "select" }, + { + name = "ignoreSelf", + display = L["Ignore Self"], + type = "toggle", + width = WeakAuras.doubleWidth, + enable = function(trigger) + return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" + end, + init = "not UnitIsUnit(\"player\", unit)" + }, { name = "ignoreDead", display = L["Ignore Dead"], @@ -4933,6 +4963,16 @@ WeakAuras.event_prototypes = { return not trigger.use_inverse end }, + { + name = "ignoreSelf", + display = L["Ignore Self"], + type = "toggle", + width = WeakAuras.doubleWidth, + enable = function(trigger) + return trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party" + end, + init = "not UnitIsUnit(\"player\", unit)" + }, { name = "sourceUnit", init = "unit", diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 6306d36..3080b2e 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -120,6 +120,39 @@ WeakAuras.format_types = { AddOptions = function() end, CreateFormatter = function() end }, + string = { + display = L["String"], + AddOptions = function(symbol, hidden, addOption, get) + addOption(symbol .. "_abbreviate", { + type = "toggle", + name = L["Abbreviate"], + width = WeakAuras.normalWidth, + hidden = hidden, + }) + addOption(symbol .. "_abbreviate_max", { + type = "range", + name = L["Max Char "], + width = WeakAuras.normalWidth, + min = 1, + max = 20, + hidden = hidden, + step = 1, + disabled = function() + return not get(symbol .. "_abbreviate") + end + }) + end, + CreateFormatter = function(symbol, get) + local abbreviate = get(symbol .. "_abbreviate", false) + local abbreviateMax = get(symbol .. "_abbreviate_max", 8) + if abbreviate then + return function(input) + return WeakAuras.WA_Utf8Sub(input, abbreviateMax) + end + end + return nil + end + }, timed = { display = L["Time Format"], AddOptions = function(symbol, hidden, addOption, get) diff --git a/WeakAurasOptions/ConditionOptions.lua b/WeakAurasOptions/ConditionOptions.lua index 06fc8ac..d0bd7bd 100644 --- a/WeakAurasOptions/ConditionOptions.lua +++ b/WeakAurasOptions/ConditionOptions.lua @@ -1699,7 +1699,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#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 for i, v in ipairs(path) do print(i, v) @@ -1712,7 +1712,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#chat-message---custom-code-1"); + WeakAuras.OpenTextEditor(data, fullPath, nil, nil, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check"); end end } diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 7ce1d17..e8b4d18 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -615,12 +615,13 @@ function WeakAuras.CreateFrame() local magnetButton = AceGUI:Create("WeakAurasToolbarButton") magnetButton:SetText(L["Magnetically Align"]) magnetButton:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\magnetic") - magnetButton:SetStrongHighlight(true) magnetButton:SetCallback("OnClick", function(self) if WeakAurasOptionsSaved.magnetAlign then + magnetButton:SetStrongHighlight(false) magnetButton:UnlockHighlight() WeakAurasOptionsSaved.magnetAlign = false else + magnetButton:SetStrongHighlight(true) magnetButton:LockHighlight() WeakAurasOptionsSaved.magnetAlign = true end diff --git a/WeakAurasOptions/SubRegionOptions/SubText.lua b/WeakAurasOptions/SubRegionOptions/SubText.lua index 3c1e432..9c89602 100644 --- a/WeakAurasOptions/SubRegionOptions/SubText.lua +++ b/WeakAurasOptions/SubRegionOptions/SubText.lua @@ -401,7 +401,7 @@ local function createOptions(parentData, data, index, subIndex) type = "description", name = "", order = 61, - hidden = hiddenFontExtra, + hidden = hiddenFunction, control = "WeakAurasExpandAnchor", arg = { expanderName = "subtext_anchor" .. index .. "#" .. subIndex