6 #include "../item/modalcontroller.qh" 12 me.configureXonoticScreenshotList(me);
18 me.configureXonoticListBox(me);
25 s = bufstr_get(me.listScreenshot, i);
42 s=
strcat(s, me.filterString, ext);
51 for(i = 0; i < n; ++i)
58 s = strreplace(
"/",
"^7/", s);
60 bufstr_add(me.listScreenshot, s,
true);
62 else { bufstr_add(me.listScreenshot, s,
true); }
73 if (me.listScreenshot >= 0)
74 buf_del(me.listScreenshot);
76 if (me.listScreenshot < 0)
84 me.nItems = buf_getsize(me.listScreenshot);
86 buf_sort(me.listScreenshot, 128,
false);
92 buf_del(me.listScreenshot);
97 me.itemAbsSize =
'0 0 0';
100 me.itemAbsSize.y = absSize.y * me.itemHeight;
101 me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
102 me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
103 me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
104 me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
106 me.columnNameOrigin = me.realFontSize.x;
107 me.columnNameSize = 1 - 2 * me.realFontSize.x;
112 if (me.newSlideShowScreenshotTime)
113 me.startSlideShow(me);
114 float selectedItem_save = me.selectedItem;
116 if (me.pressed && me.selectedItem != selectedItem_save)
119 me.newScreenshotTime =
time + 0.22;
121 else if (
time > me.newScreenshotTime)
123 me.newScreenshotTime = 0;
124 me.previewScreenshot(me);
132 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
135 me.focusedItemAlpha =
getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
136 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
139 s = me.screenshotName(me,i);
141 draw_Text(me.realUpperMargin *
eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize -
draw_TextWidth(s, 0, me.realFontSize))) *
eX, s, me.realFontSize,
'1 1 1', SKINALPHA_TEXT, 1);
146 me.getScreenshots(me);
147 me.previewScreenshot(me);
152 me.getScreenshots(me);
153 me.setSelected(me, 0);
163 me.filterString =
strzone(box.text);
174 me.filterTime =
time + 0.5;
179 if (me.filterTime &&
time > me.filterTime)
184 if (me.newScreenshotTime &&
time > me.newScreenshotTime)
186 me.previewScreenshot(me);
187 me.newScreenshotTime = 0;
189 else if (me.newSlideShowScreenshotTime &&
time > me.newSlideShowScreenshotTime)
191 if (me.selectedItem == me.nItems - 1)
194 me.setSelected(me, 0);
195 me.goScreenshot(me, +0);
198 me.goScreenshot(me, +1);
205 me.newSlideShowScreenshotTime =
time + 3;
210 me.newSlideShowScreenshotTime = 0;
215 if(!me.screenshotViewerDialog)
217 me.setSelected(me, me.selectedItem + d);
218 me.screenshotViewerDialog.loadScreenshot(me.screenshotViewerDialog,
strcat(
"/screenshots/", strdecolorize(me.screenshotName(me,me.selectedItem))));
223 me.screenshotViewerDialog.loadScreenshot(me.screenshotViewerDialog,
strcat(
"/screenshots/", strdecolorize(me.screenshotName(me,me.selectedItem))));
225 DialogOpenButton_Click_withCoords(
NULL, me.screenshotViewerDialog, me.origin +
eX * (me.columnNameOrigin * me.size.x) +
eY * ((me.itemHeight * me.selectedItem - me.scrollPos) * me.size.y),
eY * me.itemAbsSize.y +
eX * (me.itemAbsSize.x * me.columnNameSize));
230 if(!me.screenshotBrowserDialog)
233 me.screenshotBrowserDialog.loadPreviewScreenshot(me.screenshotBrowserDialog,
"");
235 me.screenshotBrowserDialog.loadPreviewScreenshot(me.screenshotBrowserDialog,
strcat(
"/screenshots/", strdecolorize(me.screenshotName(me,me.selectedItem))));
240 me.startScreenshot(me);
245 me.startScreenshot(me);
251 me.startScreenshot(me);
void XonoticScreenshotList_configureXonoticScreenshotList(entity me)
void StartScreenshot_Click(entity btn, entity me)
void XonoticScreenshotList_startSlideShow(entity me)
void XonoticScreenshotList_setSelected(entity me, float i)
void XonoticScreenshotList_draw(entity me)
void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize)
void ScreenshotList_Filter_Change(entity box, entity me)
void XonoticScreenshotList_destroy(entity me)
void XonoticScreenshotList_getScreenshots(entity me)
float XonoticScreenshotList_keyDown(entity me, float scan, float ascii, float shift)
void XonoticScreenshotList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void XonoticScreenshotList_showNotify(entity me)
void XonoticScreenshotList_doubleClickListBoxItem(entity me, float i, vector where)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity makeXonoticScreenshotList()
void XonoticScreenshotList_stopSlideShow(entity me)
void ScreenshotList_Refresh_Click(entity btn, entity me)
ERASEABLE string rgb_to_hexcolor(vector rgb)
void ScreenshotList_Filter_Would_Change(entity box, entity me)
void XonoticScreenshotList_startScreenshot(entity me)
string XonoticScreenshotList_screenshotName(entity me, float i)
void XonoticScreenshotList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
void XonoticScreenshotList_goScreenshot(entity me, float d)
void getScreenshots_for_ext(entity me, string ext, float subdir)
void XonoticScreenshotList_previewScreenshot(entity me)