Thread Tools Display Modes
Prev Previous Post   Next Post Next
11/04/15, 11:37 PM   #1
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
Contextual Actions On Item Slots

Now that game pad support is out, I want to see if we can find a better way of adding actions to context menus.

Currently, we prehook ZO_InventorySlot_ShowContextMenu and shove our code in right before the menu is shown.

The game manages contextual actions in itemslot.lua, but there is no global object to work with and both the table of action handlers and the table of actions available to each slot type are local.

I've built up a preliminary library to manage the manipulation of these tables, but it unfortunately requires a pretty ham-fisted copy/paste of much of the code in itemslot.lua since there are so many local functions used to support the handlers in the actions table.

The benefit of going about managing contextual actions with this library would be:
  • common way to manage actions for kb/m and game pad UIs
  • easily get and manipulate handlers for existing actions

The drawback is obviously the rather large size (89 KB) due to the file containing the ported itemslot.lua code, but I may be able to slim that down further. (When I was originally building it, I broke mouse interactions with item slots like double click and dragging)

So, what do you all think? Am I over-engineering here? Can anyone think of any other potential benefits to build in that would offset the cost? Do you anticipate any problems with the current implementation?
Attached Files
File Type: zip LibActionMenu-1.0.0.0beta1.zip (16.9 KB, 468 views)
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Contextual Actions On Item Slots


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