The International Simutrans Forum

Development => Patches & Projects => Topic started by: eipi on December 27, 2013, 05:06:23 PM

Title: [FIX] load non-default themes, too
Post by: 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.
Title: Re: [FIX] load non-default themes, too
Post by: prissi on December 27, 2013, 09:08:23 PM
Sorry, I did a similar fix before I saw yours. Thanks anyway.
Title: Re: [FIX] load non-default themes, too
Post by: Max-Max on December 29, 2013, 05:35:32 PM
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...
Title: Re: [FIX] load non-default themes, too
Post by: Ters on December 29, 2013, 06:31:27 PM
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.