local font = [=[Fonts\ARIALN.ttf]=]
local hour, minute
local frame = CreateFrame("Frame", nil, UIParent)
frame:Width(150)
frame:Height(45)
frame:SetTemplate()
frame:Point("TOP", UIParent, "TOP", 0, -5)
frame:SetFrameStrata("BACKGROUND")
frame:FontString(nil, font, 12, "OUTLINE")
frame.text:SetText("Dungeon Reset Time")
frame.text:SetPoint("TOP", frame, "TOP", 0, -5)
frame.startbutton = CreateFrame("Button", nil, frame)
frame.startbutton:Width(65)
frame.startbutton:Height(15)
frame.startbutton:SetTemplate()
frame.startbutton:Point("BOTTOMLEFT", frame, "BOTTOMLEFT", 5, 5)
frame.startbutton:EnableMouse(true)
frame.startbutton:RegisterForClicks("AnyUp")
frame.startbutton:HighlightButton()
frame.startbutton:FontString(nil, font, 12, "OUTLINE")
frame.startbutton.text:SetText("Start!")
frame.startbutton.text:SetPoint("CENTER")
frame.startbutton.text:SetTextColor(.03, .87, .99)
frame.timebutton = CreateFrame("Button", nil, frame)
frame.timebutton:Width(65)
frame.timebutton:Height(15)
frame.timebutton:SetTemplate()
frame.timebutton:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -5, 5)
frame.timebutton:EnableMouse(true)
frame.timebutton:RegisterForClicks("AnyUp")
frame.timebutton:HighlightButton()
frame.timebutton:Disable()
frame.timebutton:FontString(nil, font, 12, "OUTLINE")
frame.timebutton.text:SetPoint("CENTER")
frame.timebutton.text:SetTextColor(.03, .87, .99)
frame.startbutton:HookScript("OnMouseDown", function(self)
hour, minutes = tonumber(date("%H")), tonumber(date("%M"))
if minutes > 10 then
frame.timebutton.text:SetText(1+hour..":"..minutes)
elseif minutes < 10 then
frame.timebutton.text:SetText(1+hour..":".."0"..minutes)
end
self:Disable()
frame.timebutton:Enable()
end)
frame.timebutton:HookScript("OnMouseDown", function(self)
frame.timebutton.text:SetText(" ")
self:Disable()
frame.startbutton:Enable()
end