]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Disable scrolling of tabs in menu:Settings/Game (currently inactive because all setti...
authorterencehill <piuntn@gmail.com>
Sun, 31 Mar 2019 11:53:06 +0000 (13:53 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 31 Mar 2019 11:53:06 +0000 (13:53 +0200)
qcsrc/menu/xonotic/dialog_settings_game.qc
qcsrc/menu/xonotic/dialog_settings_game.qh

index 87134cb7812c15635247ec2799c21abf88c8a27e..ba10d276ebfb119b32955dc73b2243e46b9dd414 100644 (file)
@@ -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))
index c9617f582f55fa01e9caefeb624cdbc54e9ae180..c0965c23249470b0e686ddbcb68822abecc1b2b1 100644 (file)
@@ -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));