Thread Tools Display Modes
07-11-10, 02:18 AM   #1
Blia
A Fallenroot Satyr
Join Date: Jul 2010
Posts: 28
Question Target's Portrait

Hello.

I am trying to add the Target's Portrait inside my addon.
To do this, I borrowed the code from InspectFrame.

It almost works but I get an error related to "self".

I am very new to addon development I am completely lost.
If someone could help me, I would appreciate a lot.


**removed**

See you.

Last edited by Seerah : 07-11-10 at 10:59 AM. Reason: removed link to off-site download -Seerah
  Reply With Quote
07-11-10, 02:59 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
This looks more like a try to advertise a spamsite.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
07-11-10, 03:51 AM   #3
Blia
A Fallenroot Satyr
Join Date: Jul 2010
Posts: 28
Please don't say it's a spam when it's not..

2shared is just a file hosting website like rapidshare and so..
By the way, here is the rapidshare link .. since you seem to dislike 2shared.. **removed**

Here is the code of this addon :
TOC : http://pastebin.com/cjSwwN8X
XML : http://pastebin.com/UTtSiJNk
TestPortrait.lua : http://pastebin.com/Qp3WdwBT
Test.Lua : http://pastebin.com/6nHaMdgc


Thank you.

Last edited by Seerah : 07-11-10 at 11:00 AM. Reason: removed link to off-site download -Seerah
  Reply With Quote
07-11-10, 06:15 AM   #4
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Following your first link I was not able to find a download with all the blinking spam.

Looking at your code you call your scriptfiles at least twice.
Once in the toc and once it the xml ... you should remove one call.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
07-11-10, 06:16 AM   #5
mankeluvsit
An Onyxian Warder
 
mankeluvsit's Avatar
Join Date: Sep 2008
Posts: 354
you're not allowed to post offsite links.
so on that note no one will help you.
  Reply With Quote
07-11-10, 06:23 AM   #6
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
For your 3 "self" errors ... search the three calls of the functions that
throw the error in testPortrait.lua ... all three are called from your xml without
the self argument.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
07-11-10, 10:22 AM   #7
Blia
A Fallenroot Satyr
Join Date: Jul 2010
Posts: 28
Originally Posted by Rilgamon View Post
Following your first link I was not able to find a download with all the blinking spam.
I am really sorry for that. All my appologizes.

Originally Posted by Rilgamon View Post
Looking at your code you call your scriptfiles at least twice.
Once in the toc and once it the xml ... you should remove one call.
Thanks for the hints Rilgamon, I'll remove one of them.

Originally Posted by mankeluvsit View Post
you're not allowed to post offsite links.
so on that note no one will help you.
Oh, sorry, sorry. I didn't know.
So now, nobody's going to help me ? Even though I added codes on pastebin..

Originally Posted by Rilgamon View Post
For your 3 "self" errors ... search the three calls of the functions that
throw the error in testPortrait.lua ... all three are called from your xml without
the self argument.
Thank you a lot, Rilgamo, you're very helpful.
  Reply With Quote
07-11-10, 11:02 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Blia View Post
Oh, sorry, sorry. I didn't know.
So now, nobody's going to help me ? Even though I added codes on pastebin..
pastebin links are fine. But we cannot vouch for the security of downloads from external sites, hence the rule.

/edit: pastebin (or similar) links are actually great - because then we can see line numbers and someone else can put up a reply to your code.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-11-10, 11:30 AM   #9
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Originally Posted by Blia View Post
Oh, sorry, sorry. I didn't know.
So now, nobody's going to help me ? Even though I added codes on pastebin..
We're here to help where we can ... but following links to uncertain destination
is dangerous these days. It's not your fault that the net is like it is
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
07-11-10, 11:44 AM   #10
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Seerah View Post
pastebin links are fine. But we cannot vouch for the security of downloads from external sites, hence the rule.

/edit: pastebin (or similar) links are actually great - because then we can see line numbers and someone else can put up a reply to your code.
Similar post layouts can be done here as well if you use the [highlight=lua] wrapper around your code.

Example:
lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetScript("OnEvent", function(self, event, ...) if f[event] then return f[event](self, event, ...) end end)
  3. f:RegisterEvent("ADDON_LOADED")
  4. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  5. f:RegisterEvent("UNIT_EXITED_VEHICLE")
  6. f:RegisterEvent("PLAYER_TALENT_CHANGED")
  7. f:Show()
  Reply With Quote
07-11-10, 03:16 PM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
This is true, but if you're code is lengthy (or contains long lines), then pastebin or pastey is still better.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Target's Portrait

Thread Tools
Display Modes

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