Page 1 of 1

Checking if a file exists or is installed

Posted: Thu Jun 09, 2016 11:55 am
by DRY411S
I want to assign an icon to an item-group that I am creating dynamically in my code.

The logic is this:

Current item-group icon is __modname__/...
Do I have an icon for this mod in my mods graphics folder? It would be __mymod__/modname/...
If I do, use it otherwise use a default.

I want to check for the icon by seeing if the file exists.

Is there a way I can do this that would work on all Factorio platforms that use different filesystems? Windows, Mac, steam machines, Linux...