Thread Tools Display Modes
08/04/15, 03:04 PM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Altering Virtual Controls

Is there any way to alter attributes of a virtual control/template?

For example the game creates a scrollList dataType using:
Lua Code:
  1. ZO_ScrollList_AddDataType(_, _, "someVirtualControl", ...)
All I want to do is make that template MouseEnabled (without access to the rowSetup function).

Right now I am creating my own virtual control template, inheriting from the one I want to change, altering the mouseEnabled attribute on it, wiping out the dataType the game created & recreating it with my own.
That works, but there are several other dataTypes that I can not recreate because they are created dynamically, but they all use the same "someVirtualControl" template. Which is why I'm looking for a way to just alter the virtual control attribute instead.

Last edited by circonian : 08/04/15 at 06:50 PM.
  Reply With Quote
08/05/15, 12:05 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
AFAIK there's no way to alter a template.

I suppose you mean the add-on manager row types. It creates a new row type every time you unfold add-on description with a different height. You can override ZO_AddOnManager:GetRowSetupFunction() and wrap the function it returns with your own. Only the first row type exists before you have a chance to override it, so you'd have to replace its setupCallback yourself.

Would be much easier if ZO_ScrollList_AddDataType used ZO_ControlPool (in which you could simply replace the templateName), but it uses ZO_ObjectPool with the templateName in a closure, inaccessible from the outside.
  Reply With Quote
08/05/15, 02:06 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
AFAIK there's no way to alter a template.

I suppose you mean the add-on manager row types. It creates a new row type every time you unfold add-on description with a different height. You can override ZO_AddOnManager:GetRowSetupFunction() and wrap the function it returns with your own. Only the first row type exists before you have a chance to override it, so you'd have to replace its setupCallback yourself.

Would be much easier if ZO_ScrollList_AddDataType used ZO_ControlPool (in which you could simply replace the templateName), but it uses ZO_ObjectPool with the templateName in a closure, inaccessible from the outside.
Yes that is what I was talking about. Wow, now it seems like a silly problem. I thought about replacing the setup function, which was to much work. I didn't even think about wrapping it. I guess I was to focused on trying to find a way to alter or replace the template.
Works great Thanks!
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Altering Virtual Controls


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