Quantcast

Version 7.0.3 Added ready for Legion

Tina Kirby [07-24-16 - 23:37]
Version 7.0.3 Added ready for Legion
- Scaled buttons to 100% rather than 80%
- Added Legion spells to the mix ready for the expansion
- Thanks to Daveo77 for the initial database additions
- Adjusted line up to take the higher number of teleport/portal counts
- Fixed Alpha and Font Size application to work during gameplay and not after a reload
Filename
XMage_Portals/PatchNotes.txt
XMage_Portals/XMP_Data.lua
XMage_Portals/XMP_Frame.lua
XMage_Portals/XMP_Options.lua
XMage_Portals/XMP_SecureSpellButton.lua
XMage_Portals/XMP_SpellCooldown.lua
XMage_Portals/XMage_Portals.lua
XMage_Portals/XMage_Portals.toc
diff --git a/XMage_Portals/PatchNotes.txt b/XMage_Portals/PatchNotes.txt
index 4d4986a..582ba7c 100644
--- a/XMage_Portals/PatchNotes.txt
+++ b/XMage_Portals/PatchNotes.txt
@@ -1,4 +1,12 @@

+Version: 7.0.3.22293
+Changes Made :
+- Scaled buttons to 100% rather than 80%
+- Added Legion spells to the mix ready for the expansion
+- Thanks to Daveo77 for the initial database additions
+- Adjusted line up to take the higher number of teleport/portal counts
+- Fixed Alpha and Font Size application to work during gameplay and not after a reload
+
 Version: 6.0.2.19034
 Changes Made :
 - TOC Change to reflect 6.0 compatibility
diff --git a/XMage_Portals/XMP_Data.lua b/XMage_Portals/XMP_Data.lua
index d5b7791..a5eb9ba 100644
--- a/XMage_Portals/XMP_Data.lua
+++ b/XMage_Portals/XMP_Data.lua
@@ -1,4 +1,3 @@
-
 -- This file holds the data used by the rest of the addon.  For the most part it is used for the display information on the screen.

 -- Grab a copy of the local data
