PDA

View Full Version : How do I toggle a windowinstance between visible and invisible?



SilentRuin
November 19th, 2020, 19:50
I have a number of windowinstance(s) in a list and want to turn them off and on (invisible to user or visible to user in the list). But as the windowinstance contains all the stuff in it - and does not directly support setVisible I'm not sure how to do this. Anyone know?

Trenloe
November 19th, 2020, 20:03
As it's a window instance within a windowlist you can use the windowlist filter functionality - maybe have an invisible flag in each window instance and use that to filter what gets shown and what doesn't?

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4162373/windowlist#applyFilter

SilentRuin
November 19th, 2020, 20:09
As it's a window instance within a windowlist you can use the windowlist filter functionality - maybe have an invisible flag in each window instance and use that to filter what gets shown and what doesn't?

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4162373/windowlist#applyFilter

I'm coming at this from the DB - where I am looping over combattracker.list children which has a special DB entry that ties to another table that determines visibility for that entry. Is the ".list" a windowlist? And if so - how to I backtrack into that class when I'm actually starting with the window entry? I can experiment around but if you know a clue to point me in the right direction that can help. For instance, if I grab the combattracker.list and that generates the windowlist class then maybe I can go about listing out all the entries in a different manner than my normal DB.getChildren way of doing things (which gets me the windowinstance objects).

SilentRuin
November 19th, 2020, 20:14
As it's a window instance within a windowlist you can use the windowlist filter functionality - maybe have an invisible flag in each window instance and use that to filter what gets shown and what doesn't?

https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4162373/windowlist#applyFilter

I'm an idiot - I'm actually doing this to get the Database record - window.list.getWindows() - I am at the windows list already. I'll look into this OnFilter thing thanks!

SilentRuin
November 19th, 2020, 20:30
Ugh. This is going to take me right back to my other open question as that has to be done in ct.lua... https://www.fantasygrounds.com/forums/showthread.php?60844-Help-with-CT-lua&p=557797&viewfull=1#post557797 .. crap.

SilentRuin
November 19th, 2020, 21:05
Adding the onFilter and applyFilter into the correct spots works spectacularly - exactly what I wanted thanks.

As per my response in that other thread - still not seeing how this template reference of ct.lua will not only ever be able to be changed by one extension ever. I'm hoping I'm just wrong on that by the way.