notes for wrath

changed ----------------------------------------------------------------------------
to ---------------------------------------------------------------------------------

equipment sets are back


local activeTalentGroup = GetActiveTalentGroup()  -- active talent spec
local numTalentGroups = GetNumTalentGroups() -- total talent specs

---------------------------------------------------------------------------------------------------------

update .toc file for Classic Wrath

with

## Interface: 30400
## Title: Button Forge |cff69ccf0(Classic-Wrath)|r
## Version: 1.0.6-classic-Wrath


Const.lua -----------------------------------------------------------------

changed ----------------------------------------------------------------------------
Const.VersionMinor			= 0.5;
to ---------------------------------------------------------------------------------
Const.VersionMinor			= 0.6;


button.lua -----------------------------------------------------------------

changed ----------------------------------------------------------------------------
local IsUsable, NotEnoughMana = IsUsableSpell(self.SpellNameRank);
to ---------------------------------------------------------------------------------
local IsUsable, NotEnoughMana = IsUsableSpell(self.SpellName);

changed ----------------------------------------------------------------------------
  GetCompanionInfo(CompanionType, MountID);
to ----------------------------------------------------------------------------
  Util.GetCompanionInfo(CompanionType, MountID, MountName);

changed ----------------------------------------------------------------------------
	elseif (Mode == "mount") then
		self:SetCommandExplicitCompanion(ButtonSave["MountID"], "MOUNT");
to ---------------------------------------------------------------------------------
	elseif (Mode == "mount") then
    if self.ButtonSave["MountName"] ~= nil then
      creatureID, creatureName, creatureSpellID, icon, issummoned, mountTypeID = GetCompanionInfo("MOUNT", ButtonSave["MountID"]);
      if self.ButtonSave["MountName"] ~= creatureName then
        creatureID, creatureName, creatureSpellID, icon, issummoned, mountTypeID = GetCompanionInfo("CRITTER", ButtonSave["MountID"]);
        self:SetCommandExplicitCompanion(ButtonSave["MountID"], "CRITTER", ButtonSave["MountName"]);
        Util.MountName = self.ButtonSave["MountName"]
      else
        self:SetCommandExplicitCompanion(ButtonSave["MountID"], "MOUNT", ButtonSave["MountName"]);
        Util.MountName = self.ButtonSave["MountName"]
      end
    else      
      Util.MountName = ""
      self:SetCommandExplicitCompanion(ButtonSave["MountID"], "MOUNT", "");
    end

changed ----------------------------------------------------------------------------
	local Active = select(5,  Util.GetCompanionInfo(self.CompanionType, self.MountID));
to ---------------------------------------------------------------------------------
	local Active = select(5,  Util.GetCompanionInfo(self.CompanionType, self.MountID, Util.MountName));

changed ----------------------------------------------------------------------------
local IsUsable = IsUsableSpell(self.MountSpellID) and not (select(5,  Util.GetCompanionInfo(self.CompanionType, self.MountID, Util.MountName)));
to ---------------------------------------------------------------------------------
local IsUsable = IsUsableSpell(self.MountSpellID) and not (select(5,  Util.GetCompanionInfo(self.CompanionType, self.MountID)));

changed ----------------------------------------------------------------------------
function Button:SetCommandCompanion(MountID, Type)
	--local SpellName = GetSpellInfo(SpellId);
	self:SetCommandExplicitCompanion(MountID, Type);
end
to ---------------------------------------------------------------------------------
function Button:SetCommandCompanion(MountID, Type, MountName)
	--local SpellName = GetSpellInfo(SpellId);
	self:SetCommandExplicitCompanion(MountID, Type, MountName);
end

changed ----------------------------------------------------------------------------
function Button:SetCommandExplicitCompanion(MountID, Type)
	self:SetEnvCompanion(MountID, Type);
end
to ---------------------------------------------------------------------------------
function Button:SetCommandExplicitCompanion(MountID, Type, MountName)
	self:SetEnvCompanion(MountID, Type, MountName);
end


	
changed ----------------------------------------------------------------------------
function Button:GetCursorCompanion()
	return self.Mode, self.MountID;
