WoWInterface SVN FuBaruClock

Compare Revisions

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

Rev 6 → Rev 7

FuBar_uClock/Lib Property changes : Added: svn:externals + LibStub svn://svn.wowace.com/wow/libstub/mainline/tags/1.0 AceLibrary svn://svn.wowace.com/wow/ace2/mainline/trunk/AceLibrary AceOO-2.0 svn://svn.wowace.com/wow/ace2/mainline/trunk/AceOO-2.0 AceEvent-2.0 svn://svn.wowace.com/wow/ace2/mainline/trunk/AceEvent-2.0 AceDB-2.0 svn://svn.wowace.com/wow/ace2/mainline/trunk/AceDB-2.0 AceAddon-2.0 svn://svn.wowace.com/wow/ace2/mainline/trunk/AceAddon-2.0 FuBarPlugin-2.0 svn://svn.wowace.com/wow/fubarplugin-2-0/mainline/trunk/FuBarPlugin-2.0 AceConfig-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0
FuBar_uClock/Core.lua
1,24 → 1,77
--[[ $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(date("%H:%M:%S"))
self:SetText(self:GetTimeString(date("%H"), date("%M")))
end
 
function uClock:OnTooltipUpdate()
GameTooltip:SetText(date("%A, %B %d, %Y"))
local hour, minute = GetGameTime()
 
GameTooltip:AddDoubleLine("Server Time", self:GetTimeString(hour, minute))
GameTooltip:AddDoubleLine("Today's Date", date("%A, %B %d, %Y"))
end
 
function uClock:OnClick()
ToggleTimeManager()
function uClock:OnClick(button)
if button == "LeftButton" then
if IsShiftKeyDown() then ToggleCalendar()
else ToggleTimeManager() end
elseif button == "RightButton" then
InterfaceOptionsFrame_OpenToCategory("FuBar uClock")
end
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,10 → 1,9
<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">
 
<Ui 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"/>
 
</Ui>
\ No newline at end of file + +
FuBar_uClock/FuBar_uClock.toc
1,13 → 1,13
## Interface: 20400
## Interface: 30000
## Title: FuBar - |cff00ff00u|cffffffffClock|r
## Notes: Minimalistic time/date display.
## Author: Ethan Centaurai
## Version: 1.0.wowi:revision
## Version: 2.0.wowi:revision
## X-Category: Miscellaneous
## X-eMail: ethan.centaurai@live.co.uk
## X-Donate: PayPal:ethan.centaurai@live.co.uk
## X-Embeds: Ace2, FuBarPlugin-2.0
## OptionalDeps: Ace2, FuBar
## X-Embeds: Ace3, FuBarPlugin-2.0
## OptionalDeps: Ace3, FuBar
## SavedVariables: uClockDB
embeds.xml
Core.lua