Elvas Tower: Where are the "Options" settings Persisted - Elvas Tower

Jump to content

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Where are the "Options" settings Persisted Rate Topic: -----

#21 User is offline   Amtrak115 

  • Fireman
  • Group: Status: Active Member
  • Posts: 201
  • Joined: 04-August 19
  • Gender:Male
  • Location:Parker, TX
  • Simulator:open rails
  • Country:

Posted 10 February 2024 - 07:09 AM

View PostPeter B., on 10 February 2024 - 02:59 AM, said:

@Barry: Do you know more details about name and location of that json options file? I checked the latest documentation on openrails.readthedocs.io, but I didn't find any information. Then I tried creating an empty OpenRails.json file, similar to what I described about the OpenRails.ini, but when I set some options, nothing was saved to that file. Instead the new options landed in the registry.


Peter,

I found a decision tree in the code and in the code only......Basically from what I remember now....if the settings were not found in Registry, the code look for a .ini file, if not found...if would look for a .json file. I didnt pursue much after seeing that. I didn't look at the code for if there was a .ini file or for that matter a .json file.....

because I was prototyping the code, I put that off to much later in my process......

***

from the code.....

{
if (File.Exists(Location = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), EnumExtension.GetDescription(StoreType.Json))))
{
SettingsStoreType = StoreType.Json;
}
if (File.Exists(Location = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), EnumExtension.GetDescription(StoreType.Ini))))
{
SettingsStoreType = StoreType.Ini;
}
else
{
SettingsStoreType = StoreType.Registry;
Location = EnumExtension.GetDescription(StoreType.Registry);
}
}


Once I saw that code, i made a note then moved on......

Barry

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users