FreeOrion

Forums for the FreeOrion project
It is currently Thu May 23, 2013 8:16 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [PATCH] Checkbox to use default location for resource dir
PostPosted: Sun Jan 15, 2012 6:47 am 
Offline
Space Floater

Joined: Thu Oct 20, 2011 10:14 pm
Posts: 27
From the wiki:
Add a binary flag and related checkbox in the options screen to make the game use the default location for the resources directory, rather than using the version stored in config.xml. Currently, if more than one freeorion is installed on a system, and their resources directories contents are incompatible, it's necessary to delete the config.xml every time to make the game use the proper set of resources. With this switch, the game would automatically determine its own resources location (using the existing code that determines the default location of these files) and both versions could be run and would use their own, separate, automatic default locations for the resources dir without requiring the user to update it each time the version is changed.

-Added a checkbox under Options/Directories tab
-With the checkbox enabled you can change your config.xml resource directory to an invalid path and it will still start up
-Command line option --use-default-resource-dir [0 or 1]

I ran into one issue with the DirectoryOption for the resource directory above the check box. It is set up to display the config.xml saved directory when initialized. So that DirectoryOption could possibly be displaying different from what the resource directory is if things are messed up. So I'm now sure how I should work around this? It is purely aesthetic though and doesn't actually effect the functionality of the toggle.


Attachments:
UseDefaultResourceDir.patch [4.91 KiB]
Downloaded 6 times
Top
 Profile  
 
 Post subject: Re: [PATCH] Checkbox to use default location for resource di
PostPosted: Sun Jan 15, 2012 7:10 am 
Online
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7892
Location: Vancouver, BC
If the use default resource directory check is enabled, then probably there doesn't need to be a visible directory option. Instead, a text control or edit control could be shown in that location that shows what the default location is. Or, see if you can disable the directory option when the check is enabled. This might require some extra code to make sure the dir option and toggle are created at the same time and are aware of eachother, and that signals and such are connected to ensure that toggling on/off the default toggle updates the state of the directory option.

Or, just rename the directory option to "Custom Resource Directory", so that it's clearer that it's only applicable if the use default option is off.

And, that use default resource dir option should probably default to on, as the point is to make things work fine for multiple installs without the user having to change any settings.


Top
 Profile  
 
 Post subject: Re: [PATCH] Checkbox to use default location for resource di
PostPosted: Sun Jan 15, 2012 5:36 pm 
Offline
Space Floater

Joined: Thu Oct 20, 2011 10:14 pm
Posts: 27
Geoff the Medio wrote:
Or, just rename the directory option to "Custom Resource Directory", so that it's clearer that it's only applicable if the use default option is off.

And, that use default resource dir option should probably default to on, as the point is to make things work fine for multiple installs without the user having to change any settings.


Okay I completed these two things. The one thing to note is that Custom Resource Directory is shown in red because I guess it tries to get the initial path to display from it and since Custom Resource Directory is not a valid file path it appears red.

Edit: I just realized should "Custom Resource Directory" be put in the string table to be looked up for when its put in config.xml?


Attachments:
UseDefaultResourceDir.patch [5.94 KiB]
Downloaded 2 times
Top
 Profile  
 
 Post subject: Re: [PATCH] Checkbox to use default location for resource di
PostPosted: Sun Jan 15, 2012 11:06 pm 
Online
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7892
Location: Vancouver, BC
fixIt wrote:
Okay I completed these two things. The one thing to note is that Custom Resource Directory is shown in red because I guess it tries to get the initial path to display from it and since Custom Resource Directory is not a valid file path it appears red.
You mean you put "Custom Resource Directory" into the edit box? You probably shouldn't do that; leave it blank, or put the default in the edit box, and instead put "Custom Resource Directory" in a nearby label to explain what the edit box is...
Quote:
Edit: I just realized should "Custom Resource Directory" be put in the string table to be looked up for when its put in config.xml?
The string "Custom Resource Directory" shouldn't be in config.xml anywhere, but it probably should be in the stringtable so it can be put into the label textcontrol.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group