WoWInterface SVN OpenRDX

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/RDX/Designs
    from Rev 675 to Rev 676
    Reverse comparison

Rev 675 → Rev 676

Buttons/StanceBar.lua
7,12 → 7,17
local function _EmitCreateCode(objname, desc)
--desc.nIcons = GetNumShapeshiftForms();
desc.nIcons = 8;
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
--if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
--end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local hidebs = "nil"; if desc.hidebs then hidebs = "true"; end
local showkey = "nil"; if desc.showkey then showkey = "true"; end
local showtooltip = "nil"; if desc.showtooltip then showtooltip = "true"; end
40,11 → 45,11
]];
if desc.test then
createCode = createCode .. [[
btn = RDXUI.ActionButtonTest:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[);
local btn = RDXUI.ActionButtonTest:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[);
]];
else
createCode = createCode .. [[
local btn = RDXUI.StanceButton:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, statesString, ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[);
local btn = RDXUI.StanceButton:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, statesString, ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[);
]];
end
createCode = createCode .. [[
53,7 → 58,6
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtHotkey", desc.fontkey, nil, true);
createCode = createCode .. [[
if btn.Init then btn:Init(); end
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
--btn:Show();
frame.]] .. objname .. [[[i] = btn;
abid = abid + 1;
68,7 → 72,7
createCode = createCode .. RDXUI.LayoutCodeMultiRows(objname, desc);
createCode = createCode .. [[
if dabid then
RDX.printW("Stance Button already used, See feature ]] .. desc.name ..[[");
--RDX.printW("Stance Button already used, See feature ]] .. desc.name ..[[");
end
 
]];
95,6 → 99,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Frame_", desc, state, errs);
flg = flg and RDXUI.UFAnchorCheck(desc.anchor, state, errs);
182,27 → 187,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin or Frame
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin, Icon size"));
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- COOLDOWN
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Cooldown")));
local ercd = VFLUI.EmbedRight(ui, VFLI.i18n("Cooldown :"));
232,8 → 247,7
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("End")));
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "stancebar"; version = 1;
name = ed_name.editBox:GetText();
245,9 → 259,12
iconspx = VFL.clamp(ed_iconspx.editBox:GetNumber(), -20, 200);
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -20, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 20, 100);
-- Skin
externalButtonSkin = ebs;
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
-- Cooldown
cd = cd:GetSelectedCooldown();
cdTimerType = nil;
276,6 → 293,7
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
size = 36; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
bkd = VFL.copy(VFLUI.defaultBackdrop);
ButtonSkinOffset = 0;
fontkey = fontk;
cd = VFL.copy(VFLUI.defaultCooldown);
Buttons/VehicleBar.lua
5,12 → 5,18
local function _EmitCreateCode2(objname, desc, winpath)
desc.nIcons = 3; desc.rows = 1;
if not desc.size then desc.size = 36; end
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
--if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
--end
 
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local showkey = "nil"; if desc.showkey then showkey = "true"; end
local test = "nil"; if desc.test then test = "true"; end
 
35,9 → 41,8
 
-- Create buttons
for i=1, ]] .. desc.nIcons .. [[ do
btn = RDXUI.VehicleButton:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, nil, nil, ]] .. desc.nIcons .. [[, ]] .. test .. [[);
btn = RDXUI.VehicleButton:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, nil, nil, ]] .. desc.nIcons .. [[, ]] .. test .. [[);
if btn then
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:Show();
]];
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtHotkey", desc.fontkey, nil, true);
57,7 → 62,7
createCode = createCode .. RDXUI.LayoutCodeMultiRows(objname, desc);
createCode = createCode .. [[
if dabid then
RDX.printE("Vehicle Buttons already used, See window ]] .. winpath ..[[");
--RDX.printE("Vehicle Buttons already used, See window ]] .. winpath ..[[");
end
]];
return createCode;
77,6 → 82,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Frame_", desc, state, errs);
flg = flg and RDXUI.UFAnchorCheck(desc.anchor, state, errs);
164,27 → 170,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin or Frame
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin, Icon size"));
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
202,8 → 218,7
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("End")));
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "vehiclebar"; version = 1;
name = ed_name.editBox:GetText();
215,9 → 230,12
iconspx = VFL.clamp(ed_iconspx.editBox:GetNumber(), -20, 200);
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -20, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 20, 100);
-- Skin
externalButtonSkin = ebs;
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
-- Display
fontkey = fontkey:GetSelectedFont();
showkey = chk_showkey:GetChecked();
236,6 → 254,7
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
size = 36; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
cd = VFL.copy(VFLUI.defaultCooldown);
ButtonSkinOffset = 0;
fontkey = fontk;
};
Buttons/ActionBars.lua
5,13 → 5,17
-- Create function
 
local function _EmitCreateCode(objname, desc)
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
--if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if not ebs then ebs = "bs_default"; end
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
--end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local hidebs = "nil"; if desc.hidebs then hidebs = "true"; end
local showkey = "nil"; if desc.showkey then showkey = "true"; end
local showtooltip = "nil"; if desc.showtooltip then showtooltip = "true"; end
50,7 → 54,7
 
