What file would i have to edit (If its even possible) to make the mod work with "dark elf" rather than "darkelf"
Viewing post in Improved Random Portraits v1.0
portrait.gd
Line 21, you'd want to change like this I think, haven't tested.
filterRegex.compile('(?!dark ?)elf')
This will make sure it doesn't match just "elf" on files named "Dark Elf"
then later on you'd want to change line 26 like this, so it'll support both with and without spaces.
if file.findn(race.replace(' ','')) >= 0 || file.findn(race >= 0:
Entire file, and again i didn't test these but should roughly work.