]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a refresh button
authorterencehill <piuntn@gmail.com>
Tue, 10 Aug 2010 16:31:34 +0000 (18:31 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 10 Aug 2010 16:48:36 +0000 (18:48 +0200)
More appropriated color for the viewer dialog

qcsrc/menu/xonotic/dialog_multiplayer_screenshot.c
qcsrc/menu/xonotic/dialog_multiplayer_screenshot_screenshotviewer.c
qcsrc/menu/xonotic/screenshotlist.c

index f1a3dbe9a1c3ec87d7af85d858becfb0db7707da..7c6ca343fcbf95c93696a9250495b7c503906275 100644 (file)
@@ -40,13 +40,16 @@ void XonoticScreenshotBrowserTab_fill(entity me)
                me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Filter:"));
                me.TD(me, 1, 0.5, btn = makeXonoticButton("Clear", '0 0 0'));
                        btn.onClick = InputBox_Clear_Click;
-               me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null));
+               me.TD(me, 1, me.columns - 1.5, e = makeXonoticInputBox(0, string_null));
                        e.onChange = ScreenshotList_Filter_Change;
                        e.onChangeEntity = slist;
                        btn.onClickEntity = e;
                        slist.controlledTextbox = e;
                        slist.screenshotViewerDialog = main.screenshotViewerDialog;
                        main.screenshotViewerDialog.scrList = slist;
+               me.TD(me, 1, 0.5, e = makeXonoticButton("Refresh", '0 0 0'));
+                       e.onClick = ScreenshotList_Refresh_Click;
+                       e.onClickEntity = slist;
        me.TR(me);
                me.TD(me, 8, me.columns, slist);
        me.gotoRC(me, 9, 0);
index cf2c1bb507c928583de3c7de5074ad9faf281ab4..a032874a026b04e183dade713aafea599e75ef7d 100644 (file)
@@ -8,6 +8,7 @@ CLASS(XonoticScreenshotViewerDialog) EXTENDS(XonoticRootDialog)
        ATTRIB(XonoticScreenshotViewerDialog, rows, float, 25)
        ATTRIB(XonoticScreenshotViewerDialog, columns, float, 6.5)
        ATTRIB(XonoticScreenshotViewerDialog, screenshotImage, entity, NULL)
+       ATTRIB(XonoticScreenshotViewerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
        ATTRIB(XonoticScreenshotViewerDialog, scrList, entity, NULL)
        ATTRIB(XonoticScreenshotViewerDialog, titleLabel, entity, NULL)
        
index 9b639242e750743e51f97bb868a1492afb0281f2..a60c3f8ca9c2990cb436b33ab8b2a2072449ba1a 100644 (file)
@@ -31,6 +31,7 @@ ENDCLASS(XonoticScreenshotList)
 
 entity makeXonoticScreenshotList();
 void StartScreenshot_Click(entity btn, entity me);
+void ScreenshotList_Refresh_Click(entity btn, entity me);
 void ScreenshotList_Filter_Change(entity box, entity me);
 #endif
 
@@ -139,6 +140,15 @@ void XonoticScreenshotList_showNotify(entity me)
        me.getScreenshots(me);
 }
 
+void ScreenshotList_Refresh_Click(entity btn, entity me)
+{
+       me.getScreenshots(me);
+       if (me.nItems <= 0)
+               me.screenshotBrowserDialog.loadPreviewScreenshot(me.screenshotBrowserDialog, "");
+       else
+               me.setSelected(me, 0); //always select the first element after a list update
+}
+
 void ScreenshotList_Filter_Change(entity box, entity me)
 {
        if(me.filterString)
@@ -154,11 +164,7 @@ void ScreenshotList_Filter_Change(entity box, entity me)
        else
                me.filterString = string_null;
 
-       me.getScreenshots(me);
-       if (me.nItems <= 0)
-               me.screenshotBrowserDialog.loadPreviewScreenshot(me.screenshotBrowserDialog, "");
-       else
-               me.setSelected(me, 0); //always select the first element after a new search
+       ScreenshotList_Refresh_Click(world, me);
 }
 
 void XonoticScreenshotList_goScreenshot(entity me, float d)