-- Create buttons
for i=1, ]] .. desc.nIcons .. [[ do
local btn = RDXUI.ActionButton:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, "]] .. headerstate .. [[", ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[, ]] .. selfcast .. [[);
local btn = RDXUI.ActionButton:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, "]] .. headerstate .. [[", ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[, ]] .. selfcast .. [[);
]];
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtCount", desc.fontcount, nil, true);
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtMacro", desc.fontmacro, nil, true);
61,7 → 65,6
else
dabid = abid;
end
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:Show();
frame.]] .. objname .. [[[i] = btn;
abid = abid + 1;
113,6 → 116,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
if desc.headerstateType == "Custom" then
local test = __RDXconvertStatesTable(desc.headerstateCustom);
if #test == 0 then VFL.AddError(errs, VFLI.i18n("Custom definition invalid")); return nil; end
258,27 → 262,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin, Icon size"));
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
local chk_hidebs = VFLUI.Checkbox:new(ui); chk_hidebs:Show();
chk_hidebs:SetText(VFLI.i18n("Hide empty button"));
if desc and desc.hidebs then chk_hidebs:SetChecked(true); else chk_hidebs:SetChecked(); end
323,8 → 337,7
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("End")));
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "actionbar"; version = 1;
name = ed_name.editBox:GetText();
343,9 → 356,12
iconspx = VFL.clamp(ed_iconspx.editBox:GetNumber(), -20, 200);
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -20, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 20, 100);
-- Skin
externalButtonSkin = ebs;
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
hidebs = chk_hidebs:GetChecked();
-- Cooldown
cd = cd:GetSelectedCooldown();
382,6 → 398,7
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
nIcons = 12; size = 36; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
bkd = VFL.copy(VFLUI.defaultBackdrop);
ButtonSkinOffset = 0;
fontkey = fontk;
fontmacro = fontm;
Buttons/ActionButton.lua
14,7 → 14,9
x:SetScript("OnAttributeChanged", nil);
x:SetScript("OnDragStart", nil); x:SetScript("OnReceiveDrag", nil);
--VFLUI._CleanupButton(x);
VFLUI._CleanupLayoutFrame(x);
--VFLUI._CleanupLayoutFrame(x);
x:SetBackdrop(nil);
x:Hide(); x:SetParent(VFLParent); x:ClearAllPoints();
end,
function(_, key)
local f = nil;
25,9 → 27,10
return f;
end,
function(_, f) -- on acquired
f:ClearAllPoints();
f:EnableMouse(true);
f:Show();
--f:ClearAllPoints();
--f:EnableMouse(true);
--f:SetBackdrop(nil);
--f:Show();
end,
"key");
 
43,7 → 46,9
x:SetScript("OnAttributeChanged", nil);
x:SetScript("OnDragStart", nil); x:SetScript("OnReceiveDrag", nil);
--VFLUI._CleanupButton(x);
VFLUI._CleanupLayoutFrame(x);
--VFLUI._CleanupLayoutFrame(x);
x:SetBackdrop(nil);
x:Hide(); x:SetParent(VFLParent); x:ClearAllPoints();
end,
function(_, key)
local f = CreateFrame("CheckButton", "VFLButton" .. GetTmpId(), nil, "SecureActionButtonTemplate");
66,11 → 71,15
else
local infoType = GetCursorInfo();
if infoType then
self._texFlash:SetAlpha(1);
--self._texGloss:Show();
if self.usebs then
self._texFlash:SetAlpha(1);
--self._texGloss:Show();
end
else
--self._texGloss:Hide();
self._texFlash:SetAlpha(0);
if self.usebs then
--self._texGloss:Hide();
self._texFlash:SetAlpha(0);
end
end
end
end
79,33 → 88,43
 
local function ABHideGameTooltip(self)
GameTooltip:Hide();
--self._texGloss:Hide();
self._texFlash:SetAlpha(0);
if self.usebs then
--self._texGloss:Hide();
self._texFlash:SetAlpha(0);
end
self.IsShowingTooltip = nil;
end
 
RDXUI.ActionButton = {};
 
function RDXUI.ActionButton:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup, selfcast)
function RDXUI.ActionButton:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup, selfcast)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "SecureActionButtonBar", id);
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonSkin(ebs, true, true, true, true, true, true, false, true, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "SecureActionButtonBar", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
--VFLUI.StdSetParent(self, parent);
--self:SetFrameLevel(parent:GetFrameLevel());
-- store the id 1 to 120 of the frame for keybinding.
-- This is not the action. A button id can have many action when using state.
self.id = id;
self.btype = "";
self.usebs = usebs;
self.usebkd = usebkd;
self.ebhide = ebhide;
self.showtooltip = showtooltip;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
181,7 → 200,11
end
 
local function UpdateState()
self._texFlash:SetVertexColor(1, 1, 1, 0);
if self.usebs then
self._texFlash:SetVertexColor(1, 1, 1, 0);
--elseif usebkd then
--self:SetBackdropBorderColor(1, 1, 1, 0);
end
if self.error then
self.icon:SetTexture("Interface\\InventoryItems\\WoWUnknownItem01.blp");
else
197,8 → 220,12
-- use when bar page changed, and the action is changed
local function UpdateNewAction()
self.action = self:GetAttribute("action");
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
if not self.action then return; end
if HasAction(self.action) then
WoWEvents:Unbind("actionButton" .. self.id);
242,28 → 269,52
VFLT.AdaptiveUnschedule("ScheduleactionButton" .. id);
VFLT.AdaptiveSchedule("ScheduleactionButton" .. id, 0.1, function()
if self.ga then
self._texBorder:SetVertexColor(1, 0.5, 0, 0.8);
self._texGloss:SetVertexColor(1, 0.5, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 0.5, 0, 0.8);
self._texGloss:SetVertexColor(1, 0.5, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 0.5, 0, 0.8);
end
-- current action yellow color
elseif self.ca then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 0, 0.8);
end
-- out of range red color
elseif IsActionInRange(self.action) == 0 then
self._texBorder:SetVertexColor(1, 0, 0, 0.8);
self._texGloss:SetVertexColor(1, 0, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 0, 0, 0.8);
self._texGloss:SetVertexColor(1, 0, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 0, 0, 0.8);
end
-- out of mana blue color
elseif self.ua then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 0, 1, 0.8);
end
-- equipement item green color
elseif self.ea then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
if self.usebs then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 1, 0, 0.35);
end
-- default color
else
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
end
end);
else
273,9 → 324,13
end
-- Button Skin Hide
if self.ebhide and (not HasAction(self.action)) then
self:bsHide();
--if usebs then
self:bsHide();
--end
else
self:bsShow();
--if usebs then
self:bsShow();
--end
end
if self.IsShowingTooltip then ABShowGameTooltip(self); end
end
421,6 → 476,8
s.ua = nil;
s.ea = nil;
s.flash = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
s.btype = nil;
s.action = nil;
437,26 → 494,33
-------------------------------------------
RDXUI.MultiCastButton = {};
 
function RDXUI.MultiCastButton:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
function RDXUI.MultiCastButton:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "SecureActionButtonBar", id);
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetButtonSkin(ebs, true, true, true, true, true, true, false, true, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "SecureActionButtonBar", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
--VFLUI.StdSetParent(self, parent);
--self:SetFrameLevel(parent:GetFrameLevel());
-- store the id 1 to 120 of the frame for keybinding.
-- This is not the action. A button id can have many action when using state.
self.id = id;
self.btype = "";
self.usebs = usebs;
self.usebkd = usebkd;
self.ebhide = ebhide;
self.showtooltip = showtooltip;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
513,7 → 577,11
end
 
local function UpdateState()
self._texFlash:SetVertexColor(1, 1, 1, 0);
if self.usebs then
self._texFlash:SetVertexColor(1, 1, 1, 0);
--elseif usebkd then
--self:SetBackdropBorderColor(1, 1, 1, 0);
end
if self.error then
self.icon:SetTexture("Interface\\InventoryItems\\WoWUnknownItem01.blp");
else
529,8 → 597,12
-- use when bar page changed, and the action is changed
local function UpdateNewAction()
self.action = self:GetAttribute("action");
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
if not self.action then return; end
if HasAction(self.action) then
WoWEvents:Unbind("multicastButton" .. self.id);
572,24 → 644,44
VFLT.AdaptiveSchedule("SchedulemulticastButton" .. id, 0.1, function()
-- current action yellow color
if self.ca then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 0, 0.8);
end
-- out of range red color
elseif IsActionInRange(self.action) == 0 then
self._texBorder:SetVertexColor(1, 0, 0, 0.8);
self._texGloss:SetVertexColor(1, 0, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 0, 0, 0.8);
self._texGloss:SetVertexColor(1, 0, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 0, 0, 0.8);
end
-- out of mana blue color
elseif self.ua then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 0, 1, 0.8);
end
-- equipement item green color
elseif self.ea then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
if self.usebs then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 1, 0, 0.35);
end
-- default color
else
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
end
end);
else
726,6 → 818,8
s.ua = nil;
s.ea = nil;
s.flash = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
s.btype = nil;
s.action = nil;
745,7 → 839,9
if (not x) then return; end
x:SetScript("OnDragStart", nil); x:SetScript("OnReceiveDrag", nil);
--VFLUI._CleanupButton(x);
VFLUI._CleanupLayoutFrame(x);
--VFLUI._CleanupLayoutFrame(x);
x:SetBackdrop(nil);
x:Hide(); x:SetParent(VFLParent); x:ClearAllPoints();
end,
function(_, key)
local f = nil;
755,7 → 851,13
end
return f;
end,
VFL.Noop, "key");
function(_, f) -- on acquired
f:ClearAllPoints();
f:EnableMouse(true);
f:SetBackdrop(nil);
f:Show();
end,
"key");
 
function ABPShowGameTooltip(self)
if ( not self.tooltipName ) then
779,12 → 881,18
 
RDXUI.PetActionButton = {};
 
function RDXUI.PetActionButton:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
function RDXUI.PetActionButton:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "SecureActionButtonPet", id);
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 400; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonSkin(ebs, true, true, true, true, true, true, false, true, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "SecureActionButtonPet", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 400; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
792,12 → 900,14
-- This is not the action. A button id can have many action when using state.
self.id = id;
self.btype = "Pet";
self.usebs = usebs;
self.usebkd = usebkd;
self.ebhide = ebhide;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
841,7 → 951,11
 
local name, subtext, texture, token, active, autocastallowed, autocastenabled = nil, nil, nil, nil, nil, nil, nil;
local function UpdateState()
self._texFlash:SetVertexColor(0, 0, 0, 0);
if self.usebs then
self._texFlash:SetVertexColor(0, 0, 0, 0);
--elseif usebkd then
-- self:SetBackdropBorderColor(0, 0, 0, 0);
end
self.icon:SetTexture(texture);
if active then
self.ca = true;
878,24 → 992,40
VFLT.AdaptiveSchedule("ScheduleactionButtonPet" .. self.id, 0.3, function()
-- current action yellow color
if self.ca then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 0, 0.8);
end
-- out of range red color
--elseif IsActionInRange(action) == 0 then
-- self._texBorder:SetVertexColor(1, 0, 0, 0.8);
-- self._texGloss:SetVertexColor(1, 0, 0, 0.8);
-- out of mana blue color
elseif self.ua then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(0, 0, 1, 0.8);
self._texGloss:SetVertexColor(0, 0, 1, 0.8);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 0, 1, 0.8);
end
-- local spell
elseif self.ea and autocastenabled then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
if self.usebs then
self._texBorder:SetVertexColor(0, 1, 0, 0.35);
self._texGloss:SetVertexColor(0, 1, 0, 0.35);
elseif self.usebkd then
self:SetBackdropBorderColor(0, 1, 0, 0.35);
end
-- default color
else
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif self.usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
end
end);
else
1033,6 → 1163,8
s.ua = nil;
s.ea = nil;
s.flash = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
s.btype = nil;
end, self.Destroy);
1047,7 → 1179,9
VFLUI.CreateFramePool("SecureActionButtonStance", function(pool, x)
if (not x) then return; end
--VFLUI._CleanupButton(x);
VFLUI._CleanupLayoutFrame(x);
--VFLUI._CleanupLayoutFrame(x);
x:SetBackdrop(nil);
x:Hide(); x:SetParent(VFLParent); x:ClearAllPoints();
end, function(_, key)
local f = nil;
if key > 0 and key < 11 then
1079,23 → 1213,32
 
RDXUI.StanceButton = {};
 
function RDXUI.StanceButton:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, cd, showkey, showtooltip)
function RDXUI.StanceButton:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, cd, showkey, showtooltip)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "SecureActionButtonStance", id);
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 300; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonSkin(ebs, true, true, true, true, true, true, false, true, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "SecureActionButtonStance", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
--VFLUI.StdSetParent(self, parent);
--self:SetFrameLevel(parent:GetFrameLevel());
 
self.id = id;
self.btype = "Stance";
self.usebs = usebs;
self.usebkd = usebkd;
self.ebhide = ebhide;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
1126,14 → 1269,26
local texture, name, isActive, isCastable = "", nil, nil, nil;
local function UpdateState()
texture, name, isActive, isCastable = GetShapeshiftFormInfo(self.id);
self._texFlash:SetVertexColor(0, 0, 0, 0);
if self.usebs then
self._texFlash:SetVertexColor(0, 0, 0, 0);
elseif usebkd then
self:SetBackdropBorderColor(0, 0, 0, 0);
end
self.icon:SetTexture(texture);
if isActive then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 0, 0.8);
self._texGloss:SetVertexColor(1, 1, 0, 0.8);
elseif usebkd then
self:SetBackdropBorderColor(1, 1, 0, 0.8);
end
else
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
if self.usebs then
self._texBorder:SetVertexColor(1, 1, 1, 1);
self._texGloss:SetVertexColor(1, 1, 1, 1);
elseif usebkd then
self:SetBackdropBorderColor(1, 1, 1, 1);
end
end
if isCastable then
self.icon:SetAlpha(1);
1248,6 → 1403,9
s.frtxt:Destroy(); s.frtxt = nil;
s.cd:Destroy(); s.cd = nil;
s.id = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
s.btype = nil;
end, self.Destroy);
 
