mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +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["Servertime"], "|cffffffff".. servertime)
|
||||
GameTooltip:AddLine(" ")
|
||||
GameTooltip:AddDoubleLine(T["Left Click"], "|cffffffff" .. T["Show/Hide Timer"])
|
||||
GameTooltip:AddDoubleLine(T["Right Click"], "|cffffffff" .. T["Reset Timer"])
|
||||
if TimeManagerFrame then
|
||||
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()
|
||||
end
|
||||
widget.Click = function()
|
||||
this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||
if TimeManagerFrame then
|
||||
if TimeManagerClockButton.alarmFiring then
|
||||
TimeManager_TurnOffAlarm()
|
||||
end
|
||||
ToggleTimeManager()
|
||||
return
|
||||
end
|
||||
if arg1 == "LeftButton" then
|
||||
if widget.timerFrame:IsShown() then
|
||||
widget.timerFrame:Hide()
|
||||
|
||||
@@ -7,6 +7,8 @@ pfUI:RegisterSkin("Time Manager", "tbc", function ()
|
||||
StripTextures(TimeManagerFrame)
|
||||
CreateBackdrop(TimeManagerFrame, nil, nil, .75)
|
||||
CreateBackdropShadow(TimeManagerFrame)
|
||||
TimeManagerClockButton:Hide()
|
||||
TimeManagerClockButton.Show = function() return end
|
||||
|
||||
TimeManagerFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
|
||||
TimeManagerFrame.backdrop:SetPoint("BOTTOMRIGHT", -48, 1)
|
||||
@@ -116,21 +118,5 @@ pfUI:RegisterSkin("Time Manager", "tbc", function ()
|
||||
StopwatchTicker:SetHeight(16)
|
||||
StopwatchTicker:SetPoint("RIGHT", StopwatchPlayPauseButton, "LEFT", -2*border + 1, 0)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user