Hooking TimeManagerClockButton
Is there a way for me to hook the TimeManagerClockButton and add some text to it? I'm trying to add the date aswell as the time with seconds.
Code:
date("%d/%m - %H:%M:%S") |
Code:
local addon = CreateFrame('Frame') |
Nothing happens so far. What am I misunderstanding?
Code:
---------------------------------- |
Well, you load the 'Blizzard_TimeManager at the beginning of your file, so there is no chance an ADDON_LOADED could fire for it after that code.
Either: 1. place your "addon"-part with the event-function before you call LoadAddOn() 2. remove the event-part and just hook the TimeManager_UpdateTimeTicker func 3. move all your code for the timeManager in the event-function and remove LoadAddOn(), so it gets called when the timeManager is loaded by Blizz. |
I tried all your suggestion, still nothing happens.
Suggestion 3: Code:
---------------------------------- |
I don't know anything about the timeManager-frame, so I can't say if the code is working correctly, apart from syntax errors. (but I trust p3lim on that one :) )
Does the code in the event-function is called at all? Please check with a print() inside of it - or report whether your clock-modifications are working. If not, maybe the timeManager-frame is already loaded, but then solution 2) should work. |
The clock modifications work fine with that code.
|
However the text is does not update :(
|
You need a different event to handle the text, as you are updating it based on the calendar invite events (which you clearly aint using).
The event is CALENDAR_UPDATE_PENDING_INVITES You can also see how I handled it in pMinimap: http://github.com/p3lim/pMinimap/blo...p.lua#L269-274 |
I've tried several different things, all returning errors.
Code:
---------------------------------- |
Well, you have a glaringly obvious syntax error that is almost certainly causing your error (an extra "end" at the end of your event handler) and your code formatting suffers from inconsistent indentation that makes it hard to read. Try this:
Code:
local addon = CreateFrame("Frame") Add this to your TOC: Code:
## LoadOnDemand: 1 Code:
TimeManagerClockButton:SetPoint("BOTTOM", Minimap, 0, 16) |
Actually the code works, it was just a copy from a small part of bMinimap which I use.
What returns an error however is the part that's commented out where I have attempted to do what I want. It seems what I want somehow got lost in this thread so I'll explain again. I use bMinimap as stated above and I want to add to the Time part of the code so that the clock displays SetText(date('%d/%m - %H:%M:%S')) instead of simply the normal clock and to achieve that I need to constantly update the clock with that text somehow. |
There appears to be two fontstrings that are being updated, TimeManagerFrameTicker and TimeManagerClockTicker.
TimeManagerFrameTicker is the time that appears over the globe in the clock settings frame, opened by clicking the clock display. TimeManagerClockTicker is the time in the clock display on the minimap. TimeManager_UpdateTimeTicker() and TimeManagerClockButton_Update() update these respectively. lua Code:
|
All times are GMT -6. The time now is 06:20 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI