Updated the way it shows files

- Updated the sorting to be 1,2,3,4,5,6,7,8,9,10,11 instead of 1,10,11,2,3,4,5,6,7,8,9
- Made it so it doesn't show _backup files.
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2023-06-26 19:34:44 +00:00
parent d30a1dcb62
commit 914f4c5748

View file

@ -22,6 +22,7 @@ from project_manager import pm_project
#UI modules
from UI import UI_elements
from UI import UI_color
from UI import UI_math
# Studio
from studio import checklist
@ -82,9 +83,12 @@ def layer(win, call):
if "AllFiles" not in win.current:
win.current["AllFiles"] = []
for r, d, f in sorted(os.walk(win.project)):
for r, d, f in os.walk(win.project):
for item in f:
win.current["AllFiles"].append(os.path.join(r, item).replace(win.project, ""))
UI_math.sort_nicely(win.current["AllFiles"])
# Now that we have the files. There should be some way to filter them.
@ -223,11 +227,16 @@ def layer(win, call):
win.scroll["file_select"] = 0
if "AllFiles" in win.current:
for filename in win.current["AllFiles"]:
for filename in reversed(win.current["AllFiles"]):
######################## FILTERING STARTS ##########################
okay = True
# Remove all _backup files
if "_backup" in filename:
okay = False
# By search