]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/screenshotimage.qc
Merge branch 'terencehill/campaign_balance_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / screenshotimage.qc
index 82ff4ba7b2b8dad148e2b4f20cf854271ce95838..af987e7b58c9ab78491ef7829a8e57a1885842f5 100644 (file)
@@ -19,17 +19,15 @@ void XonoticScreenshotImage_load(entity me, string theImage)
 {
        me.screenshotTime = time;
        me.src = theImage;
-       if (me.screenshotTitle)
-               strunzone(me.screenshotTitle);
-       me.screenshotTitle = strzone(substring(me.src, 13, strlen(theImage) - 13)); //strip "/screenshots/"
+       strcpy(me.screenshotTitle, substring(me.src, 13, strlen(theImage) - 13)); //strip "/screenshots/"
 
        me.initZoom(me); // this image may have a different size
        me.setZoom(me, 0, 0);
 }
 
-float XonoticScreenshotImage_mousePress(entity me, vector coords)
+METHOD(XonoticScreenshotImage, mousePress, bool(XonoticScreenshotImage this, vector pos))
 {
-       return me.drag_setStartPos(me, coords);
+       return this.drag_setStartPos(this, pos);
 }
 
 float XonoticScreenshotImage_mouseDrag(entity me, vector coords)
@@ -56,12 +54,11 @@ void XonoticScreenshotImage_draw(entity me)
                if (time < me.zoomTime + 2) // 1 seconds at full alpha, 1 second fading out
                {
                        string zoomString;
-                       float z;
-                       z = me.zoomFactor * 100;
-                       if (z - floor(z) == 0)
-                               zoomString = sprintf("%d%%", z);
+                       float myzoom = me.zoomFactor * 100;
+                       if (myzoom - floor(myzoom) == 0)
+                               zoomString = sprintf("%d%%", myzoom);
                        else
-                               zoomString = sprintf("%.2f%%", z);
+                               zoomString = sprintf("%.2f%%", myzoom);
                        theAlpha = (2 - (time - me.zoomTime));
                        draw_Text('0.05 0.95 0', zoomString, me.realFontSize, '1 1 1', theAlpha, false);
                }