]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #1990
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 30 Mar 2018 06:16:41 +0000 (17:16 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 30 Mar 2018 06:16:41 +0000 (17:16 +1100)
qcsrc/menu/xonotic/scrollpanel.qh

index f675e863d409906282fad4234c205bad7d11b9ce..b00c8af8a25e0585f936c862dfd0c9c5de6fea3a 100644 (file)
@@ -4,7 +4,7 @@
 #include "tab.qh"
 CLASS(XonoticScrollPanel, XonoticListBox)
        /** container for single child panel */
-       ATTRIB(XonoticScrollPanel, currentPanel, entity, NEW(XonoticTab));
+       ATTRIB(XonoticScrollPanel, currentPanel, entity);
        ATTRIB(XonoticScrollPanel, nItems, int, 1);
        ATTRIB(XonoticScrollPanel, selectionDoesntMatter, bool, true);
        ATTRIB(XonoticScrollPanel, itemHeight, float, 1);
@@ -12,6 +12,12 @@ CLASS(XonoticScrollPanel, XonoticListBox)
        ATTRIB(XonoticScrollPanel, viewportHeight, float, 12);
        ATTRIB(XonoticScrollPanel, alphaBG, float, 0);
 
+       INIT(XonoticScrollPanel) {
+               entity p = NEW(XonoticTab);
+               this.currentPanel = p;
+               Container_addItem(this, p, '0 0 0', '1 1 0', 1);
+       }
+
        METHOD(XonoticScrollPanel, getItemAtPos, float(XonoticScrollPanel this, float pos)) { return 0; }
        METHOD(XonoticScrollPanel, getItemHeight, float(XonoticScrollPanel this, int i)) { return this.itemHeight; }
        METHOD(XonoticScrollPanel, getItemStart, float(XonoticScrollPanel this, int i)) { return 0; }