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);
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)
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
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)
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)