mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
mirrortimers: make them movable
unlock: only substring frame name if starts with pf
This commit is contained in:
committed by
Shagu
parent
ecbccbaeda
commit
4acef543b4
@@ -5,8 +5,13 @@ pfUI:RegisterModule("mirrortimers", function ()
|
||||
local text = _G["MirrorTimer"..i.."Text"]
|
||||
local border = _G["MirrorTimer"..i.."Border"]
|
||||
|
||||
text:Hide()
|
||||
border:Hide()
|
||||
|
||||
mirrorTimer:GetRegions():Hide()
|
||||
mirrorTimer.label = text
|
||||
mirrorTimer.scale = 1
|
||||
mirrorTimer.value = 0
|
||||
|
||||
statusBar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
statusBar:SetWidth(222)
|
||||
@@ -14,8 +19,15 @@ pfUI:RegisterModule("mirrortimers", function ()
|
||||
statusBar:SetPoint("TOP", 0, 0)
|
||||
CreateBackdrop(statusBar)
|
||||
|
||||
text:Hide()
|
||||
border:Hide()
|
||||
mirrorTimer:SetWidth(statusBar:GetWidth())
|
||||
mirrorTimer:SetHeight(statusBar:GetHeight())
|
||||
|
||||
if (i ~= 1) then
|
||||
mirrorTimer:ClearAllPoints()
|
||||
mirrorTimer:SetPoint("CENTER", _G["MirrorTimer"..(i-1)], "CENTER", 0, -26)
|
||||
end
|
||||
|
||||
UpdateMovable(mirrorTimer)
|
||||
|
||||
local TimerText = mirrorTimer:CreateFontString(nil, "OVERLAY")
|
||||
TimerText:SetFont(pfUI.font_default, 12, "OUTLINE")
|
||||
@@ -24,11 +36,17 @@ pfUI:RegisterModule("mirrortimers", function ()
|
||||
|
||||
hooksecurefunc("MirrorTimerFrame_OnUpdate", function(frame, elapsed)
|
||||
if frame.paused then return end
|
||||
if not frame.value then return end
|
||||
if not frame.scale then return end
|
||||
|
||||
local minutes = frame.value / 60
|
||||
local seconds = frame.value - math.floor(frame.value / 60) * 60
|
||||
local text = frame.label:GetText()
|
||||
|
||||
if not text then return end
|
||||
|
||||
if not frame:IsShown() then frame:Show() end
|
||||
|
||||
if frame.value > 0 then
|
||||
frame.TimerText:SetText(format("%s (%d:%02d)", text, minutes, seconds))
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user