Aller au contenu

Photo

UI elements: Grid and Collapsable


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
MasterChanger

MasterChanger
  • Members
  • 686 messages
I'm looking for information on two UI elements: UIGrid and UICollapsable (yes, that's how OEI spell UICollapsible--spelling correctly becomes less important in programming than spelling consistently ;)).

The wiki has a little information about UIGrid, including how you set it up and set the background textures, but not how you add entries into the cells based on the prototype. UIListBox has nwscript functions to add or modify rows or clear the listbox; does UIGrid have anything similar?

UICollapsable, meanwhile seems like it should be a way to achieve a bit of dynamic positioning rather than just hiding/un-hiding elements. I haven't found any info on how to use it, though.

Can anyone make any suggestions here? Are there any guides for these elements like Sunjammer's guide for ListBoxes?

#2
The Fred

The Fred
  • Members
  • 2 516 messages
As far as I can tell, UIGrid prototypes work the same way as UIListBox ones but unfortunately have no associated scripting function (it would be nice if those functions worked for all prototype objects).



UICollapsables should indeed be useable as you say; you can place them inside a list box (can't remember if this is necessary, though) and things below them will move up when they're closed.

#3
MasterChanger

MasterChanger
  • Members
  • 686 messages

The Fred wrote...

As far as I can tell, UIGrid prototypes work the same way as UIListBox ones but unfortunately have no associated scripting function (it would be nice if those functions worked for all prototype objects).


It would be nice indeed, since a prototype really doesn't do anything without some way to add entries based on it.

UICollapsables should indeed be useable as you say; you can place them inside a list box (can't remember if this is necessary, though) and things below them will move up when they're closed.


Do you think the Collapsable should automatically close if no prototypes nested beneath it are currently "filled in" (i.e. have entries based on the prototype) ?

Thanks for the help.

#4
The Fred

The Fred
  • Members
  • 2 516 messages
My memory is somewhat fogged on these elements at this point (too long away from modding) but IIRC, you can collapse and uncollapse things through script.