DungeonDraft displays images based on the order in which they're found in the JSON data. If images are named logically within the folder structure, sorting them alphabetically would help in the case that a tag contains dozens of images. This would make the "Lighting" tag keep candle_1.png next to candle_2.png without putting lantern_17.png between them. The following code will achieve this:
# Recursively collect all files from folders which contain pngs and creates name in a dict
for file in glob.iglob(os.path.join(base_path, '*/*.png'), recursive=True):
imagesList[os.path.basename(os.path.dirname(file))].append(filePathStruct + os.path.basename(file))
# Sort each list of assets alphabetically so that they appear in DD in a logical order
[imagesList[each].sort() for each in imagesList]
# Check for usable user input and call the prepend/append function to add to tag names
if prepend_input != None or append_input != None:
prepend_append_to_dict_keys(prepend_input, append_input, imagesList)
DungeonDraft displays images based on the order in which they're found in the JSON data. If images are named logically within the folder structure, sorting them alphabetically would help in the case that a tag contains dozens of images. This would make the "Lighting" tag keep candle_1.png next to candle_2.png without putting lantern_17.png between them. The following code will achieve this:
[imagesList[each].sort() for each in imagesList]
can be more clearly written as