ATTRIB(ListBox, colorF, vector, '1 1 1')
ATTRIB(ListBox, tolerance, vector, '0 0 0') // drag tolerance
ATTRIB(ListBox, scrollbarWidth, float, 0) // pixels
- ATTRIB(ListBox, nItems, float, 42)
+ ATTRIB(ListBox, nItems, float, 42) // FIXME: why?!?
ATTRIB(ListBox, itemHeight, float, 0)
ATTRIB(ListBox, colorBG, vector, '0 0 0')
ATTRIB(ListBox, alphaBG, float, 0)
{
me.configureXonoticListBox(me);
me.handle = buf_create();
+ me.nItems = 0;
}
void XonoticCvarList_showNotify(entity me)
{
+ bool force_initial_selection = false;
+ if(me.handle >= 0 && me.nItems <= 0) // me.handle not loaded yet?
+ force_initial_selection = true;
buf_cvarlist(me.handle, "", "_");
me.nItems = buf_getsize(me.handle);
+ if(force_initial_selection)
+ me.setSelected(me, 0);
}
void XonoticCvarList_destroy(entity me)
{
me.columnValueSize = me.realFontSize.x * 20;
me.columnNameSize = 1 - me.columnValueSize - me.realFontSize.x;
me.columnValueOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize.x;
-
- me.setSelected(me, me.selectedItem);
}
void XonoticCvarList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
{
void XonoticDemoList_configureXonoticDemoList(entity me)
{
me.configureXonoticListBox(me);
+ me.nItems = 0;
}
string XonoticDemoList_demoName(entity me, float i)
void XonoticScreenshotList_configureXonoticScreenshotList(entity me)
{
me.configureXonoticListBox(me);
+ me.nItems = 0;
}
string XonoticScreenshotList_screenshotName(entity me, float i)