@@ -12,6 +11,7 @@ addonData.ExpansionDB = {
 	[3] = EXPANSION_NAME3,	-- Cataclysm ( 80 to 85 )
 	[4] = EXPANSION_NAME4,	-- Mists of Pandaria ( 85 to 90 )
 	[5] = EXPANSION_NAME5,  -- Warlords of Draenor ( 90 to 100 )
+	[6] = EXPANSION_NAME6,  -- Legion ( 101 to 110 )
 }

 addonData.PortalDB = {
@@ -136,7 +136,7 @@ addonData.PortalDB = {
 		faction = FACTION_HORDE,
 	},

-	-- Dalaran
+	-- Dalaran (Northrend)
 	[13] = {
 		expansionRequired = 2,
 		levelRequired = 74,
@@ -146,7 +146,7 @@ addonData.PortalDB = {
 		faction = FACTION_ALLIANCE,
 	},

-	-- Dalaran
+	-- Dalaran (Northrend)
 	[14] = {
 		expansionRequired = 2,
 		levelRequired = 74,
@@ -233,6 +233,26 @@ addonData.PortalDB = {
 		spellID = 176244,
 		faction = FACTION_HORDE,
 	},
+
+	-- Dalaran (Broken Isles)
+	[23] = {
+		expansionRequired = 6,
+		levelRequired = 110,
+		dropItem = false,
+		questReward = false,
+		spellID = 224871,
+		faction = FACTION_ALLIANCE,
+	},
+
+	-- Dalaran (Broken Isles)
+	[24] = {
+		expansionRequired = 6,
+		levelRequired = 110,
+		dropItem = false,
+		questReward = false,
+		spellID = 224871,
+		faction = FACTION_HORDE,
+	},
 }

 addonData.TeleportDB = {
@@ -357,7 +377,7 @@ addonData.TeleportDB = {
 		faction = FACTION_HORDE,
 	},

-	-- Dalaran
+	-- Dalaran (Northrend)
 	[13] = {
 		expansionRequired = 2,
 		levelRequired = 71,
@@ -367,7 +387,7 @@ addonData.TeleportDB = {
 		faction = FACTION_ALLIANCE,
 	},

-	-- Dalaran
+	-- Dalaran (Northrend)
 	[14] = {
 		expansionRequired = 2,
 		levelRequired = 71,
@@ -456,5 +476,44 @@ addonData.TeleportDB = {
 		spellID = 176242,
 		faction = FACTION_HORDE,
 	},
-}
+
+	-- Dalaran (Broken Isles)
+	[23] = {
+		expansionRequired = 6,
+		levelRequired = 105,
+		dropItem = false,
+		questReward = false,
+		spellID = 224869,
+		faction = FACTION_ALLIANCE,
+	},
+
+	-- Dalaran (Broken Isles)
+	[24] = {
+		expansionRequired = 6,
+		levelRequired = 105,
+		dropItem = false,
+		questReward = false,
+		spellID = 224869,
+		faction = FACTION_HORDE,
+	},
+
+	-- Class Hall - Hall Of the Guardian
+	[25] = {
+		expansionRequired = 6,
+		levelRequired = 14,
+		dropItem = false,
+		questReward = true,
+		spellID = 193759,
+		faction = FACTION_ALLIANCE,
+	},

+	-- Class Hall - Hall Of the Guardian
+	[26] = {
+		expansionRequired = 6,
+		levelRequired = 14,
+		dropItem = false,
+		questReward = true,
+		spellID = 193759,
+		faction = FACTION_HORDE,
+	},
+}
diff --git a/XMage_Portals/XMP_Frame.lua b/XMage_Portals/XMP_Frame.lua
index a767f7e..150f4dd 100644
--- a/XMage_Portals/XMP_Frame.lua
+++ b/XMage_Portals/XMP_Frame.lua
@@ -127,7 +127,9 @@ addonData.ArrangeLayout = function(self,frame)
 	-- If the Portal Buttons table not created
 	if ( not addonData.PortalButtons) then return end

-	local cellCount = #addonData.PortalButtons;
+	local teleCount = #self.TeleportButtons;
+	local portCount = #self.PortalButtons;
+	local cellCount = math.max(teleCount,portCount)

 	-- if there are no items in the table
 	if ( cellCount < 1 ) then return end
@@ -136,29 +138,30 @@ addonData.ArrangeLayout = function(self,frame)
 	local cellGap = cellSize * 0.25;

 	frame.PortalHeading:SetPoint( "BOTTOMLEFT", addonData.PortalButtons[1], "TOPLEFT", -cellGap , cellGap);
-	frame.PortalHeading:SetPoint( "BOTTOMRIGHT", addonData.PortalButtons[cellCount], "TOPRIGHT", cellGap , cellGap);
+	frame.PortalHeading:SetPoint( "BOTTOMRIGHT", addonData.PortalButtons[portCount], "TOPRIGHT", cellGap , cellGap);
 	frame.TeleportHeading:SetPoint( "BOTTOMLEFT", addonData.TeleportButtons[1], "TOPLEFT", -cellGap , cellGap);
-	frame.TeleportHeading:SetPoint( "BOTTOMRIGHT", addonData.TeleportButtons[cellCount], "TOPRIGHT", cellGap , cellGap);
+	frame.TeleportHeading:SetPoint( "BOTTOMRIGHT", addonData.TeleportButtons[teleCount], "TOPRIGHT", cellGap , cellGap);


-	local cellCount = #self.PortalButtons;
 	local cellWidth = ( frame:GetWidth() / cellCount );
-	local btnSize = cellWidth * 0.8;
+	local btnSize = cellWidth * 1.0;
 	local btnGap = cellWidth * 0.1;
 	local verticalOffsetPortal =   frame:GetHeight() / 5;
 	local verticalOffsetTeleport = frame:GetHeight() / 4;

-	for i=1,cellCount do
+	for i=1,portCount do
 		self.PortalButtons[i]:SetWidth( btnSize );
 		self.PortalButtons[i]:SetHeight( btnSize );
+	end
+	for i = 1,teleCount do
 		self.TeleportButtons[i]:SetWidth( btnSize );
 		self.TeleportButtons[i]:SetHeight( btnSize );
 	end

-    	local odd = ( cellCount % 2 ) == 1;
-    	local midwayLeft = nil;
-    	local midwayRight = nil;
-    	if ( odd ) then
+	local odd = ( cellCount % 2 ) == 1;
+	local midwayLeft = nil;
+	local midwayRight = nil;
+	if ( odd ) then
 		midwayLeft = math.ceil( cellCount / 2 );
 	else
 		midwayLeft = math.floor( cellCount / 2 );
@@ -179,8 +182,10 @@ addonData.ArrangeLayout = function(self,frame)
 		self.PortalButtons[i]:SetPoint( "RIGHT", self.PortalButtons[i+1], "LEFT", -btnGap, 0 );
 		self.TeleportButtons[i]:SetPoint( "RIGHT", self.TeleportButtons[i+1], "LEFT", -btnGap, 0 );
 	end
-	for i = midwayLeft + 1, cellCount do
+	for i = midwayLeft + 1, portCount do
 		self.PortalButtons[i]:SetPoint( "LEFT", self.PortalButtons[i-1], "RIGHT", btnGap, 0 );
+	end
+	for i = midwayLeft + 1, teleCount do
 		self.TeleportButtons[i]:SetPoint( "LEFT", self.TeleportButtons[i-1], "RIGHT", btnGap, 0 );
 	end

diff --git a/XMage_Portals/XMP_Options.lua b/XMage_Portals/XMP_Options.lua
index f4763e1..fe0f839 100644
--- a/XMage_Portals/XMP_Options.lua
+++ b/XMage_Portals/XMP_Options.lua
@@ -113,7 +113,7 @@ local CreateMenuItems = function(frame,level,menuList)
 			info.text = v
 			info.checked = ( v == XMagePortsDB.CooldownSize )
 			info.notCheckable = false
-			info.func = function() XMagePortsDB.CooldownSize = v addonData:UpdateText(addonData.XMPFrame)  end
+			info.func = function() XMagePortsDB.CooldownSize = v addonData:UpdateButtons(addonData.XMPFrame)  end
 			UIDropDownMenu_AddButton(info,level)
 		end

@@ -124,7 +124,7 @@ local CreateMenuItems = function(frame,level,menuList)
 			info.text = v
 			info.checked = ( v == XMagePortsDB.NotAvailableAlpha )
 			info.notCheckable = false
-			info.func = function() XMagePortsDB.NotAvailableAlpha = v addonData:UpdateText(addonData.XMPFrame)  end
+			info.func = function() XMagePortsDB.NotAvailableAlpha = v addonData:UpdateButtons(addonData.XMPFrame)  end
 			UIDropDownMenu_AddButton(info,level)
 		end
 	elseif ( menuList == "NotIdealAlpha" ) then
@@ -134,7 +134,7 @@ local CreateMenuItems = function(frame,level,menuList)
 			info.text = v
 			info.checked = ( v == XMagePortsDB.NotIdealAlpha )
 			info.notCheckable = false
-			info.func = function() XMagePortsDB.NotIdealAlpha = v addonData:UpdateText(addonData.XMPFrame)  end
+			info.func = function() XMagePortsDB.NotIdealAlpha = v addonData:UpdateButtons(addonData.XMPFrame)  end
 			UIDropDownMenu_AddButton(info,level)
 		end
 	elseif ( menuList == "AvailableAlpha" ) then
@@ -144,7 +144,7 @@ local CreateMenuItems = function(frame,level,menuList)
 			info.text = v
 			info.checked = ( v == XMagePortsDB.AvailableAlpha )
 			info.notCheckable = false
-			info.func = function() XMagePortsDB.AvailableAlpha = v addonData:UpdateText(addonData.XMPFrame)  end
+			info.func = function() XMagePortsDB.AvailableAlpha = v addonData:UpdateButtons(addonData.XMPFrame)  end
 			UIDropDownMenu_AddButton(info,level)
 		end
 	end
diff --git a/XMage_Portals/XMP_SecureSpellButton.lua b/XMage_Portals/XMP_SecureSpellButton.lua
index bb12860..fca4925 100644
--- a/XMage_Portals/XMP_SecureSpellButton.lua
+++ b/XMage_Portals/XMP_SecureSpellButton.lua
@@ -11,11 +11,11 @@ addonData.UpdateAlpha = function(self,button)
 	if ( not button.spellID  ) then return end

 	local spellName, spellRank, spellIcon = GetSpellInfo(button.spellID);
-
+
 	local spellKnown = ( GetSpellInfo(spellName) ~= nil )
 	local isSolo = true
 	local isGrouped = ( GetNumGroupMembers() > 0 )
-
+
 	if ( isGrouped ) then
 		isSolo = false
 	end
@@ -30,6 +30,7 @@ addonData.UpdateAlpha = function(self,button)
 	end
 end

+
 addonData.CreateSecureSpellButton = function(self,spellID,spellType)

 	-- Protected Function call to catch errors
@@ -71,10 +72,9 @@ addonData.CreateSecureSpellButton = function(self,spellID,spellType)
 		if self:GetNormalTexture() ~= ""
 		then self:SetNormalTexture( "" );
 		end
-		addonData:UpdateAlpha(button)
+		addonData:UpdateAlpha(self)
 	end)
-
-
+
 	Button:Show()
 	return Button

diff --git a/XMage_Portals/XMP_SpellCooldown.lua b/XMage_Portals/XMP_SpellCooldown.lua
index 822411e..c9caa95 100644
--- a/XMage_Portals/XMP_SpellCooldown.lua
+++ b/XMage_Portals/XMP_SpellCooldown.lua
@@ -10,6 +10,12 @@ addonData.UpdateCooldown = function(self,button,fontStructure)
 	if ( not spellKnown ) then return end
 	local cdStart,cdDuration,cdEnabled = GetSpellCooldown(spellName)
 	if ( cdDuration < 2 ) then return end
+
+	local fontPath, fontSize, fontFlags
+	fontPath, fontSize, fontFlags = button.Counter:GetFont()
+	fontSize = XMagePortsDB.CooldownSize
+	button.Counter:SetFont(fontPath,XMagePortsDB.CooldownSize,fontFlags);
+
 	local timeNow = GetTime()
 	local diffTime = timeNow - cdStart
 	local cdCounter = math.floor(cdDuration - diffTime)
@@ -21,6 +27,7 @@ addonData.UpdateCooldown = function(self,button,fontStructure)
 	button.cooldown:Show()
 end

+
 addonData.CreateCooldown = function(self,button,texturePath,fontStructure)
 	button.icon:SetAllPoints(button)
 	button.icon:SetTexture(texturePath)
diff --git a/XMage_Portals/XMage_Portals.lua b/XMage_Portals/XMage_Portals.lua
index e70ddee..0114df4 100644
--- a/XMage_Portals/XMage_Portals.lua
+++ b/XMage_Portals/XMage_Portals.lua
@@ -14,6 +14,18 @@ addonData.CreateFrames = function(self)
 	end
 end

+-- Update the Buttons with relevant changes
+addonData.UpdateButtons = function(self,frame)
+	for i = 1,#self.PortalButtons do
+		self:UpdateAlpha(self.PortalButtons[i])
+		self:UpdateCooldown(self.PortalButtons[i])
+	end
+	for i = 1,#self.TeleportButtons do
+		self:UpdateAlpha(self.TeleportButtons[i])
+		self:UpdateCooldown(self.TeleportButtons[i])
+	end
+end
+
 local function OnEvent(self,event,...)
 	local arg1,arg2,arg3,arg4,arg5 = ...
 	if ( event == "ADDON_LOADED" and arg1 == addonName ) then
diff --git a/XMage_Portals/XMage_Portals.toc b/XMage_Portals/XMage_Portals.toc
index 39f2c72..155ec0a 100644
--- a/XMage_Portals/XMage_Portals.toc
+++ b/XMage_Portals/XMage_Portals.toc
@@ -1,9 +1,9 @@
 ## Interface: 600000
 ## Title: XMage : [Portals]
 ## Title-esES: XMage : [Portals]
-## Author: Tina Kirby AKA Xrystal (c) 2010-2014  All Rights Reserved
-## Version: 6.0.2.19034
-## Notes: A Mage Portal/Teleport Frame that can be placed into a nUI infopanel |n|cffeda55fv6.0.2.19034|r.
+## Author: Tina Kirby AKA Xrystal (c) 2010-2016  All Rights Reserved
+## Version: 7.0.3.22293
+## Notes: A Mage Portal/Teleport Frame that can be placed into a nUI infopanel |n|cffeda55fv7.0.3.22293|r.
 ## RequiredDeps:
 ## OptionalDeps: nUI
 ## DefaultState: Enabled