Add support for primalist calling.

Mere [10-12-15 - 17:06]
Add support for primalist calling.

Includes upgrading existing layouts to not filter out primalist.
Filename
Colours.lua
ConfigUI_Layouts.lua
HealingBar.lua
HealingPanel.lua
HealingPanelLayout.lua
RaidManagement.lua
RiftAddon.toc
SavedVariables.lua
diff --git a/Colours.lua b/Colours.lua
index bce7aee..2083751 100644
--- a/Colours.lua
+++ b/Colours.lua
@@ -140,6 +140,9 @@ MereHealingFrames.DefaultColours = {
     PowerBarTextShadow = {
         r = 0, g = 0, b = 0, a = 1
     },
+	PrimalistColour = {
+		r = 74/255, g = 212/255, b = 250/255, a = 1
+	},

 }

diff --git a/ConfigUI_Layouts.lua b/ConfigUI_Layouts.lua
index ee5858a..4e3b7e1 100644
--- a/ConfigUI_Layouts.lua
+++ b/ConfigUI_Layouts.lua
@@ -654,6 +654,7 @@ local callingFilterMappings = {
 	mage = "Mage",
 	rogue = "Rogue",
 	warrior = "Warrior",
+	primalist = "Primalist"
 	}

 local groupingFilterMappings = {
diff --git a/HealingBar.lua b/HealingBar.lua
index 53857a3..d3eea22 100644
--- a/HealingBar.lua
+++ b/HealingBar.lua
@@ -377,6 +377,8 @@ function MereHealingFrames.HealingBar:UpdateHealthBarColour()
 				barColour = "ClericColour"
 			elseif callingName == "rogue" then
 				barColour = "RogueColour"
+			elseif callingName == "primalist" then
+				barColour = "PrimalistColour"
 			end
         end
         self:ChangeColourSource(barColour)
diff --git a/HealingPanel.lua b/HealingPanel.lua
index ab38774..acbf158 100644
--- a/HealingPanel.lua
+++ b/HealingPanel.lua
@@ -279,6 +279,11 @@ function MereHealingFrames.HealingPanel:Calling()
 			self.ResourceHeight = 0
             self.ResourceBar:UpdateEvents(nil, nil)
 		end
+	elseif (playerInfo.calling == "primalist") then
+	-- TODO: do primalist have anything useful in other bars?
+		self.ResourceBar:SetVisible(false)
+		self.ResourceHeight = 0
+		self.ResourceBar:UpdateEvents(nil, nil)
 	else
 		error("Unknown calling: " .. playerInfo.calling)
 	end
@@ -303,6 +308,8 @@ function MereHealingFrames.HealingPanel:Name()
             self.NameLabel:SetTextColourName("MageColour")
 		elseif playerInfo.calling == "rogue" then
             self.NameLabel:SetTextColourName("RogueColour")
+		elseif playerInfo.calling == "primalist" then
+            self.NameLabel:SetTextColourName("PrimalistColour")
 		end
 	else
         self.NameLabel:SetTextColourName("UnknownColour")
diff --git a/HealingPanelLayout.lua b/HealingPanelLayout.lua
index 491e833..f98751b 100644
--- a/HealingPanelLayout.lua
+++ b/HealingPanelLayout.lua
@@ -710,7 +710,8 @@ local ValidCallingFilters = {
 	mage = true,
 	cleric = true,
 	warrior = true,
-	rogue = true
+	rogue = true,
+	primalist = true
 	}

 local ValidGroupingFilters = {
diff --git a/RaidManagement.lua b/RaidManagement.lua
index b915fdb..27fed35 100644
--- a/RaidManagement.lua
+++ b/RaidManagement.lua
@@ -432,6 +432,7 @@ local fakeCallings =
 	"warrior",
 	"mage",
 	"cleric",
+	"primalist"
 }

 local fakeRoles =
@@ -505,7 +506,7 @@ function MereHealingFrames.RaidManagement.AddFakes(howManyFakes, realms, tanks,

 			local fakeUnitId = "fake" .. i

-			MereHealingFrames.Debug(2,"Creating fake unit %s, as spec %s", fakeUnitId, groupName)
+			MereHealingFrames.Debug(2,"Creating fake unit %s, as spec %s, calling %s", fakeUnitId, groupName, calling)
 			local fakePlayerInfo = {
 				isFake = true
 				}
diff --git a/RiftAddon.toc b/RiftAddon.toc
index 4d08b7c..bd19632 100644
--- a/RiftAddon.toc
+++ b/RiftAddon.toc
@@ -7,9 +7,9 @@ Name = "Mere Healing Frames"
 NameShort = "MHF"
 Description = "A set of healing frames"
 Author = "Mere"
-Version = "0.4.37"
+Version = "0.4.38"
 Email = "rift@dokein.co.uk"
-Environment = "2.3"
+Environment = "3.4"

 RunOnStartup = {
 	"Debug.lua",
diff --git a/SavedVariables.lua b/SavedVariables.lua
index 31e9250..0718ec2 100644
--- a/SavedVariables.lua
+++ b/SavedVariables.lua
@@ -9,12 +9,34 @@ MereHealingFrames.SavedVars = {}
 local SavedVarsSchemaVersions = {
 	colours = 1,
 	spells = 1,
-	layouts = 1,
+	layouts = 2,
 	raidSave = 1,
 	buffs = 1,
 	}

-local SavedVarsSchemaConversions = {}
+function ConvertLayouts(olderVersion, currentVersion)
+	if (olderVersion == 1) then
+		print("Updating saved layouts from version 1 to 2, this will add primalist to existing layouts where all callings were previously set")
+		for layoutName, layout in pairs(MHF_Layouts) do
+			if layout.CallingFilter ~= nil then
+				local callingCount = 0
+				for calling, setting in pairs(layout.CallingFilter) do
+					if setting then
+						callingCount = callingCount + 1
+					end
+				end
+				if callingCount == 4 then
+					layout.CallingFilter["primalist"] = true
+					print(string.format("Updated layout %s to include primalist", layoutName))
+				end
+			end
+		end
+	end
+end
+
+local SavedVarsSchemaConversions = {
+	layouts = ConvertLayouts
+}

 function MereHealingFrames.SavedVars.Load(handle, addonIdentifier)
 	MereHealingFrames.Events.BumpEventCounter("Event.Addon.SavedVariables.Load.End")