From 99ba6e98aa732721e4acf4757e6759e10216391c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kelly=20Crabbe=CC=81?= Date: Wed, 4 Dec 2013 09:51:35 +0100 Subject: [PATCH] =?UTF-8?q?fixed=20instancing.lua=20=E2=80=94=20works=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LookInTehCorner.toc | 2 +- instancing.lua | 68 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 27 deletions(-) mode change 100644 => 100755 LookInTehCorner.toc mode change 100644 => 100755 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 -- 1.7.9.5