Thread Tools Display Modes
08/20/17, 02:23 PM   #1
static_recharge
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
How to get a Control to only show on the Quickslot scene / fragment?

I'm trying to get my toplevel control to only show when the user has the quickslot menu open in the inventory scene. I've looked around these forums and have had lots of success adding my control to other scenes, but the inventory scene is a local scene according to the source code.

I'm pretty sure I'm going to have to use callbacks and monitor the change of scenes myself but I'm not sure where to start or how to use the callback function to correctly achieve this. Basically I just want my control on the screen when the user has the quickslot tab of the inventory menu open and hidden all other times.

Thanks in advance!
  Reply With Quote
08/20/17, 02:31 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,913
I think there is a fragment inside the inventory scene which tells you that the quickslot is active.
If you register a callback funciton to this fragment's (if it exists) onStateChange function (like scenes provide too) you could be able to solve your problem.

Check the esoui source code and search for inventory and inside the lua files for quickslot (or the other way around).
http://www.esoui.com/downloads/info1...ourcecode.html

https://github.com/esoui/esoui/tree/master/esoui

Edit:
Found a quickslot framgent:
https://github.com/esoui/esoui/searc...fragment&type=

-

You need tor egister a callback function to:
Lua Code:
  1. QUICKSLOT_FRAGMENT:RegisterCallback("StateChange",  function(oldState, newState)
  2. -[[ possible states are:
  3.                 SCENE_FRAGMENT_SHOWN = "shown"
  4.                 SCENE_FRAGMENT_HIDDEN = "hidden"
  5.                 SCENE_FRAGMENT_SHOWING = "showing"
  6.                 SCENE_FRAGMENT_HIDING = "hiding"
  7.             ]]--
  8. if newState == SCENE_FRAGMENT_SHOWN then
  9.  --YourCotrol:SetHidden(false)
  10. elseif newState == SCENE_FRAGMENT_HIDING then
  11.  --YourCotrol:SetHidden(true)
  12. end
  13. end) -- function

Be sure to check direct scene changes from mail send to inventory (or the other way around by using a keaybind!) as sometimes the scenes and fragment callback functions will not be called properly then. Maybe you need to check this somehow via scene changes and hide your control again then.

Last edited by Baertram : 08/20/17 at 02:38 PM.
  Reply With Quote
08/20/17, 02:58 PM   #3
static_recharge
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
Thank you so much Baertram! Works like a charm and very simple to understand what is going on. Thanks again!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How to get a Control to only show on the Quickslot scene / fragment?

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