|
|
@@ -15,8 +15,6 @@
|
|
|
#include "Scripts/Editor/EditorImport.as"
|
|
|
#include "Scripts/Editor/EditorSpawn.as"
|
|
|
|
|
|
-
|
|
|
-String configPath;
|
|
|
String configFileName;
|
|
|
|
|
|
bool instancingSetting = true;
|
|
|
@@ -25,12 +23,7 @@ int shadowQualitySetting = 2;
|
|
|
void Start()
|
|
|
{
|
|
|
// Assign the value ASAP because configFileName is needed on exit, including exit on error
|
|
|
- if (GetPlatform() == "Windows")
|
|
|
- configPath = "Urho3D/Editor/";
|
|
|
- else
|
|
|
- // Unix-like platforms usually hide application configuration file
|
|
|
- configPath = ".Urho3D/Editor/";
|
|
|
- configFileName = fileSystem.userDocumentsDir + configPath + "Config.xml";
|
|
|
+ configFileName = fileSystem.GetAppPreferencesDir("urho3d", "Editor") + "Config.xml";
|
|
|
|
|
|
if (engine.headless)
|
|
|
{
|
|
|
@@ -236,8 +229,6 @@ void LoadConfig()
|
|
|
|
|
|
void SaveConfig()
|
|
|
{
|
|
|
- CreateDir(configPath);
|
|
|
-
|
|
|
XMLFile config;
|
|
|
XMLElement configElem = config.CreateRoot("configuration");
|
|
|
XMLElement cameraElem = configElem.CreateChild("camera");
|
|
|
@@ -319,14 +310,3 @@ void SaveConfig()
|
|
|
|
|
|
config.Save(File(configFileName, FILE_WRITE));
|
|
|
}
|
|
|
-
|
|
|
-void CreateDir(const String&in pathName, const String&in baseDir = fileSystem.userDocumentsDir)
|
|
|
-{
|
|
|
- Array<String> dirs = pathName.Split('/');
|
|
|
- String subdir = baseDir;
|
|
|
- for (uint i = 0; i < dirs.length; ++i)
|
|
|
- {
|
|
|
- subdir += dirs[i] + "/";
|
|
|
- fileSystem.CreateDir(subdir);
|
|
|
- }
|
|
|
-}
|