From: TimePath Date: Fri, 30 Mar 2018 06:16:41 +0000 (+1100) Subject: Fix #1990 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=489d9cca8bc2617df35b26ce1c8198f7a2b67d0f;p=xonotic%2Fxonotic-data.pk3dir.git Fix #1990 --- diff --git a/qcsrc/menu/xonotic/scrollpanel.qh b/qcsrc/menu/xonotic/scrollpanel.qh index f675e863d..b00c8af8a 100644 --- a/qcsrc/menu/xonotic/scrollpanel.qh +++ b/qcsrc/menu/xonotic/scrollpanel.qh @@ -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; }