Thread Tools Display Modes
05-18-06, 07:14 AM   #1
Dimanoid
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 4
How to catch a click on chatframe (on the nicknames)?

I need to get the nickname from a chatframe which was clicked (or alt-clicked for example) or add one more option to the popup menu when you right-click nickname. Any ideas how to do that?
  Reply With Quote
05-19-06, 10:58 AM   #2
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
The menu you are refering to is the UnitPopup dropdown menu which is defined in UnitPopup.lua

There are 6 different "unit" menus that are dealt with in that file, the one that is used when you right-click a name on the chat window is the "FRIEND" menu. If you take a close look at that file and get an understanding of how the menu works, you should be able to add an option to it.
  Reply With Quote
05-22-06, 03:12 AM   #3
Dimanoid
A Murloc Raider
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 4
Thanks a lot! With your help I did what I wanted.

PS. Its really simple when you know where to search.
  Reply With Quote
05-29-06, 09:22 AM   #4
Selice
A Defias Bandit
Join Date: May 2006
Posts: 3
Which UnitPopUp.lua contains the menu, you are talking of?

I extracted Interface\FrameXML\UnitPopup.lua out of interface.MPQ and it contains the following menus:

Code:
UnitPopupMenus = { };
UnitPopupMenus["SELF"] = { "FREE_FOR_ALL", "ROUND_ROBIN", "MASTER_LOOTER", "GROUP_LOOT", "NEED_BEFORE_GREED", "LOOT_THRESHOLD", "LOOT_PROMOTE", "LEAVE", "CANCEL" };
UnitPopupMenus["PET"] = { "PET_PAPERDOLL", "PET_ABANDON", "CANCEL" };
UnitPopupMenus["PET_RENAME"] = { "PET_PAPERDOLL", "PET_RENAME", "PET_ABANDON", "CANCEL" };
UnitPopupMenus["PET_NOABANDON"] = { "PET_DISMISS", "CANCEL" };
UnitPopupMenus["PARTY"] = { "PROMOTE", "LOOT_PROMOTE", "UNINVITE", "INSPECT", "TRADE", "FOLLOW", "DUEL", "CANCEL" };
UnitPopupMenus["PLAYER"] = { "INSPECT", "INVITE", "TRADE", "FOLLOW", "DUEL", "CANCEL" };
UnitPopupMenus["RAID"] = { "RAID_LEADER", "RAID_PROMOTE", "RAID_DEMOTE", "LOOT_PROMOTE", "RAID_REMOVE", "CANCEL" };
There is no FRIEND menu.

EDIT: I found it. It is in patch.MPQ, not in interface.MPQ.

Last edited by Selice : 05-29-06 at 09:29 AM.
  Reply With Quote
05-29-06, 03:19 PM   #5
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
Originally Posted by Selice
Which UnitPopUp.lua contains the menu, you are talking of?

I extracted Interface\FrameXML\UnitPopup.lua out of interface.MPQ and it contains the following menus:

Code:
UnitPopupMenus = { };
UnitPopupMenus["SELF"] = { "FREE_FOR_ALL", "ROUND_ROBIN", "MASTER_LOOTER", "GROUP_LOOT", "NEED_BEFORE_GREED", "LOOT_THRESHOLD", "LOOT_PROMOTE", "LEAVE", "CANCEL" };
UnitPopupMenus["PET"] = { "PET_PAPERDOLL", "PET_ABANDON", "CANCEL" };
UnitPopupMenus["PET_RENAME"] = { "PET_PAPERDOLL", "PET_RENAME", "PET_ABANDON", "CANCEL" };
UnitPopupMenus["PET_NOABANDON"] = { "PET_DISMISS", "CANCEL" };
UnitPopupMenus["PARTY"] = { "PROMOTE", "LOOT_PROMOTE", "UNINVITE", "INSPECT", "TRADE", "FOLLOW", "DUEL", "CANCEL" };
UnitPopupMenus["PLAYER"] = { "INSPECT", "INVITE", "TRADE", "FOLLOW", "DUEL", "CANCEL" };
UnitPopupMenus["RAID"] = { "RAID_LEADER", "RAID_PROMOTE", "RAID_DEMOTE", "LOOT_PROMOTE", "RAID_REMOVE", "CANCEL" };
There is no FRIEND menu.

EDIT: I found it. It is in patch.MPQ, not in interface.MPQ.
Don't use a third party extraction tool when you want to look at the UI code. Blizzard distributes an Interface AddOn Kit which will extract the most recent version of the UI files (the ones the game is currently using).
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to catch a click on chatframe (on the nicknames)?


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