mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-22 12:10:48 +00:00
skins: integrate blizzard timemanager properly
This commit is contained in:
+13
-2
@@ -31,12 +31,23 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function()
|
|||||||
GameTooltip:AddDoubleLine(T["Localtime"], "|cffffffff" .. time)
|
GameTooltip:AddDoubleLine(T["Localtime"], "|cffffffff" .. time)
|
||||||
GameTooltip:AddDoubleLine(T["Servertime"], "|cffffffff".. servertime)
|
GameTooltip:AddDoubleLine(T["Servertime"], "|cffffffff".. servertime)
|
||||||
GameTooltip:AddLine(" ")
|
GameTooltip:AddLine(" ")
|
||||||
GameTooltip:AddDoubleLine(T["Left Click"], "|cffffffff" .. T["Show/Hide Timer"])
|
if TimeManagerFrame then
|
||||||
GameTooltip:AddDoubleLine(T["Right Click"], "|cffffffff" .. T["Reset Timer"])
|
GameTooltip:AddDoubleLine(T["Left Click"], "|cffffffff" .. T["Show/Hide TimeManager"])
|
||||||
|
else
|
||||||
|
GameTooltip:AddDoubleLine(T["Left Click"], "|cffffffff" .. T["Show/Hide Timer"])
|
||||||
|
GameTooltip:AddDoubleLine(T["Right Click"], "|cffffffff" .. T["Reset Timer"])
|
||||||
|
end
|
||||||
GameTooltip:Show()
|
GameTooltip:Show()
|
||||||
end
|
end
|
||||||
widget.Click = function()
|
widget.Click = function()
|
||||||
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||||
|
if TimeManagerFrame then
|
||||||
|
if TimeManagerClockButton.alarmFiring then
|
||||||
|
TimeManager_TurnOffAlarm()
|
||||||
|
end
|
||||||
|
ToggleTimeManager()
|
||||||
|
return
|
||||||
|
end
|
||||||
if arg1 == "LeftButton" then
|
if arg1 == "LeftButton" then
|
||||||
if widget.timerFrame:IsShown() then
|
if widget.timerFrame:IsShown() then
|
||||||
widget.timerFrame:Hide()
|
widget.timerFrame:Hide()
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ pfUI:RegisterSkin("Time Manager", "tbc", function ()
|
|||||||
StripTextures(TimeManagerFrame)
|
StripTextures(TimeManagerFrame)
|
||||||
CreateBackdrop(TimeManagerFrame, nil, nil, .75)
|
CreateBackdrop(TimeManagerFrame, nil, nil, .75)
|
||||||
CreateBackdropShadow(TimeManagerFrame)
|
CreateBackdropShadow(TimeManagerFrame)
|
||||||
|
TimeManagerClockButton:Hide()
|
||||||
|
TimeManagerClockButton.Show = function() return end
|
||||||
|
|
||||||
TimeManagerFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
|
TimeManagerFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
|
||||||
TimeManagerFrame.backdrop:SetPoint("BOTTOMRIGHT", -48, 1)
|
TimeManagerFrame.backdrop:SetPoint("BOTTOMRIGHT", -48, 1)
|
||||||
@@ -116,21 +118,5 @@ pfUI:RegisterSkin("Time Manager", "tbc", function ()
|
|||||||
StopwatchTicker:SetHeight(16)
|
StopwatchTicker:SetHeight(16)
|
||||||
StopwatchTicker:SetPoint("RIGHT", StopwatchPlayPauseButton, "LEFT", -2*border + 1, 0)
|
StopwatchTicker:SetPoint("RIGHT", StopwatchPlayPauseButton, "LEFT", -2*border + 1, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
hooksecurefunc("TimeManagerClockButton_UpdateTooltip", function()
|
|
||||||
GameTooltip:AddLine(" ")
|
|
||||||
GameTooltip:AddLine(TIMEMANAGER_TOOLTIP_TOGGLE_CLOCK_SETTINGS)
|
|
||||||
GameTooltip:Show()
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- needed insecure hook
|
|
||||||
function _G.TimeManagerClockButton_OnClick(self)
|
|
||||||
if self.alarmFiring then
|
|
||||||
PlaySound("igMainMenuQuit")
|
|
||||||
TimeManager_TurnOffAlarm()
|
|
||||||
else
|
|
||||||
ToggleTimeManager()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user