METHOD(XonoticGameSettingsTab, topicChangeNotify, void(entity, entity this))
{
- entity s = this.currentPanel;
- s.viewportHeight = 15.5;
- entity c = s.currentPanel;
+ entity s = NULL;
+ entity c = this.currentPanel;
+ if (c.classname == "XonoticScrollPanel")
+ {
+ s = this.currentPanel;
+ s.viewportHeight = 15.5;
+ c = s.currentPanel;
+ }
+
entity removing = this.currentItem;
DataSource data = this.topicList.source;
entity adding = data.getEntry(data, this.topicList.selectedItem, func_null);
this.currentItem = adding;
adding.resizeNotify(adding, '0 0 0', c.size, '0 0 0', c.size);
c.addItem(c, adding, '0 0 0', '1 1 0', 1);
- s.resizeNotify(s, '0 0 0', s.size, '0 0 0', s.size);
+ if (s)
+ s.resizeNotify(s, '0 0 0', s.size, '0 0 0', s.size);
}
}
METHOD(XonoticGameSettingsTab, fill, void(entity this))
ATTRIB(XonoticGameSettingsTab, columns, float, 6.5);
ATTRIB(XonoticGameSettingsTab, source, DataSource, NEW(SettingSource));
ATTRIB(XonoticGameSettingsTab, topicList, entity, NEW(XonoticRegisteredSettingsList, this.source));
- ATTRIB(XonoticGameSettingsTab, currentPanel, entity, NEW(XonoticScrollPanel));
+ // XonoticScrollPanel disabled because it's broken, see https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/548
+ // It will probably require a different implementation since XonoticScrollPanel should be an instance of Container, not ListBox
+ //ATTRIB(XonoticGameSettingsTab, currentPanel, entity, NEW(XonoticScrollPanel));
+ ATTRIB(XonoticGameSettingsTab, currentPanel, entity, NEW(XonoticTab));
ATTRIB(XonoticGameSettingsTab, currentItem, entity);
METHOD(XonoticGameSettingsTab, topicChangeNotify, void(entity, entity this));
METHOD(XonoticGameSettingsTab, fill, void(entity this));