This commit is contained in:
Bunny67
2020-08-03 00:12:52 +03:00
parent fcd7277800
commit 9956fb7ede
20 changed files with 2562 additions and 4746 deletions
@@ -37,7 +37,7 @@ local methods = {
["OnAcquire"] = function(self)
-- restore default values
self:SetHeight(16)
self:SetWidth(32)
self:SetWidth(16)
self:SetDisabled(false)
self:SetText()
self.hTex:SetVertexColor(1, 1, 1, 0.1)
@@ -47,7 +47,11 @@ local methods = {
["SetText"] = function(self, text)
self.text:SetText(text)
self:SetWidth(self.text:GetStringWidth() + 24)
if text ~= "" then
self:SetWidth(self.text:GetStringWidth() + 28)
else
self:SetWidth(16)
end
end,
["SetDisabled"] = function(self, disabled)
+98 -236
View File
@@ -56,11 +56,19 @@ local function getAuraMatchesList(name)
end
end
local noop = function() end
local function GetBuffTriggerOptions(data, triggernum)
local trigger= data.triggers[triggernum].trigger
local spellCache = WeakAuras.spellCache;
local ValidateNumeric = WeakAuras.ValidateNumeric;
local aura_options = {
deleteNote = {
type = "description",
order = 8,
name = L["Note: The legacy buff trigger is now permanently disabled. It will be removed in the near future."],
fontSize = "large"
},
convertToBuffTrigger2SpaceBeforeDesc = {
type = "description",
width = 0.4,
@@ -90,20 +98,12 @@ local function GetBuffTriggerOptions(data, triggernum)
width = 0.3,
order = 8.4,
name = "",
hidden = function()
-- For those that update without restarting
return not WeakAuras.CanConvertBuffTrigger2
end,
},
convertToBuffTrigger2 = {
type = "execute",
width = WeakAuras.doubleWidth - 0.6,
name = L["Convert to New Aura Trigger"],
order = 8.5,
hidden = function()
-- For those that update without restarting
return not WeakAuras.CanConvertBuffTrigger2
end,
disabled = function()
if (not WeakAuras.CanConvertBuffTrigger2) then
return true;
@@ -136,20 +136,15 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Use Full Scan (High CPU)"],
width = WeakAuras.doubleWidth,
order = 9,
set = noop
},
autoclone = {
type = "toggle",
name = L["Show all matches (Auto-clone)"],
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
set = function(info, v)
trigger.autoclone = v;
if(v == true) then
WeakAuras.ShowCloneDialog(data);
end
WeakAuras.Add(data);
end,
order = 9.5
order = 9.5,
set = noop
},
useName = {
type = "toggle",
@@ -158,14 +153,16 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 10,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit ~= "multi"); end,
disabled = true,
get = function() return true end
get = function() return true end,
set = noop
},
use_name = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Aura Name"],
order = 10,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
set = noop
},
name_operator = {
type = "select",
@@ -174,7 +171,8 @@ 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 = WeakAuras.string_operator_types,
set = noop
},
name = {
type = "input",
@@ -183,25 +181,15 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 12,
disabled = function() return not trigger.use_name end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
set = function(info, v)
if (tonumber(v)) then
trigger.spellId = tonumber(v);
trigger.name = nil;
else
trigger.spellId = nil;
trigger.name = v;
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
use_tooltip = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Tooltip"],
order = 13,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end,
set = noop
},
tooltip_operator = {
type = "select",
@@ -210,7 +198,8 @@ 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 = WeakAuras.string_operator_types,
set = noop
},
tooltip = {
type = "input",
@@ -218,7 +207,8 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Tooltip"],
order = 15,
disabled = function() return not trigger.use_tooltip end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end,
set = noop
},
use_stealable = {
type = "toggle",
@@ -237,23 +227,15 @@ local function GetBuffTriggerOptions(data, triggernum)
elseif(value == false) then return "false";
else return "true"; end
end,
set = function(info, v)
if(v) then
trigger.use_stealable = true;
else
local value = trigger.use_stealable;
if(value == false) then trigger.use_stealable = nil;
else trigger.use_stealable = false end
end
WeakAuras.Add(data);
end
set = noop
},
use_spellId = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Spell ID"],
order = 17,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end,
set = noop
},
spellId = {
type = "input",
@@ -261,14 +243,16 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Spell ID"],
order = 18,
disabled = function() return not trigger.use_spellId end,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.unit ~= "multi"); end,
set = noop
},
use_debuffClass = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Debuff Type"],
order = 19,
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end
hidden = function() return not (trigger.type == "aura" and trigger.fullscan); end,
set = noop
},
debuffClass = {
type = "select",
@@ -277,7 +261,8 @@ 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 = WeakAuras.debuff_class_types,
set = noop
},
multiuse_name = {
type = "toggle",
@@ -286,7 +271,8 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 10,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit == "multi"); end,
disabled = true,
get = function() return true end
get = function() return true end,
set = noop
},
multiicon = {
type = "execute",
@@ -298,7 +284,8 @@ local function GetBuffTriggerOptions(data, triggernum)
return icon and tostring(icon) or "", 18, 18 end,
order = 11,
disabled = function() return not trigger.name and spellCache.GetIcon(trigger.name) end,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit == "multi"); end
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit == "multi"); end,
set = noop
},
multiname = {
type = "input",
@@ -308,17 +295,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 12,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit == "multi"); end,
get = function(info) return trigger.spellId and tostring(trigger.spellId) or trigger.name end,
set = function(info, v)
if(v == "") then
trigger.name = nil;
trigger.spellId = nil;
else
trigger.name, trigger.spellId = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name1icon = {
type = "execute",
@@ -331,7 +308,8 @@ local function GetBuffTriggerOptions(data, triggernum)
end,
order = 11,
disabled = function() return not spellCache.GetIcon(trigger.names[1]) end,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit ~= "multi"); end
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit ~= "multi"); end,
set = noop
},
name1 = {
type = "input",
@@ -341,19 +319,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 12,
hidden = function() return not (trigger.type == "aura" and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[1] and tostring(trigger.spellIds[1]) or trigger.names[1] end,
set = function(info, v)
if(v == "") then
if(trigger.names[1]) then
tremove(trigger.names, 1);
spellId_tremove(trigger.spellIds, 1);
end
else
trigger.names[1], trigger.spellIds[1] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name2space = {
type = "execute",
@@ -383,19 +349,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[1] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[2] and tostring(trigger.spellIds[2]) or trigger.names[2] end,
set = function(info, v)
if(v == "") then
if(trigger.names[2]) then
tremove(trigger.names, 2);
spellId_tremove(trigger.spellIds, 2);
end
else
trigger.names[2], trigger.spellIds[2] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name3space = {
type = "execute",
@@ -425,19 +379,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[2] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[3] and tostring(trigger.spellIds[3]) or trigger.names[3] end,
set = function(info, v)
if(v == "") then
if(trigger.names[3]) then
tremove(trigger.names, 3);
spellId_tremove(trigger.spellIds, 3);
end
else
trigger.names[3], trigger.spellIds[3] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name4space = {
type = "execute",
@@ -466,19 +408,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[3] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[4] and tostring(trigger.spellIds[4]) or trigger.names[4] end,
set = function(info, v)
if(v == "") then
if(trigger.names[4]) then
tremove(trigger.names, 4);
spellId_tremove(trigger.spellIds, 4);
end
else
trigger.names[4], trigger.spellIds[4] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name5space = {
type = "execute",
@@ -508,19 +438,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[4] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[5] and tostring(trigger.spellIds[5]) or trigger.names[5] end,
set = function(info, v)
if(v == "") then
if(trigger.names[5]) then
tremove(trigger.names, 5);
spellId_tremove(trigger.spellIds, 5);
end
else
trigger.names[5], trigger.spellIds[5] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name6space = {
type = "execute",
@@ -550,19 +468,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[5] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[6] and tostring(trigger.spellIds[6]) or trigger.names[6] end,
set = function(info, v)
if(v == "") then
if(trigger.names[6]) then
tremove(trigger.names, 6);
spellId_tremove(trigger.spellIds, 6);
end
else
trigger.names[6], trigger.spellIds[6] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name7space = {
type = "execute",
@@ -592,19 +498,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[6] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[7] and tostring(trigger.spellIds[7]) or trigger.names[7] end,
set = function(info, v)
if(v == "") then
if(trigger.names[7]) then
tremove(trigger.names, 7);
spellId_tremove(trigger.spellIds, 7);
end
else
trigger.names[7], trigger.spellIds[7] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name8space = {
type = "execute",
@@ -634,19 +528,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[7] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[8] and tostring(trigger.spellIds[8]) or trigger.names[8] end,
set = function(info, v)
if(v == "") then
if(trigger.names[8]) then
tremove(trigger.names, 8);
spellId_tremove(trigger.spellIds, 8);
end
else
trigger.names[8], trigger.spellIds[8] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
name9space = {
type = "execute",
@@ -676,19 +558,7 @@ local function GetBuffTriggerOptions(data, triggernum)
name = "",
hidden = function() return not (trigger.type == "aura" and trigger.names[8] and not trigger.fullscan and trigger.unit ~= "multi"); end,
get = function(info) return trigger.spellIds[9] and tostring(trigger.spellIds[9]) or trigger.names[9] end,
set = function(info, v)
if(v == "") then
if(trigger.names[9]) then
tremove(trigger.names, 9);
spellId_tremove(trigger.spellIds, 9);
end
else
trigger.names[9], trigger.spellIds[9] = WeakAuras.spellCache.CorrectAuraName(v);
end
WeakAuras.Add(data);
WeakAuras.UpdateThumbnail(data);
WeakAuras.UpdateDisplayButton(data);
end,
set = noop
},
useUnit = {
type = "toggle",
@@ -697,7 +567,8 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 40,
disabled = true,
hidden = function() return not (trigger.type == "aura"); end,
get = function() return true end
get = function() return true end,
set = noop
},
unit = {
type = "select",
@@ -712,20 +583,13 @@ local function GetBuffTriggerOptions(data, triggernum)
end
end,
hidden = function() return not (trigger.type == "aura"); end,
set = function(info, v)
trigger.unit = v;
trigger.use_specific_unit = (v == "member");
if(v == "multi") then
WeakAuras.ShowCloneDialog(data);
end
WeakAuras.Add(data);
end,
get = function()
if(trigger.fullscan and (trigger.unit == "group" or trigger.unit == "multi")) then
trigger.unit = "player";
end
return trigger.unit;
end
end,
set = noop
},
useSpecificUnit = {
type = "toggle",
@@ -734,7 +598,8 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 42,
disabled = true,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "member") end,
get = function() return true end
get = function() return true end,
set = noop
},
specificUnit = {
type = "input",
@@ -742,7 +607,8 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Specific Unit"],
order = 43,
desc = L["Can be a Name or a Unit ID (e.g. party1). A name only works on friendly players in your group."],
hidden = function() return not (trigger.type == "aura" and trigger.unit == "member") end
hidden = function() return not (trigger.type == "aura" and trigger.unit == "member") end,
set = noop
},
useGroup_count = {
type = "toggle",
@@ -751,7 +617,8 @@ local function GetBuffTriggerOptions(data, triggernum)
disabled = true,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
get = function() return true; end,
order = 45
order = 45,
set = noop
},
group_countOperator = {
type = "select",
@@ -760,7 +627,8 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.halfWidth,
values = operator_types,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
get = function() return trigger.group_countOperator; end
get = function() return trigger.group_countOperator; end,
set = noop
},
group_count = {
type = "input",
@@ -773,15 +641,7 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.halfWidth,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
get = function() return trigger.group_count; end,
set = function(info, v)
if(WeakAuras.ParseNumber(v)) then
trigger.group_count = v;
else
trigger.group_count = "";
end
WeakAuras.Add(data);
WeakAuras.UpdateDisplayButton(data);
end
set = noop
},
ignoreSelf = {
type = "toggle",
@@ -789,20 +649,15 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 47.3,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
set = noop
},
groupclone = {
type = "toggle",
name = L["Show all matches (Auto-clone)"],
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
set = function(info, v)
trigger.groupclone = v;
if(v == true) then
WeakAuras.ShowCloneDialog(data);
end
WeakAuras.Add(data);
end,
order = 47.4
order = 47.4,
set = noop
},
name_info = {
type = "select",
@@ -818,7 +673,8 @@ local function GetBuffTriggerOptions(data, triggernum)
return nil;
end
end,
values = group_aura_name_info_types
values = group_aura_name_info_types,
set = noop
},
stack_info = {
type = "select",
@@ -834,7 +690,8 @@ local function GetBuffTriggerOptions(data, triggernum)
return nil;
end
end,
values = group_aura_stack_info_types
values = group_aura_stack_info_types,
set = noop
},
hideAlone = {
type = "toggle",
@@ -842,6 +699,7 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 47.7,
width = WeakAuras.doubleWidth,
hidden = function() return not (trigger.type == "aura" and trigger.unit == "group"); end,
set = noop
},
useDebuffType = {
type = "toggle",
@@ -850,7 +708,8 @@ local function GetBuffTriggerOptions(data, triggernum)
order = 50,
disabled = true,
hidden = function() return not (trigger.type == "aura"); end,
get = function() return true end
get = function() return true end,
set = noop
},
debuffType = {
type = "select",
@@ -858,14 +717,16 @@ local function GetBuffTriggerOptions(data, triggernum)
name = L["Aura Type"],
order = 51,
values = debuff_types,
hidden = function() return not (trigger.type == "aura"); end
hidden = function() return not (trigger.type == "aura"); end,
set = noop
},
subcount = {
type = "toggle",
width = WeakAuras.doubleWidth,
name = L["Use tooltip \"size\" instead of stacks"],
hidden = function() return not (trigger.type == "aura" and trigger.fullscan) end,
order = 55
order = 55,
set = noop
},
subcountCount = {
type = "select",
@@ -873,14 +734,16 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.doubleWidth,
name = L["Use nth value from tooltip:"],
hidden = function() return not (trigger.type == "aura" and trigger.fullscan and trigger.subcount) end,
order = 55.5
order = 55.5,
set = noop
},
useRem = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Remaining Time"],
hidden = function() return not (trigger.type == "aura" and trigger.unit ~= "multi"); end,
order = 56
order = 56,
set = noop
},
remOperator = {
type = "select",
@@ -890,7 +753,8 @@ local function GetBuffTriggerOptions(data, triggernum)
values = 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
get = function() return trigger.useRem and trigger.remOperator or nil end,
set = noop
},
rem = {
type = "input",
@@ -900,14 +764,16 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.halfWidth,
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.rem or nil end
get = function() return trigger.useRem and trigger.rem or nil end,
set = noop
},
useCount = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Stack Count"],
hidden = function() return not (trigger.type == "aura" and trigger.unit ~= "multi"); end,
order = 60
order = 60,
set = noop
},
countOperator = {
type = "select",
@@ -917,7 +783,8 @@ local function GetBuffTriggerOptions(data, triggernum)
values = 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
get = function() return trigger.useCount and trigger.countOperator or nil end,
set = noop
},
count = {
type = "input",
@@ -927,7 +794,8 @@ local function GetBuffTriggerOptions(data, triggernum)
width = WeakAuras.halfWidth,
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.count or nil end
get = function() return trigger.useCount and trigger.count or nil end,
set = noop
},
ownOnly = {
type = "toggle",
@@ -950,18 +818,9 @@ local function GetBuffTriggerOptions(data, triggernum)
elseif(value == false) then return "false";
else return "true"; end
end,
set = function(info, v)
if(v) then
trigger.ownOnly = true;
else
local value = trigger.ownOnly;
if(value == false) then trigger.ownOnly = nil;
else trigger.ownOnly = false end
end
WeakAuras.Add(data);
end,
order = 70,
hidden = function() return not (trigger.type == "aura"); end
hidden = function() return not (trigger.type == "aura"); end,
set = noop
},
useBuffShowOn = {
type = "toggle",
@@ -972,7 +831,8 @@ local function GetBuffTriggerOptions(data, triggernum)
hidden = function()
return not (trigger.type == "aura" and not(trigger.unit ~= "group" and trigger.fullscan and trigger.autoclone) and trigger.unit ~= "multi" and not(trigger.unit == "group" and not trigger.groupclone));
end,
get = function() return true end
get = function() return true end,
set = noop
},
buffShowOn = {
type = "select",
@@ -983,7 +843,8 @@ local function GetBuffTriggerOptions(data, triggernum)
get = function() return trigger.buffShowOn end,
hidden = function()
return not (trigger.type == "aura" and not(trigger.unit ~= "group" and trigger.fullscan and trigger.autoclone) and trigger.unit ~= "multi" and not(trigger.unit == "group" and not trigger.groupclone));
end
end,
set = noop
},
unitExists = {
type = "toggle",
@@ -996,7 +857,8 @@ local function GetBuffTriggerOptions(data, triggernum)
and trigger.unit ~= "multi"
and trigger.unit ~= "group"
and trigger.unit ~= "player");
end
end,
set = noop
},
linespacer = {
type = "description",
+40 -2
View File
@@ -34,6 +34,44 @@ local function union(table1, table2)
return meta;
end
local function CorrectSpellName(input)
local inputId = tonumber(input);
if(inputId) then
local name = GetSpellInfo(inputId);
if(name) then
return inputId;
else
return nil;
end
elseif(input) then
local link;
if(input:sub(1,1) == "\124") then
link = input;
else
link = GetSpellLink(input);
end
if(link) and link ~= "" then
local itemId = link:match("spell:(%d+)");
return tonumber(itemId);
end
end
end
local function CorrectItemName(input)
local inputId = tonumber(input);
if(inputId) then
return inputId;
elseif(input) then
local _, link = GetItemInfo(input);
if(link) then
local itemId = link:match("item:(%d+)");
return tonumber(itemId);
else
return nil;
end
end
end
-- Also used by the GenericTrigger
function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, triggertype, unevent)
local trigger, untrigger;
@@ -564,9 +602,9 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri
if(arg.type == "aura") then
fixedInput = WeakAuras.spellCache.CorrectAuraName(v);
elseif(arg.type == "spell") then
fixedInput = WeakAuras.CorrectSpellName(v);
fixedInput = CorrectSpellName(v);
elseif(arg.type == "item") then
fixedInput = WeakAuras.CorrectItemName(v);
fixedInput = CorrectItemName(v);
end
trigger[realname] = fixedInput;
WeakAuras.Add(data);
+147 -40
View File
@@ -268,8 +268,8 @@ function WeakAuras.CreateFrame()
title:SetPoint("BOTTOMLEFT", titleBG, "BOTTOMLEFT", -25, 0)
title:SetPoint("TOPRIGHT", titleBG, "TOPRIGHT", 25, 0)
CreateFrameSizer(frame, commitWindowChanges, "BOTTOMLEFT")
CreateFrameSizer(frame, commitWindowChanges, "BOTTOMRIGHT")
frame.bottomLeftResizer = CreateFrameSizer(frame, commitWindowChanges, "BOTTOMLEFT")
frame.bottomRightResizer = CreateFrameSizer(frame, commitWindowChanges, "BOTTOMRIGHT")
local minimize = CreateDecoration(frame)
minimize:SetPoint("TOPRIGHT", -65, 12)
@@ -292,13 +292,27 @@ function WeakAuras.CreateFrame()
self.toolbarContainer.frame:Hide()
self.filterInput:Hide();
self.filterInputClear:Hide();
self.tipFrame.frame:Hide()
self.bottomLeftResizer:Hide()
self.bottomRightResizer:Hide()
else
if self.tipFrameIsVisible then
self.tipFrame.frame:Show()
end
self.bottomLeftResizer:Show()
self.bottomRightResizer:Show()
if self.window == "default" then
self.buttonsContainer.frame:Show()
self.container.frame:Show()
if self.tipFrameIsVisible then
self.tipFrame.frame:Show()
else
self.tipFrame.frame:Hide()
end
else
self.buttonsContainer.frame:Hide()
self.container.frame:Hide()
self.tipFrame.frame:Hide()
end
if self.window == "texture" then
@@ -394,45 +408,132 @@ function WeakAuras.CreateFrame()
frame:UpdateFrameVisible()
end)
local _, _, _, enabled, loadable = GetAddOnInfo("WeakAurasTutorials")
if enabled and loadable then
local tutorial = CreateDecoration(frame)
tutorial:SetPoint("TOPRIGHT", -140, 12)
local tipFrame = AceGUI:Create("SimpleGroup")
tipFrame.frame:SetParent(frame)
tipFrame:SetLayout("Flow")
tipFrame.frame:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 22, 15)
tipFrame.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 15)
tipFrame.frame:Hide()
frame.tipFrame = tipFrame
local tutorialbutton = CreateFrame("BUTTON", nil, tutorial)
tutorialbutton:SetWidth(30)
tutorialbutton:SetHeight(30)
tutorialbutton:SetPoint("CENTER", tutorial, "CENTER", 1, -1)
tutorialbutton:SetNormalTexture("Interface\\GossipFrame\\DailyActiveQuestIcon")
tutorialbutton:GetNormalTexture():ClearAllPoints()
tutorialbutton:GetNormalTexture():SetSize(16, 16)
tutorialbutton:GetNormalTexture():SetPoint("center", -2, 0)
tutorialbutton:SetPushedTexture("Interface\\GossipFrame\\DailyActiveQuestIcon")
tutorialbutton:GetPushedTexture():ClearAllPoints()
tutorialbutton:GetPushedTexture():SetSize(16, 16)
tutorialbutton:GetPushedTexture():SetPoint("center", -2, -2)
tutorialbutton:SetHighlightTexture("Interface\\BUTTONS\\UI-Panel-MinimizeButton-Highlight.blp")
tutorialbutton:SetScript("OnClick", function()
if not IsAddOnLoaded("WeakAurasTutorials") then
local loaded, reason = LoadAddOn("WeakAurasTutorials")
if not loaded then
reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.")
prettyPrint("Tutorials could not be loaded, the addon is " .. reason)
return
end
end
WeakAuras.ToggleTutorials()
local tipPopup = CreateFrame("Frame", nil, frame)
tipPopup:SetFrameStrata("FULLSCREEN")
tipPopup:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 16,
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }
})
tipPopup:SetBackdropColor(0, 0, 0, 0.8)
--tipPopup:SetHeight(100)
tipPopup:Hide()
local tipPopupTitle = tipPopup:CreateFontString(nil, "BACKGROUND", "GameFontNormalLarge")
tipPopupTitle:SetPoint("TOPLEFT", tipPopup, "TOPLEFT", 10, -10)
tipPopupTitle:SetPoint("TOPRIGHT", tipPopup, "TOPRIGHT", -10, -10)
tipPopupTitle:SetJustifyH("LEFT")
tipPopupTitle:SetJustifyV("TOP")
local tipPopupLabel = tipPopup:CreateFontString(nil, "BACKGROUND", "GameFontWhite")
tipPopupLabel:SetPoint("TOPLEFT", tipPopupTitle, "BOTTOMLEFT", 0, -6)
tipPopupLabel:SetPoint("TOPRIGHT", tipPopupTitle, "BOTTOMRIGHT", 0, -6)
tipPopupLabel:SetJustifyH("LEFT")
tipPopupLabel:SetJustifyV("TOP")
local urlWidget = CreateFrame("EDITBOX", nil, tipPopup, "InputBoxTemplate")
urlWidget:SetFont(STANDARD_TEXT_FONT, 12)
urlWidget:SetPoint("TOPLEFT", tipPopupLabel, "BOTTOMLEFT", 6, 0)
urlWidget:SetPoint("TOPRIGHT", tipPopupLabel, "BOTTOMRIGHT", 0, 0)
urlWidget:SetScript("OnChar", function() urlWidget:SetText(urlWidget.text); urlWidget:HighlightText(); end);
urlWidget:SetScript("OnMouseUp", function() urlWidget:HighlightText(); end);
urlWidget:SetScript("OnEscapePressed", function() tipPopup:Hide() end)
urlWidget:SetHeight(34)
local tipPopupCtrlC = tipPopup:CreateFontString(nil, "BACKGROUND", "GameFontWhite")
tipPopupCtrlC:SetPoint("TOPLEFT", urlWidget, "BOTTOMLEFT", -6, 0)
tipPopupCtrlC:SetPoint("TOPRIGHT", urlWidget, "BOTTOMRIGHT", 0, 0)
tipPopupCtrlC:SetJustifyH("LEFT")
tipPopupCtrlC:SetJustifyV("TOP")
tipPopupCtrlC:SetText("Press Ctrl+C to copy the URL")
local function ToggleTip(referenceWidget, url, title, description)
if tipPopup:IsVisible() and urlWidget.text == url then
tipPopup:Hide()
return
end
urlWidget.text = url
urlWidget:SetText(url)
tipPopupTitle:SetText(title)
tipPopupLabel:SetText(description)
urlWidget:HighlightText()
tipPopup:SetWidth(400)
tipPopup:SetHeight(26 + tipPopupTitle:GetHeight() + tipPopupLabel:GetHeight() + urlWidget:GetHeight() + tipPopupCtrlC:GetHeight())
tipPopup:SetPoint("BOTTOMLEFT", referenceWidget.frame, "TOPLEFT", -6, 4)
tipPopup:Show()
end
local addFooter = function(title, texture, url, description)
local button = AceGUI:Create("WeakAurasToolbarButton")
button:SetText(title)
button:SetTexture(texture)
button:SetCallback("OnClick", function()
ToggleTip(button, url, title, description)
end)
tipFrame:AddChild(button)
end
addFooter(L["Get Help"], [[Interface\AddOns\WeakAuras\Media\Textures\discord.tga]], "https://discord.gg/wa2",
L["Chat with WeakAuras experts on our Discord server."])
addFooter(L["Documentation"], [[Interface\AddOns\WeakAuras\Media\Textures\GitHub.tga]], "https://github.com/WeakAuras/WeakAuras2/wiki",
L["Check out our wiki for a large collection of examples and snippets."])
addFooter(L["Find Auras"], [[Interface\AddOns\WeakAuras\Media\Textures\wagoupdate_logo.tga]], "https://wago.io",
L["Browse Wago, the largest collection of auras."])
if not WeakAurasCompanion then
addFooter(L["Update Auras"], [[Interface\AddOns\WeakAuras\Media\Textures\wagoupdate_refresh.tga]], "https://weakauras.wtf",
L["Keep your Wago imports up to date with the Companion App."])
end
addFooter(L["Found a Bug?"], [[Interface\AddOns\WeakAuras\Media\Textures\bug_report.tga]], "https://github.com/WeakAuras/WeakAuras2/issues/new",
L["Report bugs our our issue tracker."])
-- Disable for now
--local closeTipButton = CreateFrame("Button", nil, tipFrame.frame, "UIPanelCloseButton")
--closeTipButton:SetScript("OnClick", function()
-- frame:HideTip()
--end)
--closeTipButton:SetPoint("TOPRIGHT", tipFrame.frame, "TOPRIGHT", 0, 6)
--closeTipButton:Show()
frame.ShowTip = function(self)
self.tipFrameIsVisible = true
self.tipFrame.frame:Show()
self.buttonsContainer.frame:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 17, 30)
self.container.frame:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -17, 28)
end
frame.HideTip = function(self)
self.tipFrameIsVisible = false
self.tipFrame.frame:Hide()
self.buttonsContainer.frame:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 17, 12)
self.container.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 10)
end
-- Right Side Container
local container = AceGUI:Create("InlineGroup")
container.frame:SetParent(frame)
container.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 12)
container.frame:SetPoint("TOPLEFT", frame, "TOPRIGHT", -83 - WeakAuras.normalWidth * 340, -14)
container.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 10)
container.frame:SetPoint("TOPLEFT", frame, "TOPRIGHT", -63 - WeakAuras.normalWidth * 340, -14)
container.frame:Show()
--container.frame:SetClipsChildren(true)
container.titletext:Hide()
-- Hide the border
container.content:GetParent():SetBackdrop(nil)
container.content:SetPoint("TOPLEFT", 0, 0)
container.content:SetPoint("BOTTOMRIGHT", 0, 0)
frame.container = container
frame.texturePicker = WeakAuras.TexturePicker(frame)
@@ -451,7 +552,7 @@ function WeakAuras.CreateFrame()
filterInput:SetScript("OnEnterPressed", function(...) filterInput:ClearFocus() end)
filterInput:SetScript("OnEscapePressed", function(...) filterInput:SetText("") filterInput:ClearFocus() end)
filterInput:SetHeight(15)
filterInput:SetPoint("TOP", frame, "TOP", 0, -34)
filterInput:SetPoint("TOP", frame, "TOP", 0, -44)
filterInput:SetPoint("LEFT", frame, "LEFT", 24, 0)
filterInput:SetPoint("RIGHT", container.frame, "LEFT", -5, 0)
filterInput:SetTextInsets(16, 16, 0, 0)
@@ -481,7 +582,7 @@ function WeakAuras.CreateFrame()
buttonsContainer:SetWidth(170)
buttonsContainer.frame:SetParent(frame)
buttonsContainer.frame:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 17, 12)
buttonsContainer.frame:SetPoint("TOP", frame, "TOP", 0, -34)
buttonsContainer.frame:SetPoint("TOP", frame, "TOP", 0, -46)
buttonsContainer.frame:SetPoint("RIGHT", container.frame, "LEFT", -17)
buttonsContainer.frame:Show()
frame.buttonsContainer = buttonsContainer
@@ -489,9 +590,9 @@ function WeakAuras.CreateFrame()
-- Toolbar
local toolbarContainer = AceGUI:Create("SimpleGroup")
toolbarContainer.frame:SetParent(buttonsContainer.frame)
toolbarContainer.frame:SetPoint("TOPLEFT", frame, "TOPLEFT", 20, -10)
toolbarContainer.frame:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -17, -10)
toolbarContainer.frame:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 20, -32)
toolbarContainer.frame:SetPoint("TOPLEFT", frame, "TOPLEFT", 20, -16)
toolbarContainer.frame:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -17, -16)
toolbarContainer.frame:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 20, -38)
toolbarContainer:SetLayout("Flow")
local newButton = AceGUI:Create("WeakAurasToolbarButton")
@@ -839,6 +940,7 @@ function WeakAuras.CreateFrame()
local tabsWidget
container.frame:SetPoint("TOPLEFT", frame, "TOPRIGHT", -63 - WeakAuras.normalWidth * 340, -14)
container:ReleaseChildren()
container:SetLayout("Fill")
tabsWidget = AceGUI:Create("TabGroup")
@@ -846,10 +948,10 @@ function WeakAuras.CreateFrame()
local tabs = {
{ value = "region", text = L["Display"]},
{ value = "trigger", text = L["Trigger"]},
{ value = "load", text = L["Load"]},
{ value = "conditions", text = L["Conditions"]},
{ value = "action", text = L["Actions"]},
{ value = "animation", text = L["Animations"]},
{ value = "conditions", text = L["Conditions"]},
{ value = "load", text = L["Load"]},
{ value = "authorOptions", text = L["Custom Options"]},
{ value = "information", text = L["Information"]},
}
@@ -936,10 +1038,15 @@ function WeakAuras.CreateFrame()
self.moversizer:Hide()
self.pickedOption = "New"
container.frame:SetPoint("TOPLEFT", frame, "TOPRIGHT", -63 - WeakAuras.normalWidth * 340, -8)
container:SetLayout("fill")
local border = AceGUI:Create("InlineGroup")
border:SetLayout("Fill")
container:AddChild(border)
local containerScroll = AceGUI:Create("ScrollFrame")
containerScroll:SetLayout("flow")
container:SetLayout("fill")
container:AddChild(containerScroll)
border:AddChild(containerScroll)
local _, _, _, enabled = GetAddOnInfo("WeakAurasTemplates")
if enabled then
+4 -1
View File
@@ -543,6 +543,9 @@ function WeakAuras.ShowOptions(msg)
if (frame.window == "codereview") then
frame.codereview:Close();
end
-- TODO check if it should be shown
frame:ShowTip()
end
function WeakAuras.HideOptions()
@@ -1682,4 +1685,4 @@ function WeakAuras.HandleRename(data, oldid, newid)
WeakAuras.SetGrouping()
WeakAuras.SortDisplayButtons()
WeakAuras.PickDisplay(newid)
end
end