(332bdd387) Added: Content.RootDirectory modifying on macOS

This commit is contained in:
Joonas Rikkonen
2019-04-25 18:08:20 +03:00
parent e83dba2959
commit ad028163a2
6 changed files with 66 additions and 3 deletions
@@ -159,10 +159,14 @@ namespace Barotrauma
public GameMain()
{
#if !DEBUG && OSX
#if !DEBUG && OSX
// Use a separate path for content that's editable due to macOS's .app bundles crashing when edited during runtime
string macPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library/Barotrauma");
Directory.SetCurrentDirectory(macPath);
#endif
Content.RootDirectory = macPath + "/Content";
#else
Content.RootDirectory = "Content";
#endif
GraphicsDeviceManager = new GraphicsDeviceManager(this);
@@ -174,7 +178,6 @@ namespace Barotrauma
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
Content.RootDirectory = "Content";
PerformanceCounter = new PerformanceCounter();