]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't derive from XonoticCreditsList
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 17 Aug 2015 04:58:04 +0000 (14:58 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 17 Aug 2015 04:58:04 +0000 (14:58 +1000)
qcsrc/menu/xonotic/dialog_media_guide_description.qc

index 9f8bbb8303b1be489baac76e22a768a4c7980cf3..4a09ba4608338795fe7ebb4c3d43c5a9319c215c 100644 (file)
@@ -1,7 +1,24 @@
 #ifndef DIALOG_MEDIA_GUIDE_DESCRIPTION_H
 #define DIALOG_MEDIA_GUIDE_DESCRIPTION_H
 #include "credits.qc"
-CLASS(XonoticGuideDescription, XonoticCreditsList)
+CLASS(XonoticGuideDescription, XonoticListBox)
+       ATTRIB(XonoticGuideDescription, rowsPerItem, float, 1)
+       ATTRIB(XonoticGuideDescription, selectionDoesntMatter, bool, true)
+
+       METHOD(XonoticGuideDescription, resizeNotify, void(entity, vector, vector, vector, vector))
+    void XonoticGuideDescription_resizeNotify(entity this, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
+    {
+        super.resizeNotify(this, relOrigin, relSize, absOrigin, absSize);
+
+        this.realFontSize_y = this.fontSize / (absSize.y * this.itemHeight);
+        this.realFontSize_x = this.fontSize / (absSize.x * (1 - this.controlWidth));
+        this.realUpperMargin = 0.5 * (1 - this.realFontSize.y);
+    }
+
+    INIT(XonoticGuideDescription) {
+        this.configureXonoticListBox(this);
+    }
+
     ATTRIB(XonoticGuideDescription, description, string, string_null)
     METHOD(XonoticGuideDescription, setDescription, void(entity, string))
     void XonoticGuideDescription_setDescription(entity this, string desc)