X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_multiplayer_media_screenshot_viewer.qc;h=57dd75679e03b3d272432dbe79088261220e4c87;hp=3cf20b7b5c01bea40b73c08d3b2bffe6fac1fa9b;hb=2d30ce639fd8525a6f22d383f44c4c9af89fe873;hpb=1556aa4ea70b3b275afb1cb4587e555fb44f71c3 diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc index 3cf20b7b5..57dd75679 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.qc @@ -1,25 +1,9 @@ -#ifndef DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H -#define DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H -#include "dialog.qc" -CLASS(XonoticScreenshotViewerDialog, XonoticDialog) - METHOD(XonoticScreenshotViewerDialog, fill, void(entity)); - METHOD(XonoticScreenshotViewerDialog, keyDown, float(entity, float, float, float)); - METHOD(XonoticScreenshotViewerDialog, loadScreenshot, void(entity, string)); - METHOD(XonoticScreenshotViewerDialog, close, void(entity)); - ATTRIB(XonoticScreenshotViewerDialog, title, string, "Screenshot Viewer") - ATTRIB(XonoticScreenshotViewerDialog, name, string, "ScreenshotViewer") - ATTRIB(XonoticScreenshotViewerDialog, intendedWidth, float, 1) - ATTRIB(XonoticScreenshotViewerDialog, rows, float, 25) - ATTRIB(XonoticScreenshotViewerDialog, columns, float, 4) - ATTRIB(XonoticScreenshotViewerDialog, color, vector, SKINCOLOR_DIALOG_SCREENSHOTVIEWER) - ATTRIB(XonoticScreenshotViewerDialog, scrList, entity, NULL) - ATTRIB(XonoticScreenshotViewerDialog, screenshotImage, entity, NULL) - ATTRIB(XonoticScreenshotViewerDialog, slideShowButton, entity, NULL) - ATTRIB(XonoticScreenshotViewerDialog, currentScrPath, string, string_null) -ENDCLASS(XonoticScreenshotViewerDialog) -#endif +#include "dialog_multiplayer_media_screenshot_viewer.qh" + +#include "screenshotlist.qh" +#include "inputbox.qh" +#include "button.qh" -#ifdef IMPLEMENTATION float music_playlist_index_backup; void XonoticScreenshotViewerDialog_loadScreenshot(entity me, string scrImage) { @@ -40,9 +24,7 @@ void XonoticScreenshotViewerDialog_loadScreenshot(entity me, string scrImage) if (me.currentScrPath == scrImage) return; - if (me.currentScrPath) - strunzone(me.currentScrPath); - me.currentScrPath = strzone(scrImage); + strcpy(me.currentScrPath, scrImage); me.screenshotImage.load(me.screenshotImage, me.currentScrPath); me.frame.setText(me.frame, me.screenshotImage.screenshotTitle); } @@ -98,7 +80,7 @@ float XonoticScreenshotViewerDialog_keyDown(entity me, float key, float ascii, f // to press buttons while browsing with only the keyboard if (shift & S_CTRL) { - toggleSlideShow_Click(world, me); + toggleSlideShow_Click(NULL, me); return 1; } return SUPER(XonoticScreenshotViewerDialog).keyDown(me, key, ascii, shift); @@ -170,4 +152,3 @@ void XonoticScreenshotViewerDialog_fill(entity me) e.onClickEntity = me; me.slideShowButton = e; } -#endif