WoWInterface SVN FuBaruClock

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 7 to Rev 6
    Reverse comparison

Rev 7 → Rev 6

FuBar_uClock/Core.lua
1,77 → 1,24
--[[ $Id: Core.lua 4 2008-08-23 16:03:27Z DarkImakuni-16655 $ ]]--
 
uClock = AceLibrary("AceAddon-2.0"):new("AceDB-2.0", "AceEvent-2.0", "FuBarPlugin-2.0")
uClock.date = ("$Date: 2008-08-23 17:03:27 +0100 (Sat, 23 Aug 2008) $"):match("%d%d%d%d%-%d%d%-%d%d")
uClock.blizzardTooltip = true
uClock.cannotHideText = true
 
uClock:RegisterDB("uClockDB")
uClock:RegisterDefaults('profile', { twentyFour = true, showSeconds = false })
 
 
function uClock:OnEnable()
self:ScheduleRepeatingEvent(self.UpdateDisplay, 1, self)
 
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("uClock", {
name = "FuBar uClock",
desc = "Minimalistic date/time display",
get = function(k) return self.db.profile[k.arg] end,
set = function(k, v) self.db.profile[k.arg] = v end,
type = "group",
args = {
twentyFour = {
name = "24 Hour Mode",
type = "toggle", arg = "twentyFour", order = 1,
},
showSeconds = {
name = "Show Seconds",
type = "toggle", arg = "showSeconds", order = 2,
},
},
})
 
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("uClock", "FuBar uClock")
end
 
function uClock:OnTextUpdate()
self:SetText(self:GetTimeString(date("%H"), date("%M")))
self:SetText(date("%H:%M:%S"))
end
 
function uClock:OnTooltipUpdate()
local hour, minute = GetGameTime()
 
GameTooltip:AddDoubleLine("Server Time", self:GetTimeString(hour, minute))
GameTooltip:AddDoubleLine("Today's Date", date("%A, %B %d, %Y"))
GameTooltip:SetText(date("%A, %B %d, %Y"))
end
 
function uClock:OnClick(button)
if button == "LeftButton" then
if IsShiftKeyDown() then ToggleCalendar()
else ToggleTimeManager() end
elseif button == "RightButton" then
InterfaceOptionsFrame_OpenToCategory("FuBar uClock")
end
function uClock:OnClick()
ToggleTimeManager()
end
 
 
function uClock:GetTimeString(hour, minute)
local time, pm
 
if not self.db.profile.twentyFour then
pm = floor(hour / 12) == 1
hour = mod(hour, 12)
 
if hour == 0 then hour = 12 end
end
 
time = ("%d:%02d"):format(hour, minute)
 
if self.db.profile.showSeconds then
time = time..date(":%S")
end
 
if not self.db.profile.twentyFour then
time = time..(pm and " PM" or " AM")
end
 
return time
end
FuBar_uClock/embeds.xml
1,9 → 1,10
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
 
<Script file="Lib\AceLibrary\AceLibrary.lua"/>
<Script file="Lib\AceOO-2.0\AceOO-2.0.lua"/>
<Script file="Lib\AceEvent-2.0\AceEvent-2.0.lua"/>
<Script file="Lib\AceDB-2.0\AceDB-2.0.lua"/>
<Script file="Lib\AceAddon-2.0\AceAddon-2.0.lua"/>
<Script file="Lib\FuBarPlugin-2.0\FuBarPlugin-2.0.lua"/>
<Include file="Lib\AceConfig-3.0\AceConfig-3.0.xml"/>
</Ui>
 
</Ui>
\ No newline at end of file
FuBar_uClock/FuBar_uClock.toc
1,13 → 1,13
## Interface: 30000
## Interface: 20400
## Title: FuBar - |cff00ff00u|cffffffffClock|r
## Notes: Minimalistic time/date display.
## Author: Ethan Centaurai
## Version: 2.0.wowi:revision
## Version: 1.0.wowi:revision
## X-Category: Miscellaneous
## X-eMail: ethan.centaurai@live.co.uk
## X-Donate: PayPal:ethan.centaurai@live.co.uk
## X-Embeds: Ace3, FuBarPlugin-2.0
## OptionalDeps: Ace3, FuBar
## X-Embeds: Ace2, FuBarPlugin-2.0
## OptionalDeps: Ace2, FuBar
## SavedVariables: uClockDB
embeds.xml
Core.lua