me.TD(me, 1, 0.5, btn = makeXonoticButton("Clear", '0 0 0'));
btn.onClick = InputBox_Clear_Click;
me.TD(me, 1, me.columns - 1.5, e = makeXonoticInputBox(0, string_null));
- e.onChange = ScreenshotList_Filter_Change;
+ e.onChange = ScreenshotList_Filter_Would_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'));
ATTRIB(XonoticScreenshotList, rowsPerItem, float, 1)
METHOD(XonoticScreenshotList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticScreenshotList, setSelected, void(entity, float))
+ METHOD(XonoticScreenshotList, draw, void(entity))
METHOD(XonoticScreenshotList, drawListBoxItem, void(entity, float, vector, float))
METHOD(XonoticScreenshotList, getScreenshots, void(entity))
METHOD(XonoticScreenshotList, previewScreenshot, void(entity))
ATTRIB(XonoticScreenshotList, lastClickedScreenshot, float, -1)
ATTRIB(XonoticScreenshotList, lastClickedTime, float, 0)
ATTRIB(XonoticScreenshotList, filterString, string, string_null)
+ ATTRIB(XonoticScreenshotList, filterBox, entity, NULL)
+ ATTRIB(XonoticScreenshotList, filterTime, float, 0)
ATTRIB(XonoticScreenshotList, screenshotBrowserDialog, entity, NULL)
ATTRIB(XonoticScreenshotList, screenshotPreview, entity, NULL)
entity makeXonoticScreenshotList();
void StartScreenshot_Click(entity btn, entity me);
void ScreenshotList_Refresh_Click(entity btn, entity me);
+void ScreenshotList_Filter_Would_Change(entity box, entity me);
void ScreenshotList_Filter_Change(entity box, entity me);
#endif
ScreenshotList_Refresh_Click(world, me);
}
+void ScreenshotList_Filter_Would_Change(entity box, entity me)
+{
+ me.filterBox = box;
+ me.filterTime = time + 0.5;
+}
+
+void XonoticScreenshotList_draw(entity me)
+{
+ if (me.filterTime && time > me.filterTime)
+ {
+ ScreenshotList_Filter_Change(me.filterBox, me);
+ me.filterTime = 0;
+ }
+ SUPER(XonoticScreenshotList).draw(me);
+}
+
void XonoticScreenshotList_goScreenshot(entity me, float d)
{
if(!me.screenshotViewerDialog)