Thread Tools Display Modes
05-26-09, 09:37 AM   #1
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Plugin bar doesn't show up

Hello everybody,

I'm writing a plugin to watch shaman's totem as a bar.
So I watched at Blizzard's code for TotemFrame and p3lim's oUF_RuneBar plugin which inspirated me.

Here's the code I have


When I login or I call a totem none of my bars shows up. I don't have any error that happen.
I'm tried to print to ChatFrame1 in my UpdateSlot and Update functions but they didn't print anything.

So I'm asking you if you can help me finding where the error comes from and if possible how to resolve it.
__________________
  Reply With Quote
05-26-09, 12:14 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Your scoping is messed up. You define the functions as the following:
1. Enable
2. Disable
3. Event
4. UpdateSlot
5. Update
6. OnUpdate

While the functions tries to use them before they are defined:
Enable: Tries to use Event, which is defined as a local variable below and is nil for it.
Disable: Same as Enable.
Event: Tries to use Update and UpdateSlot, which both are defined below and are nil for it.
UpdateSlot: Tries to use OnUpdate, which is defined below and is nil for it.

Another note is that oUF will call the element update function on PLAYER_ENTERING_WORLD, so you don't need to register it.

That's the issues I can see at first .
  Reply With Quote
05-27-09, 05:12 AM   #3
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Thanks I didn't think of that.

I'll try to see if it works.

Edit:

I reorganised the code and modified few things but I can get nothing working.

The new code
__________________

Last edited by Soeters : 05-27-09 at 07:44 AM. Reason: Test made
  Reply With Quote
05-30-09, 02:44 AM   #4
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
No one knows what the problem could be ?
__________________
  Reply With Quote
05-31-09, 06:36 AM   #5
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You should post the code you use in your layout also. I know most people are quite busy during these months due to exams and so on. There are also those of us who are lazy and should focus on other things .

The more information you provide the easier it is to help
  Reply With Quote
06-01-09, 09:06 AM   #6
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Here's the code I use

Link
__________________
  Reply With Quote
06-02-09, 09:35 AM   #7
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
It works here, are you sure the plug-in is loaded after your layout?
  Reply With Quote
06-02-09, 10:20 AM   #8
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Well I checked and it worked but I'm having few issues I don't understand but I'll fix them later.
__________________
  Reply With Quote
06-02-09, 10:28 AM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Just don't edit your post when you bump the thread . I don't get e-mail pings and the thread shows up as read until a new reply is made.
  Reply With Quote
06-03-09, 05:45 AM   #10
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Ok so I finally have a new issue I can't resolve.

When I login, all the bars are white. But the problem is that they should have their color set on login because there are no conditions for coloring.
Everytime I call a totem the color is good and stay until I disconnect/reload UI.

I think the problem comes from the initial update and that the UpdateSlot isn't called well.

Here are the code: core, implementation in my layout
__________________
  Reply With Quote
06-03-09, 07:59 AM   #11
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Your enable function doesn't return true when it successfully enables the element on a frame, so oUF never runs the initial update function.
  Reply With Quote
06-03-09, 08:48 AM   #12
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Thanks that's perfect now.
__________________
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Plugin bar doesn't show up


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off