From 489d9cca8bc2617df35b26ce1c8198f7a2b67d0f Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 30 Mar 2018 17:16:41 +1100 Subject: [PATCH] Fix #1990 --- qcsrc/menu/xonotic/scrollpanel.qh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.39.2