I need some advice on textures.
LISTBOX documentation on the wiki(
http://archonwiki.slitherine.com/index.php/UI ) says about the LISTBOX object:
CONTROLTEX <filename>
Required, contains all the various listbox controls. The texture is laid out as follows:
Up scroll arrow - top left
Down scroll arrow - top right
Scrollbar - bottom left (this is stretched to the height of the listbox)
Scroll nub - bottom right
FRAMETEX <filename> - used for the listbox frame
SELTEX <filename> - selection display, this is stretched across the width of the selection box
BUTTONTEX <filename> - applied to element in the listbox, texture layout is the same as a BUTTON type
TEXTLEFT <value>
TEXTTOP <value>
TEXTWIDTH <value>
TEXTHEIGHT <value>
Screen placement values for the actual text list, absolute if list is placed absolutely, relative to list if object is placed relatively
FONT <fontname> - the font of the listbox item text
COLOUR <colour> - the colour of the listbox item text.
BARSIZE <value> - Sets the size of the scrollbar. Default value is 32.
ITEMSPACING <value> - spacing between listbox items (vertical or horizontal depending on type of listbox), default value is 0
ITEMSIZE <value> - the size of the listbox items (vertical or horizontal depending on type of listbox), default is the height of one line of text for vertical listboxes and the max width to fit all items for horizontal listboxes
ITEMKEEPSQUARE - causes the scaling of ITEMSPACING and ITEMSIZE to maintain the item layout aspect ratio at non-4:3 resolutions
HORIZONTAL - causes the items to be displayed horizontally across the listbox, only the arrow elements of CONTROLTEX are used (and rotated) for left/right scrolling
MULTISELECT - allows multiselection in list with standard Ctrl and Shift click modifiers, use IsUIListboxItemSelected to test selections
AUTOSCROLL - scroll to the bottom of the list when new items are added
MAXSCROLL <value> - limit on the number of lines scrolled by the mouse wheel
TEXTMODE - mode for showing multiline text entries
MULTILINE <0/1> - allow wrapped, multiline text in listbox items, default 0 (note, this is different than a TEXTMODE listbox,
you will likely need to adjust ITEMSIZE to actually make room to display multiple lines in a single item)
CENTER <0/1> - horizontally center text on listbox items, default 0 unless a BUTTONTEX is also given
VCENTER <0/1> - vertically center text on listbox items, default 0 unless a BUTTONTEX is also given
AUTOTOOLTIP <0/1> - if an item is too wide to display in the listbox using standard drawing and no tooltip is given,
automatically show the item string as the tooltip
TABLE <headerID> - draw the listbox as a table with a header and aligned columns, items and the string referenced by headerID are
treated as tab (\t) delimited rows, behaviour may also be activated or updated using the SetUIListboxTable command
LISTALIGN <alignment> - when there are not enough items to fill the visible listbox, align the items to the "CENTER" or "BOTTOM" (or
"RIGHT") of the listbox
So:
a) What textures should be put there in CONTROLTEX, FRAMETEX etc? I tried to re-use textures "listcontrol", "listsel", "listbox" files (TGA or DDS) with no success.
b) How to use the TABLE element? To fill my items I tried to use AddUIListBoxItem() but so far no success, so the TABLE option could be more effective.
c) I created a script SCENUI_XXX.BSF (in DATA/UI) and put instructions in a function UI_OBJ_INIT(). I put my AddUIListBoxItem() there. I cannot confirm it is executed.
Difficulties and workarounds:
- ShowUIScreen never managed to work as I expected.
- The UI documentation in the wiki (
http://archonwiki.slitherine.com/index.php/UI ) does not mention such script functions; but I found them by delving through game files.
- To display the UI objects I declared, I settled with a solution I used last year: this is what I used to create working battle briefings.
I put UI objects in a script named SCENUI_XXX.TXT, where XXX is your scenario name.
That script is automatically checked and activated when a scenario XXX is launched.
Now my UI is accessed and played!
But:
- UI is displayed as a buggy-textured Listbox; please check question (a) above.
- I also need to fill the listbox with content; please check question (b) above. The UI wiki does not mention how we do this, so I am making trials and errors. Mostly errors, then
Thanks a ton!
Question #3:
I created a script SCENUI_XXX.BSF and put instructions in a function UI_OBJ_INIT().
I put my AddUIListBoxItem() there.
Looks like this:
FUNCTION UI_OBJ_INIT()
{
AddUIListboxItem("SCEN00_MyListBox", "FFFFFFFF", IDS_TOOLTIP_SELECTCHAPTER, 0, "My Chapter", 0);
}
IDS_TOOLTIP_SELECTCHAPTER is a referenced string.
0 is the user data (I saw game files using numerics here).
My Chapter" It is correct?
I use AddUIListboxItem(), and placed
It seems that the quest to have a funtioning UI tied to our game data will be long to complete!