1
0
Bifurcation 0

Merged Release 1.0.2 into master

also fixed destroy bar sound
Cette révision appartient à :
Albirew 2020-12-29 17:34:25 +01:00
Parent 89fad344be
révision 183479263c
9 fichiers modifiés avec 100 ajouts et 44 suppressions

Voir le fichier

@ -534,8 +534,7 @@ function Bar:Configure(BarSave)
self:SetAlpha(BarSave["Alpha"]);
self:SetGUI(BarSave["GUI"]);
-- Uncomment this once Clamp insets are working again
--self.ControlFrame:SetClampedToScreen(true);
self.ControlFrame:SetClampedToScreen(true);
end
--[[
@ -1105,6 +1104,7 @@ end
--]]
function Bar:DestroyBar()
if (not InCombatLockdown()) then
PlaySoundFile("sound/spells/meltoretarget.ogg"); --PlaySoundFile(569366)
Util.DeallocateBar(self);
end
UILib.ToggleDestroyBarMode(true);

Voir le fichier

@ -1397,6 +1397,8 @@ function Button:UpdateCheckedCustomAction()
end
--[[---------------------------------------------------------------------------------------
Equipped functions
-----------------------------------------------------------------------------------------]]
@ -1478,6 +1480,7 @@ function Button:UpdateCooldownBonusAction()
end
--[[-------------------------------------------------------------------------------------
Usable Functions
---------------------------------------------------------------------------------------]]
@ -1718,6 +1721,8 @@ function Button:UpdateTooltipCustomAction()
end
--[[---------------------------------------------------------------------
Cursor functions
-----------------------------------------------------------------------]]
@ -1750,6 +1755,8 @@ function Button:GetCursorCustomAction()
end
--[[------------------------------------------------------------------------
Flash functions
--------------------------------------------------------------------------]]

Voir le fichier

@ -1,8 +1,8 @@
## Interface: 11306
## Title: Button Forge (Classic)
## Title: Button Forge |cff69ccf0(Classic)|r
## Notes: Add as many or few extra Action Bars and Buttons to your user interface to complement the standard (or other) Action Bars
## Version: 0.9.50.4
## Author: Massiner of Nathrezim
## Version: 1.0.2-classic
## Author: Massiner of Nathrezim, Albirew
## SavedVariables: ButtonForgeGlobalSettings, ButtonForgeGlobalProfiles, ButtonForgeGlobalBackup
## SavedVariablesPerCharacter: ButtonForgeSave
## OptionalDeps: Masque

Voir le fichier

@ -9,8 +9,8 @@
local Const = BFConst;
Const.SUMMON_RANDOM_FAVORITE_MOUNT_SPELL = 150544;
Const.SUMMON_RANDOM_FAVORITE_MOUNT_ID = 268435455;
Const.Version = 0.9;
Const.VersionMinor = 50;
Const.Version = 1.0;
Const.VersionMinor = 0.2;
Const.MAX_ACCOUNT_MACROS = 120;
Const.ButtonNaming = "ButtonForge"
Const.ButtonSeq = 1; --This value will increment (so not technically a const...)
@ -90,15 +90,16 @@ Const.DarkOrange = "ffEE5500";
Const.SlashCommands = {};
Const.SlashCommands["-bar"] = {params = "^%s*(..-)%s*$", group = "bar"};
Const.SlashCommands["-list"] = {params = "^()$", incompat = {"ALL"}};
Const.SlashCommands["-macrotext"] = {params = "bool", group = "bar"};
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["-scale"] = {params = "^%s*(%d*%.?%d+)%s*$", group = "bar"};
Const.SlashCommands["-rows"] = {params = "^%s*(%d+)%s*$", group = "bar", requires = {"-bar"}};
Const.SlashCommands["-cols"] = {params = "^%s*(%d+)%s*$", group = "bar", requires = {"-bar"}};
Const.SlashCommands["-coords"] = {params = "^%s*(%d*%.?%d+)%s*,?%s*(%d*%.?%d+)%s*$", group = "bar", requires = {"-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"}};
Const.SlashCommands["-coords"] = {params = "^%s*(%d*%.?%d+)%s*,?%s*(%d*%.?%d+)%s*$", group = "bar", requires = {"-createbar", "-bar"}};
Const.SlashCommands["-gap"] = {params = "^%s*(%d*%.?%d+)%s*$", group = "bar"};
Const.SlashCommands["-enabled"] = {params = "bool", group = "bar"};
Const.SlashCommands["-info"] = {params = "^()$", group = "bar", requires = {"-bar"}};

Voir le fichier

@ -20,3 +20,4 @@ ButtonForgeSave = {};
ButtonForgeGlobalSettings = {};
ButtonForgeGlobalProfiles = {};
ButtonForgeGlobalBackup = {};

Voir le fichier

@ -455,6 +455,13 @@ function Misc:OnEvent(Event, ...)
-- self.TalentSwap = true;
-- self:SetScript("OnUpdate", self.OnUpdate);
-- elseif (Event == "COMPANION_LEARNED") then
-- Util.CacheCompanions();
-- Util.RefreshCompanions();
-- elseif (Event == "EQUIPMENT_SETS_CHANGED") then
-- Util.RefreshEquipmentSets();
elseif (Event == "PLAYER_REGEN_DISABLED") then
Util.PreCombatStateUpdate();

Voir le fichier

@ -36,6 +36,9 @@
BFKeyBinder.OnInputBindingOverlay("MOUSEWHEELDOWN");
end
</OnMouseWheel>
<OnGamePadButtonDown>
BFKeyBinder.OnInputBindingOverlay(button);
</OnGamePadButtonDown>
</Scripts>
</Frame>

Voir le fichier

@ -88,6 +88,7 @@ Locale["SlashHelpFormatted"] =
"Valid slash commands: |c"..Const.LightBlue.."/buttonforge|r, |c"..Const.LightBlue.."/bufo|r\n"..
"Valid switches:\n"..
"|c"..Const.LightBlue.."-bar <bar name>|r (the bar to apply changes to, or if not set then all bars)\n"..
"|c"..Const.LightBlue.."-list|r\n"..
"|c"..Const.LightBlue.."-rename <new name>|r\n"..
"|c"..Const.LightBlue.."-rows <number>|r\n"..
"|c"..Const.LightBlue.."-cols <number>|r\n"..
@ -134,6 +135,8 @@ Locale["SlashHelpFormatted"] =
Locale["SlashCommandRequired"] = "<COMMANDA> requires <COMMANDB> to also be specified";
Locale["SlashCommandIncompatible"] = "<COMMANDA> is incompatible with <COMMANDB>";
Locale["SlashCommandAlone"] = "<COMMANDA> cannot be used with other commands";
Locale["SlashListBarWithLabel"] = "- <LABEL> |c"..Const.LightBlue.." Examples: /bufo -bar <LABEL> -info";
Locale["SlashListBarWithIndex"] = "- <LABEL> (No label set, use Index) |c"..Const.LightBlue.." Examples: /bufo -bar <LABEL> -info";
Locale["SlashBarNameRequired"] =
[[ButtonForge slash command failed:

Voir le fichier

@ -105,7 +105,7 @@ function Util.UpdateSavedData()
------The following section updates the per character saved data------
--Need to allocate save structure
if (not ButtonForgeSave or ButtonForgeSave["Version"] == nil ) then
if (not ButtonForgeSave or ButtonForgeSave["Version"] == nil) then
--Swap v0.9.0 / v0.9.1 / v0.9.2 users to the new save structure
ButtonForgeSave = {};
ButtonForgeSave["ConfigureMode"] = true;
@ -168,6 +168,12 @@ function Util.UpdateSavedData()
DEFAULT_CHAT_FRAME:AddMessage(Util.GetLocaleString("UpgradedChatMsg").."v0.9.22", .5, 1, 0, 1);
end
--v0.9.25 update
if (ButtonForgeSave["Version"] == 0.9 and ButtonForgeSave["VersionMinor"] < 25) then
ButtonForgeSave["VersionMinor"] = 25;
DEFAULT_CHAT_FRAME:AddMessage(Util.GetLocaleString("UpgradedChatMsg").."v0.9.25", .5, 1, 0, 1);
end
-- v0.9.34 update
if (ButtonForgeSave["Version"] == 0.9 and ButtonForgeSave["VersionMinor"] < 34) then
for i = 1, #ButtonForgeSave.Bars do
@ -420,8 +426,6 @@ function Util.Load()
Util.StartMacroCheckDelay();
Util.RefreshOnUpdateFunction();
SLASH_BUTTONFORGE1 = Util.GetLocaleString("SlashButtonForge1"); -- = "/buttonforge"; --these two identifiers probably shouldn't change, but if need be they can be?!
SLASH_BUTTONFORGE2 = Util.GetLocaleString("SlashButtonForge2"); -- = "/bufo";
collectgarbage("collect");
Util.CallbackEvent("INITIALISED");
end
@ -1184,7 +1188,10 @@ function Util.SlashShowMessageByLine(Message)
end
end
function SlashCmdList.BUTTONFORGE(msg, editbox)
SLASH_BUTTONFORGE1 = Util.GetLocaleString("SlashButtonForge1"); -- = "/buttonforge"; --these two identifiers probably shouldn't change, but if need be they can be?!
SLASH_BUTTONFORGE2 = Util.GetLocaleString("SlashButtonForge2"); -- = "/bufo";
SlashCmdList["BUTTONFORGE"] = function(msg, editbox)
local FirstCommand;
local PreparedCommands = {};
local Command, Params;
local Count = 0;
@ -1192,6 +1199,9 @@ function SlashCmdList.BUTTONFORGE(msg, editbox)
for Token, Space in string.gmatch(msg, '([^%s]+)([%s]*)') do
if (Const.SlashCommands[strlower(Token)]) then
if (Command) then
if (FirstCommand == nil) then
FirstCommand = Command;
end;
Count = Count + 1;
--PreparedCommands["Count"] = Count;
PreparedCommands[Command] = Util.ProcessSlashCommandParams(Command, Params);
@ -1225,7 +1235,7 @@ function SlashCmdList.BUTTONFORGE(msg, editbox)
-- 2. A rules required's must be present
-- 3. A rules exclusions must not be present
local Group;
local FirstCommand;
for k, v in pairs(Commands) do
FirstCommand = FirstCommand or k;
if (Group ~= nil and Group ~= Const.SlashCommands[k].group) then
@ -1237,13 +1247,20 @@ function SlashCmdList.BUTTONFORGE(msg, editbox)
local Requires = Const.SlashCommands[k].requires;
if (Requires) then
local RequiresValid = false;
local RequiresInfo = {};
-- make sure we have at least one of the requirements
for k1, v1 in pairs(Requires) do
if (Commands[v1] == nil) then
-- Missing a required command
DEFAULT_CHAT_FRAME:AddMessage(string.gsub(string.gsub(Util.GetLocaleString("SlashCommandRequired"), "<COMMANDA>", k), "<COMMANDB>", v1), .5, 1, 0, 1);
return;
table.insert(RequiresInfo,v1);
if (Commands[v1] ~= nil) then
RequiresValid = true;
end
end
if (RequiresValid == false) then
-- Missing a required command
DEFAULT_CHAT_FRAME:AddMessage(string.gsub(string.gsub(Util.GetLocaleString("SlashCommandRequired"), "<COMMANDA>", k), "<COMMANDB>", table.concat(RequiresInfo, " or ")), .5, 1, 0, 1);
return;
end
end
local Incompat = Const.SlashCommands[k].incompat;
@ -1283,9 +1300,20 @@ function SlashCmdList.BUTTONFORGE(msg, editbox)
elseif (Commands["-destroybar"]) then
BarName = Commands["-destroybar"][1];
end
local barFound = false;
for i = 1, #Bars do
if ((not BarName) or strlower(BarName) == strlower(Bars[i].BarSave["Label"])) then
Util.ApplySlashCommands(Commands, Bars[i]);
barFound = true;
end
end
-- bar name not found, check with Index
if ( barFound == false ) then
for i = 1, #Bars do
if ( tonumber(BarName) == i ) then
Util.ApplySlashCommands(Commands, Bars[i]);
barFound = true;
end
end
end
end
@ -1310,6 +1338,17 @@ function Util.ApplySlashCommands(Commands, Bar)
Commands["-rename"] = Commands["-createbar"]; --this could arguably work by having an empty param to createbar but I think it will feel more natural to require a name with this command
end
if (Commands["-list"]) then
local Bars = Util.ActiveBars;
for i = 1, #Bars do
local label = string.gsub(Util.GetLocaleString("SlashListBarWithLabel"), "<LABEL>", Bars[i].BarSave["Label"]);
if (Bars[i].BarSave["Label"] == "") then
label = string.gsub(Util.GetLocaleString("SlashListBarWithIndex"), "<LABEL>", i);
end
DEFAULT_CHAT_FRAME:AddMessage(label, .5, 1, 0, 1);
end
end
if (Commands["-destroybar"]) then
Util.DeallocateBar(Bar);
end
@ -1638,7 +1677,7 @@ end
-------------------------------------------]]
function Util.GetFullSpellName(Name, Rank)
--BFA fix: GetSpellInfo now returns a nil for the rank. That's passed in here
--So we check to make sure ranx exists or only pass back the name itself.
--So we check to make sure rank exists or only pass back the name itself.
if (Rank) then
Rank = "("..Rank..")";
else
@ -1732,21 +1771,16 @@ end
function Util.CachePetSpellIndexes()
local i = 1;
local NewPSI = {};
--Util.NewPetSpellIndex = {};
while true do
local NameRank = Util.GetFullSpellName(GetSpellInfo(i, BOOKTYPE_PET));
if (not NameRank) then
break;
local spellName, spellSubName = GetSpellBookItemName(i, BOOKTYPE_PET)
if not spellName then
do break end
end
--if (not Util.PetSpellIndex[NameRank]) then
-- Util.NewPetSpellIndex[NameRanl] = i;
--end
NewPSI[NameRank] = i;
i = i + 1;
NewPSI[spellName] = i;
i = i + 1
end
Util.PetSpellIndex = NewPSI;
end
function Util.LookupSpellIndex(NameRank)
@ -1844,7 +1878,7 @@ function Util.CacheCompanions()
Util.Critters[Name] = i;
end]]
Util.Mounts = {};
-- Util.Mounts = {};
-- for i, mountID in pairs(C_MountJournal.GetMountIDs()) do
-- local creatureName, spellID = C_MountJournal.GetMountInfoByID(mountID);
-- if (not creatureName) then
@ -1852,6 +1886,7 @@ function Util.CacheCompanions()
-- end
-- Util.Mounts[spellID] = mountID;
-- end
-- Util.CompanionsCached = true;
end
function Util.LookupCompanion(Name)
@ -2510,6 +2545,5 @@ function Util.LookupEquipmentSetIndex(EquipmentSetID)
end
end
return nil;
end