end
to ---------------------------------------------------------------------------------
function Button:GetCursorCompanion()
	return self.Mode, self.MountSpellID
end

Bar.lua -----------------------------------------------------------------

changed ----------------------------------------------------------------------------
		--	local NumSpecs = GetNumSpecializations() -- DOESN'T EXIST IN CLASSIC
		local NumSpecs = 1;
to ---------------------------------------------------------------------------------
		local NumSpecs = GetNumTalentGroups()

change
		if (self.BarSave["HSpec1"]) then
		  Text = Text.."[spec:1] hide; ";
		end
		if (self.BarSave["HSpec2"]) then
 			Text = Text.."[spec:2] hide; ";
		end
to
		if self.BarSave["Enabled"] then
		  if (self.BarSave["HSpec1"]) and Util_GetCurspec() == 1 then
			   -- Text = Text.."[spec:1] hide; ";
			   Text = Text.."hide; ";
		  end
		  if (self.BarSave["HSpec2"]) and Util_GetCurspec() == 2 then
  		   -- Text = Text.."[spec:2] hide; ";
  			 Text = Text.."hide; ";
      end
      if not strfind(Text, "hide;",1,true) then
        if self.BarSave["VDriver"] ~= nil then
          if strfind(self.BarSave["VDriver"], "[spec:1]",1,true) and Util_GetCurspec() == 1 then
		        Text = Text.."hide; ";
		      end
  		    if strfind(self.BarSave["VDriver"], "[spec:2]",1,true) and Util_GetCurspec() == 2 then
	    	    Text = Text.."hide; ";
	  	    end
	  	  end
		  end
	  end



EventManager.lua -----------------------------------------------------------------


changed ----------------------------------------------------------------------------
  --Conditional:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED");	--spec:
to ---------------------------------------------------------------------------------
  Conditional:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED");	--spec:

added
  Misc:RegisterEvent("EQUIPMENT_SETS_CHANGED");		--resync equip sets
after
  Misc:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED");


changed ----------------------------------------------------------------------------
  --	elseif (Event =="ACTIVE_TALENT_GROUP_CHANGED") then
		  --Set the talentswap flag so we know not to auto promote any spells
  --		self.RefreshSpells = true;
  --		self.TalentSwap = true;
  --		self:SetScript("OnUpdate", self.OnUpdate);
to ---------------------------------------------------------------------------------
	elseif (Event =="ACTIVE_TALENT_GROUP_CHANGED") then
		-- Set the talentswap flag so we know not to auto promote any spells
		self.RefreshSpells = true;
		self.TalentSwap = true;
		Util.VDriverOverride(); -- refreshes bars after talent group change, so don't need to hit buttonforge config to refresh.
		self:SetScript("OnUpdate", self.OnUpdate);		



EventManager.lua -----------------------------------------------------------------


changed ----------------------------------------------------------------------------
  Misc:RegisterEvent("CURSOR_UPDATE");	
to ---------------------------------------------------------------------------------
  Misc:RegisterEvent("CURSOR_CHANGED");	



UILibDragIcon.lua -----------------------------------------------------------------


changed all ------------------------------------------------------------------------
  DragIcon:RegisterEvent("CURSOR_UPDATE")
to ---------------------------------------------------------------------------------
  DragIcon:RegisterEvent("CURSOR_CHANGED")

changed all ------------------------------------------------------------------------
  DragIcon:UnregisterEvent("CURSOR_UPDATE");
to ---------------------------------------------------------------------------------
  DragIcon:UnregisterEvent("CURSOR_CHANGED");
  

Util.lua -----------------------------------------------------------------


changed ----------------------------------------------------------------------------
  local _, _, offset, numSlots = GetSpellTabInfo(i)
to ---------------------------------------------------------------------------------
  local _, _, offset, numSlots, isGuild, offspecID  = GetSpellTabInfo(i)

changed some ----------------------------------------------------------------------------
  GetCompanionInfo(CompanionType, MountID);
to ----------------------------------------------------------------------------
  Util.GetCompanionInfo(CompanionType, MountID, MountName);

