From 3ed63f94bf7a4bb4b83cd8b712f73db720751c97 Mon Sep 17 00:00:00 2001 From: TimePath Date: Mon, 17 Aug 2015 14:58:04 +1000 Subject: [PATCH] Don't derive from XonoticCreditsList --- .../xonotic/dialog_media_guide_description.qc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/xonotic/dialog_media_guide_description.qc b/qcsrc/menu/xonotic/dialog_media_guide_description.qc index 9f8bbb8303..4a09ba4608 100644 --- a/qcsrc/menu/xonotic/dialog_media_guide_description.qc +++ b/qcsrc/menu/xonotic/dialog_media_guide_description.qc @@ -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) -- 2.39.2