From 07d94b7d8da4e6d4626aff13933aafc3767c963b Mon Sep 17 00:00:00 2001 From: Paul Sladen Date: Sun, 5 Apr 2009 17:55:52 +0300 Subject: [PATCH] * Default first-use game data from /usr/share/games/bve/{Railway/Route,Train} --- debian/changelog | 1 + openBVE/OpenBve/formMain.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4d4adc1..4e31f77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ openbve (1.0.2.0-0buntu1) unreleased; urgency=low * pass '/fhs' from the mono wrapper instead of hardcoding * overload GetSettingsFolder() to create the config directory before return it * Load first-use Keyboard mapping from GetDataFolder("Controls") not ~/ + * Default first-use game data from /usr/share/games/bve/{Railway/Route,Train} -- Paul Sladen Sun, 05 Apr 2009 12:33:10 +0000 diff --git a/openBVE/OpenBve/formMain.cs b/openBVE/OpenBve/formMain.cs index 894748f..a52fa0b 100644 --- a/openBVE/OpenBve/formMain.cs +++ b/openBVE/OpenBve/formMain.cs @@ -161,11 +161,23 @@ namespace OpenBve { textboxRouteFolder.Text = Interface.CurrentOptions.RouteFolder; } else { textboxRouteFolder.Text = Interface.GetPersonalFolder(); + // For Debian/Ubuntu, the location for the packaged trains+routes is /usr/share/games/bve/* + // since these are optional, check if it has been created (installed) by another package instead of ~/ + string s = Environment.GetFolderPath( Environment.SpecialFolder.CommonApplicationData ) + "/games/bve/Railway/Route"; + if (Program.CurrentPlatform == Program.Platform.Linux && System.IO.Directory.Exists(s)) { + textboxRouteFolder.Text = s; + } } if (Interface.CurrentOptions.TrainFolder.Length != 0 && System.IO.Directory.Exists(Interface.CurrentOptions.TrainFolder)) { textboxTrainFolder.Text = Interface.CurrentOptions.TrainFolder; } else { textboxTrainFolder.Text = Interface.GetPersonalFolder(); + // For Debian/Ubuntu, the location for the packaged trains+routes is /usr/share/games/bve/* + // since these are optional, check if it has been created (installed) by another package instead of ~/ + string s = Environment.GetFolderPath( Environment.SpecialFolder.CommonApplicationData ) + "/games/bve/Train"; + if (Program.CurrentPlatform == Program.Platform.Linux && System.IO.Directory.Exists(s)) { + textboxTrainFolder.Text = s; + } } // encodings { -- 1.6.0.4