PageRenderTime 12ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/addonskins/balancepower.lua

http://github.com/Asphyxia/Tukui
Lua | 42 lines | 37 code | 2 blank | 3 comment | 3 complexity | 0249623eed12141d7f6066d877a69b32 MD5 | raw file
  1. local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
  2. ------------------------------------------------------------------------
  3. -- Balance Power Panel [EPICGRIM]
  4. ------------------------------------------------------------------------
  5. if IsAddOnLoaded("BalancePowerTracker") then
  6. if (T.myclass == "DRUID") then
  7. local eclipseBar = CreateFrame("Frame", "EclipseBar", UIParent)
  8. eclipseBar:CreatePanel(nil, 1, 1, "CENTER", BalancePowerTrackerBackgroundFrame, "CENTER", 0, 0)
  9. eclipseBar:ClearAllPoints()
  10. eclipseBar:Point("TOPLEFT", BalancePowerTrackerBackgroundFrame, "TOPLEFT", 0, 0)
  11. eclipseBar:Point("BOTTOMRIGHT", BalancePowerTrackerBackgroundFrame, "BOTTOMRIGHT", 0, 0)
  12. eclipseBar:CreateShadow("Default")
  13. local eclipseBarfunc = CreateFrame("Frame")
  14. eclipseBarfunc:RegisterEvent("PLAYER_ENTERING_WORLD")
  15. eclipseBarfunc:RegisterEvent("UNIT_AURA")
  16. eclipseBarfunc:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
  17. eclipseBarfunc:RegisterEvent("PLAYER_TALENT_UPDATE")
  18. eclipseBarfunc:RegisterEvent("UNIT_TARGET")
  19. eclipseBarfunc:SetScript("OnEvent", function(self)
  20. local activeTalent = GetPrimaryTalentTree()
  21. local shift = GetShapeshiftForm()
  22. local grace = select(7, UnitAura("player", "Nature's Grace", nil, "HELPFUL"))
  23. if grace then
  24. eclipseBar:SetBackdropBorderColor(205, 25, 0, 1)
  25. else
  26. eclipseBar:SetBackdropBorderColor(unpack(C["media"].bordercolor))
  27. end
  28. if activeTalent == 1 then
  29. if shift == 1 or shift == 2 or shift == 3 or shift == 4 or shift == 6 then
  30. eclipseBar:Hide()
  31. else
  32. eclipseBar:Show()
  33. end
  34. else
  35. eclipseBar:Hide()
  36. end
  37. end)
  38. end
  39. end