1260,20 → 1418,31
 
RDXUI.ActionButtonTest = {};
 
function RDXUI.ActionButtonTest:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
function RDXUI.ActionButtonTest:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, cd, showkey, showtooltip, anyup)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); id = 400;
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 400; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonSkin(ebs, true, true, false, true, true, true, false, true, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "SecureActionButtonBar", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 400; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
--VFLUI.StdSetParent(self, parent);
--self:SetFrameLevel(parent:GetFrameLevel());
-- store the id 1 to 10 of the frame for keybinding.
 
self.usebs = usebs;
self.usebkd = usebkd;
self.ebhide = ebhide;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
1304,6 → 1473,9
s.frtxt:Destroy(); s.frtxt = nil;
VFLUI.ReleaseRegion(s.icon); s.icon = nil;
s.cd:Destroy(); s.cd = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
end, self.Destroy);
 
return self;
1318,7 → 1490,9
if (not x) then return; end
--x:SetScript("OnDragStart", nil); x:SetScript("OnReceiveDrag", nil);
--VFLUI._CleanupButton(x);
VFLUI._CleanupLayoutFrame(x);
--VFLUI._CleanupLayoutFrame(x);
x:SetBackdrop(nil);
x:Hide(); x:SetParent(VFLParent); x:ClearAllPoints();
end,
function(_, key)
local f = nil;
1352,23 → 1526,31
 
RDXUI.VehicleButton = {};
 
function RDXUI.VehicleButton:new(parent, id, ebsflag, ebs, ebsos, ebhide, statesString, nbuttons, testmode)
function RDXUI.VehicleButton:new(parent, id, size, usebs, ebs, usebkd, bkd, os, ebhide, statesString, nbuttons, testmode)
local self = nil;
if ebsflag then
if usebs then
self = VFLUI.SkinButton:new(parent, "ButtonVehicle", id);
if not self then self = VFLUI.SkinButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 400; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonSkin(ebs, true, true, false, true, true, true, false, false, true, true);
elseif usebkd then
self = VFLUI.BckButton:new(parent, "ButtonVehicle", id);
if not self then self = VFLUI.BckButton:new(parent, "SecureActionButtonBarTmp"); self.error = true; id = 200; end
self:SetWidth(size); self:SetHeight(size);
self:SetButtonBkd(bkd);
end
VFLUI.StdSetParent(self, parent);
self:SetFrameLevel(parent:GetFrameLevel());
--VFLUI.StdSetParent(self, parent);
--self:SetFrameLevel(parent:GetFrameLevel());
 
self.id = id;
self.btype = "Vehicle";
self.usebs = usebs;
self.usebkd = usebkd;
 
-- icon texture
self.icon = VFLUI.CreateTexture(self);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", ebsos, -ebsos);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -ebsos, ebsos);
self.icon:SetPoint("TOPLEFT", self, "TOPLEFT", os, -os);
self.icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -os, os);
self.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
self.icon:SetDrawLayer("ARTWORK", 2);
self.icon:Show();
1512,6 → 1694,9
s.frtxt:Destroy(); s.frtxt = nil;
s.id = nil;
s.btype = nil;
s.usebs = nil;
s.usebkd = nil;
s.ebhide = nil;
end, self.Destroy);
 
return self;
Buttons/MultiCastBar.lua
12,12 → 12,17
-- Create function
 
