Thread Tools Display Modes
05/07/14, 08:40 PM   #1
f1gm3nt
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 3
Question Modify menu when right click on item?

Is it possible to add another option when someone right clicks on an item? There's an addon I'd like to make to learn a few things, and it would be helpful to be able to right click on an item and have another option that the player is able to select.

If anyone knows of any addon that does this or any thread in the forums (I tried searching, but no results) would you mind letting me know?

Thanks in advanced.
  Reply With Quote
05/07/14, 08:49 PM   #2
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
I do this in my ItemSaver addon. It's an incredibly hacky way to do it, and I'm sure there's a better way to do it, but I don't know about it if there is.

Feel free to take a look at my code
  Reply With Quote
05/07/14, 08:57 PM   #3
f1gm3nt
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 3
I will, thank you.
  Reply With Quote
05/08/14, 02:38 AM   #4
Kentarii
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
In my addon, I have a TextBuffer and TextLabel where I create custom links to do various actions.

XML:
Code:
          <OnLinkClicked>
            HoWUI.QuestJournal:OnLinkClicked(self, linkData, linkText, button, ctrl, alt, shift, command)
          </OnLinkClicked>
Lua:
Lua Code:
  1. --- Event handler for OnLinkClicked in TextBuffer control.
  2. -- @param self
  3. -- @param linkData string the link url:     url:SomeLinkTargetOrUrl[SomeLinkText]
  4. -- @param linkText string the link text:    [SomeLinkText]
  5. -- @param button int the mousebutton clicked, 1 = left, 2 = right, 3 = middle
  6. -- @param ctrl bool true if ctrl was pressed during click.
  7. -- @param alt bool true if alt was pressed during click.
  8. -- @param shift bool true if shift was pressed during click.
  9. -- @param command bool true if command (Mac I assume) was pressed during click.
  10. -- @return void
  11. function module:OnLinkClicked(_self, linkData, linkText, button, ctrl, alt, shift, command)
  12.     local linkType, arg1, arg2 = zo_strsplit(":", linkData)
  13.     if linkType == "quest" then
  14.         local zoneName = arg1
  15.         local questName = arg2
  16.         if button == 1 then
  17.         -- left click
  18.         elseif button == 2 then
  19.         -- right click
  20.         end
  21.     elseif linkType == "filter" then
  22.         local state = tonumber(arg1)
  23.         if button == 1 then
  24.         -- snip
  25.         end
  26.     elseif linkType == "zone" then
  27.         local zoneName = arg1
  28.         if button == 1 then
  29.         end
  30.     end
  31. end


Links:
Code:
|H6699FF:quest:ExampleZoneName:SomeQuestName:|hSomeQuestName|h
|HFF9933:zone:ExampleZoneName:|hExampleZoneName|h
|HFFFFFF:filter:1:|h123|h
You can also check this page for more info
http://wiki.esoui.com/How_to_create_custom_links
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Modify menu when right click on item?


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