changed ----------------------------------------------------------------------------
Util.MountUselessIndexToIndex = {};
to ----------------------------------------------------------------------------
Util.MountUselessIndexToIndex = {};
Util.MountName = "";


changed ----------------------------------------------------------------------------
function Util.CacheCompanions()
	Util.Critters = {};
    --[[
    for i = 1, GetNumCompanions("CRITTER") do
        local Id, Name = GetCompanionInfo("CRITTER", i);
		if (not Name) then
			return;
		end
        Util.Critters[Name] = i;
    end]]
	
	Util.Mounts = {};
	--[[
	for i, mountID in pairs(C_MountJournal.GetMountIDs()) do
		local creatureName, spellID = C_MountJournal.GetMountInfoByID(mountID);
		if (not creatureName) then
			return;
		end
        Util.Mounts[spellID] = mountID;
	end
	Util.CompanionsCached = true;]]
end
to ---------------------------------------------------------------------------------
function Util.CacheCompanions()
    Util.Critters = {};
    for i = 1, GetNumCompanions("CRITTER") do
        local Id, Name = GetCompanionInfo("CRITTER", i);
		if (not Name) then
			return;
		end
        Util.Critters[Name] = i;
    end
	
    Util.Mounts = {};
    for i = 1, GetNumCompanions("MOUNT") do
        local Id, Name = GetCompanionInfo("MOUNT", i);
		if (not Name) then
			return;
		end
        Util.Mounts[Name] = i;
    end
	Util.CompanionsCached = true;
end

changed ----------------------------------------------------------------------------
	elseif (Command == "mount") then
		if (Subvalue == nil) then
			creatureID, creatureName, creatureSpellID, icon, issummoned, mountTypeID = GetCompanionInfo("MOUNT", Data);
			PickupSpell(creatureSpellID);
		end
to ---------------------------------------------------------------------------------
	elseif (Command == "mount") then
		PickupSpell(Data); -- MountSpellID passed
	
added to end of Util.lua

function Util.GetCompanionInfo(CompanionType, MountID, MountName)

  if MountName ~= "" and MountName ~= nil then
    Util.MountName = MountName
    if Util.Critters[MountName] == MountID then
      CompanionType = "CRITTER"
    end
    if Util.Mounts[MountName] == MountID then
      CompanionType = "MOUNT"
    end
  end
  
	creatureID, creatureName, creatureSpellID, icon, issummoned, mountTypeID = GetCompanionInfo(CompanionType, MountID);
  Util.MountName = creatureName
  
  return creatureID,creatureName,creatureSpellID,icon,issummoned,mountTypeID
end

function Util_GetCurspec()
  local curspec = 1
  if  GetActiveTalentGroup() ~= nil then
    curspec = GetActiveTalentGroup()
  end
  return(curspec)
end


-- 10/02/2022 spec macro conditionals added to wrath classic
Bar.lua -----------------------------------------------------------------

change -----------------------------------------------------------------
		if self.BarSave["Enabled"] then
		  if (self.BarSave["HSpec1"]) and Util_GetCurspec() == 1 then
			   -- Text = Text.."[spec:1] hide; ";
			   Text = Text.."hide; ";
		  end
		  if (self.BarSave["HSpec2"]) and Util_GetCurspec() == 2 then
  		   -- Text = Text.."[spec:2] hide; ";
  			 Text = Text.."hide; ";
      end
      if not strfind(Text, "hide;",1,true) then
        if self.BarSave["VDriver"] ~= nil then
          if strfind(self.BarSave["VDriver"], "[spec:1]",1,true) and Util_GetCurspec() == 1 then
		        Text = Text.."hide; ";
		      end
  		    if strfind(self.BarSave["VDriver"], "[spec:2]",1,true) and Util_GetCurspec() == 2 then
	    	    Text = Text.."hide; ";
	  	    end
	  	  end
		  end
	  end

back to -----------------------------------------------------------------

		if (self.BarSave["HSpec1"]) then
		  Text = Text.."[spec:1] hide; ";
		end
		if (self.BarSave["HSpec2"]) then
 			Text = Text.."[spec:2] hide; ";
		end
