Skip to content

Commit

Permalink
Templates Fixes (#664)
Browse files Browse the repository at this point in the history
- refactor "changes"
- small fixes for texture color, and "inverse" usage
- removed some progress bar templates, kept only horizontal & vertical, with green color default   << this will need approval
  • Loading branch information
mrbuds authored and Stanzilla committed Aug 25, 2018
1 parent eedf1c9 commit cdf86e3
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 215 deletions.
29 changes: 26 additions & 3 deletions WeakAurasOptions/OptionsFrames/OptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ local function CreateFrameSizer(frame, callback, position)
return handle
end


local defaultWidth = 730
local defaultHeight = 665

function WeakAuras.CreateFrame()
local WeakAuras_DropDownMenu = CreateFrame("frame", "WeakAuras_DropDownMenu", nil, "UIDropDownMenuTemplate");
local frame;
Expand Down Expand Up @@ -152,8 +156,8 @@ function WeakAuras.CreateFrame()
xOffset, yOffset = db.frame.xOffset, db.frame.yOffset;
end
if not(xOffset and yOffset) then
xOffset = (610 - GetScreenWidth()) / 2;
yOffset = (492 - GetScreenHeight()) / 2;
xOffset = (defaultWidth - GetScreenWidth()) / 2;
yOffset = (defaultHeight - GetScreenHeight()) / 2;
end
frame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", xOffset, yOffset);
frame:Hide();
Expand Down Expand Up @@ -191,7 +195,7 @@ function WeakAuras.CreateFrame()
width, height = db.frame.width, db.frame.height;
end
if not(width and height) then
width, height = 630, 492;
width, height = defaultWidth, defaultHeight;
end
frame:SetWidth(width);
frame:SetHeight(height);
Expand Down Expand Up @@ -679,6 +683,12 @@ function WeakAuras.CreateFrame()
container:AddChild(containerScroll);

if(GetAddOnEnableState(UnitName("player"), "WeakAurasTemplates") ~= 0) then
local simpleLabel = AceGUI:Create("Label");
simpleLabel:SetFont("Fonts\\FRIZQT__.TTF", 36, "OUTLINE");
simpleLabel:SetColor(1, 1, 0);
simpleLabel:SetText(L["Simple"]);
containerScroll:AddChild(simpleLabel);

local button = AceGUI:Create("WeakAurasNewButton");
button:SetTitle(L["From Template"]);
button:SetDescription(L["Offer a guided way to create auras for your class"])
Expand All @@ -687,6 +697,12 @@ function WeakAuras.CreateFrame()
WeakAuras.OpenTriggerTemplate();
end);
containerScroll:AddChild(button);

local advancedLabel = AceGUI:Create("Label");
advancedLabel:SetFont("Fonts\\FRIZQT__.TTF", 36, "OUTLINE");
advancedLabel:SetColor(1, 1, 0);
advancedLabel:SetText(L["Advanced"]);
containerScroll:AddChild(advancedLabel);
end

for regionType, regionData in pairs(regionOptions) do
Expand All @@ -710,6 +726,13 @@ function WeakAuras.CreateFrame()
end);
containerScroll:AddChild(button);
end

local externalLabel = AceGUI:Create("Label");
externalLabel:SetFont("Fonts\\FRIZQT__.TTF", 36, "OUTLINE");
externalLabel:SetColor(1, 1, 0);
externalLabel:SetText(L["External"]);
containerScroll:AddChild(externalLabel);

local importButton = AceGUI:Create("WeakAurasNewButton");
importButton:SetTitle(L["Import"]);

Expand Down
21 changes: 5 additions & 16 deletions WeakAurasOptions/RegionOptions/AuraBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -840,25 +840,14 @@ local function createIcon()
end

local templates = {
{
title = L["Default"],
data = {
};
},
{
title = L["Horizontal Blizzard Raid Bar"],
data = {
texture = "Blizzard Raid Bar",
width = 200,
height = 15,
};
},
{
title = L["Horizontal Bar"],
data = {
width = 200,
height = 30,
barColor = { 1, 1, 0, 1}
barColor = { 0, 1, 0, 1},
inverse = true,
smoothProgress = true,
}
},
{
Expand All @@ -869,8 +858,8 @@ local templates = {
barColor = { 0, 1, 0, 1},
rotateText = "LEFT",
orientation = "VERTICAL_INVERSE",
texture = "Blizzard Raid Bar",
icon = false
inverse = true,
smoothProgress = true,
}
},
}
Expand Down
6 changes: 6 additions & 0 deletions WeakAurasOptions/RegionOptions/ProgressTexture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ local templates = {
{
title = L["Default"],
data = {
inverse = true,
};
},
{
Expand All @@ -759,6 +760,7 @@ local templates = {
mirror = true,
foregroundTexture = "Textures\\SpellActivationOverlays\\Backlash",
orientation = "HORIZONTAL",
inverse = true,
},
},
{
Expand All @@ -769,6 +771,7 @@ local templates = {
height = 200,
xOffset = -150,
yOffset = 0,
inverse = true,
},
},
{
Expand All @@ -779,6 +782,7 @@ local templates = {
height = 200,
xOffset = -200,
yOffset = 0,
inverse = true,
},
},
{
Expand All @@ -790,6 +794,7 @@ local templates = {
xOffset = 150,
yOffset = 0,
mirror = true,
inverse = true,
},
},
{
Expand All @@ -801,6 +806,7 @@ local templates = {
xOffset = 200,
yOffset = 0,
mirror = true,
inverse = true,
},
},
}
Expand Down
Loading

0 comments on commit cdf86e3

Please sign in to comment.