WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   sStats Clock help (https://www.wowinterface.com/forums/showthread.php?t=32821)

Kendian 05-30-10 03:55 AM

sStats Clock help
 
Where exactly would I insert ("%a %b %dth, %I:%M %p") into http://www.wowinterface.com/download...ats_Clock.html, to get it to read that, instead of just the time, please? Ive tried multiple places, all wrong. =( The ,lua file is filled with helpful suggestions on how to do it my self, but I'm SOOO lost! Beg pardon for asking so many noob questions, I AM trying to learn, lol, so bear with me please >.<

Seerah 05-30-10 02:23 PM

You would use those codes to format your string, but you would need to use a different function than I'm using in sStats_clock. Instead of GameTime_GetTime(), you'd use date().

Note: for sStats, you need a prefix and a suffix (though, one of them could just be an empty string of ""). Decide if you want your formatted text to be colored like the prefix or colored like the suffix. Or, if you want it split in two. Here are a few examples, assuming you had prefix colored white and suffix colored light blue.



Default sStats_clock code:
Code:

local time, suffix = strsplit(" ", GameTime_GetTime(true))
Code:

sStats:SetModuleText(sStats_clockText, time, " "..suffix)


Changing those lines to the below, net the following results:

Code:

local time = date("%a %b %dth, %I:%M %p")
Code:

sStats:SetModuleText(sStats_clockText, time, "")
Displays: Sun May 30th, 08:07 PM


Code:

local time = date("%a %b %dth, %I:%M %p")
Code:

sStats:SetModuleText(sStats_clockText, "", time)
Displays: Sun May 30th, 08:07 PM


Code:

local day, time = date("%a %b %dth"), date("%I:%M %p")
Code:

sStats:SetModuleText(sStats_clockText, day.." ", time)
Displays: Sun May 30th 08:07 PM


/edit: the GameTime_GetTime() function allows sStats to accommodate whether the local time or server time are enabled in the clock options. I don't quite remember which date() will net you.

Kendian 05-30-10 08:27 PM

Foolish
 
That was PERFECT. Now I see it broke down like that, I feel pretty foolish for not being able to figure it out myself >.< My thanks, as always, for your help, lady~


All times are GMT -6. The time now is 06:15 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI