PageRenderTime 28ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 1ms 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
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2--------------------------------------------------------------------
 3-- Mastery
 4----------------------------------------------------------------
 5
 6if not C["datatext"].mastery == nil or C["datatext"].mastery > 0 then
 7	local Stat = CreateFrame("Frame")
 8
 9	local Text  = TukuiInfoLeft:CreateFontString(nil, "OVERLAY")
10	Text:SetFont(C.media.pixelfont, C["datatext"].fontsize, "MONOCHROMEOUTLINE")
11	T.PP(C["datatext"].mastery, Text)
12
13	local int = 1
14	
15	local function Update(self, t)
16		int = int - t
17		if int < 0 then
18			Text:SetText("Mastery: "..T.datacolor..GetCombatRating(26))
19			int = 1
20		end
21	end
22
23	Stat:SetScript("OnUpdate", Update)
24	Update(Stat, 10)
25end