local function _EmitCreateCode(objname, desc)
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
--if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
--end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local hidebs = "nil"; if desc.hidebs then hidebs = "true"; end
local showkey = "nil"; if desc.showkey then showkey = "true"; end
local showtooltip = "nil"; if desc.showtooltip then showtooltip = "true"; end
48,9 → 53,16
frame.]] .. objname .. [[ = {};
local dabid = nil;
-- Create Main button cast
local btn = VFLUI.SkinButton:new(btnOwner, "SecureUnitButton");
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:SetButtonSkin("]] .. ebs .. [[", true, true, false, true, true, true, false, true, true, true);
local btn;
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new(btnOwner, "SecureUnitButton");
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:SetButtonSkin("]] .. ebs .. [[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.BckButton:new(btnOwner, "SecureUnitButton");
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
self:SetButtonBkd(]] .. Serialize(bkd) .. [[);
end
btn:Show();
btn:RegisterForClicks("AnyDown");
btn:SetAttribute("unit", "player");
58,8 → 70,8
btn:SetAttribute("spell", ]] .. spell .. [[);
 
btn.icon = VFLUI.CreateTexture(btn);
btn.icon:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.icon:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.icon:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.icon:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.icon:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.icon:SetDrawLayer("ARTWORK", 2);
btn.icon:SetTexture("]] .. icontex .. [[");
68,7 → 80,7
frame.]] .. objname .. [[[1] = btn;
 
for i=2, ]] .. desc.nIcons .. [[ do
local btn = RDXUI.MultiCastButton:new(btnOwner, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, "", ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
local btn = RDXUI.MultiCastButton:new(btnOwner, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, "", ]] .. desc.nIcons .. [[, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
]];
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtCount", desc.fontcount, nil, true);
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtMacro", desc.fontmacro, nil, true);
79,7 → 91,6
else
dabid = abid;
end
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:Show();
frame.]] .. objname .. [[[i] = btn;
abid = abid + 1;
89,7 → 100,7
createCode = createCode .. RDXUI.LayoutCodeMultiRows(objname, desc);
createCode = createCode .. [[
if dabid then
RDX.printE("Multi Cast Button ".. dabid .." already used");
--RDX.printE("Multi Cast Button ".. dabid .." already used");
end
]];
return createCode;
115,6 → 126,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
if not desc.cd then desc.cd = VFL.copy(VFLUI.defaultCooldown); end
desc.nIcons = 5;
local flg = true;
222,27 → 234,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin, Icon size"));
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
local chk_hidebs = VFLUI.Checkbox:new(ui); chk_hidebs:Show();
chk_hidebs:SetText(VFLI.i18n("Hide empty button"));
if desc and desc.hidebs then chk_hidebs:SetChecked(true); else chk_hidebs:SetChecked(); end
287,8 → 309,7
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("End")));
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "multicastbar"; version = 1;
name = ed_name.editBox:GetText();
303,9 → 324,12
iconspx = VFL.clamp(ed_iconspx.editBox:GetNumber(), -20, 200);
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -20, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 20, 100);
-- Skin
externalButtonSkin = ebs;
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
hidebs = chk_hidebs:GetChecked();
-- Cooldown
cd = cd:GetSelectedCooldown();
335,6 → 359,7
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
nIcons = 12; size = 36; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
bkd = VFL.copy(VFLUI.defaultBackdrop);
ButtonSkinOffset = 0;
fontkey = fontk;
fontmacro = fontm;
Buttons/ActionBarPet.lua
5,12 → 5,17
-- Create function
 
local function _EmitCreateCode(objname, desc)
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
--if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
--end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local hidebs = "nil"; if desc.hidebs then hidebs = "true"; end
local showkey = "nil"; if desc.showkey then showkey = "true"; end
local showtooltip = "nil"; if desc.showtooltip then showtooltip = "true"; end
48,16 → 53,15
]];
if desc.test then
createCode = createCode .. [[
btn = RDXUI.ActionButtonTest:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
btn = RDXUI.ActionButtonTest:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
]];
else
createCode = createCode .. [[
btn = RDXUI.PetActionButton:new(h, abid, ]] .. ebsflag .. [[, "]] .. ebs .. [[", ]] .. ebsos .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
btn = RDXUI.PetActionButton:new(h, abid, ]] .. desc.size .. [[, ]] .. usebs .. [[, "]] .. ebs .. [[", ]] .. usebkd .. [[, ]] .. Serialize(bkd) .. [[, ]] .. os .. [[, ]] .. hidebs .. [[, statesString, nbuttons, ]] .. Serialize(desc.cd) .. [[, ]] .. showkey .. [[, ]] .. showtooltip .. [[, ]] .. anyup .. [[);
]];
end
createCode = createCode .. [[
if btn then
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:Show();
]];
createCode = createCode .. VFLUI.GenerateSetFontCode("btn.txtHotkey", desc.fontkey, nil, true);
73,7 → 77,7
frame.]] .. objname .. [[header = h;
 
if dabid then
RDX.printW("Pet Button ".. abid .." already used, See feature ]] .. desc.name ..[[");
--RDX.printW("Pet Button ".. abid .." already used, See feature ]] .. desc.name ..[[");
else
]];
createCode = createCode .. RDXUI.LayoutCodeMultiRows(objname, desc);
99,6 → 103,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
if not desc.cd then desc.cd = VFL.copy(VFLUI.defaultCooldown); end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Frame_", desc, state, errs);
190,27 → 195,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin or Frame
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin, Icon size"));
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
local chk_hidebs = VFLUI.Checkbox:new(ui); chk_hidebs:Show();
chk_hidebs:SetText(VFLI.i18n("Hide empty button"));
if desc and desc.hidebs then chk_hidebs:SetChecked(true); else chk_hidebs:SetChecked(); end
245,8 → 260,7
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("End")));
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "actionbarpet"; version = 1;
name = ed_name.editBox:GetText();
261,9 → 275,12
iconspx = VFL.clamp(ed_iconspx.editBox:GetNumber(), -20, 200);
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -20, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 20, 100);
-- Skin
externalButtonSkin = ebs;
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
hidebs = chk_hidebs:GetChecked();
-- Cooldown
cd = cd:GetSelectedCooldown();
294,6 → 311,7
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
nIcons = 10; size = 36; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
bkd = VFL.copy(VFLUI.defaultBackdrop);
ButtonSkinOffset = 0;
fontkey = fontk;
cd = VFL.copy(VFLUI.defaultCooldown);
Lists/CooldownIconList.lua
14,20 → 14,27
 
--------------- Code emitter helpers
local function _EmitCreateCode(objname, desc)
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
 
