News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[FIX] load non-default themes, too

Started by eipi, December 27, 2013, 05:06:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eipi

With r6995, the default theme will be loaded, even if you specify another theme to load. This patch fixes this.
I also included some error handling to theme loading: If the theme cannot be loaded from the user directory, the program tries to load the theme from the program directory.
If the default theme cannot be loaded, a fatal error is thrown.

prissi

Sorry, I did a similar fix before I saw yours. Thanks anyway.

Max-Max

Quote from: eipi on December 27, 2013, 05:06:23 PM
With r6995, the default theme will be loaded, even if you specify another theme to load. This patch fixes this.
I also included some error handling to theme loading: If the theme cannot be loaded from the user directory, the program tries to load the theme from the program directory.
If the default theme cannot be loaded, a fatal error is thrown.

My original implementation did this, but I was told it was a stupid idea because the themes shouldn't be in the programs directory...
- My code doesn't have bugs. It develops random features...

Ters

Quote from: Max-Max on December 29, 2013, 05:35:32 PM
My original implementation did this, but I was told it was a stupid idea because the themes shouldn't be in the programs directory...

The default theme is in the programs directory and has always been. I don't know why the game should try to look in the program directory if loading it from user directory fails. If the theme is listed for selection, the game should know where it is. This way, the user may select one theme and end up loading another for no apparent reason.