Quantcast

fixed instancing.lua — works now

Kelly Crabbé [12-04-13 - 08:51]
fixed instancing.lua — works now
Filename
LookInTehCorner.toc
instancing.lua
diff --git a/LookInTehCorner.toc b/LookInTehCorner.toc
old mode 100644
new mode 100755
index 925291b..927add0
--- a/LookInTehCorner.toc
+++ b/LookInTehCorner.toc
@@ -15,4 +15,4 @@ compass.lua
 coordinates.lua
 #tooltip.lua
 rightclick.lua
-#instancing.lua
\ No newline at end of file
+instancing.lua
\ No newline at end of file
diff --git a/instancing.lua b/instancing.lua
old mode 100644
new mode 100755
index 9ff4196..77fb94d
--- a/instancing.lua
+++ b/instancing.lua
@@ -11,34 +11,50 @@ idtext:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT", 0, -4)
 idtext:SetFont("Fonts\\FRIZQT__.ttf", 14, "THINOUTLINE")
 idtext:SetTextColor(color.r, color.g, color.b)

+local _, class = UnitClass("player")
+local color = RAID_CLASS_COLORS[class]
+local id = CreateFrame("Frame", nil, UIParent)
+id:SetPoint("TOP", Minimap, "TOP")
+id:RegisterEvent("PLAYER_ENTERING_WORLD")
+id:RegisterEvent("PLAYER_DIFFICULTY_CHANGED")
+
+local idtext = id:CreateFontString(nil, "OVERLAY")
+idtext:SetPoint("TOP", Minimap, "TOP", 0, -4)
+idtext:SetFont("Fonts\\FRIZQT__.ttf", 14, "THINOUTLINE")
+idtext:SetTextColor(color.r, color.g, color.b)
+
 function indiff()
-	local instance, instancetype = IsInInstance()
+	local inInstance, instancetype = IsInInstance()
 	local _, _, difficultyIndex, _, _, playerDifficulty, isDynamic = GetInstanceInfo()
-	if instance and instancetype == "raid" then
-		if isDynamic and difficultyIndex == 1 then
-			if playerDifficulty == 0 then
-				idtext:SetText("10") end
-			if playerDifficulty == 1 then
-				idtext:SetText("10H") end
-			end
-		if isDynamic and difficultyIndex == 2 then
-			if playerDifficulty == 0 then
-				idtext:SetText("25") end
-			if playerDifficulty == 1 then
-				idtext:SetText("25H") end
-			end
-		if not isDynamic then
-			if difficultyIndex == 1 then
-				idtext:SetText("10") end
-			if difficultyIndex == 2 then
-				idtext:SetText("25") end
-			if difficultyIndex == 3 then
-				idtext:SetText("10H") end
-			if difficultyIndex == 4 then
-				idtext:SetText("25H") end
-			end
+	if inInstance then
+		if difficultyIndex == 1 then
+			idtext:SetText("5")
+		elseif difficultyIndex == 2 then
+			idtext:SetText("5HC")
+		elseif difficultyIndex == 3 then
+			idtext:SetText("10")
+		elseif difficultyIndex == 4 then
+			idtext:SetText("25")
+		elseif difficultyIndex == 5 then
+			idtext:SetText("10HC")
+		elseif difficultyIndex == 6 then
+			idtext:SetText("25HC")
+		elseif difficultyIndex == 7 then
+			idtext:SetText("LFR")
+		elseif difficultyIndex == 8 then
+			idtext:SetText("CM")
+		elseif difficultyIndex == 9 then
+			idtext:SetText("40")
+		elseif difficultyIndex == 11 then
+			idtext:SetText("HScen")
+		elseif difficultyIndex == 12 then
+			idtext:SetText("Scen")
+		elseif difficultyIndex == 13 then
+			idtext:SetText("Flex")
 		end
-	if not instance then
-		idtext:SetText("") end
+	end
+	if not inInstance then
+		idtext:SetText("")
+	end
 end
 id:SetScript("OnEvent", function() indiff() end)
\ No newline at end of file