/Tukui/modules/datatext/regen.lua
http://github.com/Asphyxia/Tukui · Lua · 31 lines · 25 code · 6 blank · 0 comment · 3 complexity · ed38e443deba363995fc6e233fd27485 MD5 · raw file
- local T, C, L = unpack(select(2, ...))
- if not C["datatext"].regen and not C["datatext"].regen > 0 then return end
- local regen
- local Stat = CreateFrame("Frame")
- Stat:SetFrameStrata("HIGH")
- Stat:SetFrameLevel(3)
- local Text = TukuiInfoLeft:CreateFontString(nil, "OVERLAY")
- Text:SetFont(C["media"].pixelfont, C["datatext"].fontsize)
- Text:SetShadowColor(0, 0, 0)
- Text:SetShadowOffset(1.25, -1.25)
- T.PP(C["datatext"].regen, Text)
- Stat:RegisterEvent("PLAYER_ENTERING_WORLD")
- Stat:RegisterEvent("PLAYER_REGEN_DISABLED")
- Stat:RegisterEvent("PLAYER_REGEN_ENABLED")
- Stat:RegisterEvent("UNIT_STATS")
- Stat:RegisterEvent("UNIT_AURA")
- Stat:SetScript("OnEvent", function(self)
- local base, casting = GetManaRegen()
- if InCombatLockdown() then
- regen = floor(casting*5)
- else
- regen = floor(base*5)
- end
-
- Text:SetText(MANA_REGEN_ABBR.." "..T.datacolor..regen)
- end)