PageRenderTime 6ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Tukui/modules/datatext/mastery.lua

http://github.com/Asphyxia/Tukui
Lua | 25 lines | 17 code | 5 blank | 3 comment | 3 complexity | 9bab8df04891f923d71f7802ccdbf9f5 MD5 | raw file
  1. local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
  2. --------------------------------------------------------------------
  3. -- Mastery
  4. ----------------------------------------------------------------
  5. if not C["datatext"].mastery == nil or C["datatext"].mastery > 0 then
  6. local Stat = CreateFrame("Frame")
  7. local Text = TukuiInfoLeft:CreateFontString(nil, "OVERLAY")
  8. Text:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
  9. T.PP(C["datatext"].mastery, Text)
  10. local int = 1
  11. local function Update(self, t)
  12. int = int - t
  13. if int < 0 then
  14. Text:SetText("Mastery: "..T.datacolor..GetCombatRating(26))
  15. int = 1
  16. end
  17. end
  18. Stat:SetScript("OnUpdate", Update)
  19. Update(Stat, 10)
  20. end