Friday, February 9, 2007

UIObject - hideoverride

In 1.05 there is a new attribute that all UI Objects handle called hideoverride. If true, this attribute sets a UI Object hidden and keeps it that way until a script says otherwise via the SetGuiObjectHidden() script function.

This can be used to keep an item hidden that the GUI may try to make visible regardless what a script tries to do, such as a row in a list box.

As a result, objects that are set hidden via SetGuiObjectHidden() will STAY hidden no matter what, unless SetGuiObjectHidden() is later used to make it visible.

For example, if I add a new icon to a screen and set it hideoverride=true in the XML, it will remain hidden on that screen no matter what the GUI might try to do with it until I call SetGuiObjectHidden() with a false parameter to make it visible again, at which point the GUI once again has control over making that object hidden or unhidden.

2 comments:

Anonymous said...

Again, a function was added that helps me achieve a goal for my module.

I was looking at creating my own customized buff bar. This function would allow me to do just that sort of thing by hiding and showing the buff icons applied to the player.

Now I just have to figure out how to construct it for each party member. Meh, details. :D

Heed said...

Hey Rich.

I was wondering if the script function SetGUIObjectHidden() is supposed to be able to manipulate the context menu.

I can set hideoverride=true on a node and it works, but calling the script function to reveal it doesn't seem to.

I have scriptloadable=true set for the context menu, so I was thinking that either there's a bug or the context menu isn't meant to be manipulated in this way.

Thanks.

P.S. Being able to manipulate the context menu with SetGUIObjectHidden() means not having to distribute extra contextmenu.xml files in different packages for compatibility with other systems that add to the context menu. One contextmenu.xml could be used with all nodes present for all systems. i.e. nodes for other installed sytems can be shown/hidden all through setting constant values in script and then calling the function depending on those values.

Thanks.