From: TimePath Date: Mon, 17 Aug 2015 04:58:04 +0000 (+1000) Subject: Don't derive from XonoticCreditsList X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3ed63f94bf7a4bb4b83cd8b712f73db720751c97;p=xonotic%2Fxonotic-data.pk3dir.git Don't derive from XonoticCreditsList --- 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)