local createCode = [[
frame.]] .. objname .. [[ = {};
local btn, btnOwner = nil, ]] .. RDXUI.ResolveFrameReference(desc.owner) .. [[;
for i=1, ]] .. desc.nIcons .. [[ do
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
43,8 → 50,8
end
createCode = createCode .. [[
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:SetDrawLayer("ARTWORK", 2);
btn.tex:Show();
77,6 → 84,7
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.cd then desc.cd = VFL.copy(VFLUI.defaultCooldown); end
if not desc.usebkd then desc.usebs = true; end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Icons_", desc, state, errs);
flg = flg and RDXUI.UFAnchorCheck(desc.anchor, state, errs);
97,12 → 105,17
end;
ApplyFeature = function(desc, state)
local objname = "Icons_" .. desc.name;
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
-- Event hinting.
local mux, mask = state:GetContainingWindowState():GetSlotValue("Multiplexer"), 0;
mask = mux:GetPaintMask("COOLDOWN");
250,7 → 263,7
if (_j > ]] .. desc.nIcons .. [[) then break; end
tbl_icons = sort_icons[_j];
if not tbl_icons then break; end
__SetCooldownIcon(_icons[_j], tbl_icons._meta, tbl_icons._tex, tbl_icons._dur, tbl_icons._tl, tbl_icons._i, ]] .. ebs .. [[);
__SetCooldownIcon(_icons[_j], tbl_icons._meta, tbl_icons._tex, tbl_icons._dur, tbl_icons._tl, tbl_icons._i);
_j = _j + 1;
end
 
372,18 → 385,17
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
393,6 → 405,17
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- CooldownDisplay
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Cooldown")));
local ercd = VFLUI.EmbedRight(ui, VFLI.i18n("Cooldown :"));
486,8 → 509,7
 
function ui:GetDescriptor()
local filterName, filterNameList, filternl, ext, unitfi, maxdurfil, mindurfil = nil, nil, {}, nil, "", "", "";
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
if chk_timefilter:GetChecked() then
maxdurfil = ed_maxduration.editBox:GetText();
mindurfil = ed_minduration.editBox:GetText();
543,10 → 565,11
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -200, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 1, 100);
-- display
externalButtonSkin = ebs;
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
bkd = nil;
--bkd = bkd:GetSelectedBackdrop();
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
-- cooldown
cd = cd:GetSelectedCooldown();
-- other
591,6 → 614,7
cd = VFL.copy(VFLUI.defaultCooldown);
externalButtonSkin = "bs_default";
ButtonSkinOffset = 0;
bkd = VFL.copy(VFLUI.defaultBackdrop);
};
end;
});
Lists/AuraIconList.lua
41,32 → 41,44
 
--------------- Code emitter helpers
local function _EmitCreateCode(objname, desc)
local ebs, ebsos = "bs_default", 0;
if desc.externalButtonSkin then
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local createCode = [[
frame.]] .. objname .. [[ = {};
local btn, btnOwner = nil, ]] .. RDXUI.ResolveFrameReference(desc.owner) .. [[;
for i=1, ]] .. desc.nIcons .. [[ do
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
btn:SetParent(btnOwner); btn:SetFrameLevel(btnOwner:GetFrameLevel());
btn:SetWidth(]] .. desc.size .. [[); btn:SetHeight(]] .. desc.size .. [[);
btn:SetScript("OnEnter", __AuraIconOnEnter);
btn:SetScript("OnLeave", __AuraIconOnLeave);
]];
if desc.externalButtonSkin then createCode = createCode .. [[
btn:RegisterForClicks("RightButtonUp");
btn:SetScript("OnClick", __AuraIconOnClick);
--btn:RegisterForClicks("RightButtonUp");
--btn:SetScript("OnClick", __AuraIconOnClick);
]];
end
createCode = createCode .. [[
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:SetDrawLayer("ARTWORK", 2);
btn.tex:Show();
116,6 → 128,7
if not desc.cd then desc.cd = VFL.copy(VFLUI.defaultCooldown); end
if not desc.iconspx then desc.iconspx = 0; end
if not desc.iconspy then desc.iconspy = 0; end
if not desc.usebkd then desc.usebs = true; end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Icons_", desc, state, errs);
flg = flg and RDXUI.UFAnchorCheck(desc.anchor, state, errs);
136,11 → 149,18
end;
ApplyFeature = function(desc, state)
local objname = "Icons_" .. desc.name;
local ebs, ebsos = "bs_default", 0;
if desc.externalButtonSkin then
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
 
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local loadCode = "LoadBuffFromUnit";
-- Event hinting.
local mux, mask = state:GetContainingWindowState():GetSlotValue("Multiplexer"), 0;
406,10 → 426,19
btn.meta = _meta;
btn.tex:SetTexture(_tex);
if _dispelt and DebuffTypeColor[_dispelt] then
btn._texBorder:SetVertexColor(VFL.explodeColor(DebuffTypeColor[_dispelt]));
if ]] .. usebs .. [[ then
btn._texBorder:SetVertexColor(VFL.explodeColor(DebuffTypeColor[_dispelt]));
elseif ]] .. usebkd .. [[ then
btn:SetBackdropBorderColor(VFL.explodeRGBA(DebuffTypeColor[_dispelt]));
end
else
btn._texBorder:SetVertexColor(1, 1, 1, 1);
if ]] .. usebs .. [[ then
btn._texBorder:SetVertexColor(1, 1, 1, 1);
elseif ]] .. usebkd .. [[ then
btn:SetBackdropBorderColor(1, 1, 1, 1);
end
end
 
-- Cooldown
if _dur and _dur > 0 and btn.cd then
btn.cd:SetCooldown(GetTime() + _tl - _dur , _dur);
517,25 → 546,37
if desc and desc.size then ed_size.editBox:SetText(desc.size); end
ui:InsertFrame(ed_size);
 
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local er = VFLUI.EmbedRight(ui, VFLI.i18n("Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(er, VFLUI.GetButtonSkinList);
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
else
dd_buttonSkin:SetSelection("bs_default");
chk_bs:SetChecked();
end
er:EmbedChild(dd_buttonSkin); er:Show();
ui:InsertFrame(er);
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
 
local ed_bs = VFLUI.LabeledEdit:new(ui, 50); ed_bs:Show();
ed_bs:SetText(VFLI.i18n("Button Skin Size Offset :"));
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- CooldownDisplay
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Cooldown")));
local ercd = VFLUI.EmbedRight(ui, VFLI.i18n("Cooldown :"));
697,6 → 738,7
 
function ui:GetDescriptor()
local filterName, filterNameList, filternl, ext, unitfi, maxdurfil, mindurfil = nil, nil, {}, nil, "", "", "";
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
if chk_nameauras:GetChecked() then
unitfi = string.lower(ed_unitfilter.editBox:GetText());
end
757,9 → 799,11
iconspy = VFL.clamp(ed_iconspy.editBox:GetNumber(), -200, 200);
size = VFL.clamp(ed_size.editBox:GetNumber(), 1, 100);
-- display
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
bkd = nil;
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
-- cooldown
cd = cd:GetSelectedCooldown();
cdTimerType = nil;
813,36 → 857,11
anchor = { lp = "TOPLEFT", af = "Base", rp = "TOPLEFT", dx = 0, dy = 0};
nIcons = 4; size = 20; rows = 1; orientation = "RIGHT"; iconspx = 5; iconspy = 0;
cd = VFL.copy(VFLUI.defaultCooldown);
bkd = VFL.copy(VFLUI.defaultBackdrop);
externalButtonSkin = "bs_default";
ButtonSkinOffset = 0;
bkd = VFL.copy(VFLUI.defaultBackdrop);
};
end;
});
 
-----------------------------------
-- Updaters for old stuff.
-----------------------------------
RDX.RegisterFeature({
name = "Buff Icons"; version = 31337; invisible = true;
IsPossible = VFL.Nil;
VersionMismatch = function(desc)
local font = VFL.copy(Fonts.Default); font.size = 8;
desc.feature = "aura_icons"; desc.version = 1; desc.auraType = "BUFFS";
desc.owner = "Base";
desc.color = nil; desc.font = font; desc.text = "STACK";
end;
});
 
RDX.RegisterFeature({
name = "Debuff Icons"; version = 31337; invisible = true;
IsPossible = VFL.Nil;
VersionMismatch = function(desc)
local font = VFL.copy(Fonts.Default); font.size = 8;
desc.feature = "aura_icons"; desc.version = 1; desc.auraType = "DEBUFFS";
desc.owner = "Base";
desc.color = nil; desc.font = font; desc.text = "STACK";
end;
});
 
 
Lists/CustomIconList.lua
16,6 → 16,7
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if desc.owner == "Base" then desc.owner = "decor"; end
if not desc.usebkd then desc.usebs = true; end
if (not desc.number) or (not state:Slot("NumberVar_" .. desc.number)) then
VFL.AddError(errs, VFLI.i18n("Invalid number object pointer.")); return nil;
end
29,11 → 30,15
end;
ApplyFeature = function(desc, state)
local objname = "Icons_" .. desc.name;
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
if not desc.w then desc.w = 20; end
if not desc.h then desc.h = 20; end
57,17 → 62,20
frame.]] .. objname .. [[ = {};
btn, btnOwner = nil, ]] .. RDXUI.ResolveFrameReference(desc.owner) .. [[;
for i=1,]] .. desc.nIcons .. [[ do
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
btn:SetParent(btnOwner); btn:SetFrameLevel(btnOwner:GetFrameLevel());
btn:SetWidth(]] .. desc.w .. [[); btn:SetHeight(]] .. desc.h .. [[);
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:SetDrawLayer("ARTWORK", 2);
btn.tex:Show();
183,18 → 191,18
ed_height:SetText(VFLI.i18n("Height"));
if desc and desc.h then ed_height.editBox:SetText(desc.h); else ed_height.editBox:SetText("20"); end
ui:InsertFrame(ed_height);
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
 
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
204,7 → 212,19
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- Data source
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Datasource")));
 
local number = RDXUI.MakeSlotSelectorDropdown(ui, VFLI.i18n("Number"), state, "NumberVar_");
if desc and desc.number then number:SetSelection(desc.number); end
236,8 → 256,7
if desc and desc.color5 then color5:SetColor(VFL.explodeRGBA(desc.color5)); end
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "custom_icons"; version = 1;
name = ed_name.editBox:GetText();
250,8 → 269,11
w = VFL.clamp(ed_width.editBox:GetNumber(), 1, 100);
h = VFL.clamp(ed_height.editBox:GetNumber(), 1, 100);
-- display
externalButtonSkin = ebs;
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
number = number.editBox:GetText();
drawLayer = drawLayer:GetSelection();
texture = tsel:GetSelectedTexture();
276,6 → 298,7
orientation = "RIGHT"; iconspx = 5; iconspy = 0;
externalButtonSkin = "bs_default";
ButtonSkinOffset = 0;
bkd = VFL.copy(VFLUI.defaultBackdrop);
drawLayer = "ARTWORK";
texture = VFL.copy(VFLUI.defaultTexture);
color1 = {r=1,g=1,b=1,a=1};
Lists/HeaderAuraIconList.lua
15,6 → 15,7
end;
ExposeFeature = function(desc, state, errs)
if not desc then VFL.AddError(errs, VFLI.i18n("Missing descriptor.")); return nil; end
if not desc.usebkd then desc.usebs = true; end
local flg = true;
flg = flg and RDXUI.UFFrameCheck_Proto("Icons_", desc, state, errs);
flg = flg and RDXUI.UFAnchorCheck(desc.anchor, state, errs);
24,12 → 25,17
end;
ApplyFeature = function(desc, state)
local objname = "Icons_" .. desc.name;
local ebsflag, ebs, ebsos = "false", "bs_default", 0;
if desc.externalButtonSkin then
ebsflag = "true";
ebs = desc.externalButtonSkin;
if desc.ButtonSkinOffset then ebsos = desc.ButtonSkinOffset; end
local usebs = "false"; if desc.usebs then usebs = "true"; end
local ebs = desc.externalButtonSkin or "bs_default";
local usebkd = "false"; if desc.usebkd then usebkd = "true"; end
local bkd = desc.bkd or VFLUI.defaultBackdrop;
local os = 0;
if desc.usebs then
os = desc.ButtonSkinOffset or 0;
elseif desc.usebkd then
if desc.bkd and desc.bkd.insets and desc.bkd.insets.left then os = desc.bkd.insets.left or 0; end
end
 
local showweapons = "false";
if desc.showweapons then showweapons = "true"; end
if not desc.xoffset then desc.xoffset = "0"; end
84,9 → 90,12
for _,child in self:ActiveChildren() do
if not child.btn then
local btn;
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
94,8 → 103,8
btn:SetAllPoints(child);
 
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:SetDrawLayer("ARTWORK", 2);
btn.tex:Show();
133,9 → 142,12
if tempEnchant1 then
if not tempEnchant1.btn then
local btn;
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
143,8 → 155,8
btn:SetAllPoints(tempEnchant1);
 
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:Show();
 
177,9 → 189,12
if tempEnchant2 then
if not tempEnchant2.btn then
local btn;
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
187,8 → 202,8
btn:SetAllPoints(tempEnchant2);
 
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:Show();
 
221,9 → 236,12
if tempEnchant3 then
if not tempEnchant3.btn then
local btn;
if ]] .. ebsflag .. [[ then
if ]] .. usebs .. [[ then
btn = VFLUI.SkinButton:new();
btn:SetButtonSkin("]] .. ebs ..[[", true, true, false, true, true, true, false, true, true, true);
elseif ]] .. usebkd .. [[ then
btn = VFLUI.AcquireFrame("Frame");
VFLUI.SetBackdrop(btn, ]] .. Serialize(bkd) .. [[);
else
btn = VFLUI.AcquireFrame("Frame");
end
231,8 → 249,8
btn:SetAllPoints(tempEnchant3);
 
btn.tex = VFLUI.CreateTexture(btn);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. ebsos .. [[, -]] .. ebsos .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. ebsos .. [[, ]] .. ebsos .. [[);
btn.tex:SetPoint("TOPLEFT", btn, "TOPLEFT", ]] .. os .. [[, -]] .. os .. [[);
btn.tex:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -]] .. os .. [[, ]] .. os .. [[);
btn.tex:SetTexCoord(0.08, 1-0.08, 0.08, 1-0.08);
btn.tex:Show();
 
419,18 → 437,17
if desc and desc.yoffset then ed_yoffset.editBox:SetText(desc.yoffset); else ed_yoffset.editBox:SetText("0"); end
ui:InsertFrame(ed_yoffset);
 
-------------- ButtonSkin
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Button Skin")));
-------------- Display
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Display")));
 
local chk_bs = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Button Skin"));
local dd_buttonSkin = VFLUI.Dropdown:new(chk_bs, VFLUI.GetButtonSkinList);
dd_buttonSkin:SetWidth(150); dd_buttonSkin:Show();
if desc and desc.externalButtonSkin then
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
if desc and desc.usebs then
chk_bs:SetChecked(true);
dd_buttonSkin:SetSelection(desc.externalButtonSkin);
else
chk_bs:SetChecked();
dd_buttonSkin:SetSelection("bs_default");
end
chk_bs:EmbedChild(dd_buttonSkin); chk_bs:Show();
ui:InsertFrame(chk_bs);
440,6 → 457,17
if desc and desc.ButtonSkinOffset then ed_bs.editBox:SetText(desc.ButtonSkinOffset); end
ui:InsertFrame(ed_bs);
 
local chk_bkd = VFLUI.CheckEmbedRight(ui, VFLI.i18n("Use Backdrop"));
local dd_backdrop = VFLUI.MakeBackdropSelectButton(chk_bkd, desc.bkd);
dd_backdrop:Show();
if desc and desc.usebkd then
chk_bkd:SetChecked(true);
else
chk_bkd:SetChecked();
end
chk_bkd:EmbedChild(dd_backdrop); chk_bkd:Show();
ui:InsertFrame(chk_bkd);
 
-------------- CooldownDisplay
ui:InsertFrame(VFLUI.Separator:new(ui, VFLI.i18n("Cooldown")));
local ercd = VFLUI.EmbedRight(ui, VFLI.i18n("Cooldown :"));
491,8 → 519,7
ui:InsertFrame(er);
 
function ui:GetDescriptor()
local ebs = nil;
if chk_bs:GetChecked() then ebs = dd_buttonSkin:GetSelection(); end
if chk_bs:GetChecked() then chk_bkd:SetChecked(); end
return {
feature = "sec_aura_icons"; version = 1;
name = ed_name.editBox:GetText();
509,9 → 536,11
xoffset = VFL.clamp(ed_xoffset.editBox:GetNumber(), -10, 10);
yoffset = VFL.clamp(ed_yoffset.editBox:GetNumber(), -10, 10);
-- display
externalButtonSkin = ebs;
usebs = chk_bs:GetChecked();
externalButtonSkin = dd_buttonSkin:GetSelection();
ButtonSkinOffset = VFL.clamp(ed_bs.editBox:GetNumber(), 0, 50);
bkd = nil;
usebkd = chk_bkd:GetChecked();
bkd = dd_backdrop:GetSelectedBackdrop();
-- cooldown
cd = cd:GetSelectedCooldown();
fontst = fontsel2:GetSelectedFont();
537,6 → 566,7
template = "RDXAB30x30Template"; orientation = "LEFT"; wrapafter = 10; maxwraps = 2; xoffset = 0; yoffset = 0; point = "TOPLEFT";
externalButtonSkin = "bs_default";
ButtonSkinOffset = 0;
bkd = VFL.copy(VFLUI.defaultBackdrop);
cd = VFL.copy(VFLUI.defaultCooldown);
fontst = font;
sortmethod = "INDEX";
Variables/PowerVar.lua
5,6 → 5,7
name = "Variable: Fractional mana (fm)";
title = "Vars Frac Power";
category = VFLI.i18n("Variables");
test = true;
multiple = true;
IsPossible = function(state)
if not state:Slot("DesignFrame") then return nil; end
21,9 → 22,16
return true;
end;
ApplyFeature = function(desc, state)
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) code:AppendCode([[
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code)
if desc.test then
code:AppendCode([[
local ]] .. desc.name .. [[, ]] .. desc.name .. [[_i = 0.5, 0.5;
]]);
else
code:AppendCode([[
local ]] .. desc.name .. [[, ]] .. desc.name .. [[_i = unit:FracPower(]] .. desc.powertype .. [[);
]]);
]]);
end
end);
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer");
local mask = mux:GetPaintMask("POWER");
66,6 → 74,7
name = "Variable: Number power";
title = "Vars Number Power";
category = VFLI.i18n("Variables");
test = true;
multiple = true;
IsPossible = function(state)
if not state:Slot("DesignFrame") then return nil; end
81,9 → 90,16
return true;
end;
ApplyFeature = function(desc, state)
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) code:AppendCode([[
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code)
if desc.test then
code:AppendCode([[
local ]] .. desc.name .. [[, ]] .. desc.name .. [[_i = 3, 3;
]]);
else
code:AppendCode([[
local ]] .. desc.name .. [[, ]] .. desc.name .. [[_i = unit:Power(]] .. desc.powertype .. [[) or 0;
]]);
]]);
end
end);
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer");
local mask = mux:GetPaintMask("POWER");