소스 검색

Loading project from recent projects

Josh Engebretson 10 년 전
부모
커밋
504396c7e2
2개의 변경된 파일13개의 추가작업 그리고 62개의 파일을 삭제
  1. 7 62
      Script/AtomicEditor/ui/MainFrame.ts
  2. 6 0
      Script/AtomicEditor/ui/WelcomeFrame.ts

+ 7 - 62
Script/AtomicEditor/ui/MainFrame.ts

@@ -39,7 +39,7 @@ class MainFrame extends ScriptWidget {
         this.subscribeToEvent(UIEvents.ResourceEditorChanged, (data) => this.handleResourceEditorChanged(data));
         this.subscribeToEvent(UIEvents.ResourceEditorChanged, (data) => this.handleResourceEditorChanged(data));
 
 
         this.subscribeToEvent("ProjectLoaded", (data) => {
         this.subscribeToEvent("ProjectLoaded", (data) => {
-          this.showResourceFrame(true);
+          this.showWelcomeFrame(false);
         });
         });
 
 
         this.showWelcomeFrame(true);
         this.showWelcomeFrame(true);
@@ -59,76 +59,21 @@ class MainFrame extends ScriptWidget {
         return false;
         return false;
     }
     }
 
 
-    showResourceFrame(show: boolean) {
-
-        if (show && this.frameVisible(this.resourceframe))
-            return;
-
-        if (show && this.frameVisible(this.welcomeFrame))
-            this.showWelcomeFrame(false);
-
-        var container = <Atomic.UILayout> this.getWidget("resourceviewcontainer");
-
-        var child = null;
-
-        for (child = container.firstChild; child; child = child.next) {
-            if (child == this.resourceframe)
-                break;
-        }
-
-        if (show) {
-
-            this.showInspectorFrame(true);
-
-            if (!child) {
-                container.addChild(this.resourceframe);
-            }
-
-        }
-        else {
-
-            if (child)
-                container.removeChild(child);
-        }
-
-    }
-
-
     showWelcomeFrame(show: boolean) {
     showWelcomeFrame(show: boolean) {
 
 
-        if (show && this.frameVisible(this.welcomeFrame))
-            return;
-
-        if (show && this.frameVisible(this.resourceframe))
-            this.showResourceFrame(false);
-
-        var container = <Atomic.UILayout> this.getWidget("resourceviewcontainer");
-
-        var child = null;
-        for (child = container.firstChild; child; child = child.next) {
-            if (child == this.welcomeFrame)
-                break;
-        }
-
         if (show) {
         if (show) {
-
-            this.showInspectorFrame(false);
-
-            this.welcomeFrame.updateRecentProjects();
-
-            if (!child) {
-                container.addChild(this.welcomeFrame);
-            }
-
+          this.showInspectorFrame(false);
+          this.welcomeFrame.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
+          this.resourceframe.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
         }
         }
         else {
         else {
-            if (child)
-                container.removeChild(child);
+          this.showInspectorFrame(true);
+          this.resourceframe.visibility = Atomic.UI_WIDGET_VISIBILITY_VISIBLE;
+          this.welcomeFrame.visibility = Atomic.UI_WIDGET_VISIBILITY_GONE;
         }
         }
 
 
     }
     }
 
 
-
     showInspectorFrame(show: boolean) {
     showInspectorFrame(show: boolean) {
 
 
         if (show) {
         if (show) {

+ 6 - 0
Script/AtomicEditor/ui/WelcomeFrame.ts

@@ -20,6 +20,12 @@ class WelcomeFrame extends ScriptWidget {
 
 
         })
         })
 
 
+        var container = <Atomic.UILayout> parent.getWidget("resourceviewcontainer");
+
+        container.addChild(this);
+
+        this.updateRecentProjects();
+
     }
     }
 
 
     handleWidgetEvent(ev: Atomic.UIWidgetEvent) {
     handleWidgetEvent(ev: Atomic.UIWidgetEvent) {