Skip to content

Commit

Permalink
Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
InfusOnWoW committed Mar 28, 2021
1 parent 8e1cbf4 commit 62b2777
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion WeakAuras/AuraEnvironment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ local FakeWeakAurasMixin = {
Import = true,
NewDisplayButton = true,
NewAura = true,
OpenTriggerTemplate = true,
OpenCodeReview = true,
PickDisplay = true,
SetMoverSizer = true,
Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/OptionsFrames/OptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ function OptionsPrivate.CreateFrame()
button:SetDescription(L["Offer a guided way to create auras for your character"])
button:SetIcon("Interface\\Icons\\INV_Misc_Book_06")
button:SetClick(function()
WeakAuras.OpenTriggerTemplate(nil, targetId)
OptionsPrivate.OpenTriggerTemplate(nil, targetId)
end)
containerScroll:AddChild(button)

Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/TriggerOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
}
if (GetAddOnEnableState(UnitName("player"), "WeakAurasTemplates") ~= 0) then
options.__applyTemplate = function()
WeakAuras.OpenTriggerTemplate(data)
OptionsPrivate.OpenTriggerTemplate(data)
end
end
end
4 changes: 2 additions & 2 deletions WeakAurasOptions/WeakAurasOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1314,15 +1314,15 @@ function WeakAuras.CloseCodeReview(data)
frame.codereview:Close();
end

function WeakAuras.OpenTriggerTemplate(data, targetId)
function OptionsPrivate.OpenTriggerTemplate(data, targetId)
if not(IsAddOnLoaded("WeakAurasTemplates")) then
local loaded, reason = LoadAddOn("WeakAurasTemplates");
if not(loaded) then
reason = string.lower("|cffff2020" .. _G["ADDON_" .. reason] .. "|r.")
WeakAuras.prettyPrint("Templates could not be loaded, the addon is " .. reason);
return;
end
frame.newView = WeakAuras.CreateTemplateView(frame);
frame.newView = WeakAuras.CreateTemplateView(OptionsPrivate.Private, frame);
end
frame.newView.targetId = targetId;
frame.newView:Open(data);
Expand Down
21 changes: 11 additions & 10 deletions WeakAurasTemplates/TriggerTemplates.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-- Special layout for the New Aura Trigger template page

local AddonName, TemplatePrivate = ...

local AceGUI = LibStub("AceGUI-3.0");
local floor, ceil, tinsert = floor, ceil, tinsert;
local CreateFrame, UnitClass, UnitRace, GetSpecialization = CreateFrame, UnitClass, UnitRace, GetSpecialization;
Expand Down Expand Up @@ -51,10 +53,12 @@ local function changes(property, regionType)
value = true,
property = regionType == "icon" and "sub.1.glow" or "sub.2.glow",
};
-- TODO this doesn't work anymore, needs to be rewritten
--elseif WeakAuras.regionTypes[regionType].default[property] == nil then
-- return nil;
-- This prevented adding those properties if there weren't relevant for a aura type?
end

-- TODO check that this works
local defaults = TemplatePrivate.Private.GetDefaultsForRegion(regionType, "template")
if defaults[property] == nil then
return nil;
elseif property == "cooldownSwipe" then
return {
value = true,
Expand Down Expand Up @@ -1169,7 +1173,9 @@ local function subTypesFor(item, regionType)
return fallbacks
end

function WeakAuras.CreateTemplateView(frame)
function WeakAuras.CreateTemplateView(Private, frame)
TemplatePrivate.Private = Private

local newView = AceGUI:Create("InlineGroup");
newView.frame:SetParent(frame);
newView.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 42);
Expand Down Expand Up @@ -1866,10 +1872,5 @@ function WeakAuras.CreateTemplateView(frame)
end
end

function WeakAuras.OpenTriggerTemplate(data, targetId)
frame.newView.targetId = targetId;
frame.newView:Open(data);
end

return newView;
end
1 change: 1 addition & 0 deletions WeakAurasTemplates/TriggerTemplatesData.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local AddonName, TemplatePrivate = ...
local WeakAuras = WeakAuras
local L = WeakAuras.L
local GetSpellInfo, tinsert, GetItemInfo, GetSpellDescription, C_Timer, Spell = GetSpellInfo, tinsert, GetItemInfo, GetSpellDescription, C_Timer, Spell
Expand Down

0 comments on commit 62b2777

Please sign in to comment.