Browse Source

Removed fullscreen property from the preferences.
clean ups

rsredsq 10 years ago
parent
commit
fe02f3abcc

+ 1 - 1
Script/AtomicEditor/editor/Editor.ts

@@ -53,7 +53,7 @@ class Editor extends Atomic.ScriptObject {
             this.handleProjectUnloaded(data)
         });
 
-        this.subscribeToEvent("IPCPlayerWindow", (data) => {
+        this.subscribeToEvent("IPCPlayerWindowChanged", (data) => {
             Preferences.getInstance().savePlayerWindowData(data.posX, data.posY, data.width, data.height);
         });
 

+ 2 - 3
Script/AtomicEditor/editor/Preferences.ts

@@ -94,12 +94,12 @@ class Preferences {
             width = graphics.getWidth();
             height = graphics.getHeight();
         }
-        this._prefs.editorWindow = { x: pos[0], y: pos[1], width: width, height: height, fullscreen: graphics.getFullscreen()};
+        this._prefs.editorWindow = { x: pos[0], y: pos[1], width: width, height: height };
         jsonFile.writeString(JSON.stringify(this._prefs, null, 2));
     }
 
     savePlayerWindowData(x, y, width, height) {
-        this._prefs.playerWindow = {x: x, y: y, width: width, height: height, fullscreen: false};
+        this._prefs.playerWindow = { x: x, y: y, width: width, height: height };
     }
 
     useDefaultConfig():void {
@@ -128,7 +128,6 @@ interface WindowData {
     y: number;
     width: number;
     height: number;
-    fullscreen?: boolean;
 }
 
 class PreferencesFormat {

+ 2 - 2
Script/AtomicEditor/ui/Shortcuts.ts

@@ -29,7 +29,7 @@ class Shortcuts extends Atomic.ScriptObject {
 
         var playerWindow = Preferences.getInstance().playerWindow;
         if (playerWindow) {
-            var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable";
+            var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable ";
             Atomic.editorMode.playProject(args, false);
         } else {
             Atomic.editorMode.playProject("", false);
@@ -42,7 +42,7 @@ class Shortcuts extends Atomic.ScriptObject {
 
         var playerWindow = Preferences.getInstance().playerWindow;
         if (playerWindow) {
-            var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable";
+            var args = "--windowposx " + playerWindow.x + " --windowposy " + playerWindow.y + " --windowwidth " + playerWindow.width + " --windowheight " + playerWindow.height + " --resizable ";
             Atomic.editorMode.playProject(args, true);
         } else {
             Atomic.editorMode.playProject("", true);

+ 1 - 2
Source/AtomicEditor/Application/AEEditorApp.cpp

@@ -114,7 +114,7 @@ void AEEditorApp::Setup()
 
     JSONValue editorWindow;
 
-    if (ReadPreferences(prefsPath, &editorWindow, "editorWindow"))
+    if (ReadPreferences(prefsPath, editorWindow, "editorWindow"))
     {
         if (editorWindow.IsObject())
         {
@@ -122,7 +122,6 @@ void AEEditorApp::Setup()
             engineParameters_["WindowPositionY"] = editorWindow.Get("y").GetUInt();
             engineParameters_["WindowWidth"] = editorWindow.Get("width").GetUInt();
             engineParameters_["WindowHeight"] = editorWindow.Get("height").GetUInt();
-            engineParameters_["FullScreen"] = editorWindow.Get("fullscreen").GetBool();
         }
     }
 }

+ 6 - 6
Source/AtomicEditor/Application/AEEditorCommon.cpp

@@ -153,10 +153,10 @@ void AEEditorCommon::Stop()
 }
 
 
-bool AEEditorCommon::ReadPreferences(String path, JSONValue* prefs, String object)
+bool AEEditorCommon::ReadPreferences(String& path, JSONValue& prefs, const String& propertyName)
 {
     if (!path.EndsWith(".json"))
-        path += ".json";
+        path.Append(".json");
 
     SharedPtr<File> file(new File(context_, path, FILE_READ));
 
@@ -167,16 +167,16 @@ bool AEEditorCommon::ReadPreferences(String path, JSONValue* prefs, String objec
 
     JSONValue root = jsonFile->GetRoot();
 
-    if (object.Length() > 0)
+    if (propertyName.Length() > 0)
     {
-        if (root.Contains(object)) 
+        if (root.Contains(propertyName))
         {
-            *prefs = root.Get(object);
+            prefs = root.Get(propertyName);
         }
     }
     else
     {
-        *prefs = root;
+        prefs = root;
     }
 
     file->Close();

+ 1 - 1
Source/AtomicEditor/Application/AEEditorCommon.h

@@ -37,7 +37,7 @@ public:
 
 protected:
 
-    bool ReadPreferences(String path, JSONValue* prefs, String object = "");
+    bool ReadPreferences(String& path, JSONValue& prefs, const String& propertyName = "");
     
     SharedPtr<JSVM> vm_;