From 64ab3d7d4f2a34794b97b7b4cb3ecc1d537df914 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 8 Aug 2010 21:43:26 +0200 Subject: [PATCH] Better and correct filtering, now really only JPG files are shown NOTE: this is true only if the engine is patched with my bugfix on match_pattern Next step is to show TGAs too and one day maybe PNGs too. PNGs for now are off-limits as _the engine crashes_ opening them! --- qcsrc/menu/xonotic/screenshotlist.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qcsrc/menu/xonotic/screenshotlist.c b/qcsrc/menu/xonotic/screenshotlist.c index 1a3907e3e..175f6149a 100644 --- a/qcsrc/menu/xonotic/screenshotlist.c +++ b/qcsrc/menu/xonotic/screenshotlist.c @@ -60,7 +60,7 @@ void XonoticScreenshotList_getScreenshots(entity me) if(me.filterString) //subdirectory in filterString allowed - s=strcat("screenshots/*", me.filterString, "*.jpg"); + s=strcat("screenshots/", me.filterString, ".jpg"); else s="screenshots/*.jpg"; @@ -114,7 +114,12 @@ void ScreenshotList_Filter_Change(entity box, entity me) strunzone(me.filterString); if(box.text != "") - me.filterString = strzone(box.text); + { + if (strstrofs(box.text, "*", 0) >= 0 || strstrofs(box.text, "?", 0) >= 0) + me.filterString = strzone(box.text); + else + me.filterString = strzone(strcat("*", box.text, "*")); + } else me.filterString = string_null; -- 2.39.2