WoWInterface SVN sStats_Clock

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

trunk/sStats_Clock/clock.lua New file
0,0 → 1,45
--variables and upvalues
local count = 0
 
------------------------------
-- HOW TO CREATE A MODULE --
------------------------------
 
-- First, create your module. Pass in a key identifier for your module (ex. "clock").
-- Your key identifier should be UNIQUE to your module, and not the same as another module's.
-- This function will return references to your module's frame and fontstring.
-- USAGE: sStats:CreateModule(key)
-- key = a unique identifier/name of your module - a "string"
 
local sStats_clock, sStats_clockText = sStats:CreateModule("clock")
 
-------------------------------------------------------
-- Next, register for a callback to know when your module is ready to be used.
-- When this event fires, the module's fontstring is ready for text, the variables are
-- loaded and can be read, and the options tables are created and you can add to them.
-- USAGE: sStats.RegisterCallback(module, event, method)
-- module = the module registering for the callback
-- event = the event fired by sStats - it is called "sStats_Modules_Ready"
-- method = the function to call when the event fires (may be declared elsewhere in your
-- module's code or right in the RegisterCallback script)
 
sStats.RegisterCallback(sStats_clock, "sStats_Modules_Ready", function()
----------------------------------------------------------
sStats_clock:SetScript("OnUpdate", function(self, elapsed)
count = count + elapsed
if count >= 1 then
local time, suffix = strsplit(" ", GameTime_GetTime(true))
 
---------------------------------------------------------------------------
-- To set the text of your module, this optional function exists to ensure that
-- modules use the same format and colors set in the options.
-- If desired, you may just use module:SetText() instead, on your own.
 
sStats:SetModuleText(sStats_clockText, time, " "..suffix)
---------------------------------------------------------------------------
 
count = 0
end
end)
 
end)
\ No newline at end of file
trunk/sStats_Clock/sStats_Clock.toc New file
0,0 → 1,8
## Interface: 30200
## Title: sStats_Clock
## Author: Seerah
## Notes: A clock module for sStats
## Version: 1.0
## Dependencies: sStats
 
clock.lua
\ No newline at end of file