Updating mail/calendar invites
Hello. I made a small script so my minimap border turns red when I have pending invites, green when I have new mail, orange when both, and black when none of them.
Code:
local f=CreateFrame("Frame") |
Don't forget when you copy code to also copy the events. See the GameTimeFrame thread under General Authoring Discussion
Remember to add the event: UDATE_PENDING_MAIL What's this CreateBG function, I hope you're not creating a new texture above the previous every time the events fire. You could also do Code:
local inv = CalendarGetNumPendingInvites() |
Oops, forgot to paste some of the code here. I also have the following:
Code:
f:RegisterEvent("CALENDAR_UPDATE_PENDING_INVITES") |
Quote:
Are you using the default Minimap or a custom one, if the latter, which one? |
Quote:
CreateBG: Code:
function CreateBG(parent) I'm just wondering how to make it update instantly instead of on a reloadui. |
You shouldn't create new instances of those every time you call the function though, which I think was the point being made earlier:
lua Code:
Without really paying much attention to the above posts, that may fix your updating problem too, since I don't see why the code wouldn't be running. You might also consider putting some debugging output at key points to make sure the code is running when you expect it to. I don't really understand what bd is for either. |
I'm afraid this breaks most of the layout, so I can't do that. I'm not sure if it's an overlapping textures problem, or an updating problem, though.
|
Quote:
|
Quote:
|
Quote:
|
Without derailing on how to modify Alza's UI my suggestion is just stop using CreateGB.
As Akryn said you should only create a texture once, reference and reuse it, it's that simple and here's an example for you. Code:
local bg = Minimap:CreateTexture(nil, "BACKGROUND") |
That works. Thanks a lot. :)
This is what I made of it right now (quick cropping ftl), I made it looks like it's glowing. Left to right: 'nothing', mail, calendar invite, both. |
Nice, Haleth. :)
|
All times are GMT -6. The time now is 08:17 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI