1
0
Bifurcation 0

release 1.0.3

Cette révision appartient à :
Albirew 2021-01-30 15:10:55 +01:00
Parent fabebbfe11
révision d42e06d3de
7 fichiers modifiés avec 87 ajouts et 12 suppressions

35
Bar.lua
Voir le fichier

@ -561,6 +561,27 @@ function Bar:GetPosition()
return self.BarSave["Left"], self.BarSave["Top"], self.BarSave["Left"]..", "..self.BarSave["Top"];
end
function Bar:SetFlyoutDirection(Direction)
local flyoutDirection = "UP"; -- default
if (Direction == "left" or Direction == "LEFT") then
flyoutDirection = "LEFT";
elseif (Direction == "right" or Direction == "RIGHT") then
flyoutDirection = "RIGHT";
elseif (Direction == "down" or Direction == "DOWN") then
flyoutDirection = "DOWN";
end
self.BarSave["FlyoutDirection"] = flyoutDirection;
for r = 1, self.Rows do
for c = 1, self.Cols do
local i = (r-1) * self.Cols + c;
self.Buttons[i].Widget:SetAttribute("flyoutDirection", flyoutDirection);
self.Buttons[i]:UpdateFlyout();
end
end
end
function Bar:SetScale(Scale, NoCheck)
Scale = (Scale or 0) + 0;
if (Scale <= 0) then
@ -604,6 +625,10 @@ function Bar:SetButtonsFromSave()
local NewButton = Util.NewButton(self.ButtonFrame, self.BarSave["Buttons"][i], self.BarSave["ButtonsLocked"], self.BarSave["TooltipsOn"], self.BarSave["MacroText"], self.BarSave["KeyBindText"]);
table.insert(self.Buttons, i, NewButton);
NewButton.Widget:SetPoint("TOPLEFT", self.ButtonFrame, "TOPLEFT", (c-1) * self.BSize, (1-r) * self.BSize);
if (self.BarSave["FlyoutDirection"]) then
NewButton.Widget:SetAttribute("flyoutDirection", self.BarSave["FlyoutDirection"]);
NewButton:UpdateFlyout();
end
end
end
@ -667,6 +692,10 @@ function Bar:SetNumButtons(Cols, Rows)
local NewButton = Util.NewButton(BFrame, ButtonSave, self.BarSave["ButtonsLocked"], self.BarSave["TooltipsOn"], self.BarSave["MacroText"], self.BarSave["KeyBindText"]);
table.insert(Buttons, i, NewButton);
NewButton.Widget:SetPoint("TOPLEFT", BFrame, "TOPLEFT", (c-1) * self.BSize, (1-r) * self.BSize);
if (self.BarSave["FlyoutDirection"]) then
NewButton.Widget:SetAttribute("flyoutDirection", self.BarSave["FlyoutDirection"]);
NewButton:UpdateFlyout();
end
end
end
self.Cols = Cols;
@ -678,7 +707,11 @@ function Bar:SetNumButtons(Cols, Rows)
local ButtonSave = {};
local NewButton = Util.NewButton(BFrame, ButtonSave, self.BarSave["ButtonsLocked"], self.BarSave["TooltipsOn"], self.BarSave["MacroText"], self.BarSave["KeyBindText"]);
table.insert(Buttons, i, NewButton);
NewButton.Widget:SetPoint("TOPLEFT", BFrame, "TOPLEFT", (c-1) * self.BSize, (1-r) * self.BSize);
NewButton.Widget:SetPoint("TOPLEFT", BFrame, "TOPLEFT", (c-1) * self.BSize, (1-r) * self.BSize);
if (self.BarSave["FlyoutDirection"]) then
NewButton.Widget:SetAttribute("flyoutDirection", self.BarSave["FlyoutDirection"]);
NewButton:UpdateFlyout();
end
end
end
self.Rows = Rows;

Voir le fichier

@ -676,7 +676,7 @@ end
--[[ The following functions will configure the button to operate correctly for the specific type of action (these functions must be able to handle the player not knowing spells/macros etc) --]]
function Button:SetEnvSpell(Id, NameRank, Name, Book, IsTalent)
self.UpdateTexture = Button.Empty;
self.UpdateTexture = Button.UpdateTextureSpell;
self.UpdateChecked = Button.UpdateCheckedSpell;
self.UpdateEquipped = Button.Empty;
self.UpdateCooldown = Button.UpdateCooldownSpell;
@ -1342,6 +1342,27 @@ function Button:UnitBuffBySpell(unit, spell)
return nil;
end;
function Button:UpdateTextureSpell()
local spellHasBuffActive = false;
for i=1,40 do
local spellId = select(10, UnitBuff("player", i));
if spellId then
if spellId == self.SpellId then
spellHasBuffActive = true;
break;
end
else
-- no more buffs
break;
end;
end;
if (spellHasBuffActive == true and Const.StealthSpellIds[self.SpellId] ~= nil) then
self.WIcon:SetTexture("Interface/Icons/Spell_Nature_Invisibilty");
else
self.WIcon:SetTexture(self.Texture);
end
end
function Button:UpdateTextureWispSpell()
--BFA fix: UnitBuff can no longer be called with the spell name as a param
if (self.UnitBuffBySpell("player", self.SpellName)) then --NOTE: This en-US, hopefully it will be fine for other locales as well??
@ -1663,8 +1684,8 @@ function Button:UpdateTextCountSpell()
self.WCount:SetText(count);
return;
end
local charges = GetSpellCharges(self.SpellNameRank);
if (charges ~= nil) then
local charges, maxCharges = GetSpellCharges(self.SpellNameRank);
if (charges ~= nil and maxCharges ~= 1) then
self.WCount:SetText(charges);
return;
end
@ -2212,13 +2233,20 @@ function Button:UpdateFlyout()
-- Update arrow
Widget.FlyoutArrow:Show();
Widget.FlyoutArrow:ClearAllPoints();
--if (self:GetParent() == MultiBarRight or self:GetParent() == MultiBarLeft) then
--self.FlyoutArrow:SetPoint("LEFT", self, "LEFT", -arrowDistance, 0);
--SetClampedTextureRotation(self.FlyoutArrow, 270);
--else
local direction = self.Widget:GetAttribute("flyoutDirection");
if (direction == "LEFT") then
Widget.FlyoutArrow:SetPoint("LEFT", Widget, "LEFT", -arrowDistance, 0);
SetClampedTextureRotation(Widget.FlyoutArrow, 270);
elseif (direction == "RIGHT") then
Widget.FlyoutArrow:SetPoint("RIGHT", Widget, "RIGHT", arrowDistance, 0);
SetClampedTextureRotation(Widget.FlyoutArrow, 90);
elseif (direction == "DOWN") then
Widget.FlyoutArrow:SetPoint("BOTTOM", Widget, "BOTTOM", 0, -arrowDistance);
SetClampedTextureRotation(Widget.FlyoutArrow, 180);
else
Widget.FlyoutArrow:SetPoint("TOP", Widget, "TOP", 0, arrowDistance);
SetClampedTextureRotation(Widget.FlyoutArrow, 0);
--end
end
else
Widget.FlyoutBorder:Hide();
Widget.FlyoutBorderShadow:Hide();

Voir le fichier

@ -1,7 +1,7 @@
## Interface: 90002
## Title: Button Forge
## Notes: Add as many or few extra Action Bars and Buttons to your user interface to complement the standard (or other) Action Bars
## Version: 1.0.2
## Version: 1.0.3
## Author: Massiner of Nathrezim
## SavedVariables: ButtonForgeGlobalSettings, ButtonForgeGlobalProfiles, ButtonForgeGlobalBackup
## SavedVariablesPerCharacter: ButtonForgeSave, BFSave

Voir le fichier

@ -56,6 +56,11 @@ Const.ThresholdHSnapSq = 10 * 10;
Const.ThresholdHPressureSq = 20 * 20;
Const.StealthSpellIds = {};
Const.StealthSpellIds[1784] = 1; -- Stealth
Const.StealthSpellIds[5215] = 1; -- Prowl
Const.WispSpellIds = {};
Const.WispSpellIds[19746] = 1; --Concentration Aura
Const.WispSpellIds[32223] = 1; --Crusader Aura
@ -98,6 +103,7 @@ Const.SlashCommands["-keybindtext"] = {params = "bool", group = "bar"};
Const.SlashCommands["-tooltips"] = {params = "bool", group = "bar"};
Const.SlashCommands["-emptybuttons"] = {params = "bool", group = "bar"};
Const.SlashCommands["-lockbuttons"] = {params = "bool", group = "bar"};
Const.SlashCommands["-flyout"] = {params = "^%s*(..-)%s*$", group = "bar"};
Const.SlashCommands["-scale"] = {params = "^%s*(%d*%.?%d+)%s*$", group = "bar"};
Const.SlashCommands["-rows"] = {params = "^%s*(%d+)%s*$", group = "bar", requires = {"-createbar", "-bar"}};
Const.SlashCommands["-cols"] = {params = "^%s*(%d+)%s*$", group = "bar", requires = {"-createbar", "-bar"}};

Voir le fichier

@ -98,6 +98,7 @@ Locale["SlashHelpFormatted"] =
"|c"..Const.LightBlue.."-tooltips <on/off>|r\n"..
"|c"..Const.LightBlue.."-emptybuttons <on/off>|r\n"..
"|c"..Const.LightBlue.."-lockbuttons <on/off>|r\n"..
"|c"..Const.LightBlue.."-flyout <up/down/left/right>|r\n"..
"|c"..Const.LightBlue.."-macrotext <on/off>|r\n"..
"|c"..Const.LightBlue.."-keybindtext <on/off>|r\n"..
"|c"..Const.LightBlue.."-hidespec1 <on/off>|r\n"..

Voir le fichier

@ -5,7 +5,7 @@ Author: Massiner of Nathrezim
Contributor: xfsbill
Past Contributors: DT85, DandierSphinx
Version: 1.0.2
Version: 1.0.3
Description: Graphically create as many Action Bars and Buttons in the game as you choose
@ -23,7 +23,10 @@ Restrictions:
History:
25-Nov-2020 v1.0.2 - Removed Zone Ability frame when placed into a bar
28-Jan-2021 v1.0.3 - Replaced Stealth and Prowl with their proper stealth icon
- Experimental: Configurable flyout direction through slash commands
02-Dec-2020 v1.0.2 - Removed Zone Ability frame when placed into a bar
- Added slash commands to list bars and allow to interact with bars without a label
- Reintroduced clamping bars to the screen (a feature that was disabled all the way back in 2015)
- Added keybind support for gamepads

Voir le fichier

@ -1389,6 +1389,10 @@ function Util.ApplySlashCommands(Commands, Bar)
if (Commands["-lockbuttons"]) then
Bar:SetButtonsLocked(Commands["-lockbuttons"][1]);
end
if (Commands["-flyout"]) then
Bar:SetFlyoutDirection(Commands["-flyout"][1]);
end
if (Commands["-scale"]) then
Bar:SetScale(tonumber(Commands["-scale"][1]));