pfUI.addonskinner:RegisterSkin("TimeManager", function() local penv = pfUI:GetEnvironment() local StripTextures, CreateBackdrop, SkinButton, SkinTab, SkinCloseButton, SkinArrowButton, SkinDropDown, SkinCheckbox, SetAllPointsOffset, EnableMovable, hooksecurefunc, HookScript = penv.StripTextures, penv.CreateBackdrop, penv.SkinButton, penv.SkinTab, penv.SkinCloseButton, penv.SkinArrowButton, penv.SkinDropDown, penv.SkinCheckbox, penv.SetAllPointsOffset, penv.EnableMovable, penv.hooksecurefunc, penv.HookScript local noop = function() end local timemanager_onshow = function() UIDropDownMenu_SetWidth(60, TimeManagerAlarmHourDropDown, 50) UIDropDownMenu_SetWidth(60, TimeManagerAlarmMinuteDropDown, 50) UIDropDownMenu_SetWidth(65, TimeManagerAlarmAMPMDropDown, 50) end -- minimap StripTextures(TimeManagerClockButton) CreateBackdrop(TimeManagerClockButton, nil, nil, .8) TimeManagerClockButton.backdrop:SetPoint("TOPLEFT", 10, -5) TimeManagerClockButton.backdrop:SetPoint("BOTTOMRIGHT", -10, 5) TimeManagerClockButton:SetHitRectInsets(10, 10, 5, 5) -- main frame StripTextures(TimeManagerFrame, nil, "BORDER") TimeManagerGlobe:SetBlendMode("DISABLE") TimeManagerGlobe:SetVertexColor(0,0,0,1) CreateBackdrop(TimeManagerFrame, nil, nil, .75) EnableMovable(TimeManagerFrame) TimeManagerFrame.backdrop:SetPoint("TOPLEFT", 5, -3) TimeManagerFrame.backdrop:SetPoint("BOTTOMRIGHT", -45, 2) TimeManagerFrame:SetHitRectInsets(5, 45, 3, 2) SkinCloseButton(TimeManagerCloseButton, TimeManagerFrame.backdrop, -6, -6) SkinDropDown(TimeManagerAlarmHourDropDown) SkinDropDown(TimeManagerAlarmMinuteDropDown) TimeManagerAlarmHourDropDown:SetScale(.96) TimeManagerAlarmMinuteDropDown:SetScale(.96) SkinDropDown(TimeManagerAlarmAMPMDropDown) TimeManagerAlarmAMPMDropDown:SetScale(.8) TimeManagerAlarmAMPMDropDown_OnShow = noop TimeManagerAlarmAMPMDropDown_OnHide = noop TimeManagerAlarmTimeFrame:SetPoint("TOPLEFT", 20, -80) TimeManagerAlarmHourDropDown:SetPoint("TOPLEFT", TimeManagerAlarmTimeLabel, "BOTTOMLEFT", -14, -4) TimeManagerAlarmMessageFrame:SetPoint("TOPLEFT", TimeManagerAlarmTimeFrame, "BOTTOMLEFT", 0, -4) TimeManagerAlarmEnabledButton:SetPoint("TOPLEFT", TimeManagerAlarmMessageFrame, "BOTTOMLEFT", 2, -4) TimeManagerMilitaryTimeCheck:ClearAllPoints() TimeManagerMilitaryTimeCheck:SetPoint("TOPRIGHT", TimeManagerAlarmEnabledButton, "BOTTOMRIGHT", 2, -4) TimeManagerAlarmAMPMDropDown:ClearAllPoints() TimeManagerAlarmAMPMDropDown:SetPoint("LEFT", TimeManagerAlarmMessageLabel, "RIGHT", 0, 2) HookScript(TimeManagerFrame, "OnShow", timemanager_onshow) StripTextures(TimeManagerStopwatchFrame) CreateBackdrop(TimeManagerStopwatchFrame, nil, nil, .7) TimeManagerStopwatchFrame.backdrop:SetPoint("TOPLEFT", 15, -13) TimeManagerStopwatchFrame.backdrop:SetPoint("BOTTOMRIGHT", -15, 15) TimeManagerStopwatchCheck.icon = TimeManagerStopwatchCheck:CreateTexture(nil, "OVERLAY") TimeManagerStopwatchCheck.icon:SetAllPoints() TimeManagerStopwatchCheck.icon:SetTexture([[Interface\Icons\INV_Misc_PocketWatch_01]]) SkinButton(TimeManagerStopwatchCheck, nil, nil, nil, TimeManagerStopwatchCheck.icon) StripTextures(TimeManagerAlarmMessageEditBox, true, "BACKGROUND") CreateBackdrop(TimeManagerAlarmMessageEditBox, nil, true) TimeManagerAlarmMessageEditBox:SetPoint("TOPLEFT", TimeManagerAlarmMessageLabel, "BOTTOMLEFT", 2, -4) SkinButton(TimeManagerAlarmEnabledButton) TimeManagerAlarmEnabledButton:SetNormalTexture("") TimeManagerAlarmEnabledButton:SetPushedTexture(nil) TimeManagerAlarmEnabledButton.SetNormalTexture = function(self, tex) if string.find(tex, "Disabled") then TimeManagerAlarmEnabledButtonText:SetTextColor(.5, .5, .5) else TimeManagerAlarmEnabledButtonText:SetTextColor(1, 1, 1) end end TimeManagerAlarmEnabledButton.SetPushedTexture = noop SkinCheckbox(TimeManagerMilitaryTimeCheck,22) SkinCheckbox(TimeManagerLocalTimeCheck,22) -- stopwatch local stopwatch_onshow = function() if StopwatchFrame._shown then return end StopwatchPlayPauseButton.icon:SetTexCoord(.25, .75, .3, .75) StopwatchResetButton.icon:SetTexCoord(.25, .75, .3, .75) StopwatchFrame._shown = true end StripTextures(StopwatchFrame) CreateBackdrop(StopwatchFrame, nil, nil, .75) StopwatchFrame.backdrop:SetPoint("TOPLEFT", 10, -10) StopwatchFrame.backdrop:SetPoint("BOTTOMRIGHT", 4, 8) StopwatchFrame:SetHitRectInsets(10, -2, 10, 8) StripTextures(StopwatchTabFrame) SkinCloseButton(StopwatchCloseButton, StopwatchTabFrame, 2, 2) StopwatchCloseButton:SetWidth(10) StopwatchCloseButton:SetHeight(10) StopwatchPlayPauseButton.icon = StopwatchPlayPauseButton:CreateTexture(nil, "OVERLAY") StopwatchPlayPauseButton.icon:SetAllPoints() StopwatchPlayPauseButton.icon:SetTexture([[Interface\Buttons\UI-SpellbookIcon-NextPage-Up]]) StopwatchResetButton.icon = StopwatchResetButton:CreateTexture(nil, "OVERLAY") StopwatchResetButton.icon:SetAllPoints() StopwatchResetButton.icon:SetTexture([[Interface\AddOns\TimeManager\Textures\ResetButton]]) SkinButton(StopwatchPlayPauseButton, nil, nil, nil, StopwatchPlayPauseButton.icon) SkinButton(StopwatchResetButton, nil, nil, nil, StopwatchResetButton.icon) StopwatchResetButton:SetWidth(20) StopwatchResetButton:SetHeight(20) StopwatchResetButton:ClearAllPoints() StopwatchResetButton:SetPoint("RIGHT", StopwatchFrame.backdrop, "RIGHT", -2, 0) StopwatchPlayPauseButton:SetWidth(20) StopwatchPlayPauseButton:SetHeight(20) StopwatchPlayPauseButton:ClearAllPoints() StopwatchPlayPauseButton:SetPoint("RIGHT", StopwatchResetButton, "LEFT", -2, 0) StopwatchPlayPauseButton:SetNormalTexture("") StopwatchPlayPauseButton.SetNormalTexture = function(self, tex) self.icon:SetTexture(tex) end StopwatchTicker:ClearAllPoints() StopwatchTicker:SetPoint("RIGHT", StopwatchPlayPauseButton, "LEFT", -2, -2) HookScript(StopwatchFrame, "OnShow", stopwatch_onshow) pfUI.addonskinner:UnregisterSkin("TimeManager") end)