X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fscreenshotlist.qc;h=fe4be4ed32414fdb52b906931971fd3821df0e97;hp=5801d3be79be77a59e67572f9407c29603dfae15;hb=20387ff9f8cef7536362de05c76cc0062416a64c;hpb=6c4f62990980e74d4a0963b7179c7c964f535398 diff --git a/qcsrc/menu/xonotic/screenshotlist.qc b/qcsrc/menu/xonotic/screenshotlist.qc index 5801d3be79..fe4be4ed32 100644 --- a/qcsrc/menu/xonotic/screenshotlist.qc +++ b/qcsrc/menu/xonotic/screenshotlist.qc @@ -5,7 +5,7 @@ CLASS(XonoticScreenshotList) EXTENDS(XonoticListBox) 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, drawListBoxItem, void(entity, int, vector, bool, float)) METHOD(XonoticScreenshotList, getScreenshots, void(entity)) METHOD(XonoticScreenshotList, previewScreenshot, void(entity)) METHOD(XonoticScreenshotList, startScreenshot, void(entity)) @@ -71,7 +71,7 @@ string XonoticScreenshotList_screenshotName(entity me, float i) return s; } -// if subdir is TRUE look in subdirectories too (1 level) +// if subdir is true look in subdirectories too (1 level) void getScreenshots_for_ext(entity me, string ext, float subdir) { string s; @@ -85,7 +85,7 @@ void getScreenshots_for_ext(entity me, string ext, float subdir) s=strcat(s, "*", ext); float list, i, n; - list = search_begin(s, FALSE, TRUE); + list = search_begin(s, false, true); if(list >= 0) { n = search_getsize(list); @@ -98,15 +98,15 @@ void getScreenshots_for_ext(entity me, string ext, float subdir) { s = strreplace("/", "^7/", s); // clear colors at the forward slash s = strcat("/", rgb_to_hexcolor(SKINCOLOR_SCREENSHOTLIST_SUBDIR), s); // add a forward slash for sorting, then color - bufstr_add(me.listScreenshot, s, TRUE); + bufstr_add(me.listScreenshot, s, true); } - else { bufstr_add(me.listScreenshot, s, TRUE); } + else { bufstr_add(me.listScreenshot, s, true); } } search_end(list); } if (subdir) - getScreenshots_for_ext(me, ext, FALSE); + getScreenshots_for_ext(me, ext, false); } void XonoticScreenshotList_getScreenshots(entity me) @@ -119,12 +119,12 @@ void XonoticScreenshotList_getScreenshots(entity me) me.nItems = 0; return; } - getScreenshots_for_ext(me, ".jpg", TRUE); - getScreenshots_for_ext(me, ".tga", TRUE); - getScreenshots_for_ext(me, ".png", TRUE); + getScreenshots_for_ext(me, ".jpg", true); + getScreenshots_for_ext(me, ".tga", true); + getScreenshots_for_ext(me, ".png", true); me.nItems = buf_getsize(me.listScreenshot); if(me.nItems > 0) - buf_sort(me.listScreenshot, 128, FALSE); + buf_sort(me.listScreenshot, 128, false); } void XonoticScreenshotList_destroy(entity me) @@ -165,11 +165,13 @@ void XonoticScreenshotList_setSelected(entity me, float i) } } -void XonoticScreenshotList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) +void XonoticScreenshotList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, float highlightedTime) { string s; if(isSelected) draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); + else if(highlightedTime) + draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime)); s = me.screenshotName(me,i); s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);