From: terencehill Date: Sun, 31 Mar 2019 11:53:06 +0000 (+0200) Subject: Disable scrolling of tabs in menu:Settings/Game (currently inactive because all setti... X-Git-Tag: xonotic-v0.8.5~1566 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=53138584176193b9a34c5cbb6f1650fe4bda91ef;p=xonotic%2Fxonotic-data.pk3dir.git Disable scrolling of tabs in menu:Settings/Game (currently inactive because all settings are visible) as it's broken despite all the efforts to make it work (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 --- diff --git a/qcsrc/menu/xonotic/dialog_settings_game.qc b/qcsrc/menu/xonotic/dialog_settings_game.qc index 87134cb78..ba10d276e 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game.qc @@ -94,9 +94,15 @@ CONSTRUCTOR(XonoticRegisteredSettingsList, DataSource _source) { 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); @@ -109,7 +115,8 @@ METHOD(XonoticGameSettingsTab, topicChangeNotify, void(entity, entity this)) 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)) diff --git a/qcsrc/menu/xonotic/dialog_settings_game.qh b/qcsrc/menu/xonotic/dialog_settings_game.qh index c9617f582..c0965c232 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game.qh @@ -39,7 +39,10 @@ CLASS(XonoticGameSettingsTab, XonoticTab) 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));