- bufstr_add(me.listScreenshot, search_getfilename(list, i), TRUE);
+ {
+ s = search_getfilename(list, i); // get initial full file name
+ s = substring(s, 12, (strlen(s) - 12 - 4)); // remove "screenshots/" prefix and ".<ext>" suffix
+ s = strdecolorize(s); // remove any pre-existing colors
+ if(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);
+ }
+ else { bufstr_add(me.listScreenshot, s, TRUE); }
+ }