Scene Manager and the Hidden Attribute
So I understand (more or less) how the Scene Manager works. I know how to get it to show and hide a control based on what scene is open. The thing is, I want a control's visibility to also depend on whether the player is in a guild.
I know how to handle the conditional stuff and detecting when a player joins or leaves a guild; I'm just wondering how I would go about keeping the control hidden. As far as I can tell, there are three possibilities:
AFAIK using both would work, but I was wondering if a simpler solution would be enough. |
Scene fragments have a method called SetConditional which lets you add a callback that is evaluated whenever the fragment is refreshed. If the callback returns false the fragment is hidden. If it returns true whether it's shown is based on if it's part of a scene that is showing. So you could write a function that returns if the player is in a guild and pass that to SetConditional on the fragment. Then you just call Refresh on the fragment whenever it would change (when the player joins or leaves a guild).
|
I really like ZO_HUDFadeSceneFragment's hidden reasons (ZO_HiddenReasons).
Lua Code:
But this method has just ZO_HUDFadeSceneFragment, if you use any other scene fragment, you should use SetConditional as ZOS_ChipHilseberg said: Lua Code:
|
Since I'm just using a ZO_SimpleSceneFragment, I'll go with the SetConditional method. Thanks for the quick answers!
|
All times are GMT -6. The time now is 08:20 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI