From 220a341fedfea6546efcb531801ef5e1469d7503 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 2 Aug 2011 22:00:55 +0200 Subject: [PATCH] Small code change --- qcsrc/menu/xonotic/screenshotimage.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/menu/xonotic/screenshotimage.c b/qcsrc/menu/xonotic/screenshotimage.c index b5c8ae807..597b986aa 100644 --- a/qcsrc/menu/xonotic/screenshotimage.c +++ b/qcsrc/menu/xonotic/screenshotimage.c @@ -10,7 +10,7 @@ CLASS(XonoticScreenshotImage) EXTENDS(Image) ATTRIB(XonoticScreenshotImage, realFontSize, vector, '0 0 0') ATTRIB(XonoticScreenshotImage, fontSize, float, SKINFONTSIZE_NORMAL) ATTRIB(XonoticScreenshotImage, showTitle, float, 1) - ATTRIB(XonoticScreenshotImage, showTitleTime, float, 0) + ATTRIB(XonoticScreenshotImage, screenshotTime, float, 0) ATTRIB(XonoticScreenshotImage, screenshotTitle, string, string_null) ENDCLASS(XonoticScreenshotImage) entity makeXonoticScreenshotImage(); @@ -29,7 +29,7 @@ void XonoticScreenshotImage_configureXonoticScreenshotImage(entity me, string th { me.configureImage(me, theImage); me.forcedAspect = -1; - me.showTitleTime = time + 3; // show title for 3 seconds + me.screenshotTime = time; me.updateAspect(me); if (me.screenshotTitle) strunzone(me.screenshotTitle); @@ -55,10 +55,11 @@ void XonoticScreenshotImage_draw(entity me) { if (me.src != "") { + float theAlpha; SUPER(XonoticScreenshotImage).draw(me); - if (me.showTitle && time < me.showTitleTime + 1) // fade title out in 1 second + if (me.showTitle && time < me.screenshotTime + 4) // 3 seconds at full alpha, 1 second fading out { - float theAlpha = (1 - (time - me.showTitleTime)); + theAlpha = (4 - (time - me.screenshotTime)); draw_CenterText('0.5 0 0', me.screenshotTitle, me.realFontSize, '1 1 1', theAlpha, FALSE); } } -